认证清单-催办接口完善。
This commit is contained in:
+2
-1
@@ -12,12 +12,13 @@ public enum JumpLinkEnum {
|
|||||||
* 103:跳转 项目库 - 任务清单
|
* 103:跳转 项目库 - 任务清单
|
||||||
* 104:跳转 项目库 - 未符合项
|
* 104:跳转 项目库 - 未符合项
|
||||||
* 105:跳转 项目库 - 认证参数收集
|
* 105:跳转 项目库 - 认证参数收集
|
||||||
|
* 106:跳转 项目库 - 认证清单
|
||||||
*/
|
*/
|
||||||
INVENTORY_AFFIRM_LINK("清单确认链接","1","/ProjectDetails?id=","&type=102"),
|
INVENTORY_AFFIRM_LINK("清单确认链接","1","/ProjectDetails?id=","&type=102"),
|
||||||
PREHOMO_AFFIRM_LINK("prehomo确认链接","2","/ProjectDetails?id=","&type=103"),
|
PREHOMO_AFFIRM_LINK("prehomo确认链接","2","/ProjectDetails?id=","&type=103"),
|
||||||
VERIFY_AFFIRM_LINK("验证符合性确认链接","3","/ProjectDetails?id=","&type=103"),
|
VERIFY_AFFIRM_LINK("验证符合性确认链接","3","/ProjectDetails?id=","&type=103"),
|
||||||
DESIGN_AFFIRM_LINK("设计符合性确认链接","4","/ProjectDetails?id=","&type=103"),
|
DESIGN_AFFIRM_LINK("设计符合性确认链接","4","/ProjectDetails?id=","&type=103"),
|
||||||
CERTIFICATION_INVENTORY_LINK("认证清单链接","5","/ProjectDetails?id=","&type=104"),
|
CERTIFICATION_INVENTORY_LINK("认证清单链接","5","/ProjectDetails?id=","&type=106"),
|
||||||
TASK_AFFIRM_LINK("任务确认链接","2","/ProcessCenter",""),
|
TASK_AFFIRM_LINK("任务确认链接","2","/ProcessCenter",""),
|
||||||
FGPG_TODO_CENTER_LINK("法规评估任务待办中心链接","88","/regulatoryAssessmentTasks",""),
|
FGPG_TODO_CENTER_LINK("法规评估任务待办中心链接","88","/regulatoryAssessmentTasks",""),
|
||||||
XMCS_TODO_CENTER_LINK("项目参数任务待办中心链接","99","/projectParameterTasks",""),
|
XMCS_TODO_CENTER_LINK("项目参数任务待办中心链接","99","/projectParameterTasks",""),
|
||||||
|
|||||||
+96
-44
@@ -1329,10 +1329,12 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
|||||||
|
|
||||||
String projectLibraryId = json.getString("projectLibraryId");
|
String projectLibraryId = json.getString("projectLibraryId");
|
||||||
ProjectLibraryBase projectLibraryBase = projectLibraryBaseService.queryById(projectLibraryId, CutEnum.EN.getValue()).get(0);
|
ProjectLibraryBase projectLibraryBase = projectLibraryBaseService.queryById(projectLibraryId, CutEnum.EN.getValue()).get(0);
|
||||||
String PRN = projectLibraryBase.getProjectName();//项目名称
|
String PRN_EN = projectLibraryBase.getProjectName();//项目名称
|
||||||
if(ObjectUtils.isEmpty(projectLibraryBase)){
|
if(ObjectUtils.isEmpty(projectLibraryBase)){
|
||||||
throw new JeroBootException("无法获取项目库信息,项目库id为:" + projectLibraryId + " 请联系管理员!");
|
throw new JeroBootException("无法获取项目库信息,项目库id为:" + projectLibraryId + " 请联系管理员!");
|
||||||
}
|
}
|
||||||
|
// ProjectLibraryBase projectLibraryBaseCn = projectLibraryBaseService.queryById(projectLibraryId, CutEnum.CN.getValue()).get(0);
|
||||||
|
// String PRN_CN = projectLibraryBase.getProjectName();//项目名称
|
||||||
|
|
||||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
List<String> idList = Arrays.asList(ids.split(","));
|
List<String> idList = Arrays.asList(ids.split(","));
|
||||||
@@ -1344,11 +1346,18 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
|||||||
|
|
||||||
if(CollectionUtils.isNotEmpty(projectCertificationInventoryEOList)){
|
if(CollectionUtils.isNotEmpty(projectCertificationInventoryEOList)){
|
||||||
//飞书跳转链接
|
//飞书跳转链接
|
||||||
String hrefFeishu = backUrl
|
String hrefFeishu_CN = backUrl
|
||||||
+ JumpLinkEnum.CERTIFICATION_INVENTORY_LINK.getLink()
|
+ JumpLinkEnum.CERTIFICATION_INVENTORY_LINK.getLink()
|
||||||
+ projectLibraryId
|
+ projectLibraryId
|
||||||
+ JumpLinkEnum.CERTIFICATION_INVENTORY_LINK.getType()
|
+ JumpLinkEnum.CERTIFICATION_INVENTORY_LINK.getType()
|
||||||
+ "&" + PRN;
|
+ "&projectName=" + PRN_EN;
|
||||||
|
|
||||||
|
//飞书跳转链接
|
||||||
|
String hrefFeishu_EN = backUrl
|
||||||
|
+ JumpLinkEnum.CERTIFICATION_INVENTORY_LINK.getLink()
|
||||||
|
+ projectLibraryId
|
||||||
|
+ JumpLinkEnum.CERTIFICATION_INVENTORY_LINK.getType()
|
||||||
|
+ "&projectName=" + PRN_EN;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* studio催办:除了 清单待发布、审查通过、认证退回 的 催办当前办理人
|
* studio催办:除了 清单待发布、审查通过、认证退回 的 催办当前办理人
|
||||||
@@ -1363,45 +1372,72 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
|||||||
|| StringUtils.equals(data.getFlowStatus(), CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()));
|
|| StringUtils.equals(data.getFlowStatus(), CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()));
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
String certificationEngineerIds = projectLibraryBase.getCertificationEngineer();
|
if(CollectionUtils.isNotEmpty(certificationInventoryEOList)){
|
||||||
if(StringUtils.isNotEmpty(certificationEngineerIds)){
|
String certificationEngineerIds = projectLibraryBase.getCertificationEngineer();
|
||||||
List<String> certificationEngineerIdList = Arrays.asList(certificationEngineerIds.split(","));
|
if(StringUtils.isNotEmpty(certificationEngineerIds)){
|
||||||
|
List<String> certificationEngineerIdList = Arrays.asList(certificationEngineerIds.split(","));
|
||||||
|
|
||||||
List<SysUser> certificationEngineerList = this.sysUserService.querySysUserListByIdList(certificationEngineerIdList);
|
List<SysUser> certificationEngineerList = this.sysUserService.querySysUserListByIdList(certificationEngineerIdList);
|
||||||
String standName = "";
|
StringBuilder standNameSb = new StringBuilder();
|
||||||
String itemName = "";
|
StringBuilder itemNameSb = new StringBuilder();
|
||||||
|
|
||||||
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : certificationInventoryEOList) {
|
// 根据结束时间进行排序,获取最近的时间,发消息时使用。
|
||||||
//TODO 处理数据,飞书卡片消息中展示的标准名称、条目名称 需求没有定如何展示,暂时无法处理。
|
Collections.sort(certificationInventoryEOList, new Comparator<ProjectCertificationInventoryEO>() {
|
||||||
}
|
@Override
|
||||||
|
public int compare(ProjectCertificationInventoryEO p1, ProjectCertificationInventoryEO p2) {
|
||||||
|
return p1.getEndTime().compareTo(p2.getEndTime());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Date endTime = certificationInventoryEOList.get(0).getEndTime();
|
||||||
|
|
||||||
if(CollectionUtils.isNotEmpty(certificationEngineerList)){
|
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : certificationInventoryEOList) {
|
||||||
for (String certificationEngineerId : certificationEngineerIdList) {
|
if(StringUtils.isNotEmpty(projectCertificationInventoryEO.getInspectionItem())){
|
||||||
String thirdId = certificationEngineerList.stream().filter(certificationEngineer -> {
|
itemNameSb.append(projectCertificationInventoryEO.getInspectionItem()).append(",");
|
||||||
boolean flag = false;
|
}
|
||||||
if(StringUtils.equals(certificationEngineerId,certificationEngineer.getId())){
|
if(StringUtils.isNotEmpty(projectCertificationInventoryEO.getSerialNumber())){
|
||||||
flag = true;
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
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<String,Object> templateVariableMap = new HashMap<>();
|
||||||
|
templateVariableMap.put("projectNameCn",PRN_EN);
|
||||||
|
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<String,Object> templateVariableMap = new HashMap<>();
|
|
||||||
templateVariableMap.put("projectName",PRN);
|
|
||||||
templateVariableMap.put("standName",standName);
|
|
||||||
templateVariableMap.put("itemName",itemName);
|
|
||||||
templateVariableMap.put("Initiator",projectLibraryBase.getStudioEngineerName());
|
|
||||||
templateVariableMap.put("endTime","");
|
|
||||||
templateVariableMap.put("back_url",hrefFeishu);
|
|
||||||
|
|
||||||
larkMesJson.put("templateVariableMap",templateVariableMap);
|
|
||||||
this.feishuService.batchSendLarkCardMsgByTemplate2(larkMesJson);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("飞书消息推送失败");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1439,10 +1475,24 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
|||||||
});
|
});
|
||||||
Date endTime = value.get(0).getEndTime();
|
Date endTime = value.get(0).getEndTime();
|
||||||
|
|
||||||
String standName = "";
|
StringBuilder standNameSb = new StringBuilder();
|
||||||
String itemName = "";
|
StringBuilder itemNameSb = new StringBuilder();
|
||||||
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : value) {
|
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : value) {
|
||||||
//TODO 处理数据,飞书卡片消息中展示的标准名称、条目名称 需求没有定如何展示,暂时无法处理。
|
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 {
|
try {
|
||||||
@@ -1451,12 +1501,14 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
|||||||
larkMesJson.put("userIds",thirdId);
|
larkMesJson.put("userIds",thirdId);
|
||||||
|
|
||||||
Map<String,Object> templateVariableMap = new HashMap<>();
|
Map<String,Object> templateVariableMap = new HashMap<>();
|
||||||
templateVariableMap.put("projectName",PRN);
|
templateVariableMap.put("projectNameCn",PRN_EN);
|
||||||
|
templateVariableMap.put("projectNameEn",PRN_EN);
|
||||||
templateVariableMap.put("standName",standName);
|
templateVariableMap.put("standName",standName);
|
||||||
templateVariableMap.put("itemName",standName);
|
templateVariableMap.put("itemName",itemName);
|
||||||
templateVariableMap.put("Initiator",projectLibraryBase.getStudioEngineerName());
|
templateVariableMap.put("Initiator",projectLibraryBase.getStudioEngineerName());
|
||||||
templateVariableMap.put("endTime",DateUtils.formatDate(endTime));
|
templateVariableMap.put("endTime",DateUtils.formatDate(endTime));
|
||||||
templateVariableMap.put("back_url",hrefFeishu);
|
templateVariableMap.put("viewBtnUrlCn",hrefFeishu_CN);
|
||||||
|
templateVariableMap.put("viewBtnUrlEn",hrefFeishu_EN);
|
||||||
|
|
||||||
larkMesJson.put("templateVariableMap",templateVariableMap);
|
larkMesJson.put("templateVariableMap",templateVariableMap);
|
||||||
this.feishuService.batchSendLarkCardMsgByTemplate2(larkMesJson);
|
this.feishuService.batchSendLarkCardMsgByTemplate2(larkMesJson);
|
||||||
|
|||||||
Reference in New Issue
Block a user