Browse Source

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

dev_shibei_match
yinzuomei 4 years ago
parent
commit
16bbc279c1
  1. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  2. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java
  3. 69
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java
  4. 4
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  5. 14
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java
  6. 9
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/GroupLeaderTransferRecordServiceImpl.java
  7. 5
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java
  8. 15
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java
  9. 15
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java

7
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java

@ -21,6 +21,7 @@ import com.epmet.commons.tools.utils.*;
import com.epmet.constant.ActConstant;
import com.epmet.constant.ActMessageConstant;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dao.*;
import com.epmet.dto.*;
import com.epmet.dto.form.UserMessageFormDTO;
@ -32,7 +33,6 @@ import com.epmet.entity.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.*;
import com.epmet.utils.ModuleConstant;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -694,6 +694,11 @@ public class WorkActServiceImpl implements WorkActService {
userMessageFormDTO.setMessageContent(String.format(ActMessageConstant.ACT_CANCELED,
actInfoDTO.getTitle(),
formDTO.getCancelReason()));
//21.09.10:记录消息类型和对应的业务id
userMessageFormDTO.setMessageType(UserMessageTypeConstant.HEART_CANCEL_ACT);
userMessageFormDTO.setTargetId(formDTO.getActId());
userMessageFormDTOS.add(userMessageFormDTO);
//2020.10.26 添加发送微信订阅消息功能 sun
WxSubscribeMessageFormDTO dto = new WxSubscribeMessageFormDTO();

6
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java

@ -11,6 +11,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.ActConstant;
import com.epmet.constant.ActMessageConstant;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dao.ActInfoDao;
import com.epmet.dao.ActUserLogDao;
import com.epmet.dao.ActUserRelationDao;
@ -639,6 +640,11 @@ public class WorkActUserServiceImpl implements WorkActUserService {
} else if (ActConstant.ACT_USER_STATUS_REFUSED.equals(type)) {
userMessageFormDTO.setMessageContent(String.format(ActMessageConstant.AUDIT_REFUSED, actInfo.getTitle(), actUserRelationEntity.getFailureReason()));
}
//21.09.10:记录消息类型和对应的业务id
userMessageFormDTO.setMessageType(UserMessageTypeConstant.HEART_SIGIN_UP_RES);
userMessageFormDTO.setTargetId(actUserRelationEntity.getId());
Result result = epmetMessageOpenFeignClient.saveUserMessage(userMessageFormDTO);
if (result.success()) {
logger.info("审核成功,已成功发送站内信");

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

@ -70,6 +70,49 @@ public interface UserMessageTypeConstant {
*/
String GROUP_ENTER_GROUP_BY_LINK_RES="group_enter_group_by_link_res";
/**
* 组内发布活动
* targetId:group_act_info.id
*/
String GROUP_ACT_PUBLISH="group_act_publish";
/**
* 组内发布活动,进行编辑
* targetId:group_act_info.id
*/
String GROUP_ACT_CHANGE="group_act_change";
/**
* 组内活动取消
* targetId:group_act_info.id
*/
String GROUP_ACT_CANCEL="group_act_cancel";
/**
* 工作端转交组长通知原组长
* targetId:resi_group.id
*/
String GROUP_ORIGINAL_LEADER_DOWN="group_original_leader_down";
/**
* 新任组长告诉他这个好消息
* targetId:resi_group.id
*/
String GROUP_NEW_LEADER_UP="group_new_leader_up";
/**
* 禁言组员
* targetId:resi_group.id
*/
String GROUP_SLIENT_MEMBER="group_slient_member";
/**
* 发布小组内通知
* targetId:notice.id
*/
String GROUP_MESSAGE_PUBLISH="group_message_publish";
/**
* 发布小组内通知
* targetId:notice.id
*/
String GROUP_MESSAGE_EDIT="group_message_edit";
@ -116,10 +159,36 @@ public interface UserMessageTypeConstant {
*/
String PROJECT_FROM_RESI_EVENT="project_from_resi_event";
/**
* 项目滞留超期提醒
*/
String PROJECT_REMIND="project_remind";
/**
* 发布党建声音
* targetId:article.DRAFT_ID
*/
String PARTY_VOICE_PUBLISH="party_voice_publish";
/**
* 爱心互助通过审核的用户发送消息
* targetId:act_info.id
*/
String HEART_CANCEL_ACT="heart_cancel_act";
/**
* 活动报名结果通知居民
* act_user_relation.id
*/
String HEART_SIGIN_UP_RES="heart_sigin_up_res";
/**
* 居民端提交徽章认证申请
* user_badge_certificate_record.id todo
*/
String BADGE_AUTH_APPLY="badge_auth_apply";
}

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

@ -1727,6 +1727,10 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
messageFormDTO.setTitle(title);
messageFormDTO.setMessageContent(msg);
messageFormDTO.setReadFlag(Constant.UNREAD);
//21.09.10:记录消息类型和对应的业务id
messageFormDTO.setMessageType(UserMessageTypeConstant.PROJECT_REMIND);
msgList.add(messageFormDTO);
//10.29 项目滞留提醒添加推送微信消息 sun

14
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java

@ -35,6 +35,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.constant.UserMessageTypeConstant;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.dto.result.GridInfoResultDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
@ -265,9 +266,17 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr
if(StringUtils.isNotBlank(formDTO.getGroupActId())){
// 活动修改后,站内信通知全组成员“您有一条小组消息 【某某小组】更新了********活动详情,请查看。
userMessageFormDTO.setMessageContent(String.format(UserMessageConstant.CHANGED_GROUP_ACT, resiGroupDTO.getGroupName(), groupActInfoEntity.getTitle()));
//21.09.10:记录消息类型和对应的业务id
userMessageFormDTO.setMessageType(UserMessageTypeConstant.GROUP_ACT_PUBLISH);
userMessageFormDTO.setTargetId(groupActInfoEntity.getId());
}else{
// 活动发布,站内信通知全组成员“您有一条小组消息 【某某小组】发布了*******活动,请查看。
userMessageFormDTO.setMessageContent(String.format(UserMessageConstant.PUBLISH_GROUP_ACT, resiGroupDTO.getGroupName(), groupActInfoEntity.getTitle()));
//21.09.10:记录消息类型和对应的业务id
userMessageFormDTO.setMessageType(UserMessageTypeConstant.GROUP_ACT_CHANGE);
userMessageFormDTO.setTargetId(groupActInfoEntity.getId());
}
list.add(userMessageFormDTO);
}
@ -760,6 +769,11 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr
userMessageFormDTO.setTitle(UserMessageConstant.GROUP_TITLE);
userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ);
userMessageFormDTO.setMessageContent(String.format(UserMessageConstant.CANCEL_GROUP_ACT, resiGroupDTO.getGroupName(), actInfoEntity.getTitle()));
//21.09.10:记录消息类型和对应的业务id
userMessageFormDTO.setMessageType(UserMessageTypeConstant.GROUP_ACT_CANCEL);
userMessageFormDTO.setTargetId(actInfoEntity.getId());
list.add(userMessageFormDTO);
}
});

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

