Browse Source

一个房屋下只有一个户主

master
zhaoqifeng 3 years ago
parent
commit
889c52ffe9
  1. 28
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

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

@ -208,6 +208,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
}
//2021.11.25 end
//2022.04.19 start 这个房屋下已经设置了户主后,再次选择户主时提示提示“房屋下已存在户主” PS.户主指与户主关系是本人的用户
if (map.containsKey("YHZGX")) {
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiUserEntity::getHomeId, map.get("HOME_ID"));
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);
}
}
//2022.04.19 end
//查询组织信息
String agencyId = map.get("AGENCY_ID");
Result<CustomerAgencyDTO> result = govOrgOpenFeignClient.getAgencyById(agencyId);
@ -325,6 +338,21 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
}
//2021.11.25 end
//2022.04.19 start 这个房屋下已经设置了户主后,再次选择户主时提示提示“房屋下已存在户主” PS.户主指与户主关系是本人的用户
if (map.containsKey("YHZGX")) {
IcResiUserEntity entity = baseDao.selectById(map.get("ID"));
if (entity != null && !RelationshipEnum.SELF.getCode().equals(entity.getYhzgx())) {
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiUserEntity::getHomeId, entity.getHomeId());
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);
}
}
}
//2022.04.19 end
resiUserId = map.get("ID");
}
}

Loading…
Cancel
Save