Browse Source

Merge remote-tracking branch 'origin/dev_group_msg' into develop

master
yinzuomei 4 years ago
parent
commit
67f6afe869
  1. 51
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java
  2. 8
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/UserMessageDTO.java
  3. 11
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/UserMessageFormDTO.java
  4. 25
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
  5. 6
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java
  6. 19
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java
  7. 5
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedSubmitFormDTO.java
  8. 15
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java
  9. 17
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java

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

@ -16,8 +16,59 @@ public interface UserMessageTypeConstant {
/**
* 居民端提交热心居民申请通知网格长
* targetId:resi_warmhearted_apply.id
*/
String WARMHEARTED_APPLY="warmhearted_apply";
/**
* 工作端审核完热心居民申请通知居民结果
* targetId:resi_warmhearted_apply.id
*/
String WARMHEARTED_APPLY_RES="warmhearted_apply_res";
/**
* 居民端认证党员时补充信息填写完成提交后通知网格长人工审核党员申请
* targetId:partymember_info.id
*/
String PARTY_CERTIFY_APPLY="party_certify_apply";
/**
* 工作端审核居民是否是党员通知居民
* targetId:partymember_info.id
*/
String PARTY_CERTIFY_APPLY_RES="party_certify_apply_res";
/**
* 居民端用户申请创建小组提交小组信息后通知网格长
* targetId:resi_group.id
*/
String GROUP_CREATE_GROUP_APPLY="group_create_group_apply";
/**
* 工作端审核建群申请后通知建组人结果
* targetId:resi_group.id
*/
String GROUP_CREATE_GROUP_RES="group_create_group_res";
/**
* 居民单申请入群通知组长审核
* targetId:resi_group.id
*/
String GROUP_APPLY_ENTER="group_apply_enter";
/**
* 组长审核完入群申请通知居民结果
* targetId:resi_group.id
*/
String GROUP_APPLY_ENTER_RES="group_apply_enter_res";
/**
* 组员通过连接自动入组的通知组长
* targetId:resi_group.id
*/
String GROUP_ENTER_GROUP_BY_LINK_RES="group_enter_group_by_link_res";

8
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/UserMessageDTO.java

@ -109,4 +109,12 @@ public class UserMessageDTO implements Serializable {
*/
private Date updatedTime;
/**
* 消息分类:info-上传下达消息 详见UserMessageTypeConstant
*/
private String messageType;
/**
* 消息对应的业务id,比如message_type=info时此列存储的是消息id,可跳转到消息详情
*/
private String targetId;
}

11
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/UserMessageFormDTO.java

@ -1,8 +1,6 @@
package com.epmet.dto.form;
import lombok.Builder;
import lombok.Data;
import net.bytebuddy.implementation.bind.annotation.Default;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
@ -61,4 +59,13 @@ public class UserMessageFormDTO implements Serializable {
* 调用者 分内部调用和外部调用内部调用值为空外部默认为外挂-站内信
*/
private String referer;
/**
* 消息分类:info-上传下达消息 详见UserMessageTypeConstant
*/
private String messageType;
/**
* 消息对应的业务id,比如message_type=info时此列存储的是消息id,可跳转到消息详情
*/
private String targetId;
}

25
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java

@ -25,6 +25,7 @@ import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.rocketmq.messages.GroupAchievementMQMsg;
import com.epmet.commons.tools.constant.*;
import com.epmet.commons.tools.enums.AchievementTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
@ -40,7 +41,7 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.dto.BizPointTotalDetailDTO;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dto.form.*;
import com.epmet.dto.result.UserInfoResultDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
@ -49,7 +50,6 @@ import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.group.constant.GroupConstant;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.modules.constant.UserMessageConstant;
import com.epmet.commons.tools.enums.AchievementTypeEnum;
import com.epmet.modules.feign.EpmetMessageFeignClient;
import com.epmet.modules.feign.EpmetUserFeignClient;
import com.epmet.modules.feign.GovOrgFeignClient;
@ -85,9 +85,7 @@ import com.epmet.resi.group.dto.member.result.AchievementResultDTO;
import com.epmet.resi.group.dto.member.result.GroupAchievementDTO;
import com.epmet.resi.group.enums.SearchScopeTypeEnum;
import com.epmet.send.SendMqMsgUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import kotlin.jvm.internal.Lambda;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -528,7 +526,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
}
resiGroupStatisticalService.save(resiGroupStatisticalDTO);
//发送消息:创建小组
sendMsgResi2Gov(UserMessageConstant.CREATE_GROUP_APPLYING_MSG_TITLE,msg,applyCreateGroupFormDTO.getGridId(),applyCreateGroupFormDTO.getUserId(),applyCreateGroupFormDTO.getCustomerId());
sendMsgResi2Gov(UserMessageConstant.CREATE_GROUP_APPLYING_MSG_TITLE,msg,applyCreateGroupFormDTO.getGridId(),applyCreateGroupFormDTO.getUserId(),applyCreateGroupFormDTO.getCustomerId(), resiGroupEntity.getId());
}
@ -722,6 +720,11 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
userMessageFormDTO.setGridId(resiGroupDTO.getGridId());
userMessageFormDTO.setCustomerId(resiGroupDTO.getCustomerId());
userMessageFormDTO.setMessageContent(String.format(UserMessageConstant.AGREE_CREATING_GROUP_MSG_TEMPLATE,resiGroupDTO.getGroupName()));
//21.09.10:记录消息类型和对应的业务id
userMessageFormDTO.setMessageType(UserMessageTypeConstant.GROUP_CREATE_GROUP_RES);
userMessageFormDTO.setTargetId(agreeApplyGroupFormDTO.getGroupId());
if(!epmetMessageFeignClient.saveUserMessage(userMessageFormDTO).success()){
logger.warn(String.format(ModuleConstant.FAILED_SEND_MESSAGE,String.format(UserMessageConstant.AGREE_CREATING_GROUP_MSG_TEMPLATE,resiGroupDTO.getGroupName())));
}
@ -786,6 +789,11 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
userMessageFormDTO.setGridId(resiGroupDTO.getGridId());
userMessageFormDTO.setCustomerId(resiGroupDTO.getCustomerId());
userMessageFormDTO.setMessageContent(String.format(UserMessageConstant.DISAGREE_CREATING_GROUP_MSG_TEMPLATE,resiGroupDTO.getGroupName(),disAgreeApplyGroupFormDTO.getRejectReason()));
//21.09.10:记录消息类型和对应的业务id
userMessageFormDTO.setMessageType(UserMessageTypeConstant.GROUP_CREATE_GROUP_RES);
userMessageFormDTO.setTargetId(disAgreeApplyGroupFormDTO.getGroupId());
if(!epmetMessageFeignClient.saveUserMessage(userMessageFormDTO).success()){
logger.warn(String.format(ModuleConstant.FAILED_SEND_MESSAGE,String.format(UserMessageConstant.DISAGREE_CREATING_GROUP_MSG_TEMPLATE,resiGroupDTO.getGroupName(),disAgreeApplyGroupFormDTO.getRejectReason())));
}
@ -1158,7 +1166,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
* @author wangc
* @date 2020.04.29 22:49
**/
private void sendMsgResi2Gov(String title,String msg,String gridId,String userId,String customerId){
private void sendMsgResi2Gov(String title,String msg,String gridId,String userId,String customerId,String groupId){
//1.查询加入当前网格下的人员 customer_staff_grid
CommonGridIdFormDTO commonGridIdFormDTO = new CommonGridIdFormDTO();
commonGridIdFormDTO.setGridId(gridId);
@ -1189,6 +1197,11 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
msgObj.setReadFlag(ReadFlagConstant.UN_READ);
msgObj.setTitle(title);
msgObj.setUserId(to);
//21.09.10:记录消息类型和对应的业务id
msgObj.setMessageType(UserMessageTypeConstant.GROUP_CREATE_GROUP_APPLY);
msgObj.setTargetId(groupId);
msgList.add(msgObj);
//微信订阅
WxSubscribeMessageFormDTO subscribeDTO = new WxSubscribeMessageFormDTO();

6
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java

@ -28,6 +28,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dto.form.*;
import com.epmet.dto.result.UserInfoOnEnterGridResultDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
@ -642,6 +643,11 @@ public class GroupInvitationServiceImpl extends BaseServiceImpl<GroupInvitationD
userMessage.setMessageContent(messageContent);
userMessage.setReadFlag(ReadFlagConstant.UN_READ);
userMessage.setTitle(UserMessageConstant.GROUP_TITLE);
//21.09.10:记录消息类型和对应的业务id
userMessage.setMessageType(UserMessageTypeConstant.GROUP_ENTER_GROUP_BY_LINK_RES);
userMessage.setTargetId(resiGroupDTO.getId());
//通知群主
userMessage.setUserId(groupInvitationDTO.getInviterUserId());
Result result = epmetMessageOpenFeignClient.saveUserMessage(userMessage);

19
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java

@ -25,6 +25,7 @@ import com.epmet.commons.rocketmq.messages.GroupAchievementMQMsg;
import com.epmet.commons.tools.constant.*;
import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO;
import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.enums.AchievementTypeEnum;
import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
@ -33,6 +34,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SendMqMsgUtils;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dto.IssueShareLinkVisitRecordDTO;
import com.epmet.dto.form.CommonGridIdFormDTO;
import com.epmet.dto.form.*;
@ -45,7 +47,6 @@ import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovIssueOpenFeignClient;
import com.epmet.modules.constant.GroupMemberConstant;
import com.epmet.modules.constant.UserMessageConstant;
import com.epmet.commons.tools.enums.AchievementTypeEnum;
import com.epmet.modules.feign.EpmetUserFeignClient;
import com.epmet.modules.feign.GovOrgFeignClient;
import com.epmet.modules.group.dao.ResiGroupDao;
@ -61,7 +62,6 @@ import com.epmet.modules.member.service.ResiGroupMemberService;
import com.epmet.modules.topic.entity.TopicShareLinkVisitRecordEntity;
import com.epmet.modules.topic.service.ResiTopicService;
import com.epmet.modules.topic.service.TopicShareLinkVisitRecordService;
import com.epmet.modules.topic.service.impl.ResiTopicServiceImpl;
import com.epmet.modules.utils.ModuleConstant;
import com.epmet.resi.group.constant.EnterGroupTypeConstant;
import com.epmet.resi.group.constant.LeaderFlagConstant;
@ -315,6 +315,11 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD
userMessage.setTitle(UserMessageConstant.GROUP_TITLE);
//通知群主
userMessage.setUserId(groupLeader.getCustomerUserId());
//21.09.10:记录消息类型和对应的业务id
userMessage.setMessageType(UserMessageTypeConstant.GROUP_APPLY_ENTER);
userMessage.setTargetId(resiGroupDTO.getId());
epmetMessageOpenFeignClient.saveUserMessage(userMessage);
//微信订阅
@ -734,6 +739,11 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD
userMessage.setMessageContent(messageContent);
userMessage.setReadFlag(ReadFlagConstant.UN_READ);
userMessage.setTitle(UserMessageConstant.GROUP_TITLE);
//21.09.10:记录消息类型和对应的业务id
userMessage.setMessageType(UserMessageTypeConstant.GROUP_APPLY_ENTER_RES);
userMessage.setTargetId(resiGroupMemberDTO.getResiGroupId());
//通知群主
userMessage.setUserId(resiGroupMemberDTO.getCustomerUserId());
epmetMessageOpenFeignClient.saveUserMessage(userMessage);
@ -819,6 +829,11 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD
userMessage.setMessageContent(messageContent);
userMessage.setReadFlag(ReadFlagConstant.UN_READ);
userMessage.setTitle(UserMessageConstant.GROUP_TITLE);
//21.09.10:记录消息类型和对应的业务id
userMessage.setMessageType(UserMessageTypeConstant.GROUP_APPLY_ENTER_RES);
userMessage.setTargetId(groupMemeberOperationDTO.getGroupId());
//通知群主
userMessage.setUserId(groupMemeberOperationDTO.getCustomerUserId());
epmetMessageOpenFeignClient.saveUserMessage(userMessage);

5
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedSubmitFormDTO.java

@ -73,4 +73,9 @@ public class ResiWarmheartedSubmitFormDTO implements Serializable {
*/
private String messageText;
/**
* 无需前端传入此列用来数据传值
*/
private String applyId;
}

15
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java

@ -8,10 +8,7 @@ import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.PartyMemberConstant;
import com.epmet.constant.PartyMemberMessageConstant;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.SmsTemplateConstant;
import com.epmet.constant.*;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
@ -651,6 +648,11 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
userMessageFormDTO.setGridId(formDTO.getGridId());
userMessageFormDTO.setApp(AppClientConstant.APP_RESI);
userMessageFormDTO.setTitle(PartyMemberMessageConstant.PARTY_AUTH_TITLE);
//21.09.10:记录消息类型和对应的业务id
userMessageFormDTO.setMessageType(UserMessageTypeConstant.PARTY_CERTIFY_APPLY_RES);
userMessageFormDTO.setTargetId(formDTO.getId());
//调用gov-org服务查询网格信息
CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO();
customerGridFormDTO.setGridId(formDTO.getGridId());
@ -729,7 +731,12 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
msgDTO.setTitle(PartyMemberMessageConstant.PARTY_AUTH_TITLE);
msgDTO.setMessageContent(message);
msgDTO.setReadFlag(ReadFlagConstant.UN_READ);
//21.09.10:记录消息类型和对应的业务id
msgDTO.setMessageType(UserMessageTypeConstant.PARTY_CERTIFY_APPLY);
msgDTO.setTargetId(formDTO.getId());
msgList.add(msgDTO);
//微信订阅
WxSubscribeMessageFormDTO subscribeDTO = new WxSubscribeMessageFormDTO();
subscribeDTO.setClientType(AppClientConstant.APP_GOV);

17
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java

@ -29,6 +29,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.PartyMemberConstant;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.CustomerStaffGridDTO;
import com.epmet.dto.UserRoleDTO;
@ -211,7 +212,8 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl<ResiWarmhea
}
formDTO.setMessageText(messageContent);
//1:将申请记录存入热心居民申请表中
saveResiWarmApply(formDTO);
String applyId=saveResiWarmApply(formDTO);
formDTO.setApplyId(applyId);
//2:将最后一次操作行为更新到热心居民申请行为记录表中
resiWarmheartedVisitService.updateResiWarmVisit(formDTO);
//3:添加消息信息,给网格长发消息
@ -234,7 +236,7 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl<ResiWarmhea
* @param formDTO
* @return
*/
public void saveResiWarmApply(ResiWarmheartedSubmitFormDTO formDTO) {
public String saveResiWarmApply(ResiWarmheartedSubmitFormDTO formDTO) {
ResiWarmheartedApplyEntity entity = new ResiWarmheartedApplyEntity();
entity.setCustomerId(formDTO.getCustomerId());
entity.setGridId(formDTO.getGridId());
@ -245,6 +247,7 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl<ResiWarmhea
entity.setReadFlag(ResiWarmheartedVisitConstant.UN_READ);
entity.setMessageText(formDTO.getMessageText());
baseDao.insert(entity);
return entity.getId();
}
/**
* 热心居民申请像网格长发送消息
@ -289,6 +292,11 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl<ResiWarmhea
}
msgDTO.setMessageContent(formDTO.getMessageText());
msgDTO.setReadFlag(ReadFlagConstant.UN_READ);
//21.09.10:记录消息类型和对应的业务id
msgDTO.setMessageType(UserMessageTypeConstant.WARMHEARTED_APPLY);
msgDTO.setTargetId(formDTO.getApplyId());
msgList.add(msgDTO);
//微信订阅
WxSubscribeMessageFormDTO subscribeDTO = new WxSubscribeMessageFormDTO();
@ -466,6 +474,11 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl<ResiWarmhea
userMessageFormDTO.setGridId(formDTO.getGridId());
userMessageFormDTO.setUserId(formDTO.getUserId());
userMessageFormDTO.setApp(AppClientConstant.APP_RESI);
//21.09.10:记录消息类型和对应的业务id
userMessageFormDTO.setMessageType(UserMessageTypeConstant.WARMHEARTED_APPLY_RES);
userMessageFormDTO.setTargetId(formDTO.getId());
if (StrConstant.SPECIAL_CUSTOMER.equals(formDTO.getCustomerId())) {
userMessageFormDTO.setTitle("您有一条组长申请消息");
} else {

Loading…
Cancel
Save