Browse Source

epmetuser/icBirthRecord/{id}调整

master
yinzuomei 3 years ago
parent
commit
7b8862ed69
  1. 15
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcBirthRecordDTO.java
  2. 32
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcBirthRecordServiceImpl.java

15
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcBirthRecordDTO.java

@ -71,7 +71,11 @@ public class IcBirthRecordDTO implements Serializable {
@NotBlank(message = "所属家庭不能为空", groups = {AddGroup.class})
private String homeId;
private String home;
/**
* 所属房屋全路径名称
* 详情回显
*/
private String homeAllName;
/**
* 姓名
*/
@ -84,10 +88,9 @@ public class IcBirthRecordDTO implements Serializable {
private String mobile;
/**
* 性别
* 性别 1男2女
*/
private String gender;
/**
* 身份证号
*/
@ -139,6 +142,12 @@ public class IcBirthRecordDTO implements Serializable {
*/
private String householderRelation;
/**
* 与户主关系字典表
* 详情回显
*/
private String householderRelationName;
/**
* 是否勾选补充居民信息0否 1是
*/

32
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcBirthRecordServiceImpl.java

@ -5,14 +5,15 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.GenderEnum;
import com.epmet.commons.tools.enums.IcResiUserSubStatusEnum;
import com.epmet.commons.tools.enums.IdCardTypeEnum;
import com.epmet.commons.tools.enums.RelationshipEnum;
import com.epmet.commons.tools.enums.*;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.redis.common.bean.HouseInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.IdCardRegexUtils;
@ -29,6 +30,7 @@ import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.SyncResiResDTO;
import com.epmet.entity.IcBirthRecordEntity;
import com.epmet.entity.IcResiUserEntity;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.ChangeWelfareService;
import com.epmet.service.IcBirthRecordService;
@ -37,6 +39,7 @@ import com.epmet.service.IcUserTransferRecordService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Service;
@ -65,6 +68,8 @@ public class IcBirthRecordServiceImpl extends BaseServiceImpl<IcBirthRecordDao,
private IcResiUserDao icResiUserDao;
@Resource
private ChangeWelfareService changeWelfareService;
@Resource
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient;
@Override
public PageData<IcBirthRecordDTO> page(BirthRecordFormDTO formDTO) {
@ -118,7 +123,24 @@ public class IcBirthRecordServiceImpl extends BaseServiceImpl<IcBirthRecordDao,
@Override
public IcBirthRecordDTO get(String id) {
IcBirthRecordEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IcBirthRecordDTO.class);
if (null == entity) {
return null;
}
IcBirthRecordDTO recordDTO=ConvertUtils.sourceToTarget(entity, IcBirthRecordDTO.class);
GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(recordDTO.getGridId());
if (null != gridInfoCache) {
recordDTO.setGridName(gridInfoCache.getGridNamePath());
}
HouseInfoCache houseInfoCache = CustomerIcHouseRedis.getHouseInfo(entity.getCustomerId(), recordDTO.getHomeId());
if (null != houseInfoCache) {
recordDTO.setHomeAllName(houseInfoCache.getAllName());
}
Result<Map<String, String>> relationshipRes = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode());
if (relationshipRes.success() && MapUtils.isNotEmpty(relationshipRes.getData())) {
String householderRelationName = relationshipRes.getData().containsKey(recordDTO.getHouseholderRelation()) ? relationshipRes.getData().get(recordDTO.getHouseholderRelation()) : StrConstant.EPMETY_STR;
recordDTO.setHouseholderRelationName(householderRelationName);
}
return recordDTO;
}
@Override

Loading…
Cancel
Save