|
|
@ -1099,7 +1099,71 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public PersonWarnRightListResultDTO personWarnRightList(PersonWarnRightListFormDTO formDTO, TokenDto tokenDto) { |
|
|
|
return null; |
|
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); |
|
|
|
if (null == staffInfo){ |
|
|
|
throw new EpmetException(String.format("未查询到此工作人员信息%s",tokenDto.getUserId())); |
|
|
|
} |
|
|
|
Result<List<CustomerCategoryShowAndWarnListResultDTO>> configListResult = operCustomizeOpenFeignClient.getCustomerCategoryShowAndWarnList(tokenDto.getCustomerId()); |
|
|
|
if (!configListResult.success()){ |
|
|
|
throw new EpmetException("查询居民分类配置失败..."); |
|
|
|
} |
|
|
|
PersonWarnRightListResultDTO result = new PersonWarnRightListResultDTO(); |
|
|
|
if (CollectionUtils.isEmpty(configListResult.getData())){ |
|
|
|
return result; |
|
|
|
} |
|
|
|
List<CustomerCategoryShowAndWarnListResultDTO> configList = configListResult.getData(); |
|
|
|
PageInfo<Map<String, Object>> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectResiUsers(configList.stream().map(m -> m.getColumnName()).collect(Collectors.toList()), staffInfo.getAgencyId())); |
|
|
|
List<Map<String, Object>> list = pageInfo.getList(); |
|
|
|
if (CollectionUtils.isEmpty(list)) { |
|
|
|
return result; |
|
|
|
} |
|
|
|
result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); |
|
|
|
List<PersonWarnRightListResultDTO.PersonWarnRightList> userList = disposeCategory(list, configList); |
|
|
|
Result<List<HouseInfoDTO>> houseInfosResult = govOrgOpenFeignClient.queryListHouseInfo(userList.stream().distinct().map(m -> m.getHomeId()).collect(Collectors.toSet())); |
|
|
|
if (!houseInfosResult.success()){ |
|
|
|
throw new EpmetException("查询房屋信息失败..."); |
|
|
|
} |
|
|
|
List<HouseInfoDTO> houseInfos = houseInfosResult.getData(); |
|
|
|
userList.forEach(u -> houseInfos.stream().filter(h -> h.getHomeId().equals(u.getHomeId())).forEach(h -> { |
|
|
|
String name = h.getNeighborHoodName()+h.getBuildingName()+h.getUnitName()+h.getHouseName(); |
|
|
|
u.setFamily(name); |
|
|
|
})); |
|
|
|
result.setList(userList); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 居民分类 和 网格名 处理 |
|
|
|
* @param list |
|
|
|
* @param configList |
|
|
|
* @author zxc |
|
|
|
* @date 2022/1/18 3:22 下午 |
|
|
|
*/ |
|
|
|
public List<PersonWarnRightListResultDTO.PersonWarnRightList> disposeCategory(List<Map<String, Object>> list,List<CustomerCategoryShowAndWarnListResultDTO> configList){ |
|
|
|
List<PersonWarnRightListResultDTO.PersonWarnRightList> userList = new ArrayList<>(); |
|
|
|
list.forEach(l -> { |
|
|
|
PersonWarnRightListResultDTO.PersonWarnRightList dto = ConvertUtils.mapToEntity(l, PersonWarnRightListResultDTO.PersonWarnRightList.class); |
|
|
|
// 分类名字
|
|
|
|
List<String> types = new ArrayList<>(); |
|
|
|
configList.forEach(c -> { |
|
|
|
l.forEach((k,v) -> { |
|
|
|
if (c.getColumnName().equals(k) && null != v && v.equals(NumConstant.ONE_STR)){ |
|
|
|
types.add(c.getLabel()); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
// 只显示有类别的居民
|
|
|
|
if (CollectionUtils.isNotEmpty(types)){ |
|
|
|
dto.setType(types); |
|
|
|
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId()); |
|
|
|
if (null == gridInfo){ |
|
|
|
throw new EpmetException(String.format("查询网格信息失败%s",dto.getGridId())); |
|
|
|
} |
|
|
|
dto.setGridName(gridInfo.getGridNamePath()); |
|
|
|
userList.add(dto); |
|
|
|
} |
|
|
|
}); |
|
|
|
return userList; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|