|
|
@ -1114,26 +1114,30 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
//获取用户信息
|
|
|
|
IcResiUserEntity user = baseDao.selectById(userId); |
|
|
|
result.setOwnerName(""); |
|
|
|
//获取用户所在家庭里所有人员信息
|
|
|
|
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
wrapper.eq(IcResiUserEntity::getHomeId, user.getHomeId()); |
|
|
|
wrapper.orderByAsc(IcResiUserEntity::getYhzgx); |
|
|
|
List<IcResiUserEntity> resiUserList = baseDao.selectList(wrapper); |
|
|
|
List<OwnerRelationResultDTO.UserListBean> userList = resiUserList.stream().map(item -> { |
|
|
|
OwnerRelationResultDTO.UserListBean bean = new OwnerRelationResultDTO.UserListBean(); |
|
|
|
bean.setUserId(item.getId()); |
|
|
|
bean.setUserName(item.getName()); |
|
|
|
bean.setRelation(RelationshipEnum.getEnum(item.getYhzgx()).getName()); |
|
|
|
if (userId.equals(item.getId())) { |
|
|
|
bean.setIsSelf(NumConstant.ONE_STR); |
|
|
|
} |
|
|
|
//如果与房主的关系是本人,则这个人就是房主
|
|
|
|
if (RelationshipEnum.SELF.getCode().equals(item.getYhzgx())) { |
|
|
|
result.setOwnerName(item.getName()); |
|
|
|
if (null != user) { |
|
|
|
//获取用户所在家庭里所有人员信息
|
|
|
|
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
wrapper.eq(IcResiUserEntity::getHomeId, user.getHomeId()); |
|
|
|
wrapper.orderByAsc(IcResiUserEntity::getYhzgx); |
|
|
|
List<IcResiUserEntity> resiUserList = baseDao.selectList(wrapper); |
|
|
|
if (CollectionUtils.isNotEmpty(resiUserList)) { |
|
|
|
List<OwnerRelationResultDTO.UserListBean> userList = resiUserList.stream().map(item -> { |
|
|
|
OwnerRelationResultDTO.UserListBean bean = new OwnerRelationResultDTO.UserListBean(); |
|
|
|
bean.setUserId(item.getId()); |
|
|
|
bean.setUserName(item.getName()); |
|
|
|
bean.setRelation(RelationshipEnum.getEnum(item.getYhzgx()).getName()); |
|
|
|
if (userId.equals(item.getId())) { |
|
|
|
bean.setIsSelf(NumConstant.ONE_STR); |
|
|
|
} |
|
|
|
//如果与房主的关系是本人,则这个人就是房主
|
|
|
|
if (RelationshipEnum.SELF.getCode().equals(item.getYhzgx())) { |
|
|
|
result.setOwnerName(item.getName()); |
|
|
|
} |
|
|
|
return bean; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
result.setUserList(userList); |
|
|
|
} |
|
|
|
return bean; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
result.setUserList(userList); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|