# Conflicts:
#	renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java
This commit is contained in:
dinggang 2022-12-06 18:08:42 +08:00
commit 1289bfc619
2 changed files with 46 additions and 19 deletions

View File

@ -604,4 +604,20 @@ public class ActTaskController {
return jdbcTemplate; return jdbcTemplate;
} }
@PostMapping("batchBackToFirst")
@ApiOperation("驳回,回退至第一个用户任务(重新录入表单)")
@LogOperation("驳回,回退至第一个用户任务(重新录入表单)")
@ApiImplicitParams({
@ApiImplicitParam(name = "taskId", value = "任务ID", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "comment", value = "驳回审核意见", paramType = "query", dataType = "String")
})
public Result batchBackToFirst(@RequestBody BatchCompleteDTO batchCompleteDTO) {
batchCompleteDTO.getTaskIds().stream()
.filter(index -> org.apache.commons.lang3.StringUtils.isNotEmpty(index))
.forEach(taskId -> {
actTaskService.backToFirst(taskId, batchCompleteDTO.getComment());
});
return new Result().ok("批量驳回成功");
}
} }

View File

@ -219,9 +219,6 @@ public class TAbilityApplicationController {
index.setDoneReminders(Boolean.FALSE); // 不存在催办记录 index.setDoneReminders(Boolean.FALSE); // 不存在催办记录
index.setNextRemindersDays(0); // 距离下次催办天数为0 index.setNextRemindersDays(0); // 距离下次催办天数为0
} }
// index.setAllowReminders(Boolean.TRUE); // 允许催办
// index.setDoneReminders(Boolean.FALSE); // 不存在催办记录
// index.setNextRemindersDays(0); // 距离下次催办天数为0
} else { // 进行过催办 } else { // 进行过催办
long between = ChronoUnit.DAYS.between(localDate, LocalDate.now()); // 上次催办距离今天已过天数 long between = ChronoUnit.DAYS.between(localDate, LocalDate.now()); // 上次催办距离今天已过天数
if (between <= interval) { // 间隔天数小于限制天数 if (between <= interval) { // 间隔天数小于限制天数
@ -239,7 +236,6 @@ public class TAbilityApplicationController {
index.setDoneReminders(Boolean.FALSE); index.setDoneReminders(Boolean.FALSE);
index.setNextRemindersDays(0); index.setNextRemindersDays(0);
} }
return index; return index;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
page.setList(list); page.setList(list);
@ -384,6 +380,15 @@ public class TAbilityApplicationController {
AtomicReference<Boolean> doneReminders = new AtomicReference<>(Boolean.FALSE); // 是否已执行过催办 AtomicReference<Boolean> doneReminders = new AtomicReference<>(Boolean.FALSE); // 是否已执行过催办
AtomicReference<Integer> nextRemindersDays = new AtomicReference<>(0); // 下次催办多少天后 AtomicReference<Integer> nextRemindersDays = new AtomicReference<>(0); // 下次催办多少天后
final Optional<Task> nowTaskRoot = taskService.createTaskQuery()
.processInstanceId(tAbilityApplicationDTOList.get(0).getInstanceId())
.orderByTaskCreateTime()
.desc()
.active()
.list()
.stream()
.findFirst(); // 尝试获取当前task
taskHandleDetailInfo = taskHandleDetailInfo.stream().map(index_ -> { // 补充审核人部门名称 taskHandleDetailInfo = taskHandleDetailInfo.stream().map(index_ -> { // 补充审核人部门名称
if (StringUtils.isNumeric(index_.getAssignee())) { if (StringUtils.isNumeric(index_.getAssignee())) {
SysUserDTO userDTO = sysUserService.get(Long.valueOf(index_.getAssignee())); SysUserDTO userDTO = sysUserService.get(Long.valueOf(index_.getAssignee()));
@ -399,6 +404,7 @@ public class TAbilityApplicationController {
*/ */
Optional<Task> nowTask = taskService.createTaskQuery() Optional<Task> nowTask = taskService.createTaskQuery()
.processInstanceId(index_.getProcessInstanceId()) .processInstanceId(index_.getProcessInstanceId())
.taskId(index_.getTaskId()) // 每个任务
.orderByTaskCreateTime() .orderByTaskCreateTime()
.desc() .desc()
.active() .active()
@ -413,16 +419,20 @@ public class TAbilityApplicationController {
long between = ChronoUnit.DAYS.between(taskCreateDate, LocalDate.now()); long between = ChronoUnit.DAYS.between(taskCreateDate, LocalDate.now());
if (between <= interval) { if (between <= interval) {
logger.info("该任务未到允许催办的日期"); logger.info("该任务未到允许催办的日期");
index_.setAllowReminders(Boolean.FALSE); // 不允许催办 if (nowTask.get().getId().equals(nowTaskRoot.get().getId())) {
index_.setDoneReminders(Boolean.FALSE); // 不存在催办记录 index_.setAllowReminders(Boolean.FALSE); // 不允许催办
index_.setNextRemindersDays((int) (interval - between)); // 距离下次催办天数为 index_.setDoneReminders(Boolean.FALSE); // 不存在催办记录
index_.setNextRemindersDays((int) (interval - between)); // 距离下次催办天数为
}
allowReminders.set(Boolean.FALSE); allowReminders.set(Boolean.FALSE);
doneReminders.set(Boolean.FALSE); doneReminders.set(Boolean.FALSE);
nextRemindersDays.set((int) (interval - between)); nextRemindersDays.set((int) (interval - between));
} else { } else {
allowReminders.set(Boolean.TRUE); if (nowTask.get().getId().equals(nowTaskRoot.get().getId())) {
doneReminders.set(Boolean.FALSE); allowReminders.set(Boolean.TRUE);
nextRemindersDays.set(0); doneReminders.set(Boolean.FALSE);
nextRemindersDays.set(0);
}
index_.setAllowReminders(Boolean.TRUE); // 允许催办 index_.setAllowReminders(Boolean.TRUE); // 允许催办
index_.setDoneReminders(Boolean.FALSE); // 不存在催办记录 index_.setDoneReminders(Boolean.FALSE); // 不存在催办记录
index_.setNextRemindersDays(0); // 距离下次催办天数为0 index_.setNextRemindersDays(0); // 距离下次催办天数为0
@ -430,25 +440,26 @@ public class TAbilityApplicationController {
} else { // 进行过催办 } else { // 进行过催办
long between = ChronoUnit.DAYS.between(localDate, LocalDate.now()); // 上次催办距离今天已过天数 long between = ChronoUnit.DAYS.between(localDate, LocalDate.now()); // 上次催办距离今天已过天数
if (between <= interval) { // 间隔天数小于限制天数 if (between <= interval) { // 间隔天数小于限制天数
allowReminders.set(Boolean.FALSE); if (nowTask.get().getId().equals(nowTaskRoot.get().getId())) {
doneReminders.set(Boolean.TRUE); allowReminders.set(Boolean.FALSE);
nextRemindersDays.set((int) (interval - between)); doneReminders.set(Boolean.TRUE);
nextRemindersDays.set((int) (interval - between));
}
index_.setAllowReminders(Boolean.FALSE); // 不允许催办 index_.setAllowReminders(Boolean.FALSE); // 不允许催办
index_.setDoneReminders(Boolean.TRUE); // 存在催办记录 index_.setDoneReminders(Boolean.TRUE); // 存在催办记录
index_.setNextRemindersDays((int) (interval - between)); // 距离下次催办天数 index_.setNextRemindersDays((int) (interval - between)); // 距离下次催办天数
} else { } else {
allowReminders.set(Boolean.TRUE); if (nowTask.get().getId().equals(nowTaskRoot.get().getId())) {
doneReminders.set(Boolean.TRUE); allowReminders.set(Boolean.TRUE);
nextRemindersDays.set(0); doneReminders.set(Boolean.TRUE);
nextRemindersDays.set(0);
}
index_.setAllowReminders(Boolean.TRUE); // 不允许催办 index_.setAllowReminders(Boolean.TRUE); // 不允许催办
index_.setDoneReminders(Boolean.TRUE); // 存在催办记录 index_.setDoneReminders(Boolean.TRUE); // 存在催办记录
index_.setNextRemindersDays(0); // 距离下次催办天数为0 index_.setNextRemindersDays(0); // 距离下次催办天数为0
} }
} }
} else { } else {
// allowReminders.set(Boolean.FALSE);
// doneReminders.set(Boolean.FALSE);
// nextRemindersDays.set(0);
index_.setAllowReminders(Boolean.FALSE); index_.setAllowReminders(Boolean.FALSE);
index_.setDoneReminders(Boolean.FALSE); index_.setDoneReminders(Boolean.FALSE);
index_.setNextRemindersDays(0); index_.setNextRemindersDays(0);