From 0ef13b8bd341a907021f78fae91871e6f8cad45a Mon Sep 17 00:00:00 2001 From: wangzhijiang <12345678> Date: Fri, 10 Mar 2023 17:59:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A4=E8=AF=81=E6=B8=85=E5=8D=95-=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E4=B8=9A=E5=8A=A1=E5=8F=91=E9=80=81=E9=A3=9E=E4=B9=A6?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=BC=80=E5=8F=91=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/service/ISysUserService.java | 7 + .../service/impl/SysUserServiceImpl.java | 15 + .../feishu/enums/TemplateInfoEnum2.java | 103 +--- .../CertificationInventoryFlowStatusEnum.java | 2 +- .../project/enums/OperatorTypeEnum.java | 2 + ...rojectCertificationInventoryEOService.java | 4 + ...ctCertificationInventoryEOServiceImpl.java | 473 +++++++++++++----- .../components/certificationList/index.vue | 6 +- 8 files changed, 390 insertions(+), 222 deletions(-) diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysUserService.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysUserService.java index 33766287f..160d50570 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysUserService.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysUserService.java @@ -304,4 +304,11 @@ public interface ISysUserService extends IService { boolean isViewer(String userId); + /** + * 根据用户id,获取用户的飞书id + * @param sysUserList + * @param userId + * @return + */ + String getUserThirdIdByUserId(List sysUserList, String userId); } diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java index 7fa268907..ef7fd2b2e 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java @@ -767,4 +767,19 @@ public class SysUserServiceImpl extends ServiceImpl impl } return boo; } + + @Override + public String getUserThirdIdByUserId(List sysUserList, String userId) { + String result = ""; + if(CollectionUtils.isNotEmpty(sysUserList)){ + result = sysUserList.stream().filter(userInfo -> { + boolean flag = false; + if(StringUtils.equals(userId,userInfo.getId())){ + flag = true; + } + return flag; + }).collect(Collectors.toList()).get(0).getThirdId(); + } + return result; + } } 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 af9737288..0b3e288fd 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 @@ -7,101 +7,14 @@ public enum TemplateInfoEnum2 { // 认证消息 CERTIFICATION_MESSAGE1("stuido催办,认证工程师收到消息","ctp_AAuDmU58lKqB"), -// HOME_PARAMETER_COLLECTION2("工程接口人下发参数,填写人接收任务","ctp_AAfv49aET4Rn"), -// HOME_PARAMETER_COLLECTION3("工程接口人退回,通知认证工程师","ctp_AAfvQy0bsb6Y"), -// HOME_PARAMETER_COLLECTION4("填写人退回,通知工程接口人","ctp_AAfK3TvbkTLq"), -// HOME_PARAMETER_COLLECTION5("您的参数收集任务还有7天到期,请及时查看处理","ctp_AAfvdg0Cx6yN"), -// HOME_PARAMETER_COLLECTION6("您的参数收集任务已被XXX重新分发给XXX","ctp_AAfvKkz192fn"), -// HOME_PARAMETER_COLLECTION7(" 您的参数收集任务已被XXX撤回","ctp_AAfK2oTpFn9M"), -// HOME_PARAMETER_COLLECTION8(" 您的参数收集任务还有3天到期,请及时查看处理","ctp_AAft9XcQbrlT"), -// HOME_PARAMETER_COLLECTION9(" 您的参数收集任务将于今天到期,请及时查看处理","ctp_AAfefHo8thrQ"), -// -// REGULATION_TECHNICAL_ASSESSMENT1("法规技术评估发起提醒评估人","ctp_AAf2qRfouGcc"), -// REGULATION_TECHNICAL_ASSESSMENT2("评估人提交通知发起人审批","ctp_AAfvKkz1xSd7"), -// REGULATION_TECHNICAL_ASSESSMENT3("发起人审查通过,通知评估人","ctp_AAfK2oTpRGSa"), -// REGULATION_TECHNICAL_ASSESSMENT4("发起人审查退回,评估人接收 - 任务","ctp_AAfK2oTp4Mir"), -// REGULATION_TECHNICAL_ASSESSMENT5("任务提醒,评估人接收-任务 到期前三天","ctp_AAfvKkz1bozO"), -// REGULATION_TECHNICAL_ASSESSMENT6("任务提醒,评估人接收-任务 当天","ctp_AAf2qRforjyP"), -// -// REGULATION_OPINION_COLLECTION1("法规意见收集发起提醒评估人","ctp_AAftzD2mN9jr"), -// REGULATION_OPINION_COLLECTION2("任务提醒,评估人接收-任务 到期前三天","ctp_AAfK2oTpzhDX"), -// REGULATION_OPINION_COLLECTION3("任务提醒,评估人接收-任务 当天","ctp_AAfefHo8XrBl"), -// REGULATION_OPINION_COLLECTION4("评估人提交通知发起人","ctp_AAft9XcQW1lV"), -// REGULATION_OPINION_COLLECTION5("任务完成当天通知发起人","ctp_AAftJ7q0YClP"), -// -// -// -// -// SUBSCRIPTION_NOTIFICATION1("虚拟清单订阅更新","ctp_AAfRLrOqGiF9"), -// SUBSCRIPTION_NOTIFICATION2("法规领域订阅更新","ctp_AAfvdg0Cy90I"), -// SUBSCRIPTION_NOTIFICATION3("虚拟清单订阅更新","ctp_AAfRLrOqGiF9"), -// -// SHARE_FORWARD1("转发推送","ctp_AAfdBUtdLJog"), -// SHARE_FORWARD2("问题知识库转发推送","ctp_AAfvQy0brRtq"), -// SHARE_FORWARD3("问题知识库评论信息","ctp_AAf2qRfosO2P"), -// -// REGULATION_EARLY_WARNING1("订阅法规预警","ctp_AAfvQy0br1R7"), -// REGULATION_EARLY_WARNING2("预警信息分享","ctp_AAfK3TvbktC9"), -// -// REGULATION_LIST_CONFIRMATION1("Studio发起,法规/认证接收-任务","ctp_AAfdBUtdpKCX"), -// REGULATION_LIST_CONFIRMATION2("任务提醒,法规认证接收-任务","ctp_AAftzD2mK31z"), -// REGULATION_LIST_CONFIRMATION3("状态通知,Studio接收/法规拒绝","ctp_AAftzD2mK7e6"), -// REGULATION_LIST_CONFIRMATION4("状态通知,Studio接收/认证拒绝","ctp_AAfvdg0C4OXb"), -// -// REGULATION_TASK_CONFIRMATION1("发起,工程接口人接收-任务","ctp_AAfvdg0C4qSM"), -// REGULATION_TASK_CONFIRMATION2("询问工程师,工程师接收-任务","ctp_AAftJ7q0OgGw"), -// REGULATION_TASK_CONFIRMATION3("工程师退回,接口人接收消息-任务","ctp_AAftzD2meZ6I"), -// REGULATION_TASK_CONFIRMATION4("工程师提交,接口人接收消息-任务","ctp_AAftJ7q0O8yL"), -// REGULATION_TASK_CONFIRMATION5("任务提醒,工程接口人接收-任务 3天前","ctp_AAfvdg0CdIu8"), -// REGULATION_TASK_CONFIRMATION6("任务提醒,工程接口人接收-任务 当天","ctp_AAftzD2mtsoN"), -// REGULATION_TASK_CONFIRMATION7("任务提醒,工程接口人接收-任务 逾期之后 3天,7天,14天通知","ctp_AAfvKkz1QK9Z"), -// REGULATION_TASK_CONFIRMATION8("任务提醒,工程接口人接收-任务 催办","ctp_AAf2qRfog8ey"), -// REGULATION_TASK_CONFIRMATION9("状态提醒,Studio接收","ctp_AAfK2oTpd2de"), -// -// DESIGN_COMPLIANCE_CONFIRMATION1("设计符合性任务,责任人接收-任务","ctp_AAftJ7q0YuC7"), -// DESIGN_COMPLIANCE_CONFIRMATION2("责任人下发工程师,工程师接收-任务责任人下发工程师,工程师接收-任务","ctp_AAft9XcQP4Qi"), -// DESIGN_COMPLIANCE_CONFIRMATION3("责任人催办,工程师接收-任务","ctp_AAfvdg0Czw0L"), -// DESIGN_COMPLIANCE_CONFIRMATION4("工程师提交反馈,责任人接收-任务","ctp_AAft9XcQTO27"), -// DESIGN_COMPLIANCE_CONFIRMATION5("责任人回复工程师,工程师接收-任务","ctp_AAftJ7q0feyC"), -// DESIGN_COMPLIANCE_CONFIRMATION6("任务提醒,责任人接收-任务 发起人催办责任人","ctp_AAfefHo8XmE9"), -// DESIGN_COMPLIANCE_CONFIRMATION7("任务提醒,责任人接收-任务 两周通知","ctp_AAfvKkz1Ewe9"), -// DESIGN_COMPLIANCE_CONFIRMATION8("任务提醒,责任人接收-任务 一周通知","ctp_AAftJ7q0ur2Z"), -// DESIGN_COMPLIANCE_CONFIRMATION9("任务提醒,责任人接收-任务 当天","ctp_AAfefHo8vZzW"), -// DESIGN_COMPLIANCE_CONFIRMATION10("任务提醒,责任人接收-任务 逾期之后 3天,7天,14天通知","ctp_AAft9XcQW9xx"), -// DESIGN_COMPLIANCE_CONFIRMATION11("责任人提交,发起人接收审查任务-任务","ctp_AAftJ7q0Yym9"), -// DESIGN_COMPLIANCE_CONFIRMATION12("发起人审查退回,责任人接收-任务","ctp_AAfefHo8vR6w"), -// DESIGN_COMPLIANCE_CONFIRMATION13("发起人审查通过,责任人接收通知-通知","ctp_AAftJ7q0YF7H"), -// -// PRE_HOMO_CONFIRMATION1("Pre-Homo任务,责任人接收-任务","ctp_AAftJ7q0uXRs"), -// PRE_HOMO_CONFIRMATION2("责任人下发工程师,工程师接收-任务","ctp_AAfefHo8KU8o"), -// PRE_HOMO_CONFIRMATION3("责任人催办,工程师接收-任务","ctp_AAfvdg0C91Dv"), -// PRE_HOMO_CONFIRMATION4("工程师提交反馈,责任人接收-任务","ctp_AAftJ7q03tft"), -// PRE_HOMO_CONFIRMATION5("责任人回复工程师,工程师接收-任务","ctp_AAftJ7q03Xer"), -// PRE_HOMO_CONFIRMATION6("任务提醒,责任人接收-任务 发起人催办责任人","ctp_AAfvKkz1ETZU"), -// PRE_HOMO_CONFIRMATION7("任务提醒,责任人接收-任务 两周通知","ctp_AAft9XcQTFYa"), -// PRE_HOMO_CONFIRMATION8("任务提醒,责任人接收-任务 一周通知","ctp_AAfefHo8219e"), -// PRE_HOMO_CONFIRMATION9("任务提醒,责任人接收-任务 当天","ctp_AAftzD2mWof3"), -// PRE_HOMO_CONFIRMATION10("任务提醒,责任人接收-任务 逾期之后 每天通知","ctp_AAftJ7q0ul4M"), -// PRE_HOMO_CONFIRMATION11("责任人提交,发起人接收审查任务-任务","ctp_AAfvKkz1Evrr"), -// PRE_HOMO_CONFIRMATION12("发起人审查退回,责任人接收-任务","ctp_AAfvKkz1nMgY"), -// PRE_HOMO_CONFIRMATION13("发起人审查通过,责任人接收通知-通知","ctp_AAftJ7q0rtdn"), -// -// -// -// VALIDATION_COMPLIANCE_CONFIRMATION1("验证符合性任务,责任人接收-任务","ctp_AAftJ7q0u3Je"), -// VALIDATION_COMPLIANCE_CONFIRMATION2("责任人下发工程师,工程师接收-任务","ctp_AAft9XcQLuty"), -// VALIDATION_COMPLIANCE_CONFIRMATION3("责任人催办,工程师接收-任务","ctp_AAfefHo8Kpsf"), -// VALIDATION_COMPLIANCE_CONFIRMATION4("工程师提交反馈,责任人接收-任务","ctp_AAfefHo8K9Qk"), -// VALIDATION_COMPLIANCE_CONFIRMATION5("责任人回复工程师,工程师接收-任务","ctp_AAft9XcQLkZO"), -// VALIDATION_COMPLIANCE_CONFIRMATION6("任务提醒,责任人接收-任务 发起人催办责任人","ctp_AAftzD2mPku1"), -// VALIDATION_COMPLIANCE_CONFIRMATION7("任务提醒,责任人接收-任务 两周通知(接口人提交之后停止消息发送)","ctp_AAftJ7q0Hv3C"), -// VALIDATION_COMPLIANCE_CONFIRMATION8("任务提醒,责任人接收-任务 一周通知(接口人提交之后停止消息发送)","ctp_AAftJ7q0HzZL"), -// VALIDATION_COMPLIANCE_CONFIRMATION9("任务提醒,责任人接收-任务 当天(接口人提交之后停止消息发送)","ctp_AAfefHo8edYl"), -// VALIDATION_COMPLIANCE_CONFIRMATION10("任务提醒,责任人接收-任务 逾期之后 每天通知(接口人提交之后停止消息发送)","ctp_AAfefHo8ef2S"), -// VALIDATION_COMPLIANCE_CONFIRMATION11("责任人提交,发起人接收审查任务-任务","ctp_AAftJ7q03z1d"), -// VALIDATION_COMPLIANCE_CONFIRMATION12("发起人审查退回,责任人接收-任务","ctp_AAfefHo8eOyG"), -// VALIDATION_COMPLIANCE_CONFIRMATION13("发起人审查通过,责任人接收通知-通知","ctp_AAfefHo8K6DT"), - + CERTIFICATION_MESSAGE2("Studio发起,认证工程师收到消息","ctp_AAuDmfXCkx8W"), + CERTIFICATION_MESSAGE3("认证工程师拒绝,studio收到消息","ctp_AAuDM8YPr3iJ"), + CERTIFICATION_MESSAGE4("studio撤回,认证工程师收到消息","ctp_AAuDmgJIf6Mr"), + CERTIFICATION_MESSAGE5("studio重置流程,认证工程师收到消息","ctp_AAuDM8YPrBfs"), + CERTIFICATION_MESSAGE6("认证清单-任务提醒,截止日期前第三天","ctp_AAuDmfXC3oJo"), + CERTIFICATION_MESSAGE7("认证清单-任务提醒,截止日期当天","ctp_AAuDmfXCHc1I"), + CERTIFICATION_MESSAGE8("认证清单-任务提醒,已逾期","ctp_AAuDMwOPU71H"), + CERTIFICATION_MESSAGE9("认证清单-责任人分发(转办),第二责任人收到消息","ctp_AAuDM8YP6soc"), ; String name; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/CertificationInventoryFlowStatusEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/CertificationInventoryFlowStatusEnum.java index 6e62f11ab..57367ddc9 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/CertificationInventoryFlowStatusEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/CertificationInventoryFlowStatusEnum.java @@ -29,7 +29,7 @@ public enum CertificationInventoryFlowStatusEnum { TASK_TO_BE_CONFIRMED("任务待确认","Task to be confirmed","Task to be confirmed"), REFUSAL_OF_RESPONSIBLE_PERSON("责任人拒绝","Refusal of responsible person","Refusal of responsible person"), RESULTS_TO_BE_SUBMITTED("结果待提交","Results to be submitted","Results to be submitted"), - ENGINEER_RETURN("工程师退回","Engineer return","Engineer return"), + //ENGINEER_RETURN("工程师退回","Engineer return","Engineer return"), RESULTS_TO_BE_REVIEWED("结果待审查","Results to be reviewed","Results to be reviewed"), REVIEW_AND_PASS("审查通过","Review and pass","Review and pass"), REVIEW_AND_RETURN("审查退回","Review and return","Review and return"), diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/OperatorTypeEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/OperatorTypeEnum.java index 96ba83105..0dfbf1750 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/OperatorTypeEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/OperatorTypeEnum.java @@ -53,6 +53,8 @@ public enum OperatorTypeEnum { CERTIFICATION_INVENTORY_STUDIO_EXPEDITING("认证清单-studio催办","certificationInventoryStudioExpediting"), CERTIFICATION_INVENTORY_CERTIFICATION_ENGINEER_EXPEDITING("认证清单-认证工程师催办","certificationInventoryCertificationEngineerExpediting"), CERTIFICATION_INVENTORY_SDT_EXPEDITING("认证清单-接口人催办","certificationInventorySdtExpediting"), + CERTIFICATION_INVENTORY_STUDIO_WITHDRAW("认证清单-studio撤回","certificationInventoryStudioWithdraw"), + CERTIFICATION_INVENTORY_STUDIO_RESET("认证清单-studio重置流程","certificationInventoryStudioReset"), ; String name; 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 d2811c33a..7ae88da7e 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 @@ -156,4 +156,8 @@ public interface IProjectCertificationInventoryEOService extends IService expediting(JSONObject json); + + Map getCertificationInventoryLinkHrefFeishu(String projectLibraryId,String PRN_CN,String PRN_EN); + + Map getStandNameAndItemName(List projectCertificationInventoryEOList); } 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 e1551f33d..b4eea846e 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 @@ -125,6 +125,10 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl detailRemoveWrap = new QueryWrapper<>(); + detailRemoveWrap.lambda().eq(ProcessInfoDetailEO::getProjectLawsInventoryId,id); + this.processInfoDetailEOService.remove(detailRemoveWrap); } /** @@ -135,8 +139,16 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl ids) { - removeByIds(ids); - } + QueryWrapper queryWrap = new QueryWrapper<>(); + queryWrap.lambda().eq(ProjectCertificationInventoryEO::getId,ids); + List list = this.list(queryWrap); + removeByIds(ids); + + QueryWrapper detailRemoveWrap = new QueryWrapper<>(); + detailRemoveWrap.lambda().in(ProcessInfoDetailEO::getProjectLawsInventoryId,ids); + detailRemoveWrap.lambda().eq(ProcessInfoDetailEO::getProcessInfoId,list.get(0).getProjectLibraryId()); + this.processInfoDetailEOService.remove(detailRemoveWrap); + } /** * 通过id查询 @@ -343,7 +355,9 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl certificationEngineerList = Arrays.asList(certificationEngineer.split(",")); + List certificationEngineerIdList = Arrays.asList(certificationEngineer.split(",")); // 给认证工程师分配任务 - for (String userId : certificationEngineerList) { + for (String userId : certificationEngineerIdList) { ProcessInfoDetailEO processInfoDetailEO = new ProcessInfoDetailEO(); processInfoDetailEO.setUserId(userId); processInfoDetailEO.setTaskDefinitionKey(CertificationFlowNodeEnum.RZGCSJSRW.getKey()); @@ -381,6 +395,38 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getCertificationInventoryLinkHrefFeishu(projectLibraryId, PRN_CN, PRN_EN); + String hrefFeishu_CN = (String) hrefFeishuMap.get("hrefFeishu_CN"); + String hrefFeishu_EN = (String) hrefFeishuMap.get("hrefFeishu_EN"); + + List certificationEngineerUserInfoList = this.sysUserService.querySysUserListByIdList(certificationEngineerIdList); + certificationEngineerIdList.forEach(userId -> { + try { + String thirdId = this.sysUserService.getUserThirdIdByUserId(certificationEngineerUserInfoList,userId); + + if(StringUtils.isNotEmpty(thirdId)){ + JSONObject larkMesJson = new JSONObject(); + larkMesJson.put("template_id", TemplateInfoEnum2.CERTIFICATION_MESSAGE2.getValue()); + larkMesJson.put("userIds",thirdId); + + Map templateVariableMap = new HashMap<>(); + templateVariableMap.put("projectNameCn",PRN_CN); + templateVariableMap.put("projectNameEn",PRN_EN); + templateVariableMap.put("Initiator",projectLibraryBase.getStudioEngineerName()); + templateVariableMap.put("endTime",endTime); + templateVariableMap.put("viewBtnUrlCn",hrefFeishu_CN); + templateVariableMap.put("viewBtnUrlEn",hrefFeishu_EN); + + larkMesJson.put("templateVariableMap",templateVariableMap); + this.feishuService.batchSendLarkCardMsgByTemplate2(larkMesJson); + } + } catch (Exception e) { + log.error("飞书消息推送失败"); + } + }); + return Result.OK("发布成功!"); } @@ -691,7 +737,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl idList = Arrays.asList(ids.split(",")); List flowStatusList = new ArrayList<>(); flowStatusList.add(CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()); @@ -1103,6 +1151,16 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl studioEngineerUserInfo = this.sysUserService.querySysUserListByIdList(Arrays.asList(projectLibraryBase.getStudioEngineer().split(","))); + + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + + // 获取认证清单 - 飞书跳转链接 + Map hrefFeishuMap = this.getCertificationInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN, PRN_EN); + String hrefFeishu_CN = (String) hrefFeishuMap.get("hrefFeishu_CN"); + String hrefFeishu_EN = (String) hrefFeishuMap.get("hrefFeishu_EN"); + // 给studio分配待办中心任务 /*List processInfoDetailEOList = new ArrayList<>(); ProcessInfoDetailEO processInfoDetailEO = new ProcessInfoDetailEO(); @@ -1110,17 +1168,60 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl() { + @Override + public int compare(ProjectCertificationInventoryEO p1, ProjectCertificationInventoryEO p2) { + return p1.getEndTime().compareTo(p2.getEndTime()); } + }); + Map standNameAndItemName = this.getStandNameAndItemName(projectCertificationInventoryEOList); + String standName = (String) standNameAndItemName.get("standName"); + String itemName = (String) standNameAndItemName.get("itemName"); + + try { // 认证工程师退回任务到studio,将数据的状态更新为 认证退回 this.updateBatchById(projectCertificationInventoryEOList); // 更新该项目认证流程中,认证工程师的任务状态。 // 如果还有 清单待校核、责任人拒绝 状态的数据,不做操作,如果没有 将这个项目认证流程的所有认证工程师待办任务转为已办 this.updateProcessInfoDetailStatus(projectLibraryBase,CertificationFlowNodeEnum.RZGCSJSRW.getKey(),flowStatusList); + + try { + String thirdId = this.sysUserService.getUserThirdIdByUserId(studioEngineerUserInfo,projectLibraryBase.getStudioEngineer()); + + if(StringUtils.isNotEmpty(thirdId)){ + // 根据结束时间进行排序,获取最近的时间,发消息时使用。 + Collections.sort(projectCertificationInventoryEOList, new Comparator() { + @Override + public int compare(ProjectCertificationInventoryEO p1, ProjectCertificationInventoryEO p2) { + return p1.getEndTime().compareTo(p2.getEndTime()); + } + }); + Date endTime = projectCertificationInventoryEOList.get(0).getEndTime(); + + JSONObject larkMesJson = new JSONObject(); + larkMesJson.put("template_id", TemplateInfoEnum2.CERTIFICATION_MESSAGE3.getValue()); + larkMesJson.put("userIds",thirdId); + + Map templateVariableMap = new HashMap<>(); + templateVariableMap.put("projectNameCn",PRN_CN); + templateVariableMap.put("projectNameEn",PRN_EN); + templateVariableMap.put("standName",standName); + templateVariableMap.put("itemName",itemName); + templateVariableMap.put("Initiator",projectLibraryBase.getStudioEngineerName()); + templateVariableMap.put("endTime",DateUtils.formatDate(endTime)); + templateVariableMap.put("viewBtnUrlCn",hrefFeishu_CN); + templateVariableMap.put("viewBtnUrlEn",hrefFeishu_EN); + templateVariableMap.put("certificationEngineer",currentUser.getUsername()); + + larkMesJson.put("templateVariableMap",templateVariableMap); + this.feishuService.batchSendLarkCardMsgByTemplate2(larkMesJson); + } + } catch (Exception e) { + log.error("飞书消息推送失败"); + } }catch (Exception ex){ ex.printStackTrace(); log.error("认证工程师-退回认证清单任务失败:" + ex.getMessage()); @@ -1217,18 +1318,41 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl certificationEngineerIdList = Arrays.asList(projectLibraryBase.getCertificationEngineer().split(",")); + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + + // 获取认证清单 - 飞书跳转链接 + Map hrefFeishuMap = this.getCertificationInventoryLinkHrefFeishu(projectLibraryId, PRN_CN, PRN_EN); + String hrefFeishu_CN = (String) hrefFeishuMap.get("hrefFeishu_CN"); + String hrefFeishu_EN = (String) hrefFeishuMap.get("hrefFeishu_EN"); + List idList = Arrays.asList(ids.split(",")); QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.lambda().in(ProjectCertificationInventoryEO::getId,idList); List projectCertificationInventoryEOList = this.list(queryWrapper); + // 根据结束时间进行排序,获取最近的时间,发消息时使用。 + Collections.sort(projectCertificationInventoryEOList, new Comparator() { + @Override + public int compare(ProjectCertificationInventoryEO p1, ProjectCertificationInventoryEO p2) { + return p1.getEndTime().compareTo(p2.getEndTime()); + } + }); + + Map standNameAndItemName = this.getStandNameAndItemName(projectCertificationInventoryEOList); + String standName = (String) standNameAndItemName.get("standName"); + String itemName = (String) standNameAndItemName.get("itemName"); + try { // 处理待办中心相关数据 // 更新该项目认证流程中,认证工程师的任务状态。 @@ -1259,6 +1383,50 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl certificationEngineerList = this.sysUserService.querySysUserListByIdList(certificationEngineerIdList); + if(CollectionUtils.isNotEmpty(certificationEngineerList)){ + for (String certificationEngineerId : certificationEngineerIdList) { + String thirdId = this.sysUserService.getUserThirdIdByUserId(certificationEngineerList,certificationEngineerId); + + if(StringUtils.isNotEmpty(thirdId)){ + // 根据结束时间进行排序,获取最近的时间,发消息时使用。 + Collections.sort(projectCertificationInventoryEOList, new Comparator() { + @Override + public int compare(ProjectCertificationInventoryEO p1, ProjectCertificationInventoryEO p2) { + return p1.getEndTime().compareTo(p2.getEndTime()); + } + }); + Date endTime = projectCertificationInventoryEOList.get(0).getEndTime(); + + JSONObject larkMesJson = new JSONObject(); + if(StringUtils.equals(operatorType,OperatorTypeEnum.CERTIFICATION_INVENTORY_STUDIO_WITHDRAW.getValue())){ + larkMesJson.put("template_id", TemplateInfoEnum2.CERTIFICATION_MESSAGE4.getValue()); + }else if(StringUtils.equals(operatorType,OperatorTypeEnum.CERTIFICATION_INVENTORY_STUDIO_RESET.getValue())){ + larkMesJson.put("template_id", TemplateInfoEnum2.CERTIFICATION_MESSAGE5.getValue()); + } + larkMesJson.put("userIds",thirdId); + + Map templateVariableMap = new HashMap<>(); + templateVariableMap.put("projectNameCn",PRN_CN); + templateVariableMap.put("projectNameEn",PRN_EN); + templateVariableMap.put("standName",standName); + templateVariableMap.put("itemName",itemName); + templateVariableMap.put("Initiator",projectLibraryBase.getStudioEngineerName()); + templateVariableMap.put("endTime",DateUtils.formatDate(endTime)); + templateVariableMap.put("viewBtnUrlCn",hrefFeishu_CN); + templateVariableMap.put("viewBtnUrlEn",hrefFeishu_EN); + + larkMesJson.put("templateVariableMap",templateVariableMap); + this.feishuService.batchSendLarkCardMsgByTemplate2(larkMesJson); + } + } + } + } catch (Exception e) { + log.error("飞书消息推送失败"); + } + }catch (Exception ex){ ex.printStackTrace(); log.error("studio-流程重置失败:" + ex.getMessage()); @@ -1276,10 +1444,12 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl idList = Arrays.asList(ids.split(",")); @@ -1305,6 +1475,13 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl() { + @Override + public int compare(ProjectCertificationInventoryEO p1, ProjectCertificationInventoryEO p2) { + return p1.getEndTime().compareTo(p2.getEndTime()); + } + }); + QueryWrapper detailQueryWrap = new QueryWrapper<>(); detailQueryWrap.lambda().eq(ProcessInfoDetailEO::getProcessInfoId,projectLibraryId); detailQueryWrap.lambda().eq(ProcessInfoDetailEO::getUserId,currentUser.getId()); @@ -1317,6 +1494,39 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getCertificationInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN, PRN_EN); + String hrefFeishu_CN = (String) hrefFeishuMap.get("hrefFeishu_CN"); + String hrefFeishu_EN = (String) hrefFeishuMap.get("hrefFeishu_EN"); + + Map standNameAndItemName = this.getStandNameAndItemName(projectCertificationInventoryEOList); + String standName = (String) standNameAndItemName.get("standName"); + String itemName = (String) standNameAndItemName.get("itemName"); + + SysUser sysUser = this.sysUserService.getBaseMapper().selectById(transferUserId); + if (StringUtils.isNotEmpty(sysUser.getThirdId())) { + try { + JSONObject larkMesJson = new JSONObject(); + larkMesJson.put("template_id", TemplateInfoEnum2.CERTIFICATION_MESSAGE9.getValue()); + larkMesJson.put("userIds",sysUser.getThirdId()); + + Map templateVariableMap = new HashMap<>(); + templateVariableMap.put("projectNameCn", PRN_CN); + templateVariableMap.put("projectNameEn", PRN_EN); + templateVariableMap.put("standName",standName); + templateVariableMap.put("itemName",itemName); + templateVariableMap.put("Initiator", projectLibraryBase.getStudioEngineerName()); + templateVariableMap.put("endTime", DateUtils.formatDate(projectCertificationInventoryEOList.get(0).getEndTime())); + templateVariableMap.put("viewBtnUrlCn",hrefFeishu_CN); + templateVariableMap.put("viewBtnUrlEn",hrefFeishu_EN); + + larkMesJson.put("templateVariableMap",templateVariableMap); + this.feishuService.batchSendLarkCardMsgByTemplate2(larkMesJson); + } catch (Exception e) { + log.error("飞书消息推送失败"); + } + } + return Result.OK("转办成功!"); } @@ -1344,19 +1554,10 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl projectCertificationInventoryEOList = this.list(queryWrapper); if(CollectionUtils.isNotEmpty(projectCertificationInventoryEOList)){ - //飞书跳转链接 - String hrefFeishu_CN = backUrl - + JumpLinkEnum.CERTIFICATION_INVENTORY_LINK.getLink() - + projectLibraryId - + JumpLinkEnum.CERTIFICATION_INVENTORY_LINK.getType() - + "&projectName=" + PRN_CN; - - //飞书跳转链接 - String hrefFeishu_EN = backUrl - + JumpLinkEnum.CERTIFICATION_INVENTORY_LINK.getLink() - + projectLibraryId - + JumpLinkEnum.CERTIFICATION_INVENTORY_LINK.getType() - + "&projectName=" + PRN_EN; + // 获取认证清单 - 飞书跳转链接 + Map hrefFeishuMap = this.getCertificationInventoryLinkHrefFeishu(projectLibraryId, PRN_CN, PRN_EN); + String hrefFeishu_CN = (String) hrefFeishuMap.get("hrefFeishu_CN"); + String hrefFeishu_EN = (String) hrefFeishuMap.get("hrefFeishu_EN"); /** * studio催办:除了 清单待发布、审查通过、认证退回 的 催办当前办理人 @@ -1377,8 +1578,6 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl certificationEngineerIdList = Arrays.asList(certificationEngineerIds.split(",")); List certificationEngineerList = this.sysUserService.querySysUserListByIdList(certificationEngineerIdList); - StringBuilder standNameSb = new StringBuilder(); - StringBuilder itemNameSb = new StringBuilder(); // 根据结束时间进行排序,获取最近的时间,发消息时使用。 Collections.sort(certificationInventoryEOList, new Comparator() { @@ -1389,53 +1588,35 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl standNameAndItemName = this.getStandNameAndItemName(certificationInventoryEOList); + String standName = (String) standNameAndItemName.get("standName"); + String itemName = (String) standNameAndItemName.get("itemName"); if(CollectionUtils.isNotEmpty(certificationEngineerList)){ for (String certificationEngineerId : certificationEngineerIdList) { - String thirdId = certificationEngineerList.stream().filter(certificationEngineer -> { - boolean flag = false; - if(StringUtils.equals(certificationEngineerId,certificationEngineer.getId())){ - flag = true; + String thirdId = this.sysUserService.getUserThirdIdByUserId(certificationEngineerList,certificationEngineerId); + + if(StringUtils.isNotEmpty(thirdId)){ + try { + JSONObject larkMesJson = new JSONObject(); + larkMesJson.put("template_id", TemplateInfoEnum2.CERTIFICATION_MESSAGE1.getValue()); + larkMesJson.put("userIds",thirdId); + + Map templateVariableMap = new HashMap<>(); + templateVariableMap.put("projectNameCn",PRN_CN); + templateVariableMap.put("projectNameEn",PRN_EN); + templateVariableMap.put("standName",standName); + templateVariableMap.put("itemName",itemName); + templateVariableMap.put("Initiator",projectLibraryBase.getStudioEngineerName()); + templateVariableMap.put("endTime",DateUtils.formatDate(endTime)); + templateVariableMap.put("viewBtnUrlCn",hrefFeishu_CN); + templateVariableMap.put("viewBtnUrlEn",hrefFeishu_EN); + + larkMesJson.put("templateVariableMap",templateVariableMap); + this.feishuService.batchSendLarkCardMsgByTemplate2(larkMesJson); + } catch (Exception e) { + log.error("飞书消息推送失败"); } - return flag; - }).collect(Collectors.toList()).get(0).getThirdId(); - - try { - JSONObject larkMesJson = new JSONObject(); - larkMesJson.put("template_id", TemplateInfoEnum2.CERTIFICATION_MESSAGE1.getValue()); - larkMesJson.put("userIds",thirdId); - - Map templateVariableMap = new HashMap<>(); - templateVariableMap.put("projectNameCn",PRN_CN); - templateVariableMap.put("projectNameEn",PRN_EN); - templateVariableMap.put("standName",standName); - templateVariableMap.put("itemName",itemName); - templateVariableMap.put("Initiator",projectLibraryBase.getStudioEngineerName()); - templateVariableMap.put("endTime",DateUtils.formatDate(endTime)); - templateVariableMap.put("viewBtnUrlCn",hrefFeishu_CN); - templateVariableMap.put("viewBtnUrlEn",hrefFeishu_EN); - - larkMesJson.put("templateVariableMap",templateVariableMap); - this.feishuService.batchSendLarkCardMsgByTemplate2(larkMesJson); - } catch (Exception e) { - log.error("飞书消息推送失败"); } } } @@ -1457,62 +1638,42 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl value = map.getValue(); - String thirdId = dutyPersonList.stream().filter(dutyPersonInfo -> { - boolean flag = false; - if(StringUtils.equals(key,dutyPersonInfo.getId())){ - flag = true; + String thirdId = this.sysUserService.getUserThirdIdByUserId(dutyPersonList,key); + + if(StringUtils.isNotEmpty(thirdId)){ + // 根据结束时间进行排序,获取最近的时间,发消息时使用。 + Collections.sort(value, new Comparator() { + @Override + public int compare(ProjectCertificationInventoryEO p1, ProjectCertificationInventoryEO p2) { + return p1.getEndTime().compareTo(p2.getEndTime()); + } + }); + Map standNameAndItemName = this.getStandNameAndItemName(value); + String standName = (String) standNameAndItemName.get("standName"); + String itemName = (String) standNameAndItemName.get("itemName"); + + Date endTime = value.get(0).getEndTime(); + + try { + JSONObject larkMesJson = new JSONObject(); + larkMesJson.put("template_id", TemplateInfoEnum2.CERTIFICATION_MESSAGE1.getValue()); + larkMesJson.put("userIds",thirdId); + + Map templateVariableMap = new HashMap<>(); + templateVariableMap.put("projectNameCn",PRN_CN); + templateVariableMap.put("projectNameEn",PRN_EN); + templateVariableMap.put("standName",standName); + templateVariableMap.put("itemName",itemName); + templateVariableMap.put("Initiator",projectLibraryBase.getStudioEngineerName()); + templateVariableMap.put("endTime",DateUtils.formatDate(endTime)); + templateVariableMap.put("viewBtnUrlCn",hrefFeishu_CN); + templateVariableMap.put("viewBtnUrlEn",hrefFeishu_EN); + + larkMesJson.put("templateVariableMap",templateVariableMap); + this.feishuService.batchSendLarkCardMsgByTemplate2(larkMesJson); + } catch (Exception e) { + log.error("飞书消息推送失败"); } - return flag; - }).collect(Collectors.toList()).get(0).getThirdId(); - - // 根据结束时间进行排序,获取最近的时间,发消息时使用。 - Collections.sort(value, new Comparator() { - @Override - public int compare(ProjectCertificationInventoryEO p1, ProjectCertificationInventoryEO p2) { - return p1.getEndTime().compareTo(p2.getEndTime()); - } - }); - Date endTime = value.get(0).getEndTime(); - - StringBuilder standNameSb = new StringBuilder(); - StringBuilder itemNameSb = new StringBuilder(); - for (ProjectCertificationInventoryEO projectCertificationInventoryEO : value) { - if(StringUtils.isNotEmpty(projectCertificationInventoryEO.getInspectionItem())){ - itemNameSb.append(projectCertificationInventoryEO.getInspectionItem()).append(","); - } - if(StringUtils.isNotEmpty(projectCertificationInventoryEO.getSerialNumber())){ - standNameSb.append(projectCertificationInventoryEO.getSerialNumber()).append(","); - } - } - - String standName = ""; - if(StringUtils.isNotEmpty(standNameSb.toString())){ - standName = standNameSb.toString().substring(0,standNameSb.toString().length()-1); - } - String itemName = ""; - if(StringUtils.isNotEmpty(itemNameSb.toString())){ - itemName = itemNameSb.toString().substring(0,itemNameSb.toString().length()-1); - } - - try { - JSONObject larkMesJson = new JSONObject(); - larkMesJson.put("template_id", TemplateInfoEnum2.CERTIFICATION_MESSAGE1.getValue()); - larkMesJson.put("userIds",thirdId); - - Map templateVariableMap = new HashMap<>(); - templateVariableMap.put("projectNameCn",PRN_CN); - templateVariableMap.put("projectNameEn",PRN_EN); - templateVariableMap.put("standName",standName); - templateVariableMap.put("itemName",itemName); - templateVariableMap.put("Initiator",projectLibraryBase.getStudioEngineerName()); - templateVariableMap.put("endTime",DateUtils.formatDate(endTime)); - templateVariableMap.put("viewBtnUrlCn",hrefFeishu_CN); - templateVariableMap.put("viewBtnUrlEn",hrefFeishu_EN); - - larkMesJson.put("templateVariableMap",templateVariableMap); - this.feishuService.batchSendLarkCardMsgByTemplate2(larkMesJson); - } catch (Exception e) { - log.error("飞书消息推送失败"); } } } @@ -1521,4 +1682,68 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl getStandNameAndItemName(List projectCertificationInventoryEOList){ + Map result = new HashMap<>(); + StringBuilder standNameSb = new StringBuilder(); + StringBuilder itemNameSb = new StringBuilder(); + for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) { + projectCertificationInventoryEO.setFlowStatus(CertificationInventoryFlowStatusEnum.CERTIFICATION_RETURNED.getValue()); + + if(StringUtils.isNotEmpty(projectCertificationInventoryEO.getInspectionItem())){ + itemNameSb.append(projectCertificationInventoryEO.getInspectionItem()).append(","); + } + if(StringUtils.isNotEmpty(projectCertificationInventoryEO.getSerialNumber())){ + standNameSb.append(projectCertificationInventoryEO.getSerialNumber()).append(","); + } + } + + String standName = ""; + if(StringUtils.isNotEmpty(standNameSb.toString())){ + standName = standNameSb.toString().substring(0,standNameSb.toString().length()-1); + } + String itemName = ""; + if(StringUtils.isNotEmpty(itemNameSb.toString())){ + itemName = itemNameSb.toString().substring(0,itemNameSb.toString().length()-1); + } + + result.put("standName",standName); + result.put("itemName",itemName); + return result; + } + + /** + * 获取认证清单飞书跳转链接 + * @param projectLibraryId + * @param PRN_CN + * @param PRN_EN + * @return + */ + @Override + public Map getCertificationInventoryLinkHrefFeishu(String projectLibraryId,String PRN_CN,String PRN_EN){ + Map result = new HashMap<>(); + + String hrefFeishu_CN = backUrl + + JumpLinkEnum.CERTIFICATION_INVENTORY_LINK.getLink() + + projectLibraryId + + JumpLinkEnum.CERTIFICATION_INVENTORY_LINK.getType() + + "&projectName=" + PRN_CN; + + //飞书跳转链接 + String hrefFeishu_EN = backUrl + + JumpLinkEnum.CERTIFICATION_INVENTORY_LINK.getLink() + + projectLibraryId + + JumpLinkEnum.CERTIFICATION_INVENTORY_LINK.getType() + + "&projectName=" + PRN_EN; + + result.put("hrefFeishu_CN",hrefFeishu_CN); + result.put("hrefFeishu_EN",hrefFeishu_EN); + return result; + } + } diff --git a/jero-web/src/views/projectManagement/components/certificationList/index.vue b/jero-web/src/views/projectManagement/components/certificationList/index.vue index 799519d35..b3cacecb4 100644 --- a/jero-web/src/views/projectManagement/components/certificationList/index.vue +++ b/jero-web/src/views/projectManagement/components/certificationList/index.vue @@ -872,7 +872,8 @@ let idList = JSON.parse(JSON.stringify(_this.selectedRowKeys)) postAction('/project/projectCertificationInventoryEO/resetFlow', { ids: idList.join(','), - projectLibraryId: _this.$route.query.id + projectLibraryId: _this.$route.query.id, + operatorType: 'certificationInventoryStudioReset' }).then((res) => { if (res.success) { _this.$message.success(_this.$t('OperationSuccessful')) @@ -969,7 +970,8 @@ onOk() { postAction('/project/projectCertificationInventoryEO/resetFlow', { ids: ids.join(','), - projectLibraryId: _this.$route.query.id + projectLibraryId: _this.$route.query.id, + operatorType: 'certificationInventoryStudioWithdraw' }).then((res) => { if (res.success) { _this.$message.success(_this.$t('OperationSuccessful'))