Browse Source

支部管理:注册党员自动匹配成功、人工审核是党员,新增partymember_auth_record

master
yinzuomei 5 years ago
parent
commit
e6ef7d778c
  1. 1
      epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchAddFormDTO.java
  2. 5
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java
  3. 11
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberAuthRecordService.java
  4. 24
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java
  5. 42
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberAuthRecordServiceImpl.java
  6. 10
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java
  7. 6
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java

1
epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchAddFormDTO.java

@ -45,7 +45,6 @@ public class PartyBranchAddFormDTO implements Serializable {
/**
* 党支部概要信息
*/
@NotBlank(message = "请输入支部概要信息", groups = {AddUserShowGroup.class})
@Length(max = 500, message = "支部概要信息不能超过500个字", groups = AddUserShowGroup.class)
private String profile;
}

5
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java

@ -135,4 +135,9 @@ public interface PartyMemberConstant {
* 已读
*/
String READ = "read";
/**
* 党员详情界面账号于2020年10月31日在海泊桥社区-第一网格激活
*/
String AUTH_DESC="账户于%s年%s月%s日在%s激活";
}

11
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberAuthRecordService.java

@ -20,6 +20,7 @@ package com.epmet.modules.partymember.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.modules.partymember.entity.PartymemberAuthRecordEntity;
import com.epmet.modules.partymember.entity.PartymemberInfoEntity;
import com.epmet.resi.partymember.dto.partymember.PartymemberAuthRecordDTO;
import java.util.List;
@ -92,4 +93,14 @@ public interface PartymemberAuthRecordService extends BaseService<PartymemberAut
* @date 2020-06-17
*/
void delete(String[] ids);
/**
* @return void
* @param partyMemberInfoEntity
* @param partymemberBaseInfoId
* @author yinzuomei
* @description 自动匹配人工审核是党员记录居民-党员库关系
* @Date 2020/6/19 13:06
**/
void insert(PartymemberInfoEntity partyMemberInfoEntity, String partymemberBaseInfoId);
}

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

@ -29,7 +29,6 @@ import com.epmet.modules.feign.ResiGroupFeignClient;
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.constant.ResiWarmheartedConstant;
import com.epmet.modules.warmhearted.constant.ResiWarmheartedVisitConstant;
import com.epmet.redis.ResiPartyMemberRedis;
@ -49,7 +48,8 @@ import com.epmet.resi.partymember.dto.partymember.result.AuditingDetailResultDTO
import com.epmet.resi.partymember.dto.partymember.result.AutoFailedDetailResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.RejectedDetailResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -57,7 +57,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 党员认证
@ -68,7 +67,7 @@ import java.util.Map;
@Service
@Slf4j
public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService {
private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private EpmetUserFeignClient epmetUserFeignClient;
@Autowired
@ -93,6 +92,9 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
private ResiPartyMemberRedis resiPartyMemberRedis;
@Autowired
private ResiGroupFeignClient resiGroupFeignClient;
@Autowired
private PartymemberAuthRecordService partymemberAuthRecordService;
@Override
@Transactional(rollbackFor = Exception.class)
public Result<PartyMemberInitResultDTO> init(PartyMemberInitFromDTO fromDto) {
@ -182,7 +184,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
return new Result().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode());
}*/
//获取党员基本信息
//获取党员基本信息(匹配)
PartymemberConfirmAutoDTO confirmAutoDTO =
partymemberBaseInfoService.getPartyMemberBaseInfo(partyMemberInfoDTO);
@ -212,6 +214,9 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
partyMemberInfoEntity.setConfirmResult(PartyMemberConstant.AUTO_CONFIRM_SUCCESS);
if (partyMemberInfoEntity.getId().isEmpty()) {
partymemberInfoService.insert(partyMemberInfoEntity);
//记录当前居民与党员库关系,保存认证信息
logger.info(String.format("党员认证自动匹配成功,保存partymember_auth_record,userId=%s,党员库id=%s",partyMemberInfoEntity.getUserId(),confirmAutoDTO.getPatryMemberBaseInfoId()));
partymemberAuthRecordService.insert(partyMemberInfoEntity,confirmAutoDTO.getPatryMemberBaseInfoId());
} else {
partymemberInfoService.updateById(partyMemberInfoEntity);
}
@ -256,7 +261,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
PartymemberConfirmAutoEntity.class));
}
}
//
//判断是否已注册居民,如果没有则注册居民
isResiRegister(partyMemberInfoDTO);
@ -301,7 +306,6 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
PartymemberInfoEntity partyMemberInfoEntity = partymemberInfoService.selectById(fromDTO.getPartyMemberId());
partyMemberInfoEntity.setId(manualEntity.getPartymemberInfoId());
partyMemberInfoEntity.setConfirmResult(fromDTO.getPartyMemberFlag());
partymemberInfoService.updateById(partyMemberInfoEntity);
manualEntity.setAuditStatus(fromDTO.getPartyMemberFlag());
@ -326,6 +330,12 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
identityParam.setUserId(partyMemberInfoEntity.getUserId());
identityParam.setPartyFlag(NumConstant.ONE_STR);
resiGroupFeignClient.updateWhenAuditedResiRole(identityParam);
//如果是自动匹配失败的,人工审核他是党员,需要记录党员库-居民的认证关系
PartymemberConfirmAutoDTO partymemberConfirmAutoDTO=partymemberConfirmAutoService.get(fromDTO.getAutoId());
if(partymemberConfirmAutoDTO!=null){
logger.info(String.format("自动匹配失败,人工审核是党员,保存partymember_auth_record,userId=%s,党员库id=%s",partyMemberInfoEntity.getUserId(),partymemberConfirmAutoDTO.getPatryMemberBaseInfoId()));
partymemberAuthRecordService.insert(partyMemberInfoEntity,partymemberConfirmAutoDTO.getPatryMemberBaseInfoId());
}
} else {
auditMessageToResi(partyMemberInfoEntity, PartyMemberMessageConstant.AUDIT_REJECT_MSG);
}

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

