From 89f88b5c2f99b50f669d9a795c1a402a0f905509 Mon Sep 17 00:00:00 2001 From: wangzhijiang Date: Mon, 3 Apr 2023 17:29:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=95=E8=A7=84=E6=B8=85=E5=8D=95-=E7=BC=96?= =?UTF-8?q?=E8=BE=91=EF=BC=8C=E5=A6=82=E6=9E=9C=E7=BC=96=E8=BE=91=E4=BA=86?= =?UTF-8?q?=E6=B3=95=E8=A7=84=E5=B7=A5=E7=A8=8B=E5=B8=88=EF=BC=8C=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E6=B8=85=E5=8D=95=E7=A1=AE=E8=AE=A4=E3=80=81=E7=AC=A6?= =?UTF-8?q?=E5=90=88=E6=80=A7=E6=B5=81=E7=A8=8B=E5=BE=85=E5=8A=9E=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=8A=9E=E7=90=86=E4=BA=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectLawsInventoryEOServiceImpl.java | 83 ++++++++++++++++++- .../feginClient/WorkFlowFeignClient.java | 7 ++ .../impl/WorkFlowFeignClientImpl.java | 9 ++ 3 files changed, 98 insertions(+), 1 deletion(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java index e2542b7ae..b0e41b087 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java @@ -68,7 +68,9 @@ import com.jero.modules.system.service.impl.SysCategoryServiceImpl; import com.jero.modules.system.service.impl.SysDictItemServiceImpl; import com.jero.modules.todoCenter.entity.ProcessInfoDetailEO; import com.jero.modules.todoCenter.entity.ProcessInfoEO; +import com.jero.modules.todoCenter.enums.DesignComplianceFlowNodeKeyEnum; import com.jero.modules.todoCenter.enums.TodoCenterStatusEnum; +import com.jero.modules.todoCenter.enums.VerifyComplianceFlowNodeKeyEnum; import com.jero.modules.todoCenter.service.IProcessInfoDetailEOService; import com.jero.modules.todoCenter.service.IProcessInfoEOService; import com.jero.modules.wkflow.entity.ProcessHistoryEO; @@ -648,11 +650,24 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl pidEoQueryWrap = new QueryWrapper<>(); + pidEoQueryWrap.lambda().eq(ProcessInfoDetailEO::getProjectLawsInventoryId,projectLawsInventoryEO.getId()); + List pidEoList = this.processInfoDetailEOService.list(pidEoQueryWrap); + if(CollectionUtils.isNotEmpty(pidEoList)){ + // 过滤出来,清单确认流程,并且是法规工程师审核节点的数据,转办给新的法规工程师 + List qdqrPidEoList = pidEoList.stream().filter(pidEo -> { + boolean flag = ( + StringUtils.equals(pidEo.getFlowType(),FlowTypeEnum.QDQR.getValue()) + && StringUtils.equals(pidEo.getTaskDefinitionKey(),InventoryAffirmNodeEnum.REGULATION_OWNER_AUDIT.getKey()) + && StringUtils.equals(pidEo.getStatus(), TaskStatusEnum.NOT_DONE.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(qdqrPidEoList)) { + qdqrPidEoList.forEach(qdqrPidEo -> { + qdqrPidEo.setUserId(projectLawsInventoryEO.getRegulationOwnerId()); + }); + this.processInfoDetailEOService.updateBatchById(qdqrPidEoList); + } + + List taskIdList = new ArrayList<>(); + + // 过滤出来,设计符合性流程,并且是法规工程师审核节点的数据,转办给新的法规工程师 + List designFlowPidEoList = pidEoList.stream().filter(pidEo -> { + boolean flag = ( + StringUtils.equals(pidEo.getFlowType(),FlowTypeEnum.SJFHXSHLC.getValue()) + && StringUtils.equals(pidEo.getTaskDefinitionKey(), DesignComplianceFlowNodeKeyEnum.FGGCSSH.getValue()) + && StringUtils.equals(pidEo.getStatus(), TaskStatusEnum.NOT_DONE.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(designFlowPidEoList)) { + designFlowPidEoList.forEach(qdqrPidEo -> { + qdqrPidEo.setUserId(projectLawsInventoryEO.getRegulationOwnerId()); + }); + this.processInfoDetailEOService.updateBatchById(designFlowPidEoList); + + taskIdList.addAll(designFlowPidEoList.stream().map(ProcessInfoDetailEO::getTaskId).collect(Collectors.toList())); + } + + // 过滤出来,验证符合性流程,并且是法规工程师审核节点的数据,转办给新的法规工程师 + List verifyFlowPidEoList = pidEoList.stream().filter(pidEo -> { + boolean flag = ( + StringUtils.equals(pidEo.getFlowType(),FlowTypeEnum.YZFHXSCLC.getValue()) + && StringUtils.equals(pidEo.getTaskDefinitionKey(), VerifyComplianceFlowNodeKeyEnum.FGGCSSH.getValue()) + && StringUtils.equals(pidEo.getStatus(), TaskStatusEnum.NOT_DONE.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(verifyFlowPidEoList)) { + verifyFlowPidEoList.forEach(qdqrPidEo -> { + qdqrPidEo.setUserId(projectLawsInventoryEO.getRegulationOwnerId()); + }); + this.processInfoDetailEOService.updateBatchById(verifyFlowPidEoList); + + taskIdList.addAll(verifyFlowPidEoList.stream().map(ProcessInfoDetailEO::getTaskId).collect(Collectors.toList())); + } + + if (CollectionUtils.isNotEmpty(taskIdList)) { + String taskIds = String.join(",", taskIdList); + // 更新流程服务办理人 + this.workFlowFeignClient.changeAssigneeBatch(taskIds,projectLawsInventoryEO.getRegulationOwnerId()); + } + } } } if((projectLawsInventoryOld.getDesignDueDate() != null && projectLawsInventoryEO.getDesignDueDate() != null) && toBeCheckedFlag){ diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/WorkFlowFeignClient.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/WorkFlowFeignClient.java index 0ec3392fa..df6305416 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/WorkFlowFeignClient.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/WorkFlowFeignClient.java @@ -205,4 +205,11 @@ public interface WorkFlowFeignClient { @RequestMapping(value = "/bat-wkflow/task/getTaskConfirmAskedEngineer",method = RequestMethod.GET) Set getTaskConfirmAskedEngineer(@RequestParam("projectLawInventoryId")String projectLawInventoryId); + + /** + * 批量改派任务 + * @return + */ + @RequestMapping(value = "/bat-wkflow/changeAssigneeBatch",method = RequestMethod.GET) + Result changeAssigneeBatch(@RequestParam("taskIds") String taskIds,@RequestParam("newAssignee") String newAssignee); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/impl/WorkFlowFeignClientImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/impl/WorkFlowFeignClientImpl.java index e0ab1dc66..a09885d65 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/impl/WorkFlowFeignClientImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/feginClient/impl/WorkFlowFeignClientImpl.java @@ -212,4 +212,13 @@ public class WorkFlowFeignClientImpl{ public Result dispostHistoryBusProcessNewData() { return workFlowFeignClient.dispostHistoryBusProcessNewData(); } + + /** + * 批量改派任务 + * @return + */ + public Result changeAssigneeBatch(@RequestParam("taskIds") String taskIds,@RequestParam("newAssignee") String newAssignee){ + Result run = workFlowFeignClient.changeAssigneeBatch(taskIds,newAssignee); + return run; + } }