From 86acd6652468edec3a34454662c73211c0cdbb16 Mon Sep 17 00:00:00 2001 From: wangzhijiang Date: Tue, 4 Apr 2023 13:58:39 +0800 Subject: [PATCH] =?UTF-8?q?67785=20=E6=B3=95=E8=A7=84=E6=B8=85=E5=8D=95?= =?UTF-8?q?=EF=BC=8C=E5=82=AC=E5=8A=9E=E5=8A=9F=E8=83=BD=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectLawsInventoryEOServiceImpl.java | 795 +++++++++++------- 1 file changed, 494 insertions(+), 301 deletions(-) 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 e5dc52edf..fa515a413 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 @@ -9767,313 +9767,28 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl toBeCheckedLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> { - boolean flag =false; - if (StringUtils.equals(lawsInventory.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())){ - flag = true; - } - return flag; - }).collect(Collectors.toList()); - - if(CollectionUtils.isNotEmpty(toBeCheckedLawsInventoryList)){ - Map> regulationOwnerGroupMap = toBeCheckedLawsInventoryList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getRegulationOwnerId)); - for (Map.Entry> regulationOwnerMap : regulationOwnerGroupMap.entrySet()) { - String regulationOwnerId = regulationOwnerMap.getKey(); - List lawsInventoryEOList = regulationOwnerMap.getValue(); - if(StringUtils.isEmpty(regulationOwnerId) || CollectionUtils.isEmpty(lawsInventoryEOList)){ - continue; - } - - this.lawsInventoryEOListSortByInventoryAffirmDueDate(lawsInventoryEOList); - Date inventoryAffirmDueDate = lawsInventoryEOList.get(0).getInventoryAffirmDueDate(); - String endTime = ""; - if(inventoryAffirmDueDate != null){ - endTime = DateUtils.formatDate(inventoryAffirmDueDate); - } - String serialNumbers = lawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(",")); - - List userIdList = Arrays.asList(regulationOwnerId.split(",")); - // 给法规工程师发消息 - Map params = new HashMap<>(); - params.put("contentCn","您好,请及时校核法规清单内容并发起符合性流程,谢谢!"); - params.put("contentEn","Please check the content of the regulation list and initiate the compliance process in a timely manner. Thank you!"); - params.put("projectLibraryId",projectLibraryId); - params.put("endTime",endTime); - params.put("userIdList",userIdList); - params.put("serialNumbers",serialNumbers); - - ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLibraryId); - String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 - String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 - // 获取法规清单 - 飞书跳转链接 - Map hrefFeishuMap = this.getProjectLawsInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN,PRN_EN); - params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); - params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); - params.put("Initiator",projectLibraryBase.getStudioEngineerName()); - - this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE1.getValue(),params); - } - } - } - - // 催办设计符合性流程状态为 清单待确认的 责任人 - List toBeConfirmedLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> { - boolean flag =false; - if (StringUtils.equals(lawsInventory.getDesignFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())){ - flag = true; - } - return flag; - }).collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(toBeConfirmedLawsInventoryList)) { - Map> designDutyGroupMap = toBeConfirmedLawsInventoryList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getDesignDutyId)); - for (Map.Entry> designDutyMap : designDutyGroupMap.entrySet()) { - String designDutyId = designDutyMap.getKey(); - List lawsInventoryEOList = designDutyMap.getValue(); - if(StringUtils.isEmpty(designDutyId) || CollectionUtils.isEmpty(lawsInventoryEOList)){ - continue; - } - - this.lawsInventoryEOListSortByDesignDueDate(lawsInventoryEOList); - Date designDueDate = lawsInventoryEOList.get(0).getDesignDueDate(); - String endTime = ""; - if(designDueDate != null){ - endTime = DateUtils.formatDate(designDueDate); - } - String serialNumbers = lawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(",")); - - List userIdList = Arrays.asList(designDutyId.split(",")); - // 给设计符合性流程责任人发消息 - Map params = new HashMap<>(); - params.put("contentCn","您好,请及时查看确认以下任务要求,谢谢!"); - params.put("contentEn","Hello! Please check and confirm the following task requirement in a timely manner. Thank you!"); - params.put("projectLibraryId",projectLibraryId); - params.put("endTime",endTime); - params.put("userIdList",userIdList); - params.put("serialNumbers",serialNumbers); - - ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLibraryId); - String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 - String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 - // 获取法规清单 - 飞书跳转链接 - Map hrefFeishuMap = this.getProjectLawsInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN,PRN_EN); - params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); - params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); - params.put("Initiator",projectLibraryBase.getStudioEngineerName()); - - - this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(),params); - } - } - - // 催办设计符合性流程状态为 结果待提交的 责任人 - List toBeSubmitLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> { - boolean flag =false; - if (StringUtils.equals(lawsInventory.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())){ - flag = true; - } - return flag; - }).collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(toBeSubmitLawsInventoryList)) { - Map> designDutyGroupMap = toBeSubmitLawsInventoryList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getVerifyDutyId)); - for (Map.Entry> designDutyMap : designDutyGroupMap.entrySet()) { - String designDutyId = designDutyMap.getKey(); - List lawsInventoryEOList = designDutyMap.getValue(); - if(StringUtils.isEmpty(designDutyId) || CollectionUtils.isEmpty(lawsInventoryEOList)){ - continue; - } - this.lawsInventoryEOListSortByVerifyDueDate(lawsInventoryEOList); - - Date designDueDate = lawsInventoryEOList.get(0).getVerifyDueDate(); - String endTime = ""; - if(designDueDate != null){ - endTime = DateUtils.formatDate(designDueDate); - } - String serialNumbers = lawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(",")); - - List userIdList = Arrays.asList(designDutyId.split(",")); - // 给设计符合性流程责任人发消息 - Map params = new HashMap<>(); - params.put("contentCn","您好,请尽快查看处理此项任务,谢谢!"); - params.put("contentEn","Hello! Please check and address the task ASAP. Thank you!"); - params.put("projectLibraryId",projectLibraryId); - params.put("endTime",endTime); - params.put("userIdList",userIdList); - params.put("serialNumbers",serialNumbers); - - ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLibraryId); - // String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 - String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 - // 获取待办中心 - 飞书跳转链接 - Map todoCenterParams = new HashMap<>(); - todoCenterParams.put("projectNameCn",PRN_CN); - Map hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); - params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); - params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); - - String regulationOwnerId = lawsInventoryEOList.get(0).getRegulationOwnerId(); - List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); - String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); - params.put("Initiator",regulationOwnerUserName); - - this.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(),params); - } + // 设计符合性 清单待校核状态数据催办。 + this.designExpeditingToBeChecked(projectLibraryId, projectLawsInventoryEOList); + // 设计符合性 结果待审查状态数据催办。 + this.designExpeditingToBeReviewed(projectLibraryId, projectLawsInventoryEOList); } + // 设计符合性 清单待确认状态数据催办 + this.designExpeditingToBeConfirmed(projectLibraryId, projectLawsInventoryEOList); + // 设计符合性 结果待提交状态数据催办 + this.designExpeditingToBeSubmitted(projectLibraryId, projectLawsInventoryEOList); } if(StringUtils.contains(expeditingType,OperatorTypeEnum.LAWS_INVENTORY_VERIFY_EXPEDITING.getValue())){ // 只有studio催办的时候,才会给法规工程师发消息 if(StringUtils.equals(operateType,OperatorTypeEnum.LAWS_INVENTORY_STUDIO_EXPEDITING.getValue())){ - // 如果设计符合性流程状态为 清单待校核,催办时就需要给这一条数据的法规工程师发消息 - List toBeCheckedLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> { - boolean flag =false; - if (StringUtils.equals(lawsInventory.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())){ - flag = true; - } - return flag; - }).collect(Collectors.toList()); - - if(CollectionUtils.isNotEmpty(toBeCheckedLawsInventoryList)){ - Map> regulationOwnerGroupMap = toBeCheckedLawsInventoryList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getRegulationOwnerId)); - for (Map.Entry> regulationOwnerMap : regulationOwnerGroupMap.entrySet()) { - String regulationOwnerId = regulationOwnerMap.getKey(); - List lawsInventoryEOList = regulationOwnerMap.getValue(); - if(StringUtils.isEmpty(regulationOwnerId) || CollectionUtils.isEmpty(lawsInventoryEOList)){ - continue; - } - - this.lawsInventoryEOListSortByInventoryAffirmDueDate(lawsInventoryEOList); - Date inventoryAffirmDueDate = lawsInventoryEOList.get(0).getInventoryAffirmDueDate(); - String endTime = ""; - if(inventoryAffirmDueDate != null){ - endTime = DateUtils.formatDate(inventoryAffirmDueDate); - } - String serialNumbers = lawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(",")); - - List userIdList = Arrays.asList(regulationOwnerId.split(",")); - // 给法规工程师发消息 - Map params = new HashMap<>(); - params.put("contentCn","您好,请及时校核法规清单内容并发起符合性流程,谢谢!"); - params.put("contentEn","Please check the content of the regulation list and initiate the compliance process in a timely manner. Thank you!"); - params.put("projectLibraryId",projectLibraryId); - params.put("endTime",endTime); - params.put("userIdList",userIdList); - params.put("serialNumbers",serialNumbers); - - ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLibraryId); - String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 - String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 - // 获取法规清单 - 飞书跳转链接 - Map hrefFeishuMap = this.getProjectLawsInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN,PRN_EN); - params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); - params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); - params.put("Initiator",projectLibraryBase.getStudioEngineerName()); - - this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE1.getValue(),params); - } - } - } - - // 催办验证符合性流程状态为 清单待确认的 责任人 - List toBeConfirmedLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> { - boolean flag =false; - if (StringUtils.equals(lawsInventory.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())){ - flag = true; - } - return flag; - }).collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(toBeConfirmedLawsInventoryList)) { - Map> verifyDutyGroupMap = toBeConfirmedLawsInventoryList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getVerifyDutyId)); - for (Map.Entry> verifyDutyMap : verifyDutyGroupMap.entrySet()) { - String verifyDutyId = verifyDutyMap.getKey(); - List lawsInventoryEOList = verifyDutyMap.getValue(); - if(StringUtils.isEmpty(verifyDutyId) || CollectionUtils.isEmpty(lawsInventoryEOList)){ - continue; - } - - this.lawsInventoryEOListSortByVerifyDueDate(lawsInventoryEOList); - Date verifyDueDate = lawsInventoryEOList.get(0).getVerifyDueDate(); - String endTime = ""; - if(verifyDueDate != null){ - endTime = DateUtils.formatDate(verifyDueDate); - } - String serialNumbers = lawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(",")); - - List userIdList = Arrays.asList(verifyDutyId.split(",")); - // 给设计符合性流程责任人发消息 - Map params = new HashMap<>(); - params.put("contentCn","您好,请及时查看确认以下任务要求,谢谢!"); - params.put("contentEn","Hello! Please check and confirm the following task requirement in a timely manner. Thank you!"); - params.put("projectLibraryId",projectLibraryId); - params.put("endTime",endTime); - params.put("userIdList",userIdList); - params.put("serialNumbers",serialNumbers); - - ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLibraryId); - String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 - String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 - // 获取法规清单 - 飞书跳转链接 - Map hrefFeishuMap = this.getProjectLawsInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN,PRN_EN); - params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); - params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); - params.put("Initiator",projectLibraryBase.getStudioEngineerName()); - - this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(),params); - } - } - - // 催办验证符合性流程状态为 结果待提交的 责任人 - List toBeSubmitLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> { - boolean flag =false; - if (StringUtils.equals(lawsInventory.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())){ - flag = true; - } - return flag; - }).collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(toBeSubmitLawsInventoryList)) { - Map> verifyDutyGroupMap = toBeSubmitLawsInventoryList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getVerifyDutyId)); - for (Map.Entry> verifyDutyMap : verifyDutyGroupMap.entrySet()) { - String verifyDutyId = verifyDutyMap.getKey(); - List lawsInventoryEOList = verifyDutyMap.getValue(); - if(StringUtils.isEmpty(verifyDutyId) || CollectionUtils.isEmpty(lawsInventoryEOList)){ - continue; - } - this.lawsInventoryEOListSortByVerifyDueDate(lawsInventoryEOList); - - Date verifyDueDate = lawsInventoryEOList.get(0).getVerifyDueDate(); - String endTime = ""; - if(verifyDueDate != null){ - endTime = DateUtils.formatDate(verifyDueDate); - } - String serialNumbers = lawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(",")); - - List userIdList = Arrays.asList(verifyDutyId.split(",")); - // 给设计符合性流程责任人发消息 - Map params = new HashMap<>(); - params.put("contentCn","您好,请尽快查看处理此项任务,谢谢!"); - params.put("contentEn","Hello! Please check and address the task ASAP. Thank you!"); - params.put("projectLibraryId",projectLibraryId); - params.put("endTime",endTime); - params.put("userIdList",userIdList); - params.put("serialNumbers",serialNumbers); - - ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLibraryId); - // String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 - String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 - // 获取待办中心 - 飞书跳转链接 - Map todoCenterParams = new HashMap<>(); - todoCenterParams.put("projectNameCn",PRN_CN); - Map hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); - params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); - params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); - - String regulationOwnerId = lawsInventoryEOList.get(0).getRegulationOwnerId(); - List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); - String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); - params.put("Initiator",regulationOwnerUserName); - - this.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(),params); - } + // 验证符合性 清单待校核状态数据催办。 + this.verifyExpeditingToBeChecked(projectLibraryId, projectLawsInventoryEOList); + // 验证符合性 结果待审查状态数据催办。 + this.verifyExpeditingToBeReviewed(projectLibraryId, projectLawsInventoryEOList); } + // 验证符合性 清单待确认状态数据催办 + this.verifyExpeditingToBeConfirmed(projectLibraryId, projectLawsInventoryEOList); + // 验证符合性 结果待提交状态数据催办 + this.verifyExpeditingToBeSubmitted(projectLibraryId, projectLawsInventoryEOList); } /*//获取已经发起的 任务确认流程信息(当前处理人) @@ -10288,6 +10003,484 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl projectLawsInventoryEOList) { + // 催办验证符合性流程状态为 结果待提交的 责任人 + List toBeSubmitLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> { + boolean flag =false; + if (StringUtils.equals(lawsInventory.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())){ + flag = true; + } + return flag; + }).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(toBeSubmitLawsInventoryList)) { + Map> verifyDutyGroupMap = toBeSubmitLawsInventoryList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getVerifyDutyId)); + for (Map.Entry> verifyDutyMap : verifyDutyGroupMap.entrySet()) { + String verifyDutyId = verifyDutyMap.getKey(); + List lawsInventoryEOList = verifyDutyMap.getValue(); + if(StringUtils.isEmpty(verifyDutyId) || CollectionUtils.isEmpty(lawsInventoryEOList)){ + continue; + } + this.lawsInventoryEOListSortByVerifyDueDate(lawsInventoryEOList); + + Date verifyDueDate = lawsInventoryEOList.get(0).getVerifyDueDate(); + String endTime = ""; + if(verifyDueDate != null){ + endTime = DateUtils.formatDate(verifyDueDate); + } + String serialNumbers = lawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(",")); + + List userIdList = Arrays.asList(verifyDutyId.split(",")); + // 给设计符合性流程责任人发消息 + Map params = new HashMap<>(); + params.put("contentCn","您好,请尽快查看处理此项任务,谢谢!"); + params.put("contentEn","Hello! Please check and address the task ASAP. Thank you!"); + params.put("projectLibraryId", projectLibraryId); + params.put("endTime",endTime); + params.put("userIdList",userIdList); + params.put("serialNumbers",serialNumbers); + + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLibraryId); + // String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + // 获取待办中心 - 飞书跳转链接 + Map todoCenterParams = new HashMap<>(); + todoCenterParams.put("projectNameCn",PRN_CN); + Map hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); + params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); + params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + + String regulationOwnerId = lawsInventoryEOList.get(0).getRegulationOwnerId(); + List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); + String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); + params.put("Initiator",regulationOwnerUserName); + + this.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(),params); + } + } + } + + /** + * 验证符合性 清单待确认状态数据催办 + * @param projectLibraryId + * @param projectLawsInventoryEOList + */ + private void verifyExpeditingToBeConfirmed(String projectLibraryId, List projectLawsInventoryEOList) { + // 催办验证符合性流程状态为 清单待确认的 责任人 + List toBeConfirmedLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> { + boolean flag =false; + if (StringUtils.equals(lawsInventory.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())){ + flag = true; + } + return flag; + }).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(toBeConfirmedLawsInventoryList)) { + Map> verifyDutyGroupMap = toBeConfirmedLawsInventoryList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getVerifyDutyId)); + for (Map.Entry> verifyDutyMap : verifyDutyGroupMap.entrySet()) { + String verifyDutyId = verifyDutyMap.getKey(); + List lawsInventoryEOList = verifyDutyMap.getValue(); + if(StringUtils.isEmpty(verifyDutyId) || CollectionUtils.isEmpty(lawsInventoryEOList)){ + continue; + } + + this.lawsInventoryEOListSortByVerifyDueDate(lawsInventoryEOList); + Date verifyDueDate = lawsInventoryEOList.get(0).getVerifyDueDate(); + String endTime = ""; + if(verifyDueDate != null){ + endTime = DateUtils.formatDate(verifyDueDate); + } + String serialNumbers = lawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(",")); + + List userIdList = Arrays.asList(verifyDutyId.split(",")); + // 给设计符合性流程责任人发消息 + Map params = new HashMap<>(); + params.put("contentCn","您好,请及时查看确认以下任务要求,谢谢!"); + params.put("contentEn","Hello! Please check and confirm the following task requirement in a timely manner. Thank you!"); + params.put("projectLibraryId", projectLibraryId); + params.put("endTime",endTime); + params.put("userIdList",userIdList); + params.put("serialNumbers",serialNumbers); + + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLibraryId); + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + // 获取待办中心 - 飞书跳转链接 + Map todoCenterParams = new HashMap<>(); + todoCenterParams.put("projectNameCn",PRN_CN); + Map hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryId, todoCenterParams); + params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); + params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + + String regulationOwnerId = lawsInventoryEOList.get(0).getRegulationOwnerId(); + List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); + String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); + params.put("Initiator",regulationOwnerUserName); + + this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(),params); + } + } + } + + /** + * 验证符合性 结果待审查状态数据催办。 + * @param projectLibraryId + * @param projectLawsInventoryEOList + */ + private void verifyExpeditingToBeReviewed(String projectLibraryId, List projectLawsInventoryEOList) { + // 如果验证符合性流程状态为 结果待审查,催办时就需要给这一条数据的法规工程师发消息 + List toBeReviewedLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> { + boolean flag =false; + if (StringUtils.equals(lawsInventory.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())){ + flag = true; + } + return flag; + }).collect(Collectors.toList()); + + if(CollectionUtils.isNotEmpty(toBeReviewedLawsInventoryList)){ + Map> regulationOwnerGroupMap = toBeReviewedLawsInventoryList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getRegulationOwnerId)); + for (Map.Entry> regulationOwnerMap : regulationOwnerGroupMap.entrySet()) { + String regulationOwnerId = regulationOwnerMap.getKey(); + List lawsInventoryEOList = regulationOwnerMap.getValue(); + if(StringUtils.isEmpty(regulationOwnerId) || CollectionUtils.isEmpty(lawsInventoryEOList)){ + continue; + } + + this.lawsInventoryEOListSortByVerifyDueDate(lawsInventoryEOList); + Date designDueDate = lawsInventoryEOList.get(0).getDesignDueDate(); + String endTime = ""; + if(designDueDate != null){ + endTime = DateUtils.formatDate(designDueDate); + } + String serialNumbers = lawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(",")); + + List userIdList = Arrays.asList(regulationOwnerId.split(",")); + // 给法规工程师发消息 + Map params = new HashMap<>(); + params.put("contentCn","您好,请尽快查看处理此项任务,谢谢!"); + params.put("contentEn","Hello! Please check and address the task ASAP. Thank you!"); + params.put("projectLibraryId", projectLibraryId); + params.put("endTime",endTime); + params.put("userIdList",userIdList); + params.put("serialNumbers",serialNumbers); + + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLibraryId); + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + // 获取待办中心 - 飞书跳转链接 + Map todoCenterParams = new HashMap<>(); + todoCenterParams.put("projectNameCn",PRN_CN); + Map hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); + params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); + params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + + List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); + String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); + params.put("Initiator",regulationOwnerUserName); + + this.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(),params); + } + } + } + + /** + * 验证符合性 清单待校核状态数据催办。 + * @param projectLibraryId + * @param projectLawsInventoryEOList + */ + private void verifyExpeditingToBeChecked(String projectLibraryId, List projectLawsInventoryEOList) { + // 如果验证符合性流程状态为 清单待校核,催办时就需要给这一条数据的法规工程师发消息 + List toBeCheckedLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> { + boolean flag =false; + if (StringUtils.equals(lawsInventory.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())){ + flag = true; + } + return flag; + }).collect(Collectors.toList()); + + if(CollectionUtils.isNotEmpty(toBeCheckedLawsInventoryList)){ + Map> regulationOwnerGroupMap = toBeCheckedLawsInventoryList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getRegulationOwnerId)); + for (Map.Entry> regulationOwnerMap : regulationOwnerGroupMap.entrySet()) { + String regulationOwnerId = regulationOwnerMap.getKey(); + List lawsInventoryEOList = regulationOwnerMap.getValue(); + if(StringUtils.isEmpty(regulationOwnerId) || CollectionUtils.isEmpty(lawsInventoryEOList)){ + continue; + } + + this.lawsInventoryEOListSortByInventoryAffirmDueDate(lawsInventoryEOList); + Date inventoryAffirmDueDate = lawsInventoryEOList.get(0).getInventoryAffirmDueDate(); + String endTime = ""; + if(inventoryAffirmDueDate != null){ + endTime = DateUtils.formatDate(inventoryAffirmDueDate); + } + String serialNumbers = lawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(",")); + + List userIdList = Arrays.asList(regulationOwnerId.split(",")); + // 给法规工程师发消息 + Map params = new HashMap<>(); + params.put("contentCn","您好,请及时校核法规清单内容并发起符合性流程,谢谢!"); + params.put("contentEn","Please check the content of the regulation list and initiate the compliance process in a timely manner. Thank you!"); + params.put("projectLibraryId", projectLibraryId); + params.put("endTime",endTime); + params.put("userIdList",userIdList); + params.put("serialNumbers",serialNumbers); + + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLibraryId); + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + // 获取法规清单 - 飞书跳转链接 + Map hrefFeishuMap = this.getProjectLawsInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN,PRN_EN); + params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); + params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + params.put("Initiator",projectLibraryBase.getStudioEngineerName()); + + this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE1.getValue(),params); + } + } + } + + /** + * 设计符合性 结果待提交状态数据催办 + * @param projectLibraryId + * @param projectLawsInventoryEOList + */ + private void designExpeditingToBeSubmitted(String projectLibraryId, List projectLawsInventoryEOList) { + // 催办设计符合性流程状态为 结果待提交的 责任人 + List toBeSubmitLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> { + boolean flag =false; + if (StringUtils.equals(lawsInventory.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())){ + flag = true; + } + return flag; + }).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(toBeSubmitLawsInventoryList)) { + Map> designDutyGroupMap = toBeSubmitLawsInventoryList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getVerifyDutyId)); + for (Map.Entry> designDutyMap : designDutyGroupMap.entrySet()) { + String designDutyId = designDutyMap.getKey(); + List lawsInventoryEOList = designDutyMap.getValue(); + if(StringUtils.isEmpty(designDutyId) || CollectionUtils.isEmpty(lawsInventoryEOList)){ + continue; + } + this.lawsInventoryEOListSortByVerifyDueDate(lawsInventoryEOList); + + Date designDueDate = lawsInventoryEOList.get(0).getVerifyDueDate(); + String endTime = ""; + if(designDueDate != null){ + endTime = DateUtils.formatDate(designDueDate); + } + String serialNumbers = lawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(",")); + + List userIdList = Arrays.asList(designDutyId.split(",")); + // 给设计符合性流程责任人发消息 + Map params = new HashMap<>(); + params.put("contentCn","您好,请尽快查看处理此项任务,谢谢!"); + params.put("contentEn","Hello! Please check and address the task ASAP. Thank you!"); + params.put("projectLibraryId", projectLibraryId); + params.put("endTime",endTime); + params.put("userIdList",userIdList); + params.put("serialNumbers",serialNumbers); + + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLibraryId); + // String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + // 获取待办中心 - 飞书跳转链接 + Map todoCenterParams = new HashMap<>(); + todoCenterParams.put("projectNameCn",PRN_CN); + Map hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); + params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); + params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + + String regulationOwnerId = lawsInventoryEOList.get(0).getRegulationOwnerId(); + List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); + String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); + params.put("Initiator",regulationOwnerUserName); + + this.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(),params); + } + } + } + + /** + * 设计符合性 清单待确认状态数据催办 + * @param projectLibraryId + * @param projectLawsInventoryEOList + */ + private void designExpeditingToBeConfirmed(String projectLibraryId, List projectLawsInventoryEOList) { + // 催办设计符合性流程状态为 清单待确认的 责任人 + List toBeConfirmedLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> { + boolean flag =false; + if (StringUtils.equals(lawsInventory.getDesignFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())){ + flag = true; + } + return flag; + }).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(toBeConfirmedLawsInventoryList)) { + Map> designDutyGroupMap = toBeConfirmedLawsInventoryList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getDesignDutyId)); + for (Map.Entry> designDutyMap : designDutyGroupMap.entrySet()) { + String designDutyId = designDutyMap.getKey(); + List lawsInventoryEOList = designDutyMap.getValue(); + if(StringUtils.isEmpty(designDutyId) || CollectionUtils.isEmpty(lawsInventoryEOList)){ + continue; + } + + this.lawsInventoryEOListSortByDesignDueDate(lawsInventoryEOList); + Date designDueDate = lawsInventoryEOList.get(0).getDesignDueDate(); + String endTime = ""; + if(designDueDate != null){ + endTime = DateUtils.formatDate(designDueDate); + } + String serialNumbers = lawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(",")); + + List userIdList = Arrays.asList(designDutyId.split(",")); + // 给设计符合性流程责任人发消息 + Map params = new HashMap<>(); + params.put("contentCn","您好,请及时查看确认以下任务要求,谢谢!"); + params.put("contentEn","Hello! Please check and confirm the following task requirement in a timely manner. Thank you!"); + params.put("projectLibraryId", projectLibraryId); + params.put("endTime",endTime); + params.put("userIdList",userIdList); + params.put("serialNumbers",serialNumbers); + + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLibraryId); + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + // 获取待办中心 - 飞书跳转链接 + Map todoCenterParams = new HashMap<>(); + todoCenterParams.put("projectNameCn",PRN_CN); + Map hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryId, todoCenterParams); + params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); + params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + + String regulationOwnerId = lawsInventoryEOList.get(0).getRegulationOwnerId(); + List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); + String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); + params.put("Initiator",regulationOwnerUserName); + + this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(),params); + } + } + } + + /** + * 设计符合性 结果待审查状态数据催办 + * @param projectLibraryId + * @param projectLawsInventoryEOList + */ + private void designExpeditingToBeReviewed(String projectLibraryId, List projectLawsInventoryEOList) { + // 如果设计符合性流程状态为 结果待审查,催办时就需要给这一条数据的法规工程师发消息 + List toBeReviewedLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> { + boolean flag =false; + if (StringUtils.equals(lawsInventory.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())){ + flag = true; + } + return flag; + }).collect(Collectors.toList()); + + if(CollectionUtils.isNotEmpty(toBeReviewedLawsInventoryList)){ + Map> regulationOwnerGroupMap = toBeReviewedLawsInventoryList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getRegulationOwnerId)); + for (Map.Entry> regulationOwnerMap : regulationOwnerGroupMap.entrySet()) { + String regulationOwnerId = regulationOwnerMap.getKey(); + List lawsInventoryEOList = regulationOwnerMap.getValue(); + if(StringUtils.isEmpty(regulationOwnerId) || CollectionUtils.isEmpty(lawsInventoryEOList)){ + continue; + } + + this.lawsInventoryEOListSortByDesignDueDate(lawsInventoryEOList); + Date designDueDate = lawsInventoryEOList.get(0).getDesignDueDate(); + String endTime = ""; + if(designDueDate != null){ + endTime = DateUtils.formatDate(designDueDate); + } + String serialNumbers = lawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(",")); + + List userIdList = Arrays.asList(regulationOwnerId.split(",")); + // 给法规工程师发消息 + Map params = new HashMap<>(); + params.put("contentCn","您好,请尽快查看处理此项任务,谢谢!"); + params.put("contentEn","Hello! Please check and address the task ASAP. Thank you!"); + params.put("projectLibraryId", projectLibraryId); + params.put("endTime",endTime); + params.put("userIdList",userIdList); + params.put("serialNumbers",serialNumbers); + + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLibraryId); + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + // 获取待办中心 - 飞书跳转链接 + Map todoCenterParams = new HashMap<>(); + todoCenterParams.put("projectNameCn",PRN_CN); + Map hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); + params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); + params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + + List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); + String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); + params.put("Initiator",regulationOwnerUserName); + + this.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(),params); + } + } + } + + /** + * 设计符合性 清单待校核状态数据催办 + * @param projectLibraryId + * @param projectLawsInventoryEOList + */ + private void designExpeditingToBeChecked(String projectLibraryId, List projectLawsInventoryEOList) { + // 如果设计符合性流程状态为 清单待校核,催办时就需要给这一条数据的法规工程师发消息 + List toBeCheckedLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> { + boolean flag =false; + if (StringUtils.equals(lawsInventory.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())){ + flag = true; + } + return flag; + }).collect(Collectors.toList()); + + if(CollectionUtils.isNotEmpty(toBeCheckedLawsInventoryList)){ + Map> regulationOwnerGroupMap = toBeCheckedLawsInventoryList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getRegulationOwnerId)); + for (Map.Entry> regulationOwnerMap : regulationOwnerGroupMap.entrySet()) { + String regulationOwnerId = regulationOwnerMap.getKey(); + List lawsInventoryEOList = regulationOwnerMap.getValue(); + if(StringUtils.isEmpty(regulationOwnerId) || CollectionUtils.isEmpty(lawsInventoryEOList)){ + continue; + } + + this.lawsInventoryEOListSortByInventoryAffirmDueDate(lawsInventoryEOList); + Date inventoryAffirmDueDate = lawsInventoryEOList.get(0).getInventoryAffirmDueDate(); + String endTime = ""; + if(inventoryAffirmDueDate != null){ + endTime = DateUtils.formatDate(inventoryAffirmDueDate); + } + String serialNumbers = lawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(",")); + + List userIdList = Arrays.asList(regulationOwnerId.split(",")); + // 给法规工程师发消息 + Map params = new HashMap<>(); + params.put("contentCn","您好,请及时校核法规清单内容并发起符合性流程,谢谢!"); + params.put("contentEn","Please check the content of the regulation list and initiate the compliance process in a timely manner. Thank you!"); + params.put("projectLibraryId", projectLibraryId); + params.put("endTime",endTime); + params.put("userIdList",userIdList); + params.put("serialNumbers",serialNumbers); + + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLibraryId); + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + // 获取法规清单 - 飞书跳转链接 + Map hrefFeishuMap = this.getProjectLawsInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN,PRN_EN); + params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); + params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + params.put("Initiator",projectLibraryBase.getStudioEngineerName()); + + this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE1.getValue(),params); + } + } + } + @Override public List getRoleByUserId(String projectLibraryId,String cut) {