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