From 1a2d443bc003f97d8fa573b630cca17886f5f591 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 5 Dec 2022 09:20:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E8=83=BD=E5=8A=9B=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E8=AF=A6=E6=83=85=E6=97=B6=E8=BF=94=E5=9B=9E=E5=82=AC?= =?UTF-8?q?=E5=8A=9E=E7=9B=B8=E5=85=B3=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activiti/dto/HistoryDetailDTO.java | 10 ++++++ .../TAbilityApplicationController.java | 36 +++++++++++++++++++ 2 files changed, 46 insertions(+) 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());