From 91ba9acf4ca373fba91f8e9c210240521bdef0b6 Mon Sep 17 00:00:00 2001 From: wangzhijiang <1358525938@qq.com> Date: Thu, 13 Jul 2023 10:49:35 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E8=AE=A4=E8=AF=81=E6=B8=85=E5=8D=95-?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B4=A3=E4=BB=BB=E4=BA=BA=E3=80=81=E6=88=AA?= =?UTF-8?q?=E6=AD=A2=E6=97=A5=E6=9C=9F=E3=80=82=E9=A1=B9=E7=9B=AE=E5=BA=93?= =?UTF-8?q?-=E4=BF=AE=E6=94=B9=E8=AE=A4=E8=AF=81=E5=B7=A5=E7=A8=8B?= =?UTF-8?q?=E5=B8=88=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ctCertificationInventoryEOServiceImpl.java | 301 +++++++++++++----- .../impl/ProjectLibraryBaseServiceImpl.java | 131 +++++--- .../mapper/xml/ProcessInfoEOMapper.xml | 2 +- 3 files changed, 297 insertions(+), 137 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index 2063aa759..251ef87fa 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -196,92 +196,21 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl flowStatusList = new ArrayList<>(); - flowStatusList.add(CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()); - flowStatusList.add(CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()); QueryWrapper certificationQueryWrap = new QueryWrapper<>(); certificationQueryWrap.lambda().eq(ProjectCertificationInventoryEO::getId,projectCertificationInventoryEO.getId()); - certificationQueryWrap.lambda().in(ProjectCertificationInventoryEO::getFlowStatus,flowStatusList); - List editEndTimeCertificationInventoryEOS = this.list(certificationQueryWrap); - - // 编辑截至日期发消息 + List oldPciEoList = this.list(certificationQueryWrap); if(projectCertificationInventoryEO.getEndTime() != null){ - editEndTimeCertificationInventoryEOS = editEndTimeCertificationInventoryEOS.stream().filter(certificationInventory -> { - boolean flag = false; - if(!projectCertificationInventoryEO.getEndTime().equals(certificationInventory.getEndTime())){ - flag = true; - } - return flag; - }).collect(Collectors.toList()); - - if(CollectionUtils.isNotEmpty(editEndTimeCertificationInventoryEOS)){ - - // 同步更新待办中心-流程明细截止日期 - this.syncProcessInfoDetailEndTime(projectCertificationInventoryEO.getEndTime(),editEndTimeCertificationInventoryEOS); - - ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(editEndTimeCertificationInventoryEOS.get(0).getProjectLibraryId()); - if(ObjectUtils.isNotEmpty(projectLibraryBase)){ - List userIdList = Arrays.asList(projectLibraryBase.getCertificationEngineer().split(",")); - List userInfoList = this.sysUserService.querySysUserListByIdList(userIdList); - - editEndTimeCertificationInventoryEOS.get(0).setEndTime(projectCertificationInventoryEO.getEndTime()); - - this.sendMessageByTemplateId( - editEndTimeCertificationInventoryEOS, - TemplateInfoEnum2.CERTIFICATION_MESSAGE14.getValue(), - userIdList, - userInfoList, - projectCertificationInventoryEO.getEndTime(),"" - ); - } - } + // 编辑截至日期处理逻辑 + this.editEndTime(projectCertificationInventoryEO, oldPciEoList); } - - // 如果编辑了责任人,给责任人发消息 if(StringUtils.isNotEmpty(projectCertificationInventoryEO.getDutyPerson())){ - QueryWrapper editDutyPersonCertificationQueryWrap = new QueryWrapper<>(); - editDutyPersonCertificationQueryWrap.lambda().eq(ProjectCertificationInventoryEO::getId,projectCertificationInventoryEO.getId()); - List editDutyPersonCertificationInventoryEOS = this.list(editDutyPersonCertificationQueryWrap); - - editDutyPersonCertificationInventoryEOS = editDutyPersonCertificationInventoryEOS.stream().filter(certificationInventory -> { - boolean flag = false; - if(!StringUtils.equals(certificationInventory.getDutyPerson(),projectCertificationInventoryEO.getDutyPerson())){ - flag = true; - } - return flag; - }).collect(Collectors.toList()); - - if(CollectionUtils.isNotEmpty(editDutyPersonCertificationInventoryEOS)){ - List userIdList = editDutyPersonCertificationInventoryEOS.stream().map(ProjectCertificationInventoryEO::getDutyPerson).distinct().collect(Collectors.toList()); - List userInfoList = this.sysUserService.querySysUserListByIdList(userIdList); - this.sendMessageByTemplateId( - editDutyPersonCertificationInventoryEOS, - TemplateInfoEnum2.CERTIFICATION_MESSAGE15.getValue(), - userIdList, - userInfoList, - projectCertificationInventoryEO.getEndTime(),"" - ); - - // 如果责任人有变更,将之前责任人的待办中心任务,移交给新的责任人。 - QueryWrapper detailQueryWrap = new QueryWrapper<>(); - List idList = Arrays.asList(projectCertificationInventoryEO.getId().split(",")); - detailQueryWrap.lambda().in(ProcessInfoDetailEO::getProjectLawsInventoryId,idList); - detailQueryWrap.lambda().eq(ProcessInfoDetailEO::getFlowType,FlowTypeEnum.CERTIFICATION_LC.getValue()); - detailQueryWrap.lambda().eq(ProcessInfoDetailEO::getStatus,TaskStatusEnum.NOT_DONE.getValue()); - List taskDefinitionKeyList = new ArrayList<>(); - taskDefinitionKeyList.add(CertificationFlowNodeEnum.ZRRJSRW.getKey()); - taskDefinitionKeyList.add(CertificationFlowNodeEnum.ZRRTJRW.getKey()); - detailQueryWrap.lambda().in(ProcessInfoDetailEO::getTaskDefinitionKey,taskDefinitionKeyList); - - List processInfoDetailEOList = this.processInfoDetailEOService.list(detailQueryWrap); - if(CollectionUtils.isNotEmpty(processInfoDetailEOList)){ - processInfoDetailEOList.forEach(detail -> { - detail.setUserId(projectCertificationInventoryEO.getDutyPerson()); - }); - this.processInfoDetailEOService.updateBatchById(processInfoDetailEOList); - } - } + // 编辑责任人处理逻辑 + this.editDutyPerson(projectCertificationInventoryEO,oldPciEoList); + } + if(StringUtils.isNotEmpty(projectCertificationInventoryEO.getDeliverableType()) || StringUtils.isNotEmpty(projectCertificationInventoryEO.getDeliverableTemplate())){ + // 编辑交付物类型、交付物模板逻辑 + // TODO 此处逻辑需要详细需求。如何操作。 } // 获取编辑前的数据 @@ -453,6 +382,99 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl oldPciEoList) { + // 过滤出来,旧数据的责任人与新修改的责任人不是同一个人,并且流程状态是 任务待确认、结果待提交、审查退回的数据,这三个状态的流程数据在责任人节点。 + List oldPciEos = oldPciEoList.stream().filter(oldPciEo -> { + boolean flag = ( + !StringUtils.equals(oldPciEo.getDutyPerson(), pciEo.getDutyPerson()) + && ( + StringUtils.equals(oldPciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) + || StringUtils.equals(oldPciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(oldPciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue()) + ) + ); + return flag; + }).collect(Collectors.toList()); + + if (CollectionUtils.isNotEmpty(oldPciEos)) { + List userIdList = oldPciEos.stream().map(ProjectCertificationInventoryEO::getDutyPerson).distinct().collect(Collectors.toList()); + List userInfoList = this.sysUserService.querySysUserListByIdList(userIdList); + this.sendMessageByTemplateId( + oldPciEos, + TemplateInfoEnum2.CERTIFICATION_MESSAGE15.getValue(), + userIdList, + userInfoList, + pciEo.getEndTime(), + "" + ); + + // 如果责任人有变更,将之前责任人的待办中心任务,移交给新的责任人。 + QueryWrapper detailQueryWrap = new QueryWrapper<>(); + List idList = Arrays.asList(pciEo.getId().split(",")); + detailQueryWrap.lambda().in(ProcessInfoDetailEO::getProjectLawsInventoryId, idList); + detailQueryWrap.lambda().eq(ProcessInfoDetailEO::getFlowType, FlowTypeEnum.CERTIFICATION_LC.getValue()); + detailQueryWrap.lambda().eq(ProcessInfoDetailEO::getStatus, TaskStatusEnum.NOT_DONE.getValue()); + List taskDefinitionKeyList = new ArrayList<>(); + taskDefinitionKeyList.add(CertificationFlowNodeEnum.ZRRJSRW.getKey()); + taskDefinitionKeyList.add(CertificationFlowNodeEnum.ZRRTJRW.getKey()); + detailQueryWrap.lambda().in(ProcessInfoDetailEO::getTaskDefinitionKey, taskDefinitionKeyList); + + List processInfoDetailEOList = this.processInfoDetailEOService.list(detailQueryWrap); + if (CollectionUtils.isNotEmpty(processInfoDetailEOList)) { + processInfoDetailEOList.forEach(detail -> { + detail.setUserId(pciEo.getDutyPerson()); + }); + this.processInfoDetailEOService.updateBatchById(processInfoDetailEOList); + } + } + } + + /** + * 编辑截止日期处理逻辑 + * @param newPciEo 最新编辑的认证清单信息 + * @param oldPciEoList 旧的认证清单数组 + */ + private void editEndTime(ProjectCertificationInventoryEO newPciEo, List oldPciEoList) { + Date newEndTime = newPciEo.getEndTime(); + // 过滤出来,旧的截止日期不等于更改后的新截止日期,并且数据状态为 任务待确认、结果待提交、审查退回的数据。 + List oldPciEos = oldPciEoList.stream().filter(pldPciEo -> { + boolean flag = ( + !newEndTime.equals(pldPciEo.getEndTime()) + && ( + StringUtils.equals(pldPciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) + || StringUtils.equals(pldPciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(pldPciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue()) + ) + ); + return flag; + }).collect(Collectors.toList()); + + if(CollectionUtils.isNotEmpty(oldPciEos)){ + // 同步更新待办中心-流程明细截止日期 + this.syncProcessInfoDetailEndTime(newEndTime, oldPciEos); + + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(oldPciEos.get(0).getProjectLibraryId()); + if(ObjectUtils.isNotEmpty(projectLibraryBase)){ + List userIdList = Arrays.asList(projectLibraryBase.getCertificationEngineer().split(",")); + List userInfoList = this.sysUserService.querySysUserListByIdList(userIdList); + + oldPciEos.get(0).setEndTime(newPciEo.getEndTime()); + this.sendMessageByTemplateId( + oldPciEos, + TemplateInfoEnum2.CERTIFICATION_MESSAGE14.getValue(), + userIdList, + userInfoList, + newEndTime, + "" + ); + } + } + } + /** * 通过id删除 * @@ -1080,6 +1102,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl issue(JSONObject json) { String ids = json.getString("ids"); + String projectLibraryId = json.getString("projectLibraryId"); if(StringUtils.isEmpty(ids)){ throw new JeroBootException("至少选择一条数据进行发布!"); } @@ -1118,10 +1141,23 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl pciQueryWrap = new QueryWrapper<>(); + pciQueryWrap.lambda().eq(ProjectCertificationInventoryEO::getProjectLibraryId,projectLibraryId); + pciQueryWrap.lambda().in(ProjectCertificationInventoryEO::getFlowStatus,flowStatusList); + List pciEoList = this.list(pciQueryWrap); + if(CollectionUtils.isNotEmpty(pciEoList)){ + List inventoryVerifyEndTimeList = pciEoList.stream().map(ProjectCertificationInventoryEO::getInventoryVerifyEndTime).distinct().collect(Collectors.toList()); + inventoryVerifyEndTimeList.add(inventoryVerifyEndTime); + Collections.sort(inventoryVerifyEndTimeList, (d1, d2) -> d1.compareTo(d2)); // 根据时间顺序排序 + inventoryVerifyEndTime = inventoryVerifyEndTimeList.get(0); + } - String projectLibraryId = json.getString("projectLibraryId"); // 获取项目信息,获取认证工程师,给认证工程师分配待办任务 ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLibraryId); if(ObjectUtils.isNotEmpty(projectLibraryBase)){ @@ -1164,7 +1200,6 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getCertificationInventoryLinkHrefFeishu(projectLibraryId, PRN_CN, PRN_EN); @@ -1174,6 +1209,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl certificationEngineerUserInfoList = this.sysUserService.querySysUserListByIdList(certificationEngineerIdList); + Date finalInventoryVerifyEndTime = inventoryVerifyEndTime; certificationEngineerIdList.forEach(userId -> { try { String thirdId = this.sysUserService.getUserThirdIdByUserId(certificationEngineerUserInfoList,userId); @@ -1187,7 +1223,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl dutyPersonIdList = projectCertificationInventoryEOList.stream().map(ProjectCertificationInventoryEO::getDutyPerson).distinct().collect(Collectors.toList()); List dutyPersonList = this.sysUserService.querySysUserListByIdList(dutyPersonIdList); + + // 获取当前项目下,认证清单,截止日期最早的一个,更新到流程明细表中,认证工程师审查任务节点的截止时间中 + flowStatusList.clear(); + flowStatusList.add(CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()); + this.updateProcessInfoDetailEndTime( + flowStatusList, + CertificationFlowNodeEnum.RZGCSSC.getKey(), + projectLibraryBase, + "end_time", + idList + ); try { // 给责任人分配待办中心的任务 List processInfoDetailEOList = new ArrayList<>(); @@ -1914,6 +1961,15 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl dutyPersonIdList = projectCertificationInventoryEOList.stream().map(ProjectCertificationInventoryEO::getDutyPerson).distinct().collect(Collectors.toList()); List dutyPersonList = this.sysUserService.querySysUserListByIdList(dutyPersonIdList); + + // 获取当前项目下,认证清单,截止日期最早的一个,更新到流程明细表中,认证工程师审查任务节点的截止时间中 + this.updateProcessInfoDetailEndTime( + flowStatusList, + CertificationFlowNodeEnum.RZGCSSC.getKey(), + projectLibraryBase, + "end_time", + idList + ); try { // 更新数据状态为 审查通过 this.updateBatchById(projectCertificationInventoryEOList); @@ -1943,6 +1999,45 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl flowStatusList, + String taskDefinitionKey, + ProjectLibraryBase projectLibraryBase, + String orderByField, + List excludeIdList) { + QueryWrapper pciQueryWrap = new QueryWrapper<>(); + pciQueryWrap.lambda().eq(ProjectCertificationInventoryEO::getProjectLibraryId, projectLibraryBase.getId()); + pciQueryWrap.lambda().in(ProjectCertificationInventoryEO::getFlowStatus, flowStatusList); + if(CollectionUtils.isNotEmpty(excludeIdList)){ + pciQueryWrap.lambda().notIn(ProjectCertificationInventoryEO::getId, excludeIdList); + } + pciQueryWrap.orderByAsc(orderByField); + List pciEoList = this.list(pciQueryWrap); + if(CollectionUtils.isNotEmpty(pciEoList)){ + Date endTime = null; + if(StringUtils.equals("inventory_verify_end_time",orderByField)){ + endTime = pciEoList.get(0).getInventoryVerifyEndTime(); + } else if(StringUtils.equals("end_time",orderByField)){ + endTime = pciEoList.get(0).getEndTime(); + } + + QueryWrapper detailQueryWrapper = new QueryWrapper<>(); + detailQueryWrapper.lambda().eq(ProcessInfoDetailEO::getProcessInfoId, projectLibraryBase.getId()); + detailQueryWrapper.lambda().eq(ProcessInfoDetailEO::getTaskDefinitionKey,taskDefinitionKey); + List detailEOList = this.processInfoDetailEOService.list(detailQueryWrapper); + Date finalEndTime = endTime; + detailEOList.forEach(detailEO -> { + detailEO.setEndTime(finalEndTime); + }); + this.processInfoDetailEOService.updateBatchById(detailEOList); + } + } + /** * 更新任务状态为已办 * @param projectLibraryBase @@ -2006,6 +2101,27 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl pciQueryWrap = new QueryWrapper<>(); + pciQueryWrap.lambda().eq(ProjectCertificationInventoryEO::getProjectLibraryId,projectLibraryBase.getId()); + pciQueryWrap.lambda().eq(ProjectCertificationInventoryEO::getFlowStatus,CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()); + pciQueryWrap.lambda().isNotNull(ProjectCertificationInventoryEO::getEndTime); + List pciEoList = this.list(pciQueryWrap); + if(CollectionUtils.isNotEmpty(pciEoList) || CollectionUtils.isNotEmpty(projectCertificationInventoryEOList)){ + List endTimeList = new ArrayList<>(); + // 本次提交之前数据库里面存在的截止时间 + List oldEndTimeList = pciEoList.stream().map(ProjectCertificationInventoryEO::getEndTime).distinct().collect(Collectors.toList()); + endTimeList.addAll(oldEndTimeList); + // 当前要提交的数据截止时间 + List newEndTimeList = projectCertificationInventoryEOList.stream().map(ProjectCertificationInventoryEO::getEndTime).distinct().collect(Collectors.toList()); + endTimeList.addAll(newEndTimeList); + + endTimeList = endTimeList.stream().distinct().collect(Collectors.toList()); + Collections.sort(endTimeList, (d1, d2) -> d1.compareTo(d2)); // 根据时间顺序排序 + endTime = endTimeList.get(0); + } + List processInfoDetailEOList = new ArrayList<>(); List certificationEngineerList = Arrays.asList(certificationEngineer.split(",")); // 给认证工程师分配任务 @@ -2018,7 +2134,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl pidEoListTemp = pidEoList.stream().filter(pidEo -> { boolean flag = ( StringUtils.equals(pidEo.getProjectLawsInventoryId(),pciEoId) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java index 31310bd3a..b025ab31d 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java @@ -439,46 +439,9 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl originalCertificationEngineerIdList = Arrays.asList(original.getCertificationEngineer().split(",")); - List newCertificationEngineerIdList = Arrays.asList(projectLibraryBase.getCertificationEngineer().split(",")); - - originalCertificationEngineerIdList = originalCertificationEngineerIdList.stream().filter(originalCertificationEngineerId -> { - boolean flag = true; - for (String newCertificationEngineerId : newCertificationEngineerIdList) { - // 如果新传进来的 认证工程师id跟现有的认证工程师id一致,不用发消息 - if(StringUtils.equals(newCertificationEngineerId,originalCertificationEngineerId)){ - flag = false; - break; - } - } - return flag; - }).collect(Collectors.toList()); - - if(CollectionUtils.isNotEmpty(originalCertificationEngineerIdList)){ - // 判断当前项目下是否还有需要认证工程师操作的数据 只有清单待校核、结果待审查 这两个状态的数据由认证工程师操作。 - List flowStatusList = new ArrayList<>(); - flowStatusList.add(CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()); - flowStatusList.add(CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()); - - QueryWrapper certificationInventoryEOQueryWrapper = new QueryWrapper<>(); - certificationInventoryEOQueryWrapper.lambda().eq(ProjectCertificationInventoryEO::getProjectLibraryId,projectLibraryBase.getId()); - certificationInventoryEOQueryWrapper.lambda().in(ProjectCertificationInventoryEO::getFlowStatus,flowStatusList); - List projectCertificationInventoryEOList = this.projectCertificationInventoryEOService.list(certificationInventoryEOQueryWrapper); - if(CollectionUtils.isNotEmpty(projectCertificationInventoryEOList)){ - this.projectCertificationInventoryEOService.certificationInventoryEOListSortByEndTimeAsc(projectCertificationInventoryEOList); - List userInfoList = this.sysUserService.querySysUserListByIdList(originalCertificationEngineerIdList); - this.projectCertificationInventoryEOService.sendMessageByTemplateId( - projectCertificationInventoryEOList, - TemplateInfoEnum2.CERTIFICATION_MESSAGE13.getValue(), - originalCertificationEngineerIdList, - userInfoList, - projectCertificationInventoryEOList.get(0).getEndTime(),"" - ); - } - } + this.editCertificationEngineer(projectLibraryBase, original); } - setRzlcCertificationEngineerTask(projectLibraryBase); checkExitData(projectLibraryBase); saveOrUpdate(projectLibraryBase); checkVersionOrder(projectLibraryBase.getParentId(),projectLibraryBase.getProjectVersion(),projectLibraryBase.getId()); @@ -704,6 +667,53 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl oldCertificationEngineerIdList = Arrays.asList(oldPlbEO.getCertificationEngineer().split(",")); + List newCertificationEngineerIdList = Arrays.asList(newPlbEO.getCertificationEngineer().split(",")); + + oldCertificationEngineerIdList = oldCertificationEngineerIdList.stream().filter(originalCertificationEngineerId -> { + boolean flag = true; + for (String newCertificationEngineerId : newCertificationEngineerIdList) { + // 如果新传进来的 认证工程师id跟现有的认证工程师id一致,不用发消息 + if(StringUtils.equals(newCertificationEngineerId,originalCertificationEngineerId)){ + flag = false; + break; + } + } + return flag; + }).collect(Collectors.toList()); + + if(CollectionUtils.isNotEmpty(oldCertificationEngineerIdList)){ + // 判断当前项目下是否还有需要认证工程师操作的数据 只有清单待校核、结果待审查 这两个状态的数据由认证工程师操作。 + List flowStatusList = new ArrayList<>(); + flowStatusList.add(CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()); + flowStatusList.add(CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()); + + QueryWrapper certificationInventoryEOQueryWrapper = new QueryWrapper<>(); + certificationInventoryEOQueryWrapper.lambda().eq(ProjectCertificationInventoryEO::getProjectLibraryId, newPlbEO.getId()); + certificationInventoryEOQueryWrapper.lambda().in(ProjectCertificationInventoryEO::getFlowStatus,flowStatusList); + List projectCertificationInventoryEOList = this.projectCertificationInventoryEOService.list(certificationInventoryEOQueryWrapper); + if(CollectionUtils.isNotEmpty(projectCertificationInventoryEOList)){ + this.projectCertificationInventoryEOService.certificationInventoryEOListSortByEndTimeAsc(projectCertificationInventoryEOList); + List userInfoList = this.sysUserService.querySysUserListByIdList(oldCertificationEngineerIdList); + this.projectCertificationInventoryEOService.sendMessageByTemplateId( + projectCertificationInventoryEOList, + TemplateInfoEnum2.CERTIFICATION_MESSAGE13.getValue(), + oldCertificationEngineerIdList, + userInfoList, + projectCertificationInventoryEOList.get(0).getEndTime(),"" + ); + } + } + + this.setRzlcCertificationEngineerTask(newPlbEO); + } + /** * 重新设置认证工程师在待办中心的 认证流程的 待办任务。 * @param projectLibraryBase @@ -727,11 +737,23 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl pidRemoveWrap = new QueryWrapper<>(); - pidRemoveWrap.lambda().eq(ProcessInfoDetailEO::getProcessInfoId, projectLibraryBase.getId()); - pidRemoveWrap.lambda().eq(ProcessInfoDetailEO::getTaskDefinitionKey,CertificationFlowNodeEnum.RZGCSJSRW.getKey()); - pidRemoveWrap.lambda().eq(ProcessInfoDetailEO::getFlowType,FlowTypeEnum.CERTIFICATION_LC.getValue()); - this.processInfoDetailEOService.remove(pidRemoveWrap); + QueryWrapper pidQueryWrap = new QueryWrapper<>(); + pidQueryWrap.lambda().eq(ProcessInfoDetailEO::getProcessInfoId, projectLibraryBase.getId()); + pidQueryWrap.lambda().eq(ProcessInfoDetailEO::getTaskDefinitionKey,CertificationFlowNodeEnum.RZGCSJSRW.getKey()); + pidQueryWrap.lambda().eq(ProcessInfoDetailEO::getFlowType,FlowTypeEnum.CERTIFICATION_LC.getValue()); + pidQueryWrap.orderByAsc("end_time"); + List pidEoList = this.processInfoDetailEOService.list(pidQueryWrap); + if(CollectionUtils.isNotEmpty(pidEoList)){ + List pidEoIdList = pidEoList.stream().map(ProcessInfoDetailEO::getId).distinct().collect(Collectors.toList()); + this.processInfoDetailEOService.deleteByIds(pidEoIdList); + } + + // 获取责任确认截止时间 最早的时间 + this.projectCertificationInventoryEOService.certificationInventoryEOListSortByTaskConfirmEndTimeAsc(pciToBeCheckedList); + Date endTime = pciToBeCheckedList.get(0).getInventoryVerifyEndTime(); + if(ObjectUtils.isEmpty(endTime)){ + endTime = pidEoList.get(0).getEndTime(); + } // 给认证工程师分配任务 List processInfoDetailEOList = new ArrayList<>(); @@ -744,6 +766,7 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl pidRemoveWrap = new QueryWrapper<>(); - pidRemoveWrap.lambda().eq(ProcessInfoDetailEO::getProcessInfoId, projectLibraryBase.getId()); - pidRemoveWrap.lambda().eq(ProcessInfoDetailEO::getTaskDefinitionKey,CertificationFlowNodeEnum.RZGCSSC.getKey()); - pidRemoveWrap.lambda().eq(ProcessInfoDetailEO::getFlowType,FlowTypeEnum.CERTIFICATION_LC.getValue()); - this.processInfoDetailEOService.remove(pidRemoveWrap); + QueryWrapper pidQueryWrap = new QueryWrapper<>(); + pidQueryWrap.lambda().eq(ProcessInfoDetailEO::getProcessInfoId, projectLibraryBase.getId()); + pidQueryWrap.lambda().eq(ProcessInfoDetailEO::getTaskDefinitionKey,CertificationFlowNodeEnum.RZGCSSC.getKey()); + pidQueryWrap.lambda().eq(ProcessInfoDetailEO::getFlowType,FlowTypeEnum.CERTIFICATION_LC.getValue()); + pidQueryWrap.orderByAsc("end_time"); + List pidEoList = this.processInfoDetailEOService.list(pidQueryWrap); + + // 获取截止日期最早的一天。 + this.projectCertificationInventoryEOService.certificationInventoryEOListSortByEndTimeAsc(pciToBeReviewEDList); + Date endTime = pciToBeReviewEDList.get(0).getEndTime(); + if(CollectionUtils.isNotEmpty(pidEoList)){ + endTime = pidEoList.get(0).getEndTime(); + + List pidEoIdList = pidEoList.stream().map(ProcessInfoDetailEO::getId).distinct().collect(Collectors.toList()); + this.processInfoDetailEOService.deleteByIds(pidEoIdList); + } // 给认证工程师分配任务 List processInfoDetailEOList = new ArrayList<>(); @@ -777,6 +811,7 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl Date: Thu, 13 Jul 2023 11:03:26 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E8=AE=A4=E8=AF=81=E6=B8=85=E5=8D=95-?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E8=AE=BE=E7=BD=AE=E4=BF=AE=E6=94=B9=E8=B4=A3?= =?UTF-8?q?=E4=BB=BB=E4=BA=BA=E3=80=81=E6=88=AA=E6=AD=A2=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ctCertificationInventoryEOServiceImpl.java | 89 +++++++++++-------- 1 file changed, 51 insertions(+), 38 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index 251ef87fa..cc48b581b 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -634,45 +634,58 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl flowStatusList = new ArrayList<>(); - flowStatusList.add(CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()); - - QueryWrapper certificationQueryWrap = new QueryWrapper<>(); - certificationQueryWrap.lambda().in(ProjectCertificationInventoryEO::getId,idList); -// certificationQueryWrap.lambda().in(ProjectCertificationInventoryEO::getFlowStatus,flowStatusList); - List projectCertificationInventoryEOS = this.list(certificationQueryWrap); - - if(CollectionUtils.isNotEmpty(projectCertificationInventoryEOS)){ - List pciEoListTemp = projectCertificationInventoryEOS.stream().filter(certificationInventory -> { - boolean flag = false; - if(StringUtils.equals(certificationInventory.getFlowStatus(),CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())){ - if(projectCertificationInventoryEO.getEndTime() != null && certificationInventory.getEndTime() != null){ - if(!projectCertificationInventoryEO.getEndTime().equals(certificationInventory.getEndTime())){ - flag = true; - } - } - } - return flag; - }).collect(Collectors.toList()); - - if (CollectionUtils.isNotEmpty(pciEoListTemp)) { - ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(pciEoListTemp.get(0).getProjectLibraryId()); - if(ObjectUtils.isNotEmpty(projectLibraryBase)){ - List userIdList = Arrays.asList(projectLibraryBase.getCertificationEngineer().split(",")); - List userInfoList = this.sysUserService.querySysUserListByIdList(userIdList); - - this.sendMessageByTemplateId( - pciEoListTemp, - TemplateInfoEnum2.CERTIFICATION_MESSAGE14.getValue(), - userIdList, - userInfoList, - projectCertificationInventoryEO.getEndTime(),"" - ); - } - } - - this.syncProcessInfoDetailEndTime(projectCertificationInventoryEO.getEndTime(),projectCertificationInventoryEOS); + if(projectCertificationInventoryEO.getEndTime() != null){ + // 编辑截至日期处理逻辑 + this.editEndTime(projectCertificationInventoryEO, pciEoList); } + if(StringUtils.isNotEmpty(projectCertificationInventoryEO.getDutyPerson())){ + // 编辑责任人处理逻辑 + this.editDutyPerson(projectCertificationInventoryEO,pciEoList); + } + if(StringUtils.isNotEmpty(projectCertificationInventoryEO.getDeliverableType()) || StringUtils.isNotEmpty(projectCertificationInventoryEO.getDeliverableTemplate())){ + // 编辑交付物类型、交付物模板逻辑 + // TODO 此处逻辑需要详细需求。如何操作。 + } + +// List flowStatusList = new ArrayList<>(); +// flowStatusList.add(CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()); +// +// QueryWrapper certificationQueryWrap = new QueryWrapper<>(); +// certificationQueryWrap.lambda().in(ProjectCertificationInventoryEO::getId,idList); +//// certificationQueryWrap.lambda().in(ProjectCertificationInventoryEO::getFlowStatus,flowStatusList); +// List projectCertificationInventoryEOS = this.list(certificationQueryWrap); +// +// if(CollectionUtils.isNotEmpty(projectCertificationInventoryEOS)){ +// List pciEoListTemp = projectCertificationInventoryEOS.stream().filter(certificationInventory -> { +// boolean flag = false; +// if(StringUtils.equals(certificationInventory.getFlowStatus(),CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())){ +// if(projectCertificationInventoryEO.getEndTime() != null && certificationInventory.getEndTime() != null){ +// if(!projectCertificationInventoryEO.getEndTime().equals(certificationInventory.getEndTime())){ +// flag = true; +// } +// } +// } +// return flag; +// }).collect(Collectors.toList()); +// +// if (CollectionUtils.isNotEmpty(pciEoListTemp)) { +// ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(pciEoListTemp.get(0).getProjectLibraryId()); +// if(ObjectUtils.isNotEmpty(projectLibraryBase)){ +// List userIdList = Arrays.asList(projectLibraryBase.getCertificationEngineer().split(",")); +// List userInfoList = this.sysUserService.querySysUserListByIdList(userIdList); +// +// this.sendMessageByTemplateId( +// pciEoListTemp, +// TemplateInfoEnum2.CERTIFICATION_MESSAGE14.getValue(), +// userIdList, +// userInfoList, +// projectCertificationInventoryEO.getEndTime(),"" +// ); +// } +// } +// +// this.syncProcessInfoDetailEndTime(projectCertificationInventoryEO.getEndTime(),projectCertificationInventoryEOS); +// } if(CollectionUtils.isNotEmpty(updateList)){ this.updateBatchById(updateList); } From 84c236d81c77f3d71cd1fa30fa51a2e48b91ab05 Mon Sep 17 00:00:00 2001 From: wangzhijiang <1358525938@qq.com> Date: Thu, 13 Jul 2023 15:46:56 +0800 Subject: [PATCH 3/7] update --- .../components/listEditModel.vue | 1124 +++++++++-------- 1 file changed, 569 insertions(+), 555 deletions(-) diff --git a/jero-web/src/views/projectManagement/components/listEditModel.vue b/jero-web/src/views/projectManagement/components/listEditModel.vue index 2c0166d5e..9f69ceed2 100644 --- a/jero-web/src/views/projectManagement/components/listEditModel.vue +++ b/jero-web/src/views/projectManagement/components/listEditModel.vue @@ -14,7 +14,7 @@
- {{$t('standard')}} + {{ $t('standard') }}
- {{$t('title')}} + {{ $t('title') }}
- {{$t('subtitle')}} + {{ $t('subtitle') }}
{{$t('applicableSupplement')}} + :title="$t('applicableSupplement')">{{ $t('applicableSupplement') }}
{{$t('certificationType')}} + :title="$t('certificationType')">{{ $t('certificationType') }}
* {{$t('certificationLevel')}} + :title="$t('certificationLevel')">{{ $t('certificationLevel') }}
* {{$t('areaOfResponsibility')}} + :title="$t('areaOfResponsibility')">{{ $t('areaOfResponsibility') }}
* - {{$t('regulatoryEngineer')}} + {{ $t('regulatoryEngineer') }}
* - {{$t('engineeringInterfacePerson')}} + {{ $t('engineeringInterfacePerson') }}
- {{$t('remarks')}} + {{ $t('remarks') }}
-  {{$t('confirmationOfDesignConformity')}} +  {{ $t('confirmationOfDesignConformity') }}
@@ -189,7 +190,7 @@ * {{$t('personLiable')}} + :title="$t('personLiable')">{{ $t('personLiable') }}
* {{$t('deliveryDate')}} + :title="$t('deliveryDate')">{{ $t('deliveryDate') }}
* {{$t('typeOfDeliverables')}} + :title="$t('typeOfDeliverables')">{{ $t('typeOfDeliverables') }}
{{$t('deliverableTemplate')}} + :title="$t('deliverableTemplate')">{{ $t('deliverableTemplate') }}
- {{ (formInline.designDeliverableTemplate === 'null' || formInline.designDeliverableTemplate === '' || - formInline.designDeliverableTemplate == null) ? $t('clickUpload') : $t('viewUploadedFiles') + {{ + (formInline.designDeliverableTemplate === 'null' || formInline.designDeliverableTemplate === '' || + formInline.designDeliverableTemplate == null) ? $t('clickUpload') : $t('viewUploadedFiles') }} @@ -277,7 +279,7 @@
{{$t('deadlineForResponsibilityConfirmation')}} + :title="$t('deadlineForResponsibilityConfirmation')">{{ $t('deadlineForResponsibilityConfirmation') }}
{{$t('descriptionDeliverables')}} + :title="$t('descriptionDeliverables')">{{ $t('descriptionDeliverables') }}
-  {{$t('verificationAndConformityconfirmation')}} +  {{ $t('verificationAndConformityconfirmation') }}
@@ -320,7 +322,7 @@ * {{$t('personLiable')}} + :title="$t('personLiable')">{{ $t('personLiable') }}
* {{$t('deliveryDate')}} + :title="$t('deliveryDate')">{{ $t('deliveryDate') }} * {{$t('typeOfDeliverables')}} + :title="$t('typeOfDeliverables')">{{ $t('typeOfDeliverables') }}
{{$t('deliverableTemplate')}} + :title="$t('deliverableTemplate')">{{ $t('deliverableTemplate') }}
- {{ (formInline.verifyDeliverableTemplate === 'null' || formInline.verifyDeliverableTemplate === '' || - formInline.verifyDeliverableTemplate == null) ? $t('clickUpload') : $t('viewUploadedFiles') + {{ + (formInline.verifyDeliverableTemplate === 'null' || formInline.verifyDeliverableTemplate === '' || + formInline.verifyDeliverableTemplate == null) ? $t('clickUpload') : $t('viewUploadedFiles') }} @@ -408,7 +411,7 @@
{{$t('deadlineForResponsibilityConfirmation')}} + :title="$t('deadlineForResponsibilityConfirmation')">{{ $t('deadlineForResponsibilityConfirmation') }}
{{$t('descriptionDeliverables')}} + :title="$t('descriptionDeliverables')">{{ $t('descriptionDeliverables') }}
- {{$t('reasonForReturnOfDesignCompliance')}} + {{ $t('reasonForReturnOfDesignCompliance') }}
{{$t('rejectedBy')}} + :title="$t('rejectedBy')">{{ $t('rejectedBy') }}
- {{item.createBy ? item.createBy : '--'}} + {{ item.createBy ? item.createBy : '--' }}
@@ -462,10 +465,10 @@
{{$t('rejectionTime')}} + :title="$t('rejectionTime')">{{ $t('rejectionTime') }}
- {{item.rejectTime ? item.rejectTime : '--'}} + {{ item.rejectTime ? item.rejectTime : '--' }}
@@ -475,10 +478,10 @@
{{$t('rejectReason')}} + :title="$t('rejectReason')">{{ $t('rejectReason') }}
- {{item.rejectCause ? item.rejectCause : '--'}} + {{ item.rejectCause ? item.rejectCause : '--' }}
@@ -487,7 +490,7 @@
- {{$t('verifyComplianceConfirmReturnReason')}} + {{ $t('verifyComplianceConfirmReturnReason') }}
{{$t('rejectedBy')}} + :title="$t('rejectedBy')">{{ $t('rejectedBy') }}
- {{item.createBy ? item.createBy : '--'}} + {{ item.createBy ? item.createBy : '--' }}
@@ -508,10 +511,10 @@
{{$t('rejectionTime')}} + :title="$t('rejectionTime')">{{ $t('rejectionTime') }}
- {{item.rejectTime ? item.rejectTime : '--'}} + {{ item.rejectTime ? item.rejectTime : '--' }}
@@ -521,10 +524,10 @@
{{$t('rejectReason')}} + :title="$t('rejectReason')">{{ $t('rejectReason') }}
- {{item.rejectCause ? item.rejectCause : '--'}} + {{ item.rejectCause ? item.rejectCause : '--' }}
@@ -533,571 +536,582 @@
- {{$t('cancel')}} + {{ $t('cancel') }} - {{$t('submit')}} + {{ $t('submit') }} - {{$t('confirm')}} + {{ $t('confirm') }}
\ No newline at end of file From b5b1dfef16bbac156f2670a62b4c5684d4f64720 Mon Sep 17 00:00:00 2001 From: wangzhijiang <1358525938@qq.com> Date: Fri, 14 Jul 2023 09:35:39 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E6=B3=95=E8=A7=84=E6=B8=85=E5=8D=95-?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=8A=9F=E8=83=BD=E5=90=8C=E6=AD=A5=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E4=B8=AD=E5=BF=83=E6=88=AA=E6=AD=A2=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E3=80=81=E5=BE=85=E5=8A=9E=E4=BB=BB=E5=8A=A1=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E4=BA=BA=E7=AD=89=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ProjectLawsInventoryEOEditServiceImpl.java | 441 ++++++++++++++++++ .../ProjectLawsInventoryEOServiceImpl.java | 89 +--- 2 files changed, 465 insertions(+), 65 deletions(-) create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/editImpl/ProjectLawsInventoryEOEditServiceImpl.java diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/editImpl/ProjectLawsInventoryEOEditServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/editImpl/ProjectLawsInventoryEOEditServiceImpl.java new file mode 100644 index 000000000..1debeba94 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/editImpl/ProjectLawsInventoryEOEditServiceImpl.java @@ -0,0 +1,441 @@ +package com.jero.modules.project.service.editImpl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.jero.modules.project.entity.ProjectLawsInventoryEO; +import com.jero.modules.project.enums.ComplianceFlowStatusEnum; +import com.jero.modules.project.enums.InventoryAffirmNodeEnum; +import com.jero.modules.project.enums.TaskStatusEnum; +import com.jero.modules.project.service.IProjectLawsInventoryEOService; +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.VerifyComplianceFlowNodeKeyEnum; +import com.jero.modules.todoCenter.service.IProcessInfoDetailEOService; +import com.jero.modules.todoCenter.service.IProcessInfoEOService; +import com.jero.modules.wkflow.enums.FlowTypeEnum; +import com.jero.modules.wkflow.feginClient.impl.WorkFlowFeignClientImpl; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 项目库-法规清单-编辑功能实现类 + */ +@Service +public class ProjectLawsInventoryEOEditServiceImpl { + @Autowired + private IProjectLawsInventoryEOService projectLawsInventoryEOService; + @Autowired + private WorkFlowFeignClientImpl workFlowFeignClient; + @Autowired + private IProcessInfoDetailEOService processInfoDetailEOService; + @Autowired + private IProcessInfoEOService processInfoEOService; + + /** + * 处理编辑了法规工程师的逻辑 + * @param newPliEo 新的法规清单对象 + * @param oldPliEoList 旧的法规清单数组 + */ + public void updateRegulationOwner(ProjectLawsInventoryEO newPliEo, List oldPliEoList) { + if (CollectionUtils.isNotEmpty(oldPliEoList)) { + List oldPliEoIdList = oldPliEoList.stream().map(ProjectLawsInventoryEO::getId).distinct().collect(Collectors.toList()); + QueryWrapper pidEoQueryWrap = new QueryWrapper<>(); + pidEoQueryWrap.lambda().in(ProcessInfoDetailEO::getProjectLawsInventoryId, oldPliEoIdList); + List pidEoList = this.processInfoDetailEOService.list(pidEoQueryWrap); + if(CollectionUtils.isNotEmpty(pidEoList)){ + List taskIdList = new ArrayList<>(); + List updatePidEoList = new ArrayList<>(); + for (ProjectLawsInventoryEO oldPliEo : oldPliEoList) { + // 清单待校核 + boolean toBeCheckedFlag = ( + StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) + || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) + ); + // 结果待审查 + boolean toBeReviewedFlag = ( + StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + ); + + // 编辑前、编辑后的法规工程师都不为空。 + boolean regulationOwnerIsNotNull = ( + StringUtils.isNotEmpty(oldPliEo.getRegulationOwnerId()) + && StringUtils.isNotEmpty(newPliEo.getRegulationOwnerId()) + ); + if (regulationOwnerIsNotNull && (toBeCheckedFlag || toBeReviewedFlag)) { + // 如果新的法规工程师不等于旧的法规工程师 将之前的法规工程师的待办任务,转给新的法规工程师办理 + if (!StringUtils.equals(oldPliEo.getRegulationOwnerId(), newPliEo.getRegulationOwnerId())) { + // 过滤出来,清单确认流程,并且是法规工程师审核节点的数据,转办给新的法规工程师 + 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(newPliEo.getRegulationOwnerId()); + }); + updatePidEoList.addAll(qdqrPidEoList); + } + + // 过滤出来,设计符合性流程,并且是法规工程师审核节点的数据,转办给新的法规工程师 + 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(newPliEo.getRegulationOwnerId()); + }); + updatePidEoList.addAll(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(newPliEo.getRegulationOwnerId()); + }); + updatePidEoList.addAll(verifyFlowPidEoList); + + taskIdList.addAll(verifyFlowPidEoList.stream().map(ProcessInfoDetailEO::getTaskId).collect(Collectors.toList())); + } + } + } + } + if (CollectionUtils.isNotEmpty(updatePidEoList)) { + // 更新组装好的 法规工程师待办任务。 + this.processInfoDetailEOService.updateBatchById(updatePidEoList); + } + if (CollectionUtils.isNotEmpty(taskIdList)) { + String taskIds = String.join(",", taskIdList); + // 更新流程服务办理人 + this.workFlowFeignClient.changeAssigneeBatch(taskIds, newPliEo.getRegulationOwnerId()); + } + } + } +// ProjectLawsInventoryEO projectLawsInventoryOld = this.projectLawsInventoryEOService.queryById(newPliEo.getId()); +// // 清单待校核 +// boolean toBeCheckedFlag = ( +// StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) +// || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) +// ); +// // 结果待审查 +// boolean toBeReviewedFlag = ( +// StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) +// || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) +// ); +// +// // 编辑前、编辑后的法规工程师都不为空。 +// boolean regulationOwnerIsNotNull = ( +// StringUtils.isNotEmpty(projectLawsInventoryOld.getRegulationOwnerId()) +// && StringUtils.isNotEmpty(newPliEo.getRegulationOwnerId()) +// ); +// if (regulationOwnerIsNotNull && (toBeCheckedFlag || toBeReviewedFlag)) { +// // 如果新的法规工程师不等于旧的法规工程师 将之前的法规工程师的待办任务,转给新的法规工程师办理 +// if (!StringUtils.equals(projectLawsInventoryOld.getRegulationOwnerId(), newPliEo.getRegulationOwnerId())) { +// QueryWrapper pidEoQueryWrap = new QueryWrapper<>(); +// pidEoQueryWrap.lambda().eq(ProcessInfoDetailEO::getProjectLawsInventoryId, newPliEo.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(newPliEo.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(newPliEo.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(newPliEo.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, newPliEo.getRegulationOwnerId()); +// } +// } +// } +// } + } + + /** + * 处理编辑了责任人的逻辑 + * @param newPliEo 新的法规清单对象 + * @param oldPliEoList 旧的法规清单数组 + */ + public void updateDutyPerson(ProjectLawsInventoryEO newPliEo, List oldPliEoList) { + if (CollectionUtils.isNotEmpty(oldPliEoList)) { + List oldPliEoIdList = oldPliEoList.stream().map(ProjectLawsInventoryEO::getId).distinct().collect(Collectors.toList()); + QueryWrapper pidEoQueryWrap = new QueryWrapper<>(); + pidEoQueryWrap.lambda().in(ProcessInfoDetailEO::getProjectLawsInventoryId, oldPliEoIdList); + List pidEoList = this.processInfoDetailEOService.list(pidEoQueryWrap); + if(CollectionUtils.isNotEmpty(pidEoList)){ + List designTaskIdList = new ArrayList<>(); + List verifyTaskIdList = new ArrayList<>(); + List updatePidEoList = new ArrayList<>(); + for (ProjectLawsInventoryEO oldPliEo : oldPliEoList) { + boolean designDutyTaskFlag = ( + StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) + || StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue()) + || StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + ); + // 如果旧符合性责任人不等于新的符合性责任人,并且设计符合性流程状态是 任务待确认、结果待提交、不符合、待追踪。则代表当前任务在责任人身上,需要将旧的责任人待办任务,转给新的责任人。 + if (!StringUtils.equals(newPliEo.getDesignDutyId(), oldPliEo.getDesignDutyId()) && designDutyTaskFlag) { + // 过滤出来,设计符合性流程,并且是责任人操作节点的数据,转办给新的责任人 + List designPidEoList = pidEoList.stream().filter(pidEo -> { + boolean flag = ( + StringUtils.equals(pidEo.getFlowType(), FlowTypeEnum.SJFHXSHLC.getValue()) + && ( + StringUtils.equals(pidEo.getTaskDefinitionKey(), DesignComplianceFlowNodeKeyEnum.ZRRQR.getValue()) + ||StringUtils.equals(pidEo.getTaskDefinitionKey(), DesignComplianceFlowNodeKeyEnum.DEZRRQR.getValue()) + ||StringUtils.equals(pidEo.getTaskDefinitionKey(), DesignComplianceFlowNodeKeyEnum.ZRRTJJFW.getValue()) + ||StringUtils.equals(pidEo.getTaskDefinitionKey(), DesignComplianceFlowNodeKeyEnum.DEZRRTJJFW.getValue()) + ) + && StringUtils.equals(pidEo.getStatus(), TaskStatusEnum.NOT_DONE.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(designPidEoList)){ + designPidEoList.forEach(designPidEo -> { + designPidEo.setUserId(newPliEo.getDesignDutyId()); + }); + updatePidEoList.addAll(designPidEoList); + designTaskIdList.addAll(designPidEoList.stream().map(ProcessInfoDetailEO::getTaskId).collect(Collectors.toList())); + } + } + + boolean verifyDutyTaskFlag = ( + StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) + || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue()) + || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + ); + // 如果验证符合性流程状态是 任务待确认、结果待提交、不符合、待追踪,则代表当前任务在责任人身上,需要将旧的责任人待办任务,转给新的责任人。 + if (!StringUtils.equals(newPliEo.getVerifyDutyId(), oldPliEo.getVerifyDutyId()) && verifyDutyTaskFlag) { + // 过滤出来,验证符合性流程,并且是责任人操作节点的数据,转办给新的责任人 + List verifyPidEoList = pidEoList.stream().filter(pidEo -> { + boolean flag = ( + StringUtils.equals(pidEo.getFlowType(), FlowTypeEnum.YZFHXSCLC.getValue()) + && ( + StringUtils.equals(pidEo.getTaskDefinitionKey(), VerifyComplianceFlowNodeKeyEnum.ZRRQR.getValue()) + ||StringUtils.equals(pidEo.getTaskDefinitionKey(), VerifyComplianceFlowNodeKeyEnum.DEZRRQR.getValue()) + ||StringUtils.equals(pidEo.getTaskDefinitionKey(), VerifyComplianceFlowNodeKeyEnum.ZRRTJJFW.getValue()) + ||StringUtils.equals(pidEo.getTaskDefinitionKey(), VerifyComplianceFlowNodeKeyEnum.DEZRRTJJFW.getValue()) + ) + && StringUtils.equals(pidEo.getStatus(), TaskStatusEnum.NOT_DONE.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(verifyPidEoList)){ + verifyPidEoList.forEach(verifyPidEo -> { + verifyPidEo.setUserId(newPliEo.getVerifyDutyId()); + }); + updatePidEoList.addAll(verifyPidEoList); + verifyTaskIdList.addAll(verifyPidEoList.stream().map(ProcessInfoDetailEO::getTaskId).collect(Collectors.toList())); + } + } + } + if (CollectionUtils.isNotEmpty(updatePidEoList)) { + // 更新组装好的 责任人待办任务。 + this.processInfoDetailEOService.updateBatchById(updatePidEoList); + } + if (CollectionUtils.isNotEmpty(designTaskIdList)) { + String taskIds = String.join(",", designTaskIdList); + // 更新流程服务办理人 + this.workFlowFeignClient.changeAssigneeBatch(taskIds, newPliEo.getDesignDutyId()); + } + if (CollectionUtils.isNotEmpty(verifyTaskIdList)) { + String taskIds = String.join(",", verifyTaskIdList); + // 更新流程服务办理人 + this.workFlowFeignClient.changeAssigneeBatch(taskIds, newPliEo.getVerifyDutyId()); + } + } + } + } + + /** + * 处理修改设计或验证符合性截止日期的逻辑 + * @param newPliEo 新的法规清单对象 + * @param oldPliEoList 旧的法规清单数组 + */ + public void updateDesignOrVerifyEndTime(ProjectLawsInventoryEO newPliEo, List oldPliEoList) { + if (CollectionUtils.isNotEmpty(oldPliEoList)) { + List oldPliEoIdList = oldPliEoList.stream().map(ProjectLawsInventoryEO::getId).distinct().collect(Collectors.toList()); + QueryWrapper pidEoQueryWrap = new QueryWrapper<>(); + pidEoQueryWrap.lambda().in(ProcessInfoDetailEO::getProjectLawsInventoryId, oldPliEoIdList); + List pidEoList = this.processInfoDetailEOService.list(pidEoQueryWrap); + if (CollectionUtils.isNotEmpty(pidEoList)) { + // 处理设计符合性截止日期 + Date newDesignDueDate = newPliEo.getDesignDueDate(); + if (ObjectUtils.isNotEmpty(newDesignDueDate)) { + this.updateProcessInfoDetailEOEndTimeByDesign(oldPliEoList, pidEoList, newDesignDueDate); + } + + // 处理验证符合性截止日期 + Date newVerifyDueDate = newPliEo.getVerifyDueDate(); + if (ObjectUtils.isNotEmpty(newVerifyDueDate)) { + this.updateProcessInfoDetailEOEndTimeByVerify(oldPliEoList, pidEoList, newVerifyDueDate); + } + } + } + } + + /** + * 修改设计符合性流程明细表截止日期 + * @param oldPliEoList + * @param pidEoList + * @param newDesignDueDate + */ + private void updateProcessInfoDetailEOEndTimeByDesign(List oldPliEoList, List pidEoList, Date newDesignDueDate) { + // 过滤设计符合性截止日期,不等于新的设计符合性截止日期,并且数据状态为(结果待提交、结果待审查、不符合、待追踪)的数据,这四种状态的数据是流程走到了设计符合性确认节点。 + List designPliEOList = oldPliEoList.stream().filter(oldPliEo -> { + boolean flag = ( + !newDesignDueDate.equals(oldPliEo.getDesignDueDate()) + && ( + StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue()) + || StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + ) + ); + return flag; + }).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(designPliEOList)) { + // 过滤出来,设计符合性流程,并且是责任人提交交付物、法规工程师审核操作节点的数据,更新截止日期 + List designPidEoList = pidEoList.stream().filter(pidEo -> { + boolean flag = ( + StringUtils.equals(pidEo.getFlowType(), FlowTypeEnum.SJFHXSHLC.getValue()) + && ( + StringUtils.equals(pidEo.getTaskDefinitionKey(), DesignComplianceFlowNodeKeyEnum.FGGCSSH.getValue()) + || StringUtils.equals(pidEo.getTaskDefinitionKey(), DesignComplianceFlowNodeKeyEnum.ZRRTJJFW.getValue()) + || StringUtils.equals(pidEo.getTaskDefinitionKey(), DesignComplianceFlowNodeKeyEnum.DEZRRTJJFW.getValue()) + ) + && StringUtils.equals(pidEo.getStatus(), TaskStatusEnum.NOT_DONE.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(designPidEoList)) { + String processInfoId = designPidEoList.get(0).getProcessInfoId(); + ProcessInfoEO processInfoEO = this.processInfoEOService.queryById(processInfoId); + if(ObjectUtils.isNotEmpty(processInfoEO)){ + processInfoEO.setEndTime(newDesignDueDate); + this.processInfoEOService.updateById(processInfoEO); + } + } + } + } + + /** + * 修改验证符合性流程明细表截止日期 + * @param oldPliEoList + * @param pidEoList + * @param newVerifyDueDate + */ + private void updateProcessInfoDetailEOEndTimeByVerify(List oldPliEoList, List pidEoList, Date newVerifyDueDate) { + // 过滤验证符合性截止日期,不等于新的验证符合性截止日期,并且数据状态为(结果待提交、结果待审查、不符合、待追踪)的数据,这四种状态的数据是流程走到了验证符合性确认节点。 + List verifyPliEOList = oldPliEoList.stream().filter(oldPliEo -> { + boolean flag = ( + !newVerifyDueDate.equals(oldPliEo.getVerifyDueDate()) + && ( + StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue()) + || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + ) + ); + return flag; + }).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(verifyPliEOList)) { + // 过滤出来,验证符合性流程,并且是责任人提交交付物、法规工程师审核操作节点的数据,更新截止日期 + List verifyPidEoList = pidEoList.stream().filter(pidEo -> { + boolean flag = ( + StringUtils.equals(pidEo.getFlowType(), FlowTypeEnum.YZFHXSCLC.getValue()) + && ( + StringUtils.equals(pidEo.getTaskDefinitionKey(), VerifyComplianceFlowNodeKeyEnum.FGGCSSH.getValue()) + || StringUtils.equals(pidEo.getTaskDefinitionKey(), VerifyComplianceFlowNodeKeyEnum.ZRRTJJFW.getValue()) + || StringUtils.equals(pidEo.getTaskDefinitionKey(), VerifyComplianceFlowNodeKeyEnum.DEZRRTJJFW.getValue()) + ) + && StringUtils.equals(pidEo.getStatus(), TaskStatusEnum.NOT_DONE.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(verifyPidEoList)) { + String processInfoId = verifyPidEoList.get(0).getProcessInfoId(); + ProcessInfoEO processInfoEO = this.processInfoEOService.queryById(processInfoId); + if(ObjectUtils.isNotEmpty(processInfoEO)){ + processInfoEO.setEndTime(newVerifyDueDate); + this.processInfoEOService.updateById(processInfoEO); + } + } + } + } +} 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 3ab1ccb10..a4f8afe6d 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 @@ -55,6 +55,7 @@ import com.jero.modules.project.entity.*; import com.jero.modules.project.enums.*; import com.jero.modules.project.mapper.*; import com.jero.modules.project.service.*; +import com.jero.modules.project.service.editImpl.ProjectLawsInventoryEOEditServiceImpl; import com.jero.modules.project.util.WordUtil; import com.jero.modules.project.vo.ProjectTaskUrgVo; import com.jero.modules.split.common.FileUnZip; @@ -268,6 +269,8 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl oldPliQueryWrap = new QueryWrapper<>(); + oldPliQueryWrap.lambda().eq(ProjectLawsInventoryEO::getId,projectLawsInventoryEO.getId()); + List oldPliEoList = this.list(oldPliQueryWrap); this.updateProjectLawsInventorySendMessage(projectLawsInventoryEO); + // 处理编辑法规工程师的逻辑 + this.editService.updateRegulationOwner(projectLawsInventoryEO,oldPliEoList); + // 处理编辑责任人的逻辑 + this.editService.updateDutyPerson(projectLawsInventoryEO,oldPliEoList); + // 处理修改设计或验证符合性截止日期的逻辑 + this.editService.updateDesignOrVerifyEndTime(projectLawsInventoryEO,oldPliEoList); projectLawsInventoryEO.setUpdateTime(now); ProjectLawsInventoryEO projectLawsInventoryEOCopy = SerializationUtils.clone(projectLawsInventoryEO);//复制 @@ -776,71 +788,6 @@ 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()); - } - } } } } @@ -4376,6 +4323,18 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); List infoList = list(queryWrapper.in("id", idList)); + for (String id : idList) { + projectLawsInventoryEO.setId(id); + // 发送消息 + this.updateProjectLawsInventorySendMessage(projectLawsInventoryEO); + } + // 处理编辑法规工程师的逻辑 + this.editService.updateRegulationOwner(projectLawsInventoryEO,infoList); + // 处理编辑责任人的逻辑 + this.editService.updateDutyPerson(projectLawsInventoryEO,infoList); + // 处理修改设计或验证符合性截止日期的逻辑 + this.editService.updateDesignOrVerifyEndTime(projectLawsInventoryEO,infoList); + List projectLawsInventoryEOList = new ArrayList<>(); List adds = new ArrayList<>(); From ebc1db0360302976a6ee386c72efd3ed82c9fb1b Mon Sep 17 00:00:00 2001 From: wangzhijiang <1358525938@qq.com> Date: Fri, 14 Jul 2023 11:47:38 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=9C=A8=E8=AF=A5=E9=A1=B9=E7=9B=AE=E4=B8=AD=E6=89=80=E6=9C=89?= =?UTF-8?q?=E7=9A=84=E8=B4=A3=E4=BB=BB=E9=A2=86=E5=9F=9F=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/IParamsManifestEOService.java | 8 +++ .../impl/ParamsManifestEOServiceImpl.java | 52 ++++++++++++++++--- .../ProjectLibraryBaseController.java | 9 ++++ ...rojectCertificationInventoryEOService.java | 9 ++++ .../IProjectLawsInventoryEOService.java | 8 +++ .../service/IProjectLibraryBaseService.java | 8 +++ .../IProjectRelatedPersonnelService.java | 9 ++++ ...ctCertificationInventoryEOServiceImpl.java | 35 +++++++++++++ .../ProjectLawsInventoryEOServiceImpl.java | 36 +++++++++++++ .../impl/ProjectLibraryBaseServiceImpl.java | 43 +++++++++++++++ .../ProjectRelatedPersonnelServiceImpl.java | 32 ++++++++++++ 11 files changed, 241 insertions(+), 8 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsManifestEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsManifestEOService.java index faccdc37e..9cb232dbd 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsManifestEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsManifestEOService.java @@ -7,6 +7,7 @@ import com.jero.modules.cert.collect.entity.ParamsManifestEO; import com.jero.modules.cert.collect.vo.ParamsManifestHistoryVO; import com.jero.modules.cert.collect.vo.ParamsManifestVO; import com.jero.modules.cert.template.entity.ParamsTemplateEO; +import com.jero.modules.system.entity.SysDictItem; import java.util.List; import java.util.Map; @@ -99,4 +100,11 @@ public interface IParamsManifestEOService extends IService { boolean setTemplateName(List paramsTemplateIds); boolean updateModel(String mid,String version, String cid); + + /** + * 获取用户的责任领域数组 + * @param params + * @return + */ + List getUserDutyTerritoryList(Map params); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsManifestEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsManifestEOServiceImpl.java index ab57f651d..0ed131daf 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsManifestEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsManifestEOServiceImpl.java @@ -3,6 +3,7 @@ package com.jero.modules.cert.collect.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -36,6 +37,7 @@ import com.jero.modules.cert.template.enums.ControlTypeEnum; import com.jero.modules.cert.template.service.IParamsInfoPublishEOService; import com.jero.modules.cert.template.service.IParamsTemplateEOService; import com.jero.modules.enums.DictCodeEnum; +import com.jero.modules.project.entity.ProjectCertificationInventoryEO; import com.jero.modules.project.entity.ProjectRelatedPersonnel; import com.jero.modules.project.service.IProjectLibraryBaseService; import com.jero.modules.project.service.IProjectRelatedPersonnelService; @@ -56,14 +58,7 @@ import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import java.text.NumberFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.UUID; +import java.util.*; import java.util.stream.Collectors; /** @@ -1135,4 +1130,45 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl getUserDutyTerritoryList(Map params) { + List result = new ArrayList<>(); + String userId = (String) params.get("userId"); + String userName = (String) params.get("userName"); + String projectLibraryId = (String) params.get("projectLibraryId"); + String parentId = (String) params.get("parentId"); + if(StringUtils.isNotEmpty(parentId)){ + projectLibraryId = parentId; + } + List dutyTerritorySdiList = (List) params.get("dutyTerritorySdiList"); + + QueryWrapper pmQueryWrap = new QueryWrapper<>(); + pmQueryWrap.lambda().like(ParamsManifestEO::getProjectId,projectLibraryId); + List pmEoList = this.list(pmQueryWrap); + if (CollectionUtils.isNotEmpty(pmEoList)) { + List pmEoIdList = pmEoList.stream().map(ParamsManifestEO::getId).distinct().collect(Collectors.toList()); + QueryWrapper pcmQueryWrap = new QueryWrapper<>(); + pcmQueryWrap.lambda().in(ParamsCollectManifestEO::getParamsManifestId,pmEoIdList); + pcmQueryWrap.and(pcmQuery -> { + pcmQuery.lambda().eq(ParamsCollectManifestEO::getDre,userName).or().like(ParamsCollectManifestEO::getSdt,userName); + }); + List pcmEoList = this.paramsCollectManifestEOService.list(pcmQueryWrap); + if(CollectionUtils.isNotEmpty(pcmEoList)){ + List dutyTerritoryIdList = pcmEoList.stream().map(ParamsCollectManifestEO::getDutyTerritory).distinct().collect(Collectors.toList()); + + result = dutyTerritorySdiList.stream().filter(dutyTerritory -> { + boolean flag = false; + for (String dutyTerritoryId : dutyTerritoryIdList) { + if (org.apache.commons.lang3.StringUtils.equals(dutyTerritoryId, dutyTerritory.getItemValue())) { + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + } + } + return result; + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLibraryBaseController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLibraryBaseController.java index b870ca39e..5636ba5f1 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLibraryBaseController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLibraryBaseController.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.jero.common.api.vo.Result; import com.jero.common.aspect.annotation.AutoLog; import com.jero.common.system.base.controller.JeroController; +import com.jero.common.system.vo.DictModel; import com.jero.modules.project.entity.ProjectLibraryBase; import com.jero.modules.project.service.IProjectLibraryBaseService; import io.swagger.annotations.Api; @@ -291,4 +292,12 @@ public class ProjectLibraryBaseController extends JeroController params) { this.projectLibraryBaseService.exportProjectProgressStatisticsXls(response,request, params); } + + @AutoLog(value = "获取用户在该项目中所有的责任领域") + @ApiOperation(value="获取用户在该项目中所有的责任领域", notes="获取用户在该项目中所有的责任领域") + @GetMapping(value = "/getUserAllDutyTerritoryList") + public Result> getUserAllDutyTerritoryList(@RequestParam Map params){ + List resList = this.projectLibraryBaseService.getUserAllDutyTerritoryList(params); + return Result.OK(resList); + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java index 4c99ee3a5..42072e6fb 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java @@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.jero.common.api.vo.Result; +import com.jero.common.system.vo.DictModel; import com.jero.modules.project.entity.ProjectCertificationInventoryEO; import com.baomidou.mybatisplus.extension.service.IService; import com.jero.modules.system.entity.SysCategory; +import com.jero.modules.system.entity.SysDictItem; import com.jero.modules.system.entity.SysRole; import com.jero.modules.system.entity.SysUser; import com.jero.modules.todoCenter.entity.ProcessInfoDetailEO; @@ -317,4 +319,11 @@ public interface IProjectCertificationInventoryEOService extends IService editEndTimeCertificationInventoryEOS); + + /** + * 获取用户的责任领域数组 + * @param params + * @return + */ + List getUserDutyTerritoryList(Map params); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLawsInventoryEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLawsInventoryEOService.java index 208d148fb..2f3da9490 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLawsInventoryEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLawsInventoryEOService.java @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.itextpdf.text.DocumentException; import com.jero.common.api.vo.Result; import com.jero.common.constant.enums.MessageTypeEnum; +import com.jero.common.system.vo.DictModel; import com.jero.common.system.vo.LoginUser; import com.jero.modules.feishu.vo.FeishuMsgVo; import com.jero.modules.project.entity.ProjectLawsInventoryEO; @@ -308,4 +309,11 @@ public interface IProjectLawsInventoryEOService extends IService queryPage(ProjectLawsInventoryEO projectLawsInventoryEO, Integer pageNo, Integer pageSize, HttpServletRequest req); Result finalizationVerify(Map params); + + /** + * 获取用户的责任领域数组 + * @param params + * @return + */ + List getUserDutyTerritoryList(Map params); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLibraryBaseService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLibraryBaseService.java index 34ea29c85..c3ac81e88 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLibraryBaseService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLibraryBaseService.java @@ -3,6 +3,7 @@ package com.jero.modules.project.service; import com.alibaba.fastjson.JSONArray; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; +import com.jero.common.system.vo.DictModel; import com.jero.modules.project.entity.ProjectLibraryBase; import javax.servlet.http.HttpServletRequest; @@ -167,4 +168,11 @@ public interface IProjectLibraryBaseService extends IService * @param params */ void exportProjectProgressStatisticsXls(HttpServletResponse response, HttpServletRequest request, Map params); + + /** + * 获取用户在该项目中所有的责任领域数组 + * @param params + * @return + */ + List getUserAllDutyTerritoryList(Map params); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectRelatedPersonnelService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectRelatedPersonnelService.java index 9e34642b4..979479e95 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectRelatedPersonnelService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectRelatedPersonnelService.java @@ -2,7 +2,9 @@ package com.jero.modules.project.service; import com.baomidou.mybatisplus.extension.service.IService; import com.jero.common.api.vo.Result; +import com.jero.common.system.vo.DictModel; import com.jero.modules.project.entity.ProjectRelatedPersonnel; +import com.jero.modules.system.entity.SysDictItem; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.springframework.web.multipart.MultipartFile; @@ -103,4 +105,11 @@ public interface IProjectRelatedPersonnelService extends IService> queryLawEngineerByProjectId(Map params); List> queryEngineeringInterfacePersonByProjectId(Map params); + + /** + * 获取用户的责任领域数组 + * @param params + * @return + */ + List getUserDutyTerritoryList(Map params); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index cc48b581b..c5cb6235e 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -18,6 +18,7 @@ import com.jero.common.api.vo.Result; import com.jero.common.constant.enums.CutEnum; import com.jero.common.exception.JeroBootException; import com.jero.common.system.query.QueryGenerator; +import com.jero.common.system.vo.DictModel; import com.jero.common.system.vo.LoginUser; import com.jero.common.util.DateUtils; import com.jero.common.util.oss.CosBootUtil; @@ -6229,5 +6230,39 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl getUserDutyTerritoryList(Map params) { + List result = new ArrayList<>(); + String userId = (String) params.get("userId"); + String projectLibraryId = (String) params.get("projectLibraryId"); + List dutyTerritorySdiList = (List) params.get("dutyTerritorySdiList"); + + QueryWrapper pciQueryWrap = new QueryWrapper<>(); + pciQueryWrap.lambda().eq(ProjectCertificationInventoryEO::getProjectLibraryId,projectLibraryId); + pciQueryWrap.and(pciQuery -> { + pciQuery.lambda().like(ProjectCertificationInventoryEO::getDutyPerson,userId) + .or().like(ProjectCertificationInventoryEO::getSdt,userId); + }); + List pciEoList = this.list(pciQueryWrap); + + if(CollectionUtils.isNotEmpty(pciEoList)){ + List dutyTerritoryIdList = Arrays.asList( + pciEoList.stream().map(ProjectCertificationInventoryEO::getDutyTerritory).collect(Collectors.joining(",")).split(",") + ).stream().distinct().collect(Collectors.toList()); + + result = dutyTerritorySdiList.stream().filter(dutyTerritory -> { + boolean flag = false; + for (String dutyTerritoryId : dutyTerritoryIdList) { + if (StringUtils.equals(dutyTerritoryId, dutyTerritory.getItemValue())) { + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + } + + return result; + } } 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 a4f8afe6d..a1f73b762 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 @@ -27,6 +27,7 @@ import com.jero.common.constant.enums.MessageTypeEnum; import com.jero.common.constant.enums.MsgColorEnum; import com.jero.common.exception.JeroBootException; import com.jero.common.system.query.QueryGenerator; +import com.jero.common.system.vo.DictModel; import com.jero.common.system.vo.LoginUser; import com.jero.common.util.DateUtils; import com.jero.common.util.oss.CosBootUtil; @@ -13682,4 +13683,39 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl getUserDutyTerritoryList(Map params) { + List result = new ArrayList<>(); + String userId = (String) params.get("userId"); + String projectLibraryId = (String) params.get("projectLibraryId"); + List dutyTerritorySdiList = (List) params.get("dutyTerritorySdiList"); + + QueryWrapper pliQueryWrap = new QueryWrapper<>(); + pliQueryWrap.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,projectLibraryId); + pliQueryWrap.and(pliQuery -> { + pliQuery.lambda().like(ProjectLawsInventoryEO::getRegulationOwnerId,userId) + .or().like(ProjectLawsInventoryEO::getDesignDutyId,userId) + .or().like(ProjectLawsInventoryEO::getVerifyDutyId,userId); + }); + List pliEoList = this.list(pliQueryWrap); + if(CollectionUtils.isNotEmpty(pliEoList)){ + List dutyTerritoryIdList = Arrays.asList( + pliEoList.stream().map(ProjectLawsInventoryEO::getDutyTerritory).collect(Collectors.joining(",")).split(",") + ).stream().distinct().collect(Collectors.toList()); + + result = dutyTerritorySdiList.stream().filter(dutyTerritory -> { + boolean flag = false; + for (String dutyTerritoryId : dutyTerritoryIdList) { + if (StringUtils.equals(dutyTerritoryId, dutyTerritory.getItemValue())) { + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + } + + return result; + } } \ No newline at end of file diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java index b025ab31d..75346a6b7 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java @@ -2585,6 +2585,49 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl getUserAllDutyTerritoryList(Map params) { + List result = new ArrayList<>(); + List sysDictItems = this.sysDictItemServiceImpl.selectItemsAll(); + List dutyTerritorySdiList = sysDictItems.stream().filter(sysDictItem -> { + return (StringUtils.equals(sysDictItem.getDictCode(), DicCodeEnum.DUTY_TERRITORY.getCode())); + }).collect(Collectors.toList()); + params.put("dutyTerritorySdiList",dutyTerritorySdiList); + + List userAllDutyTerritorySdiList = new ArrayList<>(); + List prpSdiList = this.projectRelatedPersonnelService.getUserDutyTerritoryList(params); + if(CollectionUtils.isNotEmpty(prpSdiList)){ + userAllDutyTerritorySdiList.addAll(prpSdiList); + } + List pliSdiList = this.projectLawsInventoryEOService.getUserDutyTerritoryList(params); + if(CollectionUtils.isNotEmpty(pliSdiList)){ + userAllDutyTerritorySdiList.addAll(pliSdiList); + } + List pciSdiList = this.projectCertificationInventoryEOService.getUserDutyTerritoryList(params); + if(CollectionUtils.isNotEmpty(pciSdiList)){ + userAllDutyTerritorySdiList.addAll(pciSdiList); + } + String projectLibraryId = (String) params.get("projectLibraryId"); + ProjectLibraryBase projectLibraryBase = this.selectById(projectLibraryId); + params.put("parentId",projectLibraryBase.getParentId()); + List pmSdiList = this.paramsManifestEOService.getUserDutyTerritoryList(params); + if(CollectionUtils.isNotEmpty(pmSdiList)){ + userAllDutyTerritorySdiList.addAll(pmSdiList); + } + + userAllDutyTerritorySdiList = userAllDutyTerritorySdiList.stream().distinct().collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(userAllDutyTerritorySdiList)){ + for (SysDictItem sysDictItem : userAllDutyTerritorySdiList) { + DictModel dictModel = new DictModel(); + dictModel.setText(sysDictItem.getItemText()); + dictModel.setTextEn(sysDictItem.getEnName()); + dictModel.setValue(sysDictItem.getItemValue()); + result.add(dictModel); + } + } + return result; + } + /** * 导出法规符合性管理 * @param workbook diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectRelatedPersonnelServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectRelatedPersonnelServiceImpl.java index ee9069061..ee1097115 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectRelatedPersonnelServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectRelatedPersonnelServiceImpl.java @@ -9,6 +9,7 @@ import com.jero.common.constant.CommonConstant; import com.jero.common.constant.enums.CutEnum; import com.jero.common.exception.JeroBootException; import com.jero.common.system.api.ISysBaseAPI; +import com.jero.common.system.vo.DictModel; import com.jero.common.system.vo.LoginUser; import com.jero.common.util.RedisUtil; import com.jero.common.util.TokenUtils; @@ -1894,4 +1895,35 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl getUserDutyTerritoryList(Map params) { + List result = new ArrayList<>(); + String userId = (String) params.get("userId"); + String projectLibraryId = (String) params.get("projectLibraryId"); + List dutyTerritorySdiList = (List) params.get("dutyTerritorySdiList"); + QueryWrapper prpQueryWrap = new QueryWrapper<>(); + prpQueryWrap.lambda().eq(ProjectRelatedPersonnel::getProjectId,projectLibraryId); + prpQueryWrap.and(prpQuery -> { + prpQuery.lambda().like(ProjectRelatedPersonnel::getLawEngineer,userId) + .or().like(ProjectRelatedPersonnel::getEngineerLawSet,userId) + .or().like(ProjectRelatedPersonnel::getEngineeringInterfacePerson,userId) + .or().like(ProjectRelatedPersonnel::getEngineerAttSet,userId); + }); + List projectRelatedPersonnelList = this.list(prpQueryWrap); + if(CollectionUtils.isNotEmpty(projectRelatedPersonnelList)){ + List dutyTerritoryIdList = projectRelatedPersonnelList.stream().map(ProjectRelatedPersonnel::getDutyTerritory).distinct().collect(Collectors.toList()); + result = dutyTerritorySdiList.stream().filter(dutyTerritory -> { + boolean flag = false; + for (String dutyTerritoryId : dutyTerritoryIdList) { + if (StringUtils.equals(dutyTerritoryId, dutyTerritory.getItemValue())) { + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + } + return result; + } + } From 7ed4fabd8d4e7727df36aad4826a2cfff4f79801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E5=BC=BA=E5=BC=BA?= <787203167> Date: Fri, 14 Jul 2023 15:11:10 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=85=A8=E5=B1=80=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-web/src/common/lang/en-us.js | 4 + jero-web/src/common/lang/zh-cn.js | 4 + .../ProjectDetails/index.vue | 225 ++++++++++++++++-- 3 files changed, 209 insertions(+), 24 deletions(-) diff --git a/jero-web/src/common/lang/en-us.js b/jero-web/src/common/lang/en-us.js index d2006fc76..b1cc5321e 100644 --- a/jero-web/src/common/lang/en-us.js +++ b/jero-web/src/common/lang/en-us.js @@ -1905,4 +1905,8 @@ module.exports = { knowledgeSharingHaveBeenStored:'Knowledge Sharing have been stored', regulationMonthlyReportHaveBeenStored:'Regulation Monthly Report have been stored', sendBackOne:'Return', + globalReplacement:'Global Replacement', + replacedPerson:'Replaced person', + replacementPerson:'Replacement Person', + thereReplaceableData:'There is currently no replaceable data', } \ No newline at end of file diff --git a/jero-web/src/common/lang/zh-cn.js b/jero-web/src/common/lang/zh-cn.js index 96f81402f..c66230a56 100644 --- a/jero-web/src/common/lang/zh-cn.js +++ b/jero-web/src/common/lang/zh-cn.js @@ -3862,4 +3862,8 @@ module.exports = { Notitleincluded:'不包含标题', backToHomePage:'返回主页', sendBackOne:'退回', + globalReplacement:'全局替换', + replacedPerson:'被替换人', + replacementPerson:'替换人', + thereReplaceableData:'当前没有可替换的数据', } \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/ProjectDetails/index.vue b/jero-web/src/views/projectManagement/ProjectDetails/index.vue index 17425e6c6..802fb4bf7 100644 --- a/jero-web/src/views/projectManagement/ProjectDetails/index.vue +++ b/jero-web/src/views/projectManagement/ProjectDetails/index.vue @@ -11,6 +11,12 @@
+
+ + {{$t('globalReplacement')}} +
@@ -45,7 +51,7 @@
{{ item.roleName }}
@@ -103,13 +109,13 @@ {{$t('TaskParameterCollection')}}
- - - - - - - + + + + + + +
@@ -143,12 +149,12 @@ @click="textClick(4,$t('TaskParameterCollection'))">
- - - - - - + + + + + +
- - + + - - + + + + + + + + + + + +
+ {{$t('cancel')}} + {{$t('submit')}} +
+
\ No newline at end of file