@ -25,6 +25,7 @@ import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.modules.constant.UserMessageConstant;
@ -204,6 +205,10 @@ public class GroupLeaderTransferRecordServiceImpl extends BaseServiceImpl<GroupL
originalLeader.setCustomerId(formDTO.getCustomerId());
originalLeader.setMessageContent(String.format(UserMessageConstant.ORIGINAL_LEADER_DOWN,resiGroupDTO.getGroupName()));
//21.09.10:记录消息类型和对应的业务id
originalLeader.setMessageType(UserMessageTypeConstant.GROUP_ORIGINAL_LEADER_DOWN);
originalLeader.setTargetId(resiGroupDTO.getId());
msgList.add(originalLeader);
}
//新组长
@ -217,6 +222,10 @@ public class GroupLeaderTransferRecordServiceImpl extends BaseServiceImpl<GroupL
newLeader.setCustomerId(formDTO.getCustomerId());
newLeader.setMessageContent(String.format(UserMessageConstant.NEW_LEADER_UP,resiGroupDTO.getGroupName()));
//21.09.10:记录消息类型和对应的业务id
newLeader.setMessageType(UserMessageTypeConstant.GROUP_NEW_LEADER_UP);
newLeader.setTargetId(resiGroupDTO.getId());
msgList.add(newLeader);
if(!epmetMessageOpenFeignClient.saveUserMessageList(msgList).success()){
log.warn("转让组发送站内信失败");

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

@ -935,6 +935,11 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD
String messageContent=String.format(UserMessageConstant.SLIENT_IN_GROUP, dateStr);
userMessageFormDTO.setMessageContent(messageContent);
userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ);
//21.09.10:记录消息类型和对应的业务id
userMessageFormDTO.setMessageType(UserMessageTypeConstant.GROUP_SLIENT_MEMBER);
userMessageFormDTO.setTargetId(resiGroupMemberEntity.getResiGroupId());
epmetMessageOpenFeignClient.saveUserMessage(userMessageFormDTO);
//发送微信订阅
WxSubscribeMessageFormDTO subscribeMessageFormDTO = new WxSubscribeMessageFormDTO();

15
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java

