|
@ -2330,6 +2330,52 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
return new Result().ok("修改成功"); |
|
|
return new Result().ok("修改成功"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public Result addWorkMember(IcResiUserConfirmSubmitDTO dto) { |
|
|
|
|
|
if(StringUtils.isBlank(dto.getHouseCode())){ |
|
|
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "房屋编码不可为空", "房屋编码不可为空"); |
|
|
|
|
|
} |
|
|
|
|
|
CommonHouseFormDTO formDto = new CommonHouseFormDTO(); |
|
|
|
|
|
formDto.setHouseCode(dto.getHouseCode()); |
|
|
|
|
|
Result<HouseInfoResultDTO> houseResult = govOrgOpenFeignClient.getHomeInfoByHouseCode(formDto); |
|
|
|
|
|
if (!houseResult.success() || null == houseResult || null == houseResult.getData()) { |
|
|
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询房屋信息失败", "查询房屋信息失败"); |
|
|
|
|
|
} |
|
|
|
|
|
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<>(); |
|
|
|
|
|
wrapper.eq(IcResiUserEntity::getHomeId, houseInfo.getHouseId()); |
|
|
|
|
|
wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode()); |
|
|
|
|
|
List<IcResiUserEntity> entityList = baseDao.selectList(wrapper); |
|
|
|
|
|
if (CollectionUtils.isNotEmpty(entityList)) { |
|
|
|
|
|
String errorMsg = "房屋下已存在户主"; |
|
|
|
|
|
throw new EpmetException(EpmetErrorCode.ORG_ADD_FAILED.getCode(), errorMsg, errorMsg); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dto.setCustomerId(houseInfo.getCustomerId()); |
|
|
|
|
|
dto.setAgencyId(houseInfo.getAgencyId()); |
|
|
|
|
|
dto.setPids(houseInfo.getAgencyPids()); |
|
|
|
|
|
dto.setGridId(houseInfo.getGridId()); |
|
|
|
|
|
dto.setVillageId(houseInfo.getNeighborHoodId()); |
|
|
|
|
|
dto.setBuildId(houseInfo.getBuildingId()); |
|
|
|
|
|
dto.setUnitId(houseInfo.getBuildingUnitId()); |
|
|
|
|
|
dto.setHomeId(houseInfo.getHouseId()); |
|
|
|
|
|
|
|
|
|
|
|
IcResiUserEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserEntity.class); |
|
|
|
|
|
insert(entity); |
|
|
|
|
|
|
|
|
|
|
|
return new Result().ok("新增成功"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* desc:根据字段值获取 options |
|
|
* desc:根据字段值获取 options |
|
|
* @param customerId |
|
|
* @param customerId |
|
|