@ -20,20 +20,28 @@ package com.epmet.modules.partymember.service.impl;
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.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.PartyMemberConstant;
import com.epmet.dto.result.GridInfoResultDTO;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.modules.partymember.dao.PartymemberAuthRecordDao;
import com.epmet.modules.partymember.entity.PartymemberAuthRecordEntity;
import com.epmet.modules.partymember.entity.PartymemberInfoEntity;
import com.epmet.modules.partymember.redis.PartymemberAuthRecordRedis;
import com.epmet.modules.partymember.service.PartymemberAuthRecordService;
import com.epmet.resi.partymember.dto.partymember.PartymemberAuthRecordDTO;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
@ -45,9 +53,11 @@ import java.util.Map;
*/
@Service
public class PartymemberAuthRecordServiceImpl extends BaseServiceImpl<PartymemberAuthRecordDao, PartymemberAuthRecordEntity> implements PartymemberAuthRecordService {
private static final Logger logger = LoggerFactory.getLogger(PartymemberAuthRecordServiceImpl.class);
@Autowired
private PartymemberAuthRecordRedis partymemberAuthRecordRedis;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Override
public PageData<PartymemberAuthRecordDTO> page(Map<String, Object> params) {
@ -101,4 +111,32 @@ public class PartymemberAuthRecordServiceImpl extends BaseServiceImpl<Partymembe
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public void insert(PartymemberInfoEntity partyMemberInfoEntity, String partymemberBaseInfoId) {
PartymemberAuthRecordEntity partymemberAuthRecordEntity=new PartymemberAuthRecordEntity();
partymemberAuthRecordEntity.setPartymemberBaseInfoId(partymemberBaseInfoId);
partymemberAuthRecordEntity.setUserId(partyMemberInfoEntity.getUserId());
partymemberAuthRecordEntity.setAuthTime(partyMemberInfoEntity.getCreatedTime());
partymemberAuthRecordEntity.setCustomerId(partyMemberInfoEntity.getCustomerId());
partymemberAuthRecordEntity.setGridId(partyMemberInfoEntity.getGridId());
//日历对象
Calendar calendar = Calendar.getInstance();
//设置当前日期
calendar.setTime(partymemberAuthRecordEntity.getAuthTime());
Result<GridInfoResultDTO> result=govOrgOpenFeignClient.queryGridInfo(partymemberAuthRecordEntity.getGridId());
String gridName="";
if(result.success()&&null!=result.getData()){
gridName=String.format("%s-%s",result.getData().getParentAgencyName(),result.getData().getGridName());
}else{
logger.error("保存用户认证党员记录失败:查询网格名称失败");
}
partymemberAuthRecordEntity.setAuthDesc(String.format(PartyMemberConstant.AUTH_DESC,
calendar.get(Calendar.YEAR),
calendar.get(Calendar.MONTH)+1,
calendar.get(Calendar.DATE),
gridName));
baseDao.insert(partymemberAuthRecordEntity);
logger.info(String.format("保存用户认证党员记录成功:认证描述%s",partymemberAuthRecordEntity.getAuthDesc()));
}
}

10
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java

@ -330,11 +330,12 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl<PartymemberB
Result<GridInfoResultDTO> gridInfoResult = govOrgFeignClient.queryGridInfo(formDTO.getGridId());
String gridFullPath = "";
if (gridInfoResult.success() && null != gridInfoResult.getData()) {
gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName(),
/*gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName(),
gridInfoResult.getData().getCommnuityName(),
gridInfoResult.getData().getGridName());
gridFullPath = gridFullPath.replaceAll("null", "").trim();
gridFullPath = gridFullPath.replaceAll("--", "-").trim();
gridFullPath = gridFullPath.replaceAll("--", "-").trim();*/
gridFullPath=String.format("%s-%s",gridInfoResult.getData().getParentAgencyName(),gridInfoResult.getData().getGridName());
}
//查询居民认证信息,获取居民头像
List<String> userIdList = new ArrayList<>();
@ -373,11 +374,12 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl<PartymemberB
Result<GridInfoResultDTO> gridInfoResult = govOrgFeignClient.queryGridInfo(formDTO.getGridId());
String gridFullPath = "";
if (gridInfoResult.success() && null != gridInfoResult.getData()) {
gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName() == null?"":gridInfoResult.getData().getStreetName(),
/*gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName() == null?"":gridInfoResult.getData().getStreetName(),
gridInfoResult.getData().getCommnuityName() == null?"":gridInfoResult.getData().getCommnuityName(),
gridInfoResult.getData().getGridName() == null?"":gridInfoResult.getData().getGridName());
gridFullPath = gridFullPath.replaceAll("null", "").trim();
gridFullPath = gridFullPath.replaceAll("--", "-").trim();
gridFullPath = gridFullPath.replaceAll("--", "-").trim();*/
gridFullPath=String.format("%s-%s",gridInfoResult.getData().getParentAgencyName(),gridInfoResult.getData().getGridName());
}
//查询居民认证信息,获取居民头像
List<String> userIdList = new ArrayList<>();

6
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java

@ -29,7 +29,6 @@ import com.epmet.dto.form.CreatedTimeByUserIdFormDTO;
import com.epmet.dto.result.CertifiedResultDTO;
import com.epmet.dto.result.CreatedTimeByUserIdResultDTO;
import com.epmet.dto.result.GridInfoResultDTO;
import com.epmet.dto.result.SelectGridNameByGridIdResultDTO;
import com.epmet.modules.feign.EpmetUserFeignClient;
import com.epmet.modules.feign.GovOrgFeignClient;
import com.epmet.modules.partymember.dao.PartymemberInfoDao;
@ -159,10 +158,11 @@ public class PartymemberInfoServiceImpl extends BaseServiceImpl<PartymemberInfoD
Result<GridInfoResultDTO> gridInfoResult = govOrgFeignClient.queryGridInfo(certifiedFormDTO.getGridId());
String gridFullPath = "";
if (gridInfoResult.success() && null != gridInfoResult.getData()) {
gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName() == null?"":gridInfoResult.getData().getStreetName(),
/*gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName() == null?"":gridInfoResult.getData().getStreetName(),
gridInfoResult.getData().getCommnuityName() == null?"":gridInfoResult.getData().getCommnuityName(),
gridInfoResult.getData().getGridName() == null?"":gridInfoResult.getData().getGridName());
gridFullPath = gridFullPath.replaceAll("--", "").trim();
gridFullPath = gridFullPath.replaceAll("--", "").trim();*/
gridFullPath=String.format("%s-%s",gridInfoResult.getData().getParentAgencyName(),gridInfoResult.getData().getGridName());
}
for (CertifiedResultDTO datum : listResult.getData()) {
datum.setGridFullPath(gridFullPath);

Loading…
Cancel
Save