@ -33,6 +33,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.dto.result.GridInfoResultDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
@ -58,7 +59,10 @@ import com.epmet.modules.notice.service.NoticeService;
import com.epmet.resi.group.constant.TopicConstant;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.notice.NoticeDTO;
import com.epmet.resi.group.dto.notice.form.*;
import com.epmet.resi.group.dto.notice.form.AddNoticeFormDTO;
import com.epmet.resi.group.dto.notice.form.EditNoticeFormDTO;
import com.epmet.resi.group.dto.notice.form.NoticeDetailFormDTO;
import com.epmet.resi.group.dto.notice.form.NoticeFileDTO;
import com.epmet.resi.group.dto.notice.result.NoticeDetailResultDTO;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.logging.Log;
@ -272,6 +276,10 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
userMessageFormDTO.setTitle(UserMessageConstant.GROUP_TITLE);
userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ);
userMessageFormDTO.setMessageContent(String.format(UserMessageConstant.GROUP_NOTICE_ADD, groupEntity.getGroupName(), formDTO.getTitle()));
//21.09.10:记录消息类型和对应的业务id
userMessageFormDTO.setMessageType(UserMessageTypeConstant.GROUP_MESSAGE_PUBLISH);
userMessageFormDTO.setTargetId(messageEntity.getMessageId());
userMessageFormDTOS.add(userMessageFormDTO);
}
});
@ -430,6 +438,11 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
userMessageFormDTO.setTitle(UserMessageConstant.GROUP_TITLE);
userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ);
userMessageFormDTO.setMessageContent(String.format(UserMessageConstant.GROUP_NOTICE_EDIT, groupEntity.getGroupName(), formDTO.getTitle()));
//21.09.10:记录消息类型和对应的业务id
userMessageFormDTO.setTargetId(entity.getId());
userMessageFormDTO.setMessageType(UserMessageTypeConstant.GROUP_MESSAGE_EDIT);
userMessageFormDTOS.add(userMessageFormDTO);
}
});

15
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java

@ -2,6 +2,7 @@ package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
@ -12,6 +13,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.BadgeConstant;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.SmsTemplateConstant;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dao.*;
import com.epmet.dto.ResiUserBadgeDTO;
import com.epmet.dto.UserBadgeCertificateRecordDTO;
@ -53,8 +55,6 @@ public class UserBadgeServiceImpl implements UserBadgeService {
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Autowired
private EpmetMessageOpenFeignClient messageFeignClient;
@Autowired
private UserRoleDao userRoleDao;
@Autowired
private ResiUserBadgeDao resiUserBadgeDao;
@ -278,11 +278,10 @@ public class UserBadgeServiceImpl implements UserBadgeService {
form.setSurname(certificationAddFormDTO.getSurname());
log.info(JSON.toJSONString(form));
userBadgeDao.insertUserBadgeCertificateRecord(form);
//TODO 站内信发送
String badgeName = badgeDao.selectBadgeName(form.getCustomerId(), form.getBadgeId());
String msg = String.format(BadgeConstant.MESSAGE_CONTENT, userBaseInfoResultDTOS.get(NumConstant.ZERO).getDistrict().concat(userBaseInfoResultDTOS.get(NumConstant.ZERO).getRealName()), badgeName);
sendMessage(BadgeConstant.AUTH_TITLE,msg,form.getGridId(),form.getUserId(),form.getCustomerId());
sendMessage(BadgeConstant.AUTH_TITLE,msg,form.getGridId(),form.getUserId(),form.getCustomerId(), UserMessageTypeConstant.BADGE_AUTH_APPLY);
return new Result();
}
@ -443,7 +442,7 @@ public class UserBadgeServiceImpl implements UserBadgeService {
* @author zxc
* @date 2020/11/19 上午9:16
*/
public void sendMessage(String title,String msg,String gridId,String userId,String customerId){
public void sendMessage(String title,String msg,String gridId,String userId,String customerId,String messageType){
//1.查询加入当前网格下的人员 customer_staff_grid
CommonGridIdFormDTO commonGridIdFormDTO = new CommonGridIdFormDTO();
commonGridIdFormDTO.setGridId(gridId);
@ -474,6 +473,12 @@ public class UserBadgeServiceImpl implements UserBadgeService {
msgObj.setReadFlag(ReadFlagConstant.UN_READ);
msgObj.setTitle(title);
msgObj.setUserId(to);
//21.09.10:记录消息类型和对应的业务id
msgObj.setMessageType(messageType);
//todo
msgObj.setTargetId(StrConstant.EPMETY_STR);
msgList.add(msgObj);
//微信订阅
WxSubscribeMessageFormDTO subscribeDTO = new WxSubscribeMessageFormDTO();

Loading…
Cancel
Save