Browse Source

【证件类型】护照-居民出生、迁入

master
wangxianzhang 3 years ago
parent
commit
e6b392d988
  1. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcBirthRecordServiceImpl.java
  2. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcMoveInRecordServiceImpl.java

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

@ -7,12 +7,15 @@ 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.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.IdCardRegexUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcBirthRecordDao;
import com.epmet.dao.IcResiUserDao;
@ -144,6 +147,15 @@ public class IcBirthRecordServiceImpl extends BaseServiceImpl<IcBirthRecordDao,
userEntity.setStatus(NumConstant.ZERO_STR);
userEntity.setSubStatus(IcResiUserSubStatusEnum.BIRTH.getSubStatus());
// 证件类型判断----start----
IdCardRegexUtils regex = IdCardRegexUtils.parse(dto.getIdCard());
if (regex == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "证件号解析错误", "证件号解析错误");
}
IdCardTypeEnum typeEnum = regex.getTypeEnum();
userEntity.setIdCardType(typeEnum.getType());
// 证件类型判断----end----
//判断是否有所属组织,如果有,判断是否属于当前组织,没有的话则直接新增
if (StringUtils.isNotEmpty(sync.getIcResiUserId())) {
userEntity.setId(sync.getIcResiUserId());

12
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcMoveInRecordServiceImpl.java

@ -5,6 +5,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.DictTypeEnum;
import com.epmet.commons.tools.enums.IcResiUserSubStatusEnum;
import com.epmet.commons.tools.enums.IdCardTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
@ -12,6 +13,7 @@ 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.utils.ConvertUtils;
import com.epmet.commons.tools.utils.IdCardRegexUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcMoveInRecordDao;
import com.epmet.dto.ChangeWelfareDTO;
@ -168,6 +170,16 @@ public class IcMoveInRecordServiceImpl extends BaseServiceImpl<IcMoveInRecordDao
IcResiUserEntity entity = ConvertUtils.sourceToTarget(formDTO, IcResiUserEntity.class);
//状态改为0正常
entity.setStatus(NumConstant.ZERO_STR);
// 证件类型判断----start----
IdCardRegexUtils regex = IdCardRegexUtils.parse(formDTO.getIdCard());
if (regex == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "证件号解析错误", "证件号解析错误");
}
IdCardTypeEnum typeEnum = regex.getTypeEnum();
entity.setIdCardType(typeEnum.getType());
// 证件类型判断----end----
//4-1.本社区下正常状态居民且房屋不一样并选择了更新【只更新居民信息,插入调动记录,生成变更记录,不生成变更明细】
if (StringUtils.isNotBlank(resiDTO.getResiAgencyId()) && staffInfo.getAgencyId().equals(resiDTO.getResiAgencyId())
&& "0".equals(resiDTO.getStatus()) && !resiDTO.getResiHomeId().equals(formDTO.getHomeId())

Loading…
Cancel
Save