清单确认、任务确认,发送飞书消息时,发起人设置为 该项目的studio。

符合性确认,发送飞书消息时,发起人设置为 各个流程在法规清单中设置的发起人。
This commit is contained in:
wangzhijiang
2022-08-05 11:37:30 +08:00
parent 58ed14fac2
commit 0259400fe4
2 changed files with 101 additions and 11 deletions
@@ -1290,6 +1290,11 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
ProjectLibraryBase projectLibraryBase = projectLibraryBaseMapper.selectOne(new QueryWrapper<ProjectLibraryBase>()
.lambda().eq(ProjectLibraryBase::getId, projectLibraryId));
// studio信息
SysUser studioUserInfo = this.sysUserMapper.selectOne(
new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, projectLibraryBase.getStudioEngineer())
);
QueryWrapper<ProjectNameInfoEO> projectNameInfoEOQueryWrapper = new QueryWrapper<>();
projectNameInfoEOQueryWrapper.lambda().eq(ProjectNameInfoEO::getId,projectLibraryBase.getProjectNameId());
ProjectNameInfoEO projectNameInfoEO = projectNameInfoEOMapper.selectOne(projectNameInfoEOQueryWrapper);
@@ -1354,7 +1359,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
feishuMsgVo.setContent("Hello! Please check and address this task in a timely manner.");
feishuMsgVo.setTaskType("Regulation List Confirmation");
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
feishuMsgVo.setInitiator(currentUser.getUsername());
feishuMsgVo.setInitiator(studioUserInfo.getUsername());
feishuMsgVo.setDueDate(inventoryAffirmDueDate);
//飞书跳转链接
@@ -1466,10 +1471,6 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
}*/
}
SysUser studioUserInfo = this.sysUserMapper.selectOne(
new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, projectLibraryBase.getStudioEngineer())
);
//只要有一个人拒绝就改为拒绝
if(StringUtils.equals(operatorResult, OperatorResultEnum.REJECTED.getValue())){
inventoryAffirmStatus = InventoryAffirmStatusEnum.REJECTED.getValue();
@@ -1493,7 +1494,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
feishuMsgVo.setTaskType("Regulation List Confirmation");
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
feishuMsgVo.setInitiator(currentUser.getUsername());
feishuMsgVo.setInitiator(studioUserInfo.getUsername());
feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate()));
//飞书跳转链接
@@ -1534,7 +1535,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
feishuMsgVo.setTaskType("Regulation List Confirmation");
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
feishuMsgVo.setInitiator(currentUser.getUsername());
feishuMsgVo.setInitiator(studioUserInfo.getUsername());
feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate()));
//飞书跳转链接
@@ -1584,7 +1585,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
feishuMsgVo.setTaskType("Regulation List Confirmation");
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
feishuMsgVo.setInitiator(currentUser.getUsername());
feishuMsgVo.setInitiator(studioUserInfo.getUsername());
feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate()));
//飞书跳转链接
@@ -2088,6 +2089,9 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
ProjectLibraryBase projectLibraryBase = projectLibraryBaseMapper.selectOne(new QueryWrapper<ProjectLibraryBase>()
.lambda().eq(ProjectLibraryBase::getId, projectLibraryId));
ProjectLawsInventoryEO projectLawsInventoryEO = this.baseMapper.selectOne(
new QueryWrapper<ProjectLawsInventoryEO>().lambda().eq(ProjectLawsInventoryEO::getId, id)
);
SysUser studioUserInfo = this.sysUserMapper.selectOne(
new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, projectLibraryBase.getStudioEngineer())
@@ -2112,6 +2116,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
MessageTypeEnum messageTypeEnum = null;
String taskType = "";
String initiator = "";
String initiatorLark = "";
if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_START_MSG.getValue())) {
userIdList.add(engineeringInterfacePerson);
@@ -2126,6 +2131,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
taskType = "Regulation Task Confirmation";
initiator = studioUserInfo.getUsername();
initiatorLark = studioUserInfo.getUsername();
} else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_ISSUE_DRE_MSG.getValue())) {
String dreUserId = jsonObject.getString("dreUserId"); //dre用户id
userIdList.add(dreUserId);
@@ -2138,7 +2144,9 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION;
taskType = "Regulation Task Confirmation";
initiator = studioUserInfo.getUsername();
initiatorLark = studioUserInfo.getUsername();
} else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_DRE_REJECTED.getValue())) {
userIdList.add(engineeringInterfacePerson);
msgContentEN = sysUser.getUsername() + " has rejected the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName()
@@ -2150,7 +2158,9 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION;
taskType = "Regulation Task Confirmation";
initiator = studioUserInfo.getUsername();
initiatorLark = studioUserInfo.getUsername();
} else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_DRE_ACCEPTED.getValue())) {
userIdList.add(engineeringInterfacePerson);
msgContentEN = sysUser.getUsername() + " has submitted the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName()
@@ -2162,7 +2172,9 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION;
taskType = "Regulation Task Confirmation";
initiator = studioUserInfo.getUsername();
initiatorLark = studioUserInfo.getUsername();
} else if(StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_REJECTED_MSG.getValue())){
userIdList.add(projectLibraryBase.getStudioEngineer());
msgContentEN = sysUser.getUsername() + " has rejected the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName()
@@ -2174,7 +2186,9 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION;
taskType = "Regulation Task Confirmation";
initiator = studioUserInfo.getUsername();
initiatorLark = studioUserInfo.getUsername();
} else if(StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_ACCEPTED_MSG.getValue())){
userIdList.add(projectLibraryBase.getStudioEngineer());
msgContentEN = sysUser.getUsername() + " has accepted the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName()
@@ -2186,7 +2200,9 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION;
taskType = "Regulation Task Confirmation";
initiator = studioUserInfo.getUsername();
initiatorLark = studioUserInfo.getUsername();
} else if(StringUtils.equals(msgType, MsgTypeEnum.DESIGN_START_MSG.getValue())){
String designDutyId = jsonObject.getString("designDutyId"); //设计符合性责任人id
userIdList.add(designDutyId);
@@ -2199,7 +2215,12 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
taskType = "Design Compliance Confirmation";
initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
SysUser initiatorLarkInfo = this.sysUserMapper.selectOne(
new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, projectLawsInventoryEO.getDesignInitiatorId())
);
initiatorLark = initiatorLarkInfo.getUsername();
} else if(StringUtils.equals(msgType, MsgTypeEnum.PREHOMO_START_MSG.getValue())){
String prehomoDutyId = jsonObject.getString("prehomoDutyId"); //pre-Home责任人id
userIdList.add(prehomoDutyId);
@@ -2212,7 +2233,13 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
taskType = "Pre-Homo Confirmation";
initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
SysUser initiatorLarkInfo = this.sysUserMapper.selectOne(
new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, projectLawsInventoryEO.getPrehomoInitiatorId())
);
initiatorLark = initiatorLarkInfo.getUsername();
} else if(StringUtils.equals(msgType, MsgTypeEnum.VERIFY_START_MSG.getValue())){
String verifyDutyId = jsonObject.getString("verifyDutyId"); //验证符合性责任人id
userIdList.add(verifyDutyId);
@@ -2225,7 +2252,12 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
taskType = "Validation Compliance Confirmation";
initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
SysUser initiatorLarkInfo = this.sysUserMapper.selectOne(
new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, projectLawsInventoryEO.getVerifyInitiatorId())
);
initiatorLark = initiatorLarkInfo.getUsername();
} else if(StringUtils.equals(msgType, MsgTypeEnum.DESIGN_CHARGE_PERSON_SUBMIT_MSG.getValue())){
String designInitiatorId = jsonObject.getString("designInitiatorId"); //设计符合性发起人id
userIdList.add(designInitiatorId);
@@ -2238,7 +2270,12 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
taskType = "Design Compliance Confirmation";
initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
SysUser initiatorLarkInfo = this.sysUserMapper.selectOne(
new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, projectLawsInventoryEO.getDesignInitiatorId())
);
initiatorLark = initiatorLarkInfo.getUsername();
} else if(StringUtils.equals(msgType, MsgTypeEnum.PREHOMO_CHARGE_PERSON_SUBMIT_MSG.getValue())){
String prehomoInitiatorId = jsonObject.getString("prehomoInitiatorId"); //pre-Home发起人id
userIdList.add(prehomoInitiatorId);
@@ -2251,7 +2288,12 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
taskType = "Pre-Homo Confirmation";
initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
SysUser initiatorLarkInfo = this.sysUserMapper.selectOne(
new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, projectLawsInventoryEO.getPrehomoInitiatorId())
);
initiatorLark = initiatorLarkInfo.getUsername();
} else if(StringUtils.equals(msgType, MsgTypeEnum.VERIFY_CHARGE_PERSON_SUBMIT_MSG.getValue())){
String verifyInitiatorId = jsonObject.getString("verifyInitiatorId"); //验证符合性发起人id
userIdList.add(verifyInitiatorId);
@@ -2264,7 +2306,12 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
taskType = "Validation Compliance Confirmation";
initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
SysUser initiatorLarkInfo = this.sysUserMapper.selectOne(
new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, projectLawsInventoryEO.getVerifyInitiatorId())
);
initiatorLark = initiatorLarkInfo.getUsername();
}else if(StringUtils.equals(msgType, MsgTypeEnum.DESIGN_INITIATOR_ACCEPTED_MSG.getValue())){
String designDutyId = jsonObject.getString("designDutyId"); //设计符合性责任人id
userIdList.add(designDutyId);
@@ -2277,7 +2324,12 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
taskType = "Design Compliance Confirmation";
initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
SysUser initiatorLarkInfo = this.sysUserMapper.selectOne(
new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, projectLawsInventoryEO.getDesignInitiatorId())
);
initiatorLark = initiatorLarkInfo.getUsername();
} else if(StringUtils.equals(msgType, MsgTypeEnum.PREHOMO_INITIATOR_ACCEPTED_MSG.getValue())){
String prehomoDutyId = jsonObject.getString("prehomoDutyId"); //pre-Home责任人id
userIdList.add(prehomoDutyId);
@@ -2290,7 +2342,12 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
taskType = "Pre-Homo Confirmation";
initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
SysUser initiatorLarkInfo = this.sysUserMapper.selectOne(
new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, projectLawsInventoryEO.getPrehomoInitiatorId())
);
initiatorLark = initiatorLarkInfo.getUsername();
} else if(StringUtils.equals(msgType, MsgTypeEnum.VERIFY_INITIATOR_ACCEPTED_MSG.getValue())){
String verifyDutyId = jsonObject.getString("verifyDutyId"); //验证符合性责任人id
userIdList.add(verifyDutyId);
@@ -2303,7 +2360,12 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
taskType = "Validation Compliance Confirmation";
initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
SysUser initiatorLarkInfo = this.sysUserMapper.selectOne(
new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, projectLawsInventoryEO.getVerifyInitiatorId())
);
initiatorLark = initiatorLarkInfo.getUsername();
}
if(CollectionUtils.isNotEmpty(userIdList) && StringUtils.isNotEmpty(msgContentEN)){
@@ -2311,7 +2373,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
feishuMsgVo.setTaskType(taskType);
feishuMsgVo.setRegulationNo(serialNumber);
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
feishuMsgVo.setInitiator(sysUser.getUsername());
feishuMsgVo.setInitiator(initiatorLark);
feishuMsgVo.setDueDate(taskAffirmDueDate);
//飞书跳转链接
@@ -155,13 +155,13 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
feishuMsgVo.setContent("Hello! " + currentUser.getUsername() + " has replied to your engineering deliverable information. Please check and address it in a timely manner.");
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket());
feishuMsgVo.setInitiator(currentUser.getUsername());
MessageTypeEnum messageTypeEnum = null;
//消息内容
String msgContentEN = "";
String msgTitle = "";
String initiatorId = "";
String flowType = projectTaskInventoryFeedbackEO.getFlowType();
if(StringUtils.equals(flowType,FlowTypeEnum.SJFHXSHLC.getValue())){
@@ -173,6 +173,7 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
feishuMsgVo.setTaskType("Design Compliance Confirmation");
feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getDesignDueDate()));
initiatorId = projectLawsInventoryEO.getDesignInitiatorId();
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
}else if(StringUtils.equals(flowType,FlowTypeEnum.PREHOMOQRLC.getValue())){
@@ -184,6 +185,7 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
feishuMsgVo.setTaskType("Pre-Homo Confirmation");
feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getPrehomoDueDate()));
initiatorId = projectLawsInventoryEO.getPrehomoInitiatorId();
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
}else if(StringUtils.equals(flowType,FlowTypeEnum.YZFHXSCLC.getValue())){
@@ -195,6 +197,7 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
feishuMsgVo.setTaskType("Validation Compliance Confirmation");
feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getVerifyDueDate()));
initiatorId = projectLawsInventoryEO.getVerifyInitiatorId();
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
}
@@ -218,6 +221,14 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
sendMessageMap.put("hrefFeishu",hrefFeishu);
sendMessageMap.put("contentInfo",contentInfo);
String initiator = "";
if(StringUtils.isNotEmpty(initiatorId)){
QueryWrapper<SysUser> queryOneWrapper = new QueryWrapper<>();
queryOneWrapper.lambda().eq(SysUser::getId,initiatorId);
SysUser sysUser = this.sysUserService.getBaseMapper().selectOne(queryOneWrapper);
initiator = sysUser.getUsername();
}
feishuMsgVo.setInitiator(initiator);
//发送消息
SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryBaseInfo.getId(),sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
}
@@ -351,13 +362,30 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
projectYearInfoEOQueryWrapper.lambda().eq(ProjectYearNameInfoEO::getId,projectLibraryBaseInfo.getYearNameId());
ProjectYearNameInfoEO projectYearNameInfoEO = this.projectYearNameInfoEOService.getOne(projectYearInfoEOQueryWrapper);
String initiatorId = "";
if (StringUtils.equals(projectTaskInventoryFeedbackEO.getFlowType(), FlowTypeEnum.SJFHXSHLC.getValue())) {
initiatorId = projectLawsInventoryEO.getDesignInitiatorId();
}else if(StringUtils.equals(projectTaskInventoryFeedbackEO.getFlowType(), FlowTypeEnum.PREHOMOQRLC.getValue())){
initiatorId = projectLawsInventoryEO.getPrehomoInitiatorId();
}else if(StringUtils.equals(projectTaskInventoryFeedbackEO.getFlowType(), FlowTypeEnum.YZFHXSCLC.getValue())){
initiatorId = projectLawsInventoryEO.getVerifyInitiatorId();
}
// 飞书消息封装
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
feishuMsgVo.setContent("Hello! " + currentUser.getUsername() + " has submitted the engineering deliverable information. Please check and address it in a timely manner.");
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket());
feishuMsgVo.setInitiator(currentUser.getUsername());
String initiator = "";
if (StringUtils.isNotEmpty(initiatorId)) {
QueryWrapper<SysUser> queryOneWrapper = new QueryWrapper<>();
queryOneWrapper.lambda().eq(SysUser::getId,initiatorId);
SysUser sysUser = this.sysUserService.getBaseMapper().selectOne(queryOneWrapper);
initiator = sysUser.getUsername();
}
feishuMsgVo.setInitiator(initiator);
MessageTypeEnum messageTypeEnum = null;