Browse Source

代码优化

feature/teamB_zz_wgh
sunyuchao 3 years ago
parent
commit
de9010d676
  1. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

11
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

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

Loading…
Cancel
Save