Browse Source

工作端审核建组申请时将审核结果发起推送,给申请建小组的用户推送一条订阅消息;

dev_shibei_match
liushaowen 5 years ago
parent
commit
46b71fac7a
  1. 7
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/UserMessageConstant.java
  2. 29
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
  3. 4
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java

7
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/UserMessageConstant.java

@ -62,6 +62,11 @@ public interface UserMessageConstant {
/**
* 组长审核入组申请时的微信订阅behavior
*/
String WX_APPLY_GROUP_BEHAVIOR = "小组消息";
String WX_APPLY_JOIN_GROUP_BEHAVIOR = "小组消息";
/**
* 建组审核的微信订阅behavior
*/
String WX_APPLY_CREATE_GROUP_BEHAVIOR = "建组审核消息";
}

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

@ -21,6 +21,7 @@ import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.EpmetRoleKeyConstant;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
@ -34,6 +35,7 @@ import com.epmet.constant.ReadFlagConstant;
import com.epmet.dto.form.*;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.dto.result.UserRoleResultDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.modules.constant.UserMessageConstant;
import com.epmet.modules.feign.EpmetMessageFeignClient;
import com.epmet.modules.feign.EpmetUserFeignClient;
@ -122,6 +124,9 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
@Autowired
private EpmetMessageFeignClient epmetMessageFeignClient;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Override
public PageData<ResiGroupDTO> page(Map<String, Object> params) {
IPage<ResiGroupEntity> page = baseDao.selectPage(
@ -569,6 +574,17 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
if(!epmetMessageFeignClient.saveUserMessage(userMessageFormDTO).success()){
logger.warn(String.format(ModuleConstant.FAILED_SEND_MESSAGE,String.format(UserMessageConstant.AGREE_CREATING_GROUP_MSG_TEMPLATE,resiGroupDTO.getGroupName())));
}
//发送微信订阅消息
WxSubscribeMessageFormDTO wxSubscribeMessageFormDTO = new WxSubscribeMessageFormDTO();
wxSubscribeMessageFormDTO.setCustomerId(resiGroupDTO.getCustomerId());
wxSubscribeMessageFormDTO.setUserId(resiGroupDTO.getCreatedBy());
wxSubscribeMessageFormDTO.setClientType(AppClientConstant.APP_RESI);
wxSubscribeMessageFormDTO.setBehaviorType(UserMessageConstant.WX_APPLY_CREATE_GROUP_BEHAVIOR);
wxSubscribeMessageFormDTO.setMessageContent(String.format(UserMessageConstant.AGREE_CREATING_GROUP_MSG_TEMPLATE,resiGroupDTO.getGroupName()));
wxSubscribeMessageFormDTO.setMessageTime(new Date());
List<WxSubscribeMessageFormDTO> msgList = new ArrayList<>();
msgList.add(wxSubscribeMessageFormDTO);
epmetMessageOpenFeignClient.sendWxSubscribeMessage(msgList);
//更新政府端:工作-基层治理-党员认证reddot
resiGroupRedis.subtractWorkGrassrootsPartyAuthRedDotValue(resiGroupDTO.getGridId());
return new Result();
@ -615,6 +631,19 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
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())));
}
//发送微信订阅消息
WxSubscribeMessageFormDTO wxSubscribeMessageFormDTO = new WxSubscribeMessageFormDTO();
wxSubscribeMessageFormDTO.setCustomerId(resiGroupDTO.getCustomerId());
wxSubscribeMessageFormDTO.setUserId(resiGroupDTO.getCreatedBy());
wxSubscribeMessageFormDTO.setClientType(AppClientConstant.APP_RESI);
wxSubscribeMessageFormDTO.setBehaviorType(UserMessageConstant.WX_APPLY_CREATE_GROUP_BEHAVIOR);
wxSubscribeMessageFormDTO.setMessageContent(String.format(UserMessageConstant.AGREE_CREATING_GROUP_MSG_TEMPLATE,resiGroupDTO.getGroupName()));
wxSubscribeMessageFormDTO.setMessageTime(new Date());
List<WxSubscribeMessageFormDTO> msgList = new ArrayList<>();
msgList.add(wxSubscribeMessageFormDTO);
epmetMessageOpenFeignClient.sendWxSubscribeMessage(msgList);
//更新政府端:工作-基层治理-党员认证reddot
resiGroupRedis.subtractWorkGrassrootsPartyAuthRedDotValue(resiGroupDTO.getGridId());
return new Result();

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

@ -458,7 +458,7 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD
wxSubscribeMessageFormDTO.setCustomerId(resiGroupMemberDTO.getCustomerId());
wxSubscribeMessageFormDTO.setUserId(resiGroupMemberDTO.getCustomerUserId());
wxSubscribeMessageFormDTO.setClientType(AppClientConstant.APP_RESI);
wxSubscribeMessageFormDTO.setBehaviorType(UserMessageConstant.WX_APPLY_GROUP_BEHAVIOR);
wxSubscribeMessageFormDTO.setBehaviorType(UserMessageConstant.WX_APPLY_JOIN_GROUP_BEHAVIOR);
wxSubscribeMessageFormDTO.setMessageContent(messageContent);
wxSubscribeMessageFormDTO.setMessageTime(new Date());
List<WxSubscribeMessageFormDTO> msgList = new ArrayList<>();
@ -534,7 +534,7 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD
wxSubscribeMessageFormDTO.setCustomerId(resiGroupDTO.getCustomerId());
wxSubscribeMessageFormDTO.setUserId(groupMemeberOperationDTO.getCustomerUserId());
wxSubscribeMessageFormDTO.setClientType(AppClientConstant.APP_RESI);
wxSubscribeMessageFormDTO.setBehaviorType(UserMessageConstant.WX_APPLY_GROUP_BEHAVIOR);
wxSubscribeMessageFormDTO.setBehaviorType(UserMessageConstant.WX_APPLY_JOIN_GROUP_BEHAVIOR);
wxSubscribeMessageFormDTO.setMessageContent(messageContent);
List<WxSubscribeMessageFormDTO> msgList = new ArrayList<>();
msgList.add(wxSubscribeMessageFormDTO);

Loading…
Cancel
Save