消息修改,添加日志,权限
This commit is contained in:
@@ -10,4 +10,12 @@ public class RoleCommon {
|
||||
* 财务人员
|
||||
*/
|
||||
public final static String CWRY = "cwry";
|
||||
/**
|
||||
* 合同负责人
|
||||
*/
|
||||
public final static String HTFZR = "htfzr";
|
||||
/**
|
||||
* 企业信息维护人员
|
||||
*/
|
||||
public final static String QYXXWHRY = "qyxxwhry";
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 发送短信,消息,邮件
|
||||
@@ -44,4 +45,8 @@ public class SendMessageDTO implements Serializable {
|
||||
* 模板参数
|
||||
*/
|
||||
private HashMap<String, String> templateParam;
|
||||
/**
|
||||
* 文件名集合(邮箱发送附件)
|
||||
*/
|
||||
private List<String> listFile;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.jero.common.enums;
|
||||
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
|
||||
public enum MessageUrlEnums {
|
||||
|
||||
// 管理端
|
||||
M_OPEN_TYPE1("M_OPEN_TYPE1","component","/ProjectDetailModal"),
|
||||
M_OPEN_TYPE2("M_OPEN_TYPE2","url","/contractManagement/RevenueContractDetail"),
|
||||
M_OPEN_TYPE3("M_OPEN_TYPE3","url","/contractManagement/RevenueContractDetail"),
|
||||
M_OPEN_TYPE4("M_OPEN_TYPE4","url","/contractManagement/RevenueContractDetail"),
|
||||
M_OPEN_TYPE5("M_OPEN_TYPE5","component","@views/incomePayments/meetManage/modules/AuditModal"),
|
||||
M_OPEN_TYPE6("M_OPEN_TYPE6","component","@comp/ProjectDetailModal"),
|
||||
M_OPEN_TYPE7("M_OPEN_TYPE7","component","@comp/ProjectDetailModal"),
|
||||
M_OPEN_TYPE8("M_OPEN_TYPE8","url","/incomePayments/meetManage/SignUpInfoDetail"),
|
||||
M_OPEN_TYPE9("M_OPEN_TYPE9","url","/businessManagement/BusinessManagement"),
|
||||
// todo 待定企业端
|
||||
C_OPEN_TYPE1("C_OPEN_TYPE1","url",""),
|
||||
C_OPEN_TYPE2("C_OPEN_TYPE2","component",""),
|
||||
C_OPEN_TYPE3("C_OPEN_TYPE3","component",""),
|
||||
C_OPEN_TYPE4("C_OPEN_TYPE4","component",""),
|
||||
C_OPEN_TYPE5("C_OPEN_TYPE5","component",""),
|
||||
C_OPEN_TYPE6("C_OPEN_TYPE6","component",""),
|
||||
C_OPEN_TYPE7("C_OPEN_TYPE7","component",""),
|
||||
C_OPEN_TYPE8("C_OPEN_TYPE8","none",""),
|
||||
C_OPEN_TYPE9("C_OPEN_TYPE9","",""),
|
||||
C_OPEN_TYPE10("C_OPEN_TYPE10","",""),
|
||||
C_OPEN_TYPE11("C_OPEN_TYPE11","component",""),
|
||||
C_OPEN_TYPE12("C_OPEN_TYPE12","component","");
|
||||
|
||||
/**
|
||||
* 业务类型(email:邮件 bpm:流程)
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 打开方式 组件:component 路由:url
|
||||
*/
|
||||
private String openType;
|
||||
/**
|
||||
* 组件/路由 地址
|
||||
*/
|
||||
private String openPage;
|
||||
|
||||
MessageUrlEnums(String type, String openType, String openPage) {
|
||||
this.type = type;
|
||||
this.openType = openType;
|
||||
this.openPage = openPage;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getOpenType() {
|
||||
return openType;
|
||||
}
|
||||
|
||||
public void setOpenType(String openType) {
|
||||
this.openType = openType;
|
||||
}
|
||||
|
||||
public String getOpenPage() {
|
||||
return openPage;
|
||||
}
|
||||
|
||||
public void setOpenPage(String openPage) {
|
||||
this.openPage = openPage;
|
||||
}
|
||||
|
||||
public static MessageUrlEnums getByType(String type) {
|
||||
if (oConvertUtils.isEmpty(type)) {
|
||||
return null;
|
||||
}
|
||||
for (MessageUrlEnums val : values()) {
|
||||
if (val.getType().equals(type)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -6,8 +6,9 @@ public interface ContractCreateProjectSendMessageService {
|
||||
* @Author lqt
|
||||
* @Date 2021/9/24
|
||||
* @Param projectName 项目名称
|
||||
* @Param projectId 项目id
|
||||
* @Return
|
||||
* @Exception
|
||||
*/
|
||||
void ContractCreateProjectSendMessageService(String projectName);
|
||||
void ContractCreateProjectSendMessageService(String projectName,String projectId);
|
||||
}
|
||||
|
||||
+3
-3
@@ -30,7 +30,7 @@ public class ContractCreateProjectSendMessageServiceImpl implements ContractCrea
|
||||
private SendMessageService sendMessageService;
|
||||
|
||||
@Override
|
||||
public void ContractCreateProjectSendMessageService(String projectName) {
|
||||
public void ContractCreateProjectSendMessageService(String projectName,String projectId) {
|
||||
// 获取项目负责人,发送消息
|
||||
List<SysUser> list = sysUserService.getRolesUser(Arrays.asList(RoleCommon.XMFZR));
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
@@ -43,13 +43,13 @@ public class ContractCreateProjectSendMessageServiceImpl implements ContractCrea
|
||||
}
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("projectName",projectName);
|
||||
sendMessageDTO.setFromUser(sysUser.getId());
|
||||
sendMessageDTO.setFromUser(sysUser.getUsername());
|
||||
sendMessageDTO.setToUser(p.getUsername());
|
||||
sendMessageDTO.setTemplateCode(ManagementMessageEnums.MSG1.getCode());
|
||||
sendMessageDTO.setTemplateParam(map);
|
||||
sendMessageDTO.setBusType("M_OPEN_TYPE1");
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("id",p.getId());
|
||||
json.put("id",projectId);
|
||||
sendMessageDTO.setBusId(json.toJSONString());
|
||||
sendMessageService.SendMessageService(sendMessageDTO);
|
||||
});
|
||||
|
||||
+9
-3
@@ -5,6 +5,7 @@ import com.jero.common.common.ProjectCommon;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.constant.WebsocketConst;
|
||||
import com.jero.common.dto.SendMessageDTO;
|
||||
import com.jero.common.enums.MessageUrlEnums;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.service.SendMessageService;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
@@ -86,7 +87,12 @@ public class SendMessageServiceImpl implements SendMessageService {
|
||||
if(templateType.contains(ProjectCommon.MESSAGE_TYPE2) && !StringUtils.isEmpty(sendMessageDTO.getEmail())){
|
||||
try {
|
||||
EmailSendMsgHandle emailHandle = new EmailSendMsgHandle();
|
||||
emailHandle.SendMsg(sendMessageDTO.getEmail(), title, content);
|
||||
// 发送带附件邮箱
|
||||
if(!CollectionUtils.isEmpty(sendMessageDTO.getListFile())){
|
||||
emailHandle.SendMsgAndFile(sendMessageDTO.getEmail(), title, content,sendMessageDTO.getListFile());
|
||||
}else{
|
||||
emailHandle.SendMsg(sendMessageDTO.getEmail(), title, content);
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error("发送邮件异常",e);
|
||||
}
|
||||
@@ -112,8 +118,8 @@ public class SendMessageServiceImpl implements SendMessageService {
|
||||
announcement.setBusId(busId);
|
||||
announcement.setBusType(busType);
|
||||
if(!StringUtils.isEmpty(busType)){
|
||||
announcement.setOpenType(SysAnnmentTypeEnum.getByType(busType).getOpenType());
|
||||
announcement.setOpenPage(SysAnnmentTypeEnum.getByType(busType).getOpenPage());
|
||||
announcement.setOpenType(MessageUrlEnums.getByType(busType).getOpenType());
|
||||
announcement.setOpenPage(MessageUrlEnums.getByType(busType).getOpenPage());
|
||||
}
|
||||
announcement.setTemplateCode(sendMessageDTO.getTemplateCode());
|
||||
sysAnnouncementService.save(announcement);
|
||||
|
||||
Reference in New Issue
Block a user