Browse Source

党员认证添加消息

master
zhaoqifeng 5 years ago
parent
commit
3494dba942
  1. 28
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberMessageConstant.java
  2. 42
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java

28
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberMessageConstant.java

@ -0,0 +1,28 @@
package com.epmet.constant;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/4/29 13:41
*/
public interface PartyMemberMessageConstant {
/**
* 消息标题
*/
String GROUP_TITLE = "您有一条党员申请消息";
/**
* 党员提交申请时给网格长发送消息XX街道-XX先生/女士申请成为党员请审核
*/
String MEMBER_APPLY_MSG = "%s申请成为党员,请审核。";
/**
* 党员申请审核通过给申请人发送消息您好您申请的党员已审核通过请查看
*/
String AUDIT_APPROVE_MSG = "您好,您申请的%s党员已审核通过,请查看。";
/**
* 党员申请审核驳回给申请人发送消息您好您申请的党员由于不符合条件的原因已被驳回
*/
String AUDIT_REJECT_MSG = "您好,您申请的%s党员,由于不符合条件的原因,已被驳回。";
}

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

@ -1,12 +1,18 @@
package com.epmet.modules.partymember.service.impl;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.EpmetRoleKeyConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
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.dto.CustomerGridDTO;
import com.epmet.dto.UserResiInfoDTO;
import com.epmet.dto.UserRoleDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.dto.form.UserResiInfoFormDTO;
import com.epmet.dto.result.GridInfoResultDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
@ -16,6 +22,8 @@ import com.epmet.modules.feign.GovOrgFeignClient;
import com.epmet.modules.partymember.entity.*;
import com.epmet.modules.partymember.redis.PartymemberInfoRedis;
import com.epmet.modules.partymember.service.*;
import com.epmet.modules.warmhearted.constant.ResiWarmUserMessageConstant;
import com.epmet.modules.warmhearted.entity.ResiWarmheartedApplyEntity;
import com.epmet.resi.mine.dto.from.PartyMemberInitFromDTO;
import com.epmet.resi.mine.dto.from.VerificationCodeFromDTO;
import com.epmet.resi.mine.dto.result.PartyMemberInitResultDTO;
@ -260,11 +268,12 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
partymemberConfirmManualService.insert(manualEntity);
}
auditMessage(ConvertUtils.sourceToTarget(partyMemberInfo, PartymemberInfoEntity.class), PartyMemberMessageConstant.MEMBER_APPLY_MSG);
return new Result();
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result manualConfirmResult(PartyMemberConfirmFromDTO fromDTO) {
PartymemberConfirmManualEntity manualEntity = partymemberConfirmManualService.selectById(fromDTO.getManualId());
PartymemberInfoEntity partyMemberInfoEntity = partymemberInfoService.selectById(fromDTO.getPartyMemberId());
@ -289,6 +298,9 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
//存入党员注册关系表 用于统计客户网格的认证党员数
saveRegisterRelation(ConvertUtils.sourceToTarget(partyMemberInfoEntity,
PartymemberInfoDTO.class));
auditMessage(partyMemberInfoEntity, PartyMemberMessageConstant.AUDIT_APPROVE_MSG);
} else {
auditMessage(partyMemberInfoEntity, PartyMemberMessageConstant.AUDIT_REJECT_MSG);
}
return new Result();
@ -532,4 +544,32 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
return partymemberVisitEntity.getId();
}
/**
* 热心居民申请审核通过向申请人发送消息
* @Author sun
* @param formDTO
* @param userMsg 消息模板
*/
private Result auditMessage(PartymemberInfoEntity formDTO, String userMsg) {
UserMessageFormDTO userMessageFormDTO = new UserMessageFormDTO();
userMessageFormDTO.setCustomerId(formDTO.getCustomerId());
userMessageFormDTO.setGridId(formDTO.getGridId());
userMessageFormDTO.setUserId(formDTO.getUserId());
userMessageFormDTO.setApp(AppClientConstant.APP_RESI);
userMessageFormDTO.setTitle(PartyMemberMessageConstant.GROUP_TITLE);
//调用gov-org服务查询网格信息
CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO();
customerGridFormDTO.setGridId(formDTO.getGridId());
Result<CustomerGridDTO> result = govOrgFeignClient.getCustomerGridByGridId(customerGridFormDTO);
String gridName = null;
if (result.success() && null != result.getData()) {
gridName = result.getData().getGridName();
}
String messageContent = String.format(userMsg, gridName);
userMessageFormDTO.setMessageContent(messageContent);
userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ);
//保存消息
return messageFeignClient.saveUserMessage(userMessageFormDTO);
}
}

Loading…
Cancel
Save