|
|
@@ -809,40 +809,49 @@ public class DataCountService {
|
|
|
roomBuckets.get(vacant).add(room);
|
|
|
}
|
|
|
}
|
|
|
- tempCacheTownData.put("leaseVacantRoomCount", roomBuckets.get(vacant).size());
|
|
|
- tempCacheTownData.put("leaseVacantAreaCount", roomBuckets.get(vacant)
|
|
|
- .stream()
|
|
|
+ // 房间数据更改,根据租赁得到的空房间并不完整,暂时不处理房间数量问题,租赁空置面积改为总面积减去其他面积
|
|
|
+ // 总面积
|
|
|
+ BigDecimal totalBuildArea = allPark.stream()
|
|
|
.map(IndustrialPark::getCBuildingArea)
|
|
|
.filter(Objects::nonNull)
|
|
|
- .reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
|
|
+ .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
|
- tempCacheTownData.put("leaseExpiringSoonRoomCount", roomBuckets.get(expiringSoon).size());
|
|
|
- tempCacheTownData.put("leaseExpiringSoonAreaCount", roomBuckets.get(expiringSoon)
|
|
|
+ BigDecimal expiringSoonArea = roomBuckets.get(expiringSoon)
|
|
|
.stream()
|
|
|
.map(IndustrialPark::getCBuildingArea)
|
|
|
.filter(Objects::nonNull)
|
|
|
- .reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
|
|
-
|
|
|
- tempCacheTownData.put("leaseUtilizedRoomCount", roomBuckets.get(utilized).size());
|
|
|
- tempCacheTownData.put("leaseUtilizedAreaCount", roomBuckets.get(utilized)
|
|
|
+ .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ BigDecimal utilizedArea = roomBuckets.get(utilized)
|
|
|
.stream()
|
|
|
.map(IndustrialPark::getCBuildingArea)
|
|
|
.filter(Objects::nonNull)
|
|
|
- .reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
|
|
-
|
|
|
- tempCacheTownData.put("leaseReservedRoomCount", roomBuckets.get(reserved).size());
|
|
|
- tempCacheTownData.put("leaseReservedAreaCount", roomBuckets.get(reserved)
|
|
|
+ .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ BigDecimal reservedArea = roomBuckets.get(reserved)
|
|
|
.stream()
|
|
|
.map(IndustrialPark::getCBuildingArea)
|
|
|
.filter(Objects::nonNull)
|
|
|
- .reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
|
|
-
|
|
|
- tempCacheTownData.put("leaseTerminatedRoomCount", roomBuckets.get(terminated).size());
|
|
|
- tempCacheTownData.put("leaseTerminatedAreaCount", roomBuckets.get(terminated)
|
|
|
+ .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ BigDecimal terminatedArea = roomBuckets.get(terminated)
|
|
|
.stream()
|
|
|
.map(IndustrialPark::getCBuildingArea)
|
|
|
.filter(Objects::nonNull)
|
|
|
- .reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
|
|
+ .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ BigDecimal vacantArea = totalBuildArea.subtract(expiringSoonArea).subtract(utilizedArea).subtract(reservedArea).subtract(terminatedArea);
|
|
|
+
|
|
|
+ tempCacheTownData.put("leaseVacantRoomCount", roomBuckets.get(vacant).size());
|
|
|
+ tempCacheTownData.put("leaseVacantAreaCount", vacantArea);
|
|
|
+
|
|
|
+ tempCacheTownData.put("leaseExpiringSoonRoomCount", roomBuckets.get(expiringSoon).size());
|
|
|
+ tempCacheTownData.put("leaseExpiringSoonAreaCount", expiringSoonArea);
|
|
|
+
|
|
|
+ tempCacheTownData.put("leaseUtilizedRoomCount", roomBuckets.get(utilized).size());
|
|
|
+ tempCacheTownData.put("leaseUtilizedAreaCount", utilizedArea);
|
|
|
+
|
|
|
+ tempCacheTownData.put("leaseReservedRoomCount", roomBuckets.get(reserved).size());
|
|
|
+ tempCacheTownData.put("leaseReservedAreaCount", reservedArea);
|
|
|
+
|
|
|
+ tempCacheTownData.put("leaseTerminatedRoomCount", roomBuckets.get(terminated).size());
|
|
|
+ tempCacheTownData.put("leaseTerminatedAreaCount", terminatedArea);
|
|
|
}
|
|
|
|
|
|
public JSONObject getTownData() {
|