|
|
@ -43,6 +43,7 @@ import com.epmet.dao.IcResiUserDao; |
|
|
|
import com.epmet.dto.CustomerAgencyDTO; |
|
|
|
import com.epmet.dto.CustomerGridDTO; |
|
|
|
import com.epmet.dto.IcHouseDTO; |
|
|
|
import com.epmet.dto.IcNeighborHoodDTO; |
|
|
|
import com.epmet.dto.form.*; |
|
|
|
import com.epmet.dto.result.*; |
|
|
|
import com.epmet.entity.IcResiUserEntity; |
|
|
@ -545,11 +546,32 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
Integer no = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); |
|
|
|
PageInfo<SearchByNameResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.searchByName(formDTO.getName(), staffInfo.getAgencyId(), no)); |
|
|
|
List<SearchByNameResultDTO> result = pageInfo.getList(); |
|
|
|
// 查询小区,楼号,网格
|
|
|
|
// TODO
|
|
|
|
if (CollectionUtils.isEmpty(result)){ |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
// 查询小区,楼号,网格
|
|
|
|
Result<List<AllGridsByUserIdResultDTO>> gridResult = govOrgOpenFeignClient.getGridListByGridIds(result.stream().map(SearchByNameResultDTO::getGridId).collect(Collectors.toList())); |
|
|
|
if (!gridResult.success()) { |
|
|
|
throw new RenException(gridResult.getCode(),gridResult.getMsg()); |
|
|
|
} |
|
|
|
Map<String, String> gridMap = gridResult.getData().stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, AllGridsByUserIdResultDTO::getGridName)); |
|
|
|
Result<List<IcNeighborHoodDTO>> neighborHoodResult = govOrgOpenFeignClient.getListByIds(result.stream().map(SearchByNameResultDTO::getNeighborHoodId).collect(Collectors.toList())); |
|
|
|
if (!neighborHoodResult.success()) { |
|
|
|
throw new RenException(neighborHoodResult.getCode(),neighborHoodResult.getMsg()); |
|
|
|
} |
|
|
|
Map<String, String> neighborHoodMap = neighborHoodResult.getData().stream().collect(Collectors.toMap(IcNeighborHoodDTO::getId, IcNeighborHoodDTO::getNeighborHoodName)); |
|
|
|
Result<List<BuildingResultDTO>> buildResult = govOrgOpenFeignClient.buildingListByIds(result.stream().map(SearchByNameResultDTO::getBuildId).collect(Collectors.toList())); |
|
|
|
if (!buildResult.success()) { |
|
|
|
throw new RenException(buildResult.getCode(),buildResult.getMsg()); |
|
|
|
} |
|
|
|
Map<String, String> buildMap = buildResult.getData().stream().collect(Collectors.toMap(BuildingResultDTO::getBuildingId, BuildingResultDTO::getBuildingName)); |
|
|
|
|
|
|
|
result.forEach(item -> { |
|
|
|
item.setGridName(gridMap.get(item.getGridId())); |
|
|
|
item.setNeighborHoodName(neighborHoodMap.get(item.getNeighborHoodId())); |
|
|
|
item.setBuildNum(buildMap.get(item.getBuildId())); |
|
|
|
}); |
|
|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|