Commit 46bbd6ff authored by lixuan's avatar lixuan

feat: 房源

parent 84699671
Pipeline #145550 canceled with stages
......@@ -304,6 +304,9 @@ public class HouseResourceServiceImpl implements HouseResourceService {
houseResourceProfileGraph.setId(gridRegion.getWgCode());
houseResourceProfileGraph.setWgName(gridRegion.getWgName());
houseResourceProfileGraph.setPosition(gridRegion.getPosition());
if (Objects.nonNull(gridRegion.getJzArea())) {
houseResourceProfileGraph.setJzArea(new BigDecimal(gridRegion.getJzArea()));
}
List<HouseResource> collect = houseResources.stream().filter(x -> x.getFour().equals(gridRegion.getWgCode())).collect(Collectors.toList());
if (CollectionUtils.isEmpty(collect)) {
houseResourceProfileGraph.setHouseResources(Collections.emptyList());
......@@ -327,6 +330,7 @@ public class HouseResourceServiceImpl implements HouseResourceService {
}
}
}
result.forEach(x -> x.setJyArea(x.getHouseResources().stream().map(HouseResourcePage::getHouseArea).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add)));
return result.stream().sorted(Comparator.comparing(HouseResourceProfileGraph::getPosition, Comparator.nullsLast(Integer::compareTo))).collect(Collectors.toList());
}
return Collections.emptyList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment