Browse Source

立项、结案、退回、事件立项,存储targetId,messageType

dev_shibei_match
yinzuomei 4 years ago
parent
commit
fda7232373
  1. 25
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java
  2. 35
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  3. 23
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java

25
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java

@ -91,4 +91,29 @@ public interface UserMessageTypeConstant {
* targetId:project.id
*/
String PROJECT_TRANSFER="project_transfer";
/**
* 项目结案
* targetId:project.id
*/
String PROJECT_CLOSED="project_closed";
/**
* 项目退回
* targetId:project.id
*/
String PROJECT_RETURN="project_return";
/**
* 项目立项
* targetId:project.id
*/
String PROJECT_APPROVAL="project_approval";
/**
* 事件立项
* targetId:project.id
*/
String PROJECT_FROM_RESI_EVENT="project_from_resi_event";
}

35
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

@ -31,10 +31,7 @@ import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.*;
import com.epmet.constant.ParameterKeyConstant;
import com.epmet.constant.ProjectConstant;
import com.epmet.constant.SmsTemplateConstant;
import com.epmet.constant.UserMessageConstant;
import com.epmet.constant.*;
import com.epmet.dao.ProjectDao;
import com.epmet.dao.ProjectOrgRelationDao;
import com.epmet.dao.ProjectSatisfactionStatisticsDao;
@ -513,6 +510,11 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
messageFormDTO.setTitle(UserMessageConstant.PROJECT_TITLE);
messageFormDTO.setMessageContent(String.format(UserMessageConstant.PROJECT_CLOSED_MSG, projectEntity.getTitle(), fromDTO.getPublicReply()));
messageFormDTO.setReadFlag(Constant.UNREAD);
//21.09.10:记录消息类型和对应的业务id
messageFormDTO.setMessageType(UserMessageTypeConstant.PROJECT_CLOSED);
messageFormDTO.setTargetId(fromDTO.getProjectId());
msgList.add(messageFormDTO);
WxSubscribeMessageFormDTO msg = new WxSubscribeMessageFormDTO();
msg.setCustomerId(projectEntity.getCustomerId());
@ -536,6 +538,11 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
messageFormDTO.setTitle(UserMessageConstant.PROJECT_TITLE);
messageFormDTO.setMessageContent(String.format(UserMessageConstant.PROJECT_CLOSED_MSG, projectEntity.getTitle(), fromDTO.getPublicReply()));
messageFormDTO.setReadFlag(Constant.UNREAD);
//21.09.10:记录消息类型和对应的业务id
messageFormDTO.setMessageType(UserMessageTypeConstant.PROJECT_CLOSED);
messageFormDTO.setTargetId(fromDTO.getProjectId());
msgList.add(messageFormDTO);
WxSubscribeMessageFormDTO msg = new WxSubscribeMessageFormDTO();
msg.setCustomerId(projectEntity.getCustomerId());
@ -694,6 +701,11 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
messageFormDTO.setTitle(UserMessageConstant.PROJECT_TITLE);
messageFormDTO.setMessageContent(String.format(UserMessageConstant.PROJECT_CLOSED_MSG, projectEntity.getTitle(), fromDTO.getPublicReply()));
messageFormDTO.setReadFlag(Constant.UNREAD);
//21.09.10:记录消息类型和对应的业务id
messageFormDTO.setMessageType(UserMessageTypeConstant.PROJECT_CLOSED);
messageFormDTO.setTargetId(fromDTO.getProjectId());
msgList.add(messageFormDTO);
WxSubscribeMessageFormDTO msg = new WxSubscribeMessageFormDTO();
msg.setCustomerId(projectEntity.getCustomerId());
@ -717,6 +729,11 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
messageFormDTO.setTitle(UserMessageConstant.PROJECT_TITLE);
messageFormDTO.setMessageContent(String.format(UserMessageConstant.PROJECT_CLOSED_MSG, projectEntity.getTitle(), fromDTO.getPublicReply()));
messageFormDTO.setReadFlag(Constant.UNREAD);
//21.09.10:记录消息类型和对应的业务id
messageFormDTO.setMessageType(UserMessageTypeConstant.PROJECT_CLOSED);
messageFormDTO.setTargetId(fromDTO.getProjectId());
msgList.add(messageFormDTO);
WxSubscribeMessageFormDTO msg = new WxSubscribeMessageFormDTO();
msg.setCustomerId(projectEntity.getCustomerId());
@ -881,6 +898,11 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
messageFormDTO.setTitle(UserMessageConstant.PROJECT_TITLE);
messageFormDTO.setMessageContent(String.format(UserMessageConstant.PROJECT_RESOLVED_MSG, projectEntity.getTitle()));
messageFormDTO.setReadFlag(Constant.UNREAD);
//21.09.10:记录消息类型和对应的业务id
messageFormDTO.setMessageType(UserMessageTypeConstant.PROJECT_RETURN);
messageFormDTO.setTargetId(fromDTO.getProjectId());
msgList.add(messageFormDTO);
messageFeignClient.saveUserMessageList(msgList);
//2020.10.26 添加项目退回给勾选人推送微信订阅消息 sun
@ -2056,6 +2078,11 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
messageFormDTO.setTitle(UserMessageConstant.PROJECT_TITLE);
messageFormDTO.setMessageContent(String.format(UserMessageConstant.PROJECT_RESOLVED_MSG, projectEntity.getTitle()));
messageFormDTO.setReadFlag(Constant.UNREAD);
//21.09.10:记录消息类型和对应的业务id
messageFormDTO.setMessageType(UserMessageTypeConstant.PROJECT_RETURN);
messageFormDTO.setTargetId(fromDTO.getProjectId());
msgList.add(messageFormDTO);
messageFeignClient.saveUserMessageList(msgList);
//2020.10.26 添加项目退回给勾选人推送微信订阅消息 sun

