|
|
@ -2343,11 +2343,6 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
} |
|
|
|
HouseInfoResultDTO houseInfo = houseResult.getData(); |
|
|
|
|
|
|
|
IcResiUserDTO userDTO = baseDao.getResiUserByIdCard(dto.getIdCard(), houseInfo.getCustomerId()); |
|
|
|
if (null != userDTO && null != userDTO.getIdCard()) { |
|
|
|
String errorMsg = "新增居民信息失败,身份证号已存在!"; |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); |
|
|
|
} |
|
|
|
//这个房屋下已经设置了户主后,再次选择户主时提示提示“房屋下已存在户主” PS.户主指与户主关系是本人的用户
|
|
|
|
if (RelationshipEnum.SELF.getCode().equals(dto.getYhzgx())) { |
|
|
|
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>(); |
|
|
@ -2360,7 +2355,6 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
dto.setCustomerId(houseInfo.getCustomerId()); |
|
|
|
dto.setAgencyId(houseInfo.getAgencyId()); |
|
|
|
dto.setPids(houseInfo.getAgencyPids()); |
|
|
@ -2370,12 +2364,33 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
dto.setUnitId(houseInfo.getBuildingUnitId()); |
|
|
|
dto.setHomeId(houseInfo.getHouseId()); |
|
|
|
|
|
|
|
IcResiUserDTO userDTO = baseDao.getResiUserByIdCard(dto.getIdCard(), houseInfo.getCustomerId()); |
|
|
|
if (null != userDTO && null != userDTO.getIdCard()) { |
|
|
|
//覆盖原有的家庭成员信息
|
|
|
|
return updateOldMemberInfo(houseInfo.getCustomerId(),dto); |
|
|
|
} |
|
|
|
|
|
|
|
IcResiUserEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserEntity.class); |
|
|
|
insert(entity); |
|
|
|
|
|
|
|
return new Result().ok("新增成功"); |
|
|
|
} |
|
|
|
|
|
|
|
private Result updateOldMemberInfo(String customerId, IcResiUserConfirmSubmitDTO dto) { |
|
|
|
IcResiUserEntity userEntity = baseDao.selectResiUserEntityByIdCard(dto.getIdCard(), customerId); |
|
|
|
userEntity.setName(dto.getName()); |
|
|
|
userEntity.setIdCard(dto.getIdCard()); |
|
|
|
userEntity.setMobile(dto.getMobile()); |
|
|
|
userEntity.setBirthday(dto.getBirthday()); |
|
|
|
userEntity.setGender(dto.getGender()); |
|
|
|
userEntity.setMz(dto.getMz()); |
|
|
|
userEntity.setYhzgx(dto.getYhzgx()); |
|
|
|
userEntity.setHjszd(dto.getHjszd()); |
|
|
|
userEntity.setXjzd(dto.getXjzd()); |
|
|
|
baseDao.updateById(userEntity); |
|
|
|
return new Result().ok("新增成功"); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* desc:根据字段值获取 options |
|
|
|
* @param customerId |
|
|
|