修改法规清单人员变更发消息

This commit is contained in:
高嵩
2023-07-27 19:44:00 +08:00
parent a5f932f47f
commit f7db512483
2 changed files with 285 additions and 57 deletions
@@ -142,38 +142,6 @@ public class ProjectLawsInventoryEOEditServiceImpl {
taskIdList.addAll(verifyFlowPidEoList.stream().map(ProcessInfoDetailEO::getTaskId).collect(Collectors.toList()));
}
// String regulationOwnerId = oldPliEo.getRegulationOwnerId();
// // 给旧的法规工程师发消息
// String endTime = "";
// if (newPliEo.getInventoryAffirmDueDate() != null) {
// endTime = DateUtils.formatDate(newPliEo.getInventoryAffirmDueDate());
// }
// Map<String, Object> params = new HashMap<>();
// params.put("contentCn", "您好,您以下任务已被发起人撤回。");
// params.put("contentEn", "Hello! Your task has been withdrawn by the initiator.");
// params.put("projectLibraryId", oldPliEo.getProjectLibraryId());
// params.put("endTime", endTime);
// params.put("userIdList", Arrays.asList(regulationOwnerId.split(",")));
// params.put("serialNumbers", oldPliEo.getSerialNumber());
//
// ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(oldPliEo.getProjectLibraryId());
// if (ObjectUtils.isNotEmpty(projectLibraryBase)) {
// String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文
// String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文
// // 获取待办中心 - 飞书跳转链接
// Map<String, Object> todoCenterParams = new HashMap<>();
// todoCenterParams.put("projectNameCn", PRN_CN);
// todoCenterParams.put("projectNameEn", PRN_EN);
// Map<String, Object> hrefFeishuMap = projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams);
// params.put("hrefFeishu_CN", hrefFeishuMap.get("hrefFeishu_CN"));
// params.put("hrefFeishu_EN", hrefFeishuMap.get("hrefFeishu_EN"));
// params.put("hrefFeishu_CN_P", hrefFeishuMap.get("hrefFeishu_CN_P"));
//
// List<SysUser> regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(",")));
// String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId);
// params.put("Initiator", regulationOwnerUserName);
// projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params);
// }
}
}
}
@@ -743,6 +743,22 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
ProjectLawsInventoryEO projectLawsInventoryOld = this.queryById(projectLawsInventoryEO.getId());
// 是否不在流程中
boolean isNotInDesignProcess = (
StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
||StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
||StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.CONFORMITY.getValue())
||StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TERMINATION_OF_TASK.getValue())
||StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.UNINVOLVED.getValue())
);
boolean isNotInVerifyProcess = (
StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
||StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
||StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.CONFORMITY.getValue())
||StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TERMINATION_OF_TASK.getValue())
||StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.UNINVOLVED.getValue())
);
// 清单待校核
boolean toBeCheckedFlag = (
StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
@@ -760,7 +776,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
&& StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerId())
);
if (regulationOwnerIsNotNull && (toBeCheckedFlag || toBeReviewedFlag)) {
if (regulationOwnerIsNotNull && !isNotInDesignProcess && !isNotInVerifyProcess) {
// 如果编辑了法规工程师给之前的法规工程师发消息
if (!StringUtils.equals(projectLawsInventoryOld.getRegulationOwnerId(), projectLawsInventoryEO.getRegulationOwnerId())) {
String endTime = "";
@@ -795,19 +811,35 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId);
params.put("Initiator", regulationOwnerUserName);
this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params);
if(StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
||StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
||StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue())
||StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())){
params.put("flowTypeCn","设计符合性流程");
params.put("flowTypeEn","Design Compliance Process");
this.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(), params);
}else if(StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
||StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
||StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue())
||StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())){
params.put("flowTypeCn","验证符合性流程");
params.put("flowTypeEn","Verify Compliance Process");
this.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(), params);
}else{
this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params);
}
}
}
}
if ((projectLawsInventoryOld.getDesignDueDate() != null && projectLawsInventoryEO.getDesignDueDate() != null) && toBeCheckedFlag) {
if ((projectLawsInventoryOld.getDesignDueDate() != null && projectLawsInventoryEO.getDesignDueDate() != null) && !isNotInDesignProcess) {
if (!projectLawsInventoryOld.getDesignDueDate().equals(projectLawsInventoryEO.getDesignDueDate())) {
String endTime = "";
if (projectLawsInventoryEO.getDesignDueDate() != null) {
endTime = DateUtils.formatDate(projectLawsInventoryEO.getDesignDueDate());
}
String regulationOwnerId = projectLawsInventoryOld.getRegulationOwnerId();
String regulationOwnerId = projectLawsInventoryEO.getRegulationOwnerId();
// 给法规工程师发消息
Map<String, Object> params = new HashMap<>();
params.put("contentCn", "您好,以下符合性任务的截止时间已被发起人修改。");
@@ -833,18 +865,27 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId);
params.put("Initiator", regulationOwnerUserName);
this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params);
if(StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
||StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
||StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue())
||StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())){
params.put("flowTypeCn","设计符合性流程");
params.put("flowTypeEn","Design Compliance Process");
this.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(), params);
}else{
this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params);
}
}
}
}
if ((projectLawsInventoryOld.getVerifyDueDate() != null && projectLawsInventoryEO.getVerifyDueDate() != null) && toBeCheckedFlag) {
if ((projectLawsInventoryOld.getVerifyDueDate() != null && projectLawsInventoryEO.getVerifyDueDate() != null) && !isNotInVerifyProcess) {
if (!projectLawsInventoryOld.getVerifyDueDate().equals(projectLawsInventoryEO.getVerifyDueDate())) {
String endTime = "";
if (projectLawsInventoryEO.getVerifyDueDate() != null) {
endTime = DateUtils.formatDate(projectLawsInventoryEO.getVerifyDueDate());
}
String regulationOwnerId = projectLawsInventoryOld.getRegulationOwnerId();
String regulationOwnerId = projectLawsInventoryEO.getRegulationOwnerId();
// 给法规工程师发消息
Map<String, Object> params = new HashMap<>();
params.put("contentCn", "您好,以下符合性任务的截止时间已被发起人修改。");
@@ -870,7 +911,16 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId);
params.put("Initiator", regulationOwnerUserName);
this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params);
if(StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
||StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
||StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue())
||StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())){
params.put("flowTypeCn","验证符合性流程");
params.put("flowTypeEn","Verify Compliance Process");
this.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(), params);
}else{
this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params);
}
}
}
}
@@ -915,8 +965,11 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
List<SysUser> regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(",")));
String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId);
params.put("Initiator", regulationOwnerUserName);
this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION4.getValue(), params);
if(StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())){
this.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(), params);
}else{
this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION4.getValue(), params);
}
}
}
}
@@ -942,8 +995,8 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
params.put("endTime", endTime);
params.put("userIdList", Arrays.asList(projectLawsInventoryOld.getDesignDutyId().split(",")));
params.put("serialNumbers", projectLawsInventoryOld.getSerialNumber());
params.put("flowTypeCn","设计符合性流程");
params.put("flowTypeEn","Design Compliance Process");
params.put("flowTypeCn","验证符合性流程");
params.put("flowTypeEn","Verify Compliance Process");
ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId());
if (ObjectUtils.isNotEmpty(projectLibraryBase)) {
@@ -960,8 +1013,12 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
List<SysUser> regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(",")));
String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId);
params.put("Initiator", regulationOwnerUserName);
if(StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())){
this.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(), params);
}else{
this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION4.getValue(), params);
}
this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION4.getValue(), params);
}
}
}
@@ -972,12 +1029,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
String endTime = "";
String regulationOwnerId = "";
// 设计符合性 结果待审查结果待提交 标识 判断法规工程师是否被修改了 如果被修改了给新的法规工程师发消息
boolean toBeReviewedDesignFlag = (
StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
);
if (toBeReviewedDesignFlag) {
if (!isNotInDesignProcess) {
if (projectLawsInventoryEO.getDesignDueDate() != null) {
endTime = DateUtils.formatDate(projectLawsInventoryEO.getDesignDueDate());
}
@@ -1014,12 +1066,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
}
}
// 验证符合性 结果待审查结果待提交 标识 判断法规工程师是否被修改了 如果被修改了给新的法规工程师发消息
boolean toBeReviewedVerifyFlag = (
StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
);
if (toBeReviewedVerifyFlag) {
if (!isNotInVerifyProcess) {
if (projectLawsInventoryEO.getVerifyDueDate() != null) {
endTime = DateUtils.formatDate(projectLawsInventoryEO.getVerifyDueDate());
}
@@ -1058,6 +1105,219 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
}
}
}
//交付物类型修改
if (StringUtils.equals(projectLawsInventoryEO.getDesignDeliverableType(), projectLawsInventoryOld.getDesignDeliverableType()) && !isNotInDesignProcess) {
String endTime = "";
if (projectLawsInventoryOld.getDesignDueDate() != null) {
endTime = DateUtils.formatDate(projectLawsInventoryOld.getDesignDueDate());
}
String regulationOwnerId = projectLawsInventoryEO.getDesignDuty();
// 给设计符合性-责任人发消息
Map<String, Object> params = new HashMap<>();
params.put("contentCn", "您好,以下符合性任务的交付物类型已被发起人修改。");
params.put("contentEn", "Hello! The type of deliverables of the compliance task has been modified 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());
params.put("flowTypeCn", "设计符合性流程");
params.put("flowTypeEn", "Design Compliance Process");
ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId());
if (ObjectUtils.isNotEmpty(projectLibraryBase)) {
String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文
String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文
// 获取待办中心 - 飞书跳转链接
Map<String, Object> todoCenterParams = new HashMap<>();
todoCenterParams.put("projectNameCn", PRN_CN);
todoCenterParams.put("projectNameEn", PRN_EN);
Map<String, Object> hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams);
params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN"));
params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN"));
params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P"));
List<SysUser> regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(",")));
String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId);
params.put("Initiator", regulationOwnerUserName);
if (StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) {
params.put("flowTypeCn", "设计符合性流程");
params.put("flowTypeEn", "Design Compliance Process");
this.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(), params);
} else if (StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) {
params.put("flowTypeCn", "验证符合性流程");
params.put("flowTypeEn", "Verify Compliance Process");
this.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(), params);
} else {
this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params);
}
}
}
//交付物类型修改
if (StringUtils.equals(projectLawsInventoryEO.getVerifyDeliverableType(), projectLawsInventoryOld.getVerifyDeliverableType()) && !isNotInVerifyProcess) {
String endTime = "";
if (projectLawsInventoryOld.getVerifyDueDate() != null) {
endTime = DateUtils.formatDate(projectLawsInventoryOld.getVerifyDueDate());
}
String regulationOwnerId = projectLawsInventoryEO.getVerifyDuty();
// 给设计符合性-责任人发消息
Map<String, Object> params = new HashMap<>();
params.put("contentCn", "您好,以下符合性任务的交付物类型已被发起人修改。");
params.put("contentEn", "Hello! The type of deliverables of the compliance task has been modified by the initiator.");
params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId());
params.put("endTime", endTime);
params.put("userIdList", Arrays.asList(projectLawsInventoryOld.getVerifyDutyId().split(",")));
params.put("serialNumbers", projectLawsInventoryOld.getSerialNumber());
params.put("flowTypeCn", "验证符合性流程");
params.put("flowTypeEn", "Verify Compliance Process");
ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId());
if (ObjectUtils.isNotEmpty(projectLibraryBase)) {
String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文
String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文
// 获取待办中心 - 飞书跳转链接
Map<String, Object> todoCenterParams = new HashMap<>();
todoCenterParams.put("projectNameCn", PRN_CN);
todoCenterParams.put("projectNameEn", PRN_EN);
Map<String, Object> hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams);
params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN"));
params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN"));
params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P"));
List<SysUser> regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(",")));
String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId);
params.put("Initiator", regulationOwnerUserName);
if (StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) {
params.put("flowTypeCn", "设计符合性流程");
params.put("flowTypeEn", "Design Compliance Process");
this.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(), params);
} else if (StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) {
params.put("flowTypeCn", "验证符合性流程");
params.put("flowTypeEn", "Verify Compliance Process");
this.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(), params);
} else {
this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params);
}
}
}
//交付物模板修改
if (StringUtils.equals(projectLawsInventoryEO.getDesignDeliverableTemplate(), projectLawsInventoryOld.getDesignDeliverableTemplate()) && !isNotInDesignProcess) {
String endTime = "";
if (projectLawsInventoryOld.getDesignDueDate() != null) {
endTime = DateUtils.formatDate(projectLawsInventoryOld.getDesignDueDate());
}
String regulationOwnerId = projectLawsInventoryEO.getDesignDuty();
// 给设计符合性-责任人发消息
Map<String, Object> params = new HashMap<>();
params.put("contentCn", "您好,以下符合性任务的交付物模板已被发起人修改。");
params.put("contentEn", "Hello! The deliverable template of the compliance task has been modified 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());
params.put("flowTypeCn", "设计符合性流程");
params.put("flowTypeEn", "Design Compliance Process");
ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId());
if (ObjectUtils.isNotEmpty(projectLibraryBase)) {
String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文
String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文
// 获取待办中心 - 飞书跳转链接
Map<String, Object> todoCenterParams = new HashMap<>();
todoCenterParams.put("projectNameCn", PRN_CN);
todoCenterParams.put("projectNameEn", PRN_EN);
Map<String, Object> hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams);
params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN"));
params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN"));
params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P"));
List<SysUser> regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(",")));
String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId);
params.put("Initiator", regulationOwnerUserName);
if (StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) {
params.put("flowTypeCn", "设计符合性流程");
params.put("flowTypeEn", "Design Compliance Process");
this.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(), params);
} else if (StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) {
params.put("flowTypeCn", "验证符合性流程");
params.put("flowTypeEn", "Verify Compliance Process");
this.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(), params);
} else {
this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params);
}
}
}
if (StringUtils.equals(projectLawsInventoryEO.getVerifyDeliverableTemplate(), projectLawsInventoryOld.getVerifyDeliverableTemplate()) && !isNotInVerifyProcess) {
String endTime = "";
if (projectLawsInventoryOld.getVerifyDueDate() != null) {
endTime = DateUtils.formatDate(projectLawsInventoryOld.getVerifyDueDate());
}
String regulationOwnerId = projectLawsInventoryEO.getVerifyDuty();
// 给设计符合性-责任人发消息
Map<String, Object> params = new HashMap<>();
params.put("contentCn", "您好,以下符合性任务的交付物模板已被发起人修改。");
params.put("contentEn", "Hello! The deliverable template of the compliance task has been modified by the initiator.");
params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId());
params.put("endTime", endTime);
params.put("userIdList", Arrays.asList(projectLawsInventoryOld.getVerifyDutyId().split(",")));
params.put("serialNumbers", projectLawsInventoryOld.getSerialNumber());
params.put("flowTypeCn", "验证符合性流程");
params.put("flowTypeEn", "Verify Compliance Process");
ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId());
if (ObjectUtils.isNotEmpty(projectLibraryBase)) {
String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文
String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文
// 获取待办中心 - 飞书跳转链接
Map<String, Object> todoCenterParams = new HashMap<>();
todoCenterParams.put("projectNameCn", PRN_CN);
todoCenterParams.put("projectNameEn", PRN_EN);
Map<String, Object> hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams);
params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN"));
params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN"));
params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P"));
List<SysUser> regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(",")));
String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId);
params.put("Initiator", regulationOwnerUserName);
if (StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) {
params.put("flowTypeCn", "设计符合性流程");
params.put("flowTypeEn", "Design Compliance Process");
this.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(), params);
} else if (StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue())
|| StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) {
params.put("flowTypeCn", "验证符合性流程");
params.put("flowTypeEn", "Verify Compliance Process");
this.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(), params);
} else {
this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params);
}
}
}
}
private String handlePhoneDesignLink(ProjectLawsInventoryEO projectLawsInventoryEO,String actiProcInstId,String taskDefinitionKey) {