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; + } }