23
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java

@ -15,10 +15,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.IpUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.ProjectConstant;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.SmsTemplateConstant;
import com.epmet.constant.UserMessageConstant;
import com.epmet.constant.*;
import com.epmet.dao.ProjectOrgRelationDao;
import com.epmet.dao.ProjectProcessAttachmentDao;
import com.epmet.dao.ProjectProcessDao;
@ -488,7 +485,7 @@ public class ProjectTraceServiceImpl<ProjectTagService> implements ProjectTraceS
//4.推送站内信、微信、短信消息
//4-1.调用epmet-message服务,给工作端勾选的工作人员发送消息
if (!shiftProjectMessage(formDTO).success()) {
if (!shiftProjectMessage(formDTO,projectEntity.getId()).success()) {
throw new RenException("项目立项,推送站内信失败");
}
@ -565,7 +562,7 @@ public class ProjectTraceServiceImpl<ProjectTagService> implements ProjectTraceS
* @Description 项目立项给勾选的工作人员推送站内信消息
* @author sun
*/
private Result shiftProjectMessage(ProjectApprovalFormDTO formDTO) {
private Result shiftProjectMessage(ProjectApprovalFormDTO formDTO,String projectId) {
List<UserMessageFormDTO> msgList = new ArrayList<>();
//1.创建项目工作人员消息对象
String projectStaffMessage = String.format(UserMessageConstant.PROJECT_RESOLVED_MSG, formDTO.getTitle());
@ -581,6 +578,11 @@ public class ProjectTraceServiceImpl<ProjectTagService> implements ProjectTraceS
msg.setMessageContent(projectStaffMessage);
msg.setReadFlag(ReadFlagConstant.UN_READ);
msg.setUserId(staff.getStaffId());
//21.09.10:记录消息类型和对应的业务id
msg.setMessageType(UserMessageTypeConstant.PROJECT_APPROVAL);
msg.setTargetId(projectId);
msgList.add(msg);
map.put(staff.getStaffId(),staff.getStaffId());
}
@ -789,7 +791,7 @@ public class ProjectTraceServiceImpl<ProjectTagService> implements ProjectTraceS
//4.推送站内信、微信、短信消息
//4-1.调用epmet-message服务,给工作端勾选的工作人员发送消息
if (!shiftProjectMessage(formDTO.getStaffList(),formDTO.getCustomerId(),formDTO.getTitle()).success()) {
if (!shiftProjectMessage(formDTO.getStaffList(),formDTO.getCustomerId(),formDTO.getTitle(),projectEntity.getId()).success()) {
throw new RenException("事件转为项目,推送站内信失败");
}
@ -919,7 +921,7 @@ public class ProjectTraceServiceImpl<ProjectTagService> implements ProjectTraceS
* @Description 项目立项给勾选的工作人员推送站内信消息
* @author yinzuomei
*/
private Result shiftProjectMessage(List<TickStaffFormDTO> staffList,String customerId,String title) {
private Result shiftProjectMessage(List<TickStaffFormDTO> staffList,String customerId,String title,String projectId) {
List<UserMessageFormDTO> msgList = new ArrayList<>();
//1.创建项目工作人员消息对象
String projectStaffMessage = String.format(UserMessageConstant.PROJECT_RESOLVED_MSG, title);
@ -935,6 +937,11 @@ public class ProjectTraceServiceImpl<ProjectTagService> implements ProjectTraceS
msg.setMessageContent(projectStaffMessage);
msg.setReadFlag(ReadFlagConstant.UN_READ);
msg.setUserId(staff.getStaffId());
//21.09.10:记录消息类型和对应的业务id
msg.setTargetId(projectId);
msg.setMessageType(UserMessageTypeConstant.PROJECT_FROM_RESI_EVENT);
msgList.add(msg);
map.put(staff.getStaffId(),staff.getStaffId());
}

Loading…
Cancel
Save