diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/enums/TemplateInfoEnum2.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/enums/TemplateInfoEnum2.java index 08ffc61a2..c05abd5cb 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/enums/TemplateInfoEnum2.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/enums/TemplateInfoEnum2.java @@ -41,6 +41,17 @@ public enum TemplateInfoEnum2 { REGULATION_LIST_RELEASE2("法规清单发布-公用消息-绿色","ctp_AAuPKJ9Cj9w5"), REGULATION_LIST_RELEASE3("法规清单发布-公用消息-红色","ctp_AAu2lBIgaB79"), REGULATION_LIST_RELEASE4("法规清单发布-公用消息-黄色","ctp_AAuPh3LJWg1x"), + + /** + * 法规任务确认消息 + */ + REGULATION_TASK_CONFIRMATION1("法规任务确认-公用消息-绿色-无流程类型","ctp_AAuLRr2QIbMb"), + REGULATION_TASK_CONFIRMATION2("法规任务确认-公用消息-红色-无流程类型","ctp_AAuL6mDxffmu"), + REGULATION_TASK_CONFIRMATION3("法规任务确认-公用消息-黄色-无流程类型","ctp_AAuLRr2Qzyj0"), + REGULATION_TASK_CONFIRMATION4("法规任务确认-公用消息-绿色-有流程类型","ctp_AAuL6mDxf8l1"), + REGULATION_TASK_CONFIRMATION5("法规任务确认-公用消息-红色-有流程类型","ctp_AAuPWTSU2Fg2"), + REGULATION_TASK_CONFIRMATION6("法规任务确认-公用消息-黄色-有流程类型","ctp_AAuLRr2Qzkbo"), + ; String name; 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 f79b294cf..bb1c9f47f 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 @@ -477,6 +477,9 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl params = new HashMap<>(); + params.put("contentCn","您好,您以下任务已被发起人撤回。"); + params.put("contentEn","Hello! Your task has been withdrawn by the initiator."); + params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); + params.put("endTime",endTime); + params.put("userIdList",Arrays.asList(regulationOwnerId.split(","))); + params.put("serialNumbers",projectLawsInventoryOld.getSerialNumber()); + this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(),params); + } + } + if((projectLawsInventoryOld.getDesignDueDate() != null && projectLawsInventoryEO.getDesignDueDate() != null) && toBeCheckedFlag){ + if(!projectLawsInventoryOld.getDesignDueDate().equals(projectLawsInventoryEO.getDesignDueDate())){ + String endTime = ""; + if(projectLawsInventoryOld.getInventoryAffirmDueDate() != null){ + endTime = DateUtils.formatDate(projectLawsInventoryOld.getInventoryAffirmDueDate()); + } + + String regulationOwnerId = projectLawsInventoryOld.getRegulationOwnerId(); + // 给法规工程师发消息 + Map params = new HashMap<>(); + params.put("contentCn","您好,以下符合性任务的截止时间已被发起人修改。"); + params.put("contentEn","Hello! The due date of the compliance task has been modified by the initiator."); + params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); + params.put("endTime",endTime); + params.put("userIdList",Arrays.asList(regulationOwnerId.split(","))); + params.put("serialNumbers",projectLawsInventoryOld.getSerialNumber()); + this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(),params); + } + } + if((projectLawsInventoryOld.getVerifyDueDate() != null && projectLawsInventoryEO.getVerifyDueDate() != null) && toBeCheckedFlag){ + if(!projectLawsInventoryOld.getVerifyDueDate().equals(projectLawsInventoryEO.getVerifyDueDate())){ + String endTime = ""; + if(projectLawsInventoryOld.getInventoryAffirmDueDate() != null){ + endTime = DateUtils.formatDate(projectLawsInventoryOld.getInventoryAffirmDueDate()); + } + + String regulationOwnerId = projectLawsInventoryOld.getRegulationOwnerId(); + // 给法规工程师发消息 + Map params = new HashMap<>(); + params.put("contentCn","您好,以下符合性任务的截止时间已被发起人修改。"); + params.put("contentEn","Hello! The due date of the compliance task has been modified by the initiator."); + params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); + params.put("endTime",endTime); + params.put("userIdList",Arrays.asList(regulationOwnerId.split(","))); + params.put("serialNumbers",projectLawsInventoryOld.getSerialNumber()); + this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(),params); + } + } + + // 设计符合性 任务待确认消息 标识 + boolean toBeConfirmedDesignFlag = ( + StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + ); + + if((projectLawsInventoryOld.getDesignDutyId() != null && projectLawsInventoryEO.getDesignDutyId() != null) && toBeConfirmedDesignFlag){ + if(!projectLawsInventoryOld.getDesignDutyId().equals(projectLawsInventoryEO.getDesignDutyId())){ + String endTime = ""; + if(projectLawsInventoryOld.getDesignDueDate() != null){ + endTime = DateUtils.formatDate(projectLawsInventoryOld.getDesignDueDate()); + } + + String regulationOwnerId = projectLawsInventoryOld.getRegulationOwnerId(); + // 给法规工程师发消息 + Map params = new HashMap<>(); + params.put("contentCn","您好,您以下任务已被发起人撤回。"); + params.put("contentEn","Hello! Your task has been withdrawn by the initiator."); + params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); + params.put("endTime",endTime); + params.put("userIdList",Arrays.asList(projectLawsInventoryOld.getDesignDutyId().split(","))); + params.put("serialNumbers",projectLawsInventoryOld.getSerialNumber()); + this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(),params); + } + } + + // 验证符合性 任务待确认消息 标识 + boolean toBeConfirmedVerifyFlag = ( + StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + ); + if((projectLawsInventoryOld.getVerifyDutyId() != null && projectLawsInventoryEO.getVerifyDutyId() != null) && toBeConfirmedVerifyFlag){ + if(!projectLawsInventoryOld.getVerifyDutyId().equals(projectLawsInventoryEO.getVerifyDutyId())){ + String endTime = ""; + if(projectLawsInventoryOld.getVerifyDueDate() != null){ + endTime = DateUtils.formatDate(projectLawsInventoryOld.getVerifyDueDate()); + } + + String regulationOwnerId = projectLawsInventoryOld.getRegulationOwnerId(); + // 给法规工程师发消息 + Map params = new HashMap<>(); + params.put("contentCn","您好,您以下任务已被发起人撤回。"); + params.put("contentEn","Hello! Your task has been withdrawn by the initiator."); + params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); + params.put("endTime",endTime); + params.put("userIdList",Arrays.asList(projectLawsInventoryOld.getDesignDutyId().split(","))); + params.put("serialNumbers",projectLawsInventoryOld.getSerialNumber()); + this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(),params); + } + } + } + private void setProjectLawsInventoryPermission(String userId, String projectId,String lawsInventoryId,Date now, List adds, String belong) { QueryWrapper del = new QueryWrapper<>(); del.eq("project_id", projectId) @@ -2812,7 +2936,10 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl prarams = (Map) jsonObject.get("params"); + String templateId = jsonObject.getString("templateId"); + this.sendMessageByTemplateId(templateId,prarams); } return new Result<>().success("调用成功!"); @@ -10249,6 +10376,8 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl