任务确认流程-发送消息- 模板需修改(暂时没有正确模板)
This commit is contained in:
+46
@@ -0,0 +1,46 @@
|
||||
package com.jero.modules.project.enums;
|
||||
|
||||
/**
|
||||
* 消息类型枚举类
|
||||
*/
|
||||
public enum MsgTypeEnum {
|
||||
TASK_AFFIRM_START_MSG("任务确认发起消息","taskAffirmStartMsg"),
|
||||
TASK_AFFIRM_ISSUE_DRE_MSG("任务确认分配dre消息","taskAffirmIssueDreMsg"),
|
||||
TASK_AFFIRM_DRE_ACCEPTED("任务确认DRE通过消息","taskAffirmDreAccepted"),
|
||||
TASK_AFFIRM_DRE_REJECTED("任务确认DRE退回消息","taskAffirmDreRejected"),
|
||||
;
|
||||
|
||||
String name;
|
||||
String value;
|
||||
|
||||
private MsgTypeEnum(String name, String value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static String getTextByValue(String value) {
|
||||
MsgTypeEnum[] values = values();
|
||||
for (MsgTypeEnum msgTypeEnum : values) {
|
||||
if (msgTypeEnum.value.equals(value)) {
|
||||
return msgTypeEnum.name;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+1
@@ -14,6 +14,7 @@ public enum OperatorTypeEnum {
|
||||
UPDATE_STATUS("修改状态","updateStatus"),
|
||||
DELETE("删除","delete"),
|
||||
QUERY("查询","query"),
|
||||
SEND_MSG("发送消息","sendMessage"),
|
||||
|
||||
|
||||
TASK_AFFIRM_QUERY("任务确认流程,查询法规清单信息","taskAffirmQuery"),
|
||||
|
||||
+3
-2
@@ -118,9 +118,10 @@ public class InventoryAffirmJob implements Job {
|
||||
threeDaysUserIdList = threeDaysUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
|
||||
/*String msgContentCN = "您" + projectLibraryBase.getProjectName() + "(项目名称)法规清单的任务确认剩余处理时间还有3天,请及时查看处理";*/
|
||||
String msgContentEN = "The remaining processing time for the regulation task confirmationof GB 7258 in"
|
||||
// XXX .
|
||||
String msgContentEN = "The remaining processing time for the regulation list confirmation of"
|
||||
+ projectNameInfoEO.getProjectName()
|
||||
+ "(project name) is 3 days. Please check andhandle it in time.";
|
||||
+ "(project name) is 3 days. Please check and handle it in time.";
|
||||
//发送消息
|
||||
projectLawsInventoryEOService.sendMessage(msgContentEN,threeDaysUserIdList,projectLibraryBase.getId());
|
||||
}
|
||||
|
||||
+60
-1
@@ -668,7 +668,8 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
/**
|
||||
* 发送消息
|
||||
* @param msgContent
|
||||
* @param projectLawsInventoryEO
|
||||
* @param userIdList
|
||||
* @param projectLibraryId
|
||||
*/
|
||||
@Override
|
||||
public void sendMessage(String msgContent, List<String> userIdList,String projectLibraryId){
|
||||
@@ -923,6 +924,9 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
if(StringUtils.equals(operatorType,OperatorTypeEnum.QUERY.getValue())){
|
||||
|
||||
}
|
||||
if(StringUtils.equals(operatorType,OperatorTypeEnum.SEND_MSG.getValue())){
|
||||
workFlowSendMsg(jsonObject);
|
||||
}
|
||||
|
||||
return new Result<>().success("调用成功!");
|
||||
}
|
||||
@@ -978,4 +982,59 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 工作流发送消息
|
||||
* @param jsonObject
|
||||
*/
|
||||
public void workFlowSendMsg(JSONObject jsonObject){
|
||||
String msgType = jsonObject.getString("msgType"); //发送消息类型
|
||||
if(StringUtils.isEmpty(msgType)){
|
||||
throw new JeroBootException("发送消息类型不能为空,请检查!");
|
||||
}
|
||||
String id = jsonObject.getString("id"); //法规清单id
|
||||
String currentUserId = jsonObject.getString("currentUserId"); //当前操作用户id
|
||||
String taskAffirmDueDate = jsonObject.getString("taskAffirmDueDate"); //截止日期
|
||||
String projectLibraryId = jsonObject.getString("projectLibraryId"); //项目库id
|
||||
String engineeringInterfacePerson = jsonObject.getString("engineeringInterfacePerson"); //工程接口人id
|
||||
|
||||
ProjectLibraryBase projectLibraryBase = projectLibraryBaseMapper.selectOne(new QueryWrapper<ProjectLibraryBase>()
|
||||
.lambda().eq(ProjectLibraryBase::getId, projectLibraryId));
|
||||
|
||||
QueryWrapper<ProjectNameInfoEO> projectNameInfoEOQueryWrapper = new QueryWrapper<>();
|
||||
projectNameInfoEOQueryWrapper.lambda().eq(ProjectNameInfoEO::getId,projectLibraryBase.getProjectNameId());
|
||||
ProjectNameInfoEO projectNameInfoEO = projectNameInfoEOMapper.selectOne(projectNameInfoEOQueryWrapper);
|
||||
|
||||
SysUser sysUser = sysUserMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, currentUserId));
|
||||
|
||||
String msgContentEN = "";
|
||||
List<String> userIdList = new ArrayList<>();
|
||||
|
||||
if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_START_MSG.getValue())) {
|
||||
userIdList.add(engineeringInterfacePerson);
|
||||
msgContentEN = sysUser.getUsername() + " initiated the regulation list confirmation of " + projectNameInfoEO.getProjectName()
|
||||
+ " (project name).The due date is:" +taskAffirmDueDate+ ". Please check and deal with it in time.";
|
||||
} else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_ISSUE_DRE_MSG.getValue())) {
|
||||
String dreUserId = jsonObject.getString("dreUserId"); //dre用户id
|
||||
userIdList.add(dreUserId);
|
||||
//暂时没有英文消息模板。
|
||||
msgContentEN = sysUser.getUsername() + " 将 " + projectNameInfoEO.getProjectName()
|
||||
+ " (project name).的任务确认流程分发您,截止日期为:" +taskAffirmDueDate+ ". Please check and deal with it in time.";
|
||||
} else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_DRE_REJECTED.getValue())) {
|
||||
userIdList.add(engineeringInterfacePerson);
|
||||
//暂时没有英文消息模板。
|
||||
msgContentEN = sysUser.getUsername() + " 将 " + projectNameInfoEO.getProjectName()
|
||||
+ " (project name).的任务确认流程退回,截止日期为:" +taskAffirmDueDate+ ". Please check and deal with it in time.";
|
||||
} else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_DRE_ACCEPTED.getValue())) {
|
||||
userIdList.add(engineeringInterfacePerson);
|
||||
//暂时没有英文消息模板。
|
||||
msgContentEN = sysUser.getUsername() + " 将 " + projectNameInfoEO.getProjectName()
|
||||
+ " (project name).的任务确认流程通过,截止日期为:" +taskAffirmDueDate+ ". Please check and deal with it in time.";
|
||||
}
|
||||
|
||||
if(CollectionUtils.isNotEmpty(userIdList) && StringUtils.isNotEmpty(msgContentEN)){
|
||||
//发送消息
|
||||
sendMessage(msgContentEN,userIdList,id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user