From 19e6f7d5a463ef76e9cd523730ba6089cc11f8ab Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 5 Dec 2022 16:08:46 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=83=BD=E5=8A=9B=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E6=AF=8F=E4=B8=AA=E4=BB=BB=E5=8A=A1=E8=8A=82=E7=82=B9=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E5=82=AC=E5=8A=9E=E4=BF=A1=E6=81=AF=E4=B8=8E=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TAbilityApplicationController.java | 45 ++++++++++++------- 1 file changed, 30 insertions(+), 15 deletions(-) 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); From 9832a37e2c27fd70fc361763f43be4c140aeaa64 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 5 Dec 2022 16:59:30 +0800 Subject: [PATCH 2/4] ... --- .../processForm/controller/TAbilityApplicationController.java | 4 ---- 1 file changed, 4 deletions(-) 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 863e0c8e..0da56cf4 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 @@ -219,9 +219,6 @@ public class TAbilityApplicationController { index.setDoneReminders(Boolean.FALSE); // 不存在催办记录 index.setNextRemindersDays(0); // 距离下次催办天数为0 } -// index.setAllowReminders(Boolean.TRUE); // 允许催办 -// index.setDoneReminders(Boolean.FALSE); // 不存在催办记录 -// index.setNextRemindersDays(0); // 距离下次催办天数为0 } else { // 进行过催办 long between = ChronoUnit.DAYS.between(localDate, LocalDate.now()); // 上次催办距离今天已过天数 if (between <= interval) { // 间隔天数小于限制天数 @@ -239,7 +236,6 @@ public class TAbilityApplicationController { index.setDoneReminders(Boolean.FALSE); index.setNextRemindersDays(0); } - return index; }).collect(Collectors.toList()); page.setList(list); From e1abfa6e5d6927a0516ef7251a330cbd256f3b47 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 6 Dec 2022 10:06:31 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=89=B9=E9=87=8F=E9=A9=B3=E5=9B=9E?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ActTaskController.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java b/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java index 81f9f2e6..015a6f4f 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java @@ -419,4 +419,25 @@ public class ActTaskController { return new Result(); } + @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("批量驳回成功"); +// if (StringUtils.isEmpty(taskId)) { +// return new Result().error(ErrorCode.PARAMS_GET_ERROR); +// } +// actTaskService.backToFirst(taskId, comment); +// return new Result(); + } + } From b6de83347afc39ef9a03009f7ad102412fb71ca5 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 6 Dec 2022 17:57:17 +0800 Subject: [PATCH 4/4] ... --- .../modules/activiti/controller/ActTaskController.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java b/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java index 015a6f4f..277c5c22 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java @@ -433,11 +433,6 @@ public class ActTaskController { actTaskService.backToFirst(taskId, batchCompleteDTO.getComment()); }); return new Result().ok("批量驳回成功"); -// if (StringUtils.isEmpty(taskId)) { -// return new Result().error(ErrorCode.PARAMS_GET_ERROR); -// } -// actTaskService.backToFirst(taskId, comment); -// return new Result(); } }