|
|
@ -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); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|