|
@ -441,11 +441,12 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
} |
|
|
} |
|
|
//2021.11.25 新增需求 客户下身份证号唯一 start
|
|
|
//2021.11.25 新增需求 客户下身份证号唯一 start
|
|
|
if (map.containsKey("ID_CARD")) { |
|
|
if (map.containsKey("ID_CARD")) { |
|
|
IcResiUserDTO dto = new IcResiUserDTO(); |
|
|
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>(); |
|
|
dto.setCustomerId(tokenDto.getCustomerId()); |
|
|
wrapper.eq(IcResiUserEntity::getCustomerId, tokenDto.getCustomerId()); |
|
|
dto.setIdCard(map.get("ID_CARD")); |
|
|
wrapper.eq(IcResiUserEntity::getIdCard, map.get("ID_CARD")); |
|
|
IcResiUserDTO userDTO = baseDao.getResiUserByIdCard(map.get("ID_CARD"), dto.getCustomerId()); |
|
|
wrapper.ne(IcResiUserEntity::getId, map.get("ID")); |
|
|
if (null != userDTO && null != userDTO.getIdCard()) { |
|
|
List<IcResiUserEntity> entityList = baseDao.selectList(wrapper); |
|
|
|
|
|
if (CollectionUtils.isNotEmpty(entityList)) { |
|
|
String errorMsg = "修改居民信息失败,身份证号已存在!"; |
|
|
String errorMsg = "修改居民信息失败,身份证号已存在!"; |
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); |
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); |
|
|
} |
|
|
} |
|
|