|
|
@ -1025,18 +1025,21 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp |
|
|
|
//因需要保证议题表中的转项目时间与创建项目时间一致 因此先新增项目数据再更新议题数据
|
|
|
|
|
|
|
|
//2:调用resi-group查询话题创建人数据(目前议题来源只有来自话题),为了到项目服务初始数据以及发送消息使用
|
|
|
|
Result<ResiTopicDTO> resultTopicDTO = resiGroupFeignClient.getTopicById(entity.getSourceId()); |
|
|
|
if (!resultTopicDTO.success() || null == resultTopicDTO.getData()) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),IssueConstant.SELECT_TOPIC_EXCEPTION,IssueConstant.SELECT_TOPIC_EXCEPTION); |
|
|
|
if("resi_topic".equals(entity.getSourceType())){ |
|
|
|
Result<ResiTopicDTO> resultTopicDTO = resiGroupFeignClient.getTopicById(entity.getSourceId()); |
|
|
|
if (!resultTopicDTO.success() || null == resultTopicDTO.getData()) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),IssueConstant.SELECT_TOPIC_EXCEPTION,IssueConstant.SELECT_TOPIC_EXCEPTION); |
|
|
|
} |
|
|
|
ResiTopicDTO topicDTO = resultTopicDTO.getData(); |
|
|
|
formDTO.setTopicDTO(topicDTO); |
|
|
|
} |
|
|
|
ResiTopicDTO topicDTO = resultTopicDTO.getData(); |
|
|
|
formDTO.setTopicDTO(topicDTO); |
|
|
|
|
|
|
|
//3:调用gov-project服务,新增项目各业务表初始数据
|
|
|
|
formDTO.setCategoryList(categoryList); |
|
|
|
formDTO.setGridId(entity.getGridId()); |
|
|
|
List<IssueTagsDTO> tagList = issueTagsService.getTagsByIssue(formDTO.getIssueId()); |
|
|
|
formDTO.setTagList(tagList); |
|
|
|
// 议题转项目!!!!!!!!!!!!在这步
|
|
|
|
Result<IssueProjectResultDTO> resultDTO = govProjectFeignClient.issueShiftProject(formDTO); |
|
|
|
if (!resultDTO.success() || null == resultDTO.getData()) { |
|
|
|
logger.error(resultDTO.getInternalMsg()); |
|
|
@ -1124,32 +1127,50 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp |
|
|
|
|
|
|
|
List<UserMessageFormDTO> msgList = new ArrayList<>(); |
|
|
|
//1:创建话题发起人、议题发表人消息对象
|
|
|
|
UserMessageFormDTO msgDTO = new UserMessageFormDTO(); |
|
|
|
msgDTO.setCustomerId(entity.getCustomerId()); |
|
|
|
msgDTO.setGridId(entity.getGridId()); |
|
|
|
msgDTO.setApp(AppClientConstant.APP_RESI); |
|
|
|
msgDTO.setTitle(UserMessageConstant.ISSUE_TITLE); |
|
|
|
String topicIssueMessage = String.format(UserMessageConstant.ISSUE_SHIFT_PROJECT_MSG, formDTO.getTopicDTO().getTopicContent(), issueProjectResultDTO.getOrgName()); |
|
|
|
msgDTO.setMessageContent(topicIssueMessage); |
|
|
|
msgDTO.setReadFlag(ReadFlagConstant.UN_READ); |
|
|
|
msgDTO.setUserId(formDTO.getTopicDTO().getCreatedBy()); |
|
|
|
if ("resi_topic".equals(entity.getSourceType()) && null != formDTO.getTopicDTO()) { |
|
|
|
UserMessageFormDTO msgDTO = new UserMessageFormDTO(); |
|
|
|
msgDTO.setCustomerId(entity.getCustomerId()); |
|
|
|
msgDTO.setGridId(entity.getGridId()); |
|
|
|
msgDTO.setApp(AppClientConstant.APP_RESI); |
|
|
|
msgDTO.setTitle(UserMessageConstant.ISSUE_TITLE); |
|
|
|
String topicIssueMessage = String.format(UserMessageConstant.ISSUE_SHIFT_PROJECT_MSG, formDTO.getTopicDTO().getTopicContent(), issueProjectResultDTO.getOrgName()); |
|
|
|
msgDTO.setMessageContent(topicIssueMessage); |
|
|
|
msgDTO.setReadFlag(ReadFlagConstant.UN_READ); |
|
|
|
msgDTO.setUserId(formDTO.getTopicDTO().getCreatedBy()); |
|
|
|
|
|
|
|
//21.09.10:记录消息类型和对应的业务id
|
|
|
|
msgDTO.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT); |
|
|
|
msgDTO.setTargetId(entity.getId()); |
|
|
|
//21.09.10:记录消息类型和对应的业务id
|
|
|
|
msgDTO.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT); |
|
|
|
msgDTO.setTargetId(entity.getId()); |
|
|
|
|
|
|
|
msgList.add(msgDTO); |
|
|
|
//话题人和议题人是同一个人时则只发送一条居民消息
|
|
|
|
if (!formDTO.getTopicDTO().getCreatedBy().equals(entity.getCreatedBy())) { |
|
|
|
UserMessageFormDTO msgIssue = ConvertUtils.sourceToTarget(msgDTO, UserMessageFormDTO.class); |
|
|
|
msgIssue.setUserId(entity.getCreatedBy()); |
|
|
|
msgList.add(msgDTO); |
|
|
|
|
|
|
|
//21.09.10:记录消息类型和对应的业务id
|
|
|
|
msgIssue.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT); |
|
|
|
msgIssue.setTargetId(entity.getId()); |
|
|
|
//话题人和议题人是同一个人时则只发送一条居民消息
|
|
|
|
if (!formDTO.getTopicDTO().getCreatedBy().equals(entity.getCreatedBy())) { |
|
|
|
UserMessageFormDTO msgIssue = ConvertUtils.sourceToTarget(msgDTO, UserMessageFormDTO.class); |
|
|
|
msgIssue.setUserId(entity.getCreatedBy()); |
|
|
|
|
|
|
|
msgList.add(msgIssue); |
|
|
|
//21.09.10:记录消息类型和对应的业务id
|
|
|
|
msgIssue.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT); |
|
|
|
msgIssue.setTargetId(entity.getId()); |
|
|
|
|
|
|
|
msgList.add(msgIssue); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
//居民端发布的议题,只给议题发布人发送消息
|
|
|
|
UserMessageFormDTO msgDTO = new UserMessageFormDTO(); |
|
|
|
msgDTO.setCustomerId(entity.getCustomerId()); |
|
|
|
msgDTO.setGridId(entity.getGridId()); |
|
|
|
msgDTO.setApp(AppClientConstant.APP_RESI); |
|
|
|
msgDTO.setTitle(UserMessageConstant.ISSUE_TITLE); |
|
|
|
String issueMessage = String.format(UserMessageConstant.PUB_ISSUE_SHIFT_PROJECT_MSG, entity.getIssueTitle(), issueProjectResultDTO.getOrgName()); |
|
|
|
msgDTO.setMessageContent(issueMessage); |
|
|
|
msgDTO.setReadFlag(ReadFlagConstant.UN_READ); |
|
|
|
msgDTO.setUserId(entity.getCreatedBy()); |
|
|
|
msgDTO.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT); |
|
|
|
msgDTO.setTargetId(entity.getId()); |
|
|
|
msgList.add(msgDTO); |
|
|
|
} |
|
|
|
|
|
|
|
//2:创建项目工作人员消息对象
|
|
|
|
String projectStaffMessage = String.format(UserMessageConstant.PROJECT_RESOLVED_MSG, entity.getIssueTitle()); |
|
|
|
//所选人员如果即在部门下又在网格下则只发一条消息
|
|
|
@ -1181,20 +1202,34 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp |
|
|
|
*/ |
|
|
|
private Result wxmpShiftProjectMessage(IssueProjectResultDTO issueProjectResultDTO, ShiftProjectFormDTO formDTO, IssueEntity entity) { |
|
|
|
List<WxSubscribeMessageFormDTO> msgList = new ArrayList<>(); |
|
|
|
//1:创建话题发起人、议题发表人消息对象
|
|
|
|
WxSubscribeMessageFormDTO msgDTO = new WxSubscribeMessageFormDTO(); |
|
|
|
msgDTO.setCustomerId(entity.getCustomerId()); |
|
|
|
msgDTO.setClientType(AppClientConstant.APP_RESI); |
|
|
|
msgDTO.setUserId(formDTO.getTopicDTO().getCreatedBy()); |
|
|
|
msgDTO.setBehaviorType(UserMessageConstant.WXMP_ISSUE_TITLE); |
|
|
|
String topicIssueMessage = String.format(UserMessageConstant.ISSUE_SHIFT_PROJECT_MSG, formDTO.getTopicDTO().getTopicContent(), issueProjectResultDTO.getOrgName()); |
|
|
|
msgDTO.setMessageContent(topicIssueMessage); |
|
|
|
msgDTO.setMessageTime(new Date()); |
|
|
|
msgDTO.setGridId(entity.getGridId()); |
|
|
|
msgList.add(msgDTO); |
|
|
|
//话题人和议题人是同一个人时则只发送一条居民消息
|
|
|
|
if (!formDTO.getTopicDTO().getCreatedBy().equals(entity.getCreatedBy())) { |
|
|
|
WxSubscribeMessageFormDTO msgIssue = ConvertUtils.sourceToTarget(msgDTO, WxSubscribeMessageFormDTO.class); |
|
|
|
if ("resi_topic".equals(entity.getSourceType()) && null != formDTO.getTopicDTO()) { |
|
|
|
//1:创建话题发起人、议题发表人消息对象
|
|
|
|
WxSubscribeMessageFormDTO msgDTO = new WxSubscribeMessageFormDTO(); |
|
|
|
msgDTO.setCustomerId(entity.getCustomerId()); |
|
|
|
msgDTO.setClientType(AppClientConstant.APP_RESI); |
|
|
|
msgDTO.setUserId(formDTO.getTopicDTO().getCreatedBy()); |
|
|
|
msgDTO.setBehaviorType(UserMessageConstant.WXMP_ISSUE_TITLE); |
|
|
|
String topicIssueMessage = String.format(UserMessageConstant.ISSUE_SHIFT_PROJECT_MSG, formDTO.getTopicDTO().getTopicContent(), issueProjectResultDTO.getOrgName()); |
|
|
|
msgDTO.setMessageContent(topicIssueMessage); |
|
|
|
msgDTO.setMessageTime(new Date()); |
|
|
|
msgDTO.setGridId(entity.getGridId()); |
|
|
|
msgList.add(msgDTO); |
|
|
|
//话题人和议题人是同一个人时则只发送一条居民消息
|
|
|
|
if (!formDTO.getTopicDTO().getCreatedBy().equals(entity.getCreatedBy())) { |
|
|
|
WxSubscribeMessageFormDTO msgIssue = ConvertUtils.sourceToTarget(msgDTO, WxSubscribeMessageFormDTO.class); |
|
|
|
msgIssue.setUserId(entity.getCreatedBy()); |
|
|
|
msgList.add(msgIssue); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
//只给议题发布人发送微信消息
|
|
|
|
WxSubscribeMessageFormDTO msgIssue = new WxSubscribeMessageFormDTO(); |
|
|
|
msgIssue.setCustomerId(entity.getCustomerId()); |
|
|
|
msgIssue.setClientType(AppClientConstant.APP_RESI); |
|
|
|
msgIssue.setBehaviorType(UserMessageConstant.WXMP_ISSUE_TITLE); |
|
|
|
String topicIssueMessage = String.format(UserMessageConstant.PUB_ISSUE_SHIFT_PROJECT_MSG, entity.getIssueTitle(), issueProjectResultDTO.getOrgName()); |
|
|
|
msgIssue.setMessageContent(topicIssueMessage); |
|
|
|
msgIssue.setMessageTime(new Date()); |
|
|
|
msgIssue.setGridId(entity.getGridId()); |
|
|
|
msgIssue.setUserId(entity.getCreatedBy()); |
|
|
|
msgList.add(msgIssue); |
|
|
|
} |
|
|
|