diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/dto/HistoryDetailDTO.java b/renren-admin/src/main/java/io/renren/modules/activiti/dto/HistoryDetailDTO.java index 465c68b5..52620fb1 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/dto/HistoryDetailDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/dto/HistoryDetailDTO.java @@ -56,4 +56,14 @@ public class HistoryDetailDTO { @ApiModelProperty(value = "受理人部门名称") private String assigneeDeptName; + + /** + * 催办功能增加字段 + */ + @ApiModelProperty(value = "该流程的节点当前是否允许催办") + private Boolean allowReminders; + @ApiModelProperty(value = "该流程的节点当前是否已经进行过催办") + private Boolean doneReminders; + @ApiModelProperty(value = "该流程的节点需几天后进行催办") + private Integer nextRemindersDays; } 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 a3c7502f..1357ab78 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 @@ -377,6 +377,42 @@ public class TAbilityApplicationController { } } } + + /** + * 处理催办条件与催办信息 + */ + Optional nowTask = taskService.createTaskQuery() + .processInstanceId(index_.getProcessInstanceId()) + .orderByTaskCreateTime() + .desc() + .active() + .list() + .stream() + .findFirst(); // 尝试获取当前task + if (nowTask.isPresent()) { // 存在正在进行的任务 + LocalDate localDate = tRemindersService.selectRemindersTime(nowTask.get().getId()); + if (localDate == null) { // 未进行过催办 + index_.setAllowReminders(Boolean.TRUE); // 允许催办 + index_.setDoneReminders(Boolean.FALSE); // 不存在催办记录 + index_.setNextRemindersDays(0); // 距离下次催办天数为0 + } else { // 进行过催办 + long between = ChronoUnit.DAYS.between(localDate, LocalDate.now()); // 上次催办距离今天已过天数 + if (between <= interval) { // 间隔天数小于限制天数 + index_.setAllowReminders(Boolean.FALSE); // 不允许催办 + index_.setDoneReminders(Boolean.TRUE); // 存在催办记录 + index_.setNextRemindersDays((int) (interval - between)); // 距离下次催办天数 + } else { + index_.setAllowReminders(Boolean.TRUE); // 不允许催办 + index_.setDoneReminders(Boolean.TRUE); // 存在催办记录 + index_.setNextRemindersDays(0); // 距离下次催办天数为0 + } + } + } else { + index_.setAllowReminders(Boolean.FALSE); + index_.setDoneReminders(Boolean.FALSE); + index_.setNextRemindersDays(0); + } + return index_; }).collect(Collectors.toList());