|
|
@@ -591,7 +591,7 @@ public class DataCountService {
|
|
|
parkCount++;
|
|
|
allPark.add(industrialPark);
|
|
|
if (parkTypeCount.containsKey(industrialPark.getCLandUse())) {
|
|
|
- parkTypeCount.put(industrialPark.getCLandUse(), parkCount + 1);
|
|
|
+ parkTypeCount.put(industrialPark.getCLandUse(), parkTypeCount.get(industrialPark.getCLandUse()) + 1);
|
|
|
} else {
|
|
|
parkTypeCount.put(industrialPark.getCLandUse(), 1);
|
|
|
}
|
|
|
@@ -809,19 +809,28 @@ public class DataCountService {
|
|
|
roomBuckets.get(vacant).add(room);
|
|
|
}
|
|
|
}
|
|
|
- // 房间数据更改,根据租赁得到的空房间并不完整,暂时不处理房间数量问题,租赁空置面积改为总面积减去其他面积
|
|
|
- // 总面积
|
|
|
+ // 更改计算逻辑,按照注释说明:
|
|
|
+ // 1) 租赁维度的已预约、到期中止、即将到期(reserved/terminated/expiringSoon)由租赁数据计算
|
|
|
+ // 2) 总体空置和总体已用以总体数据为准(allPark 的总量),不直接用租赁数据计算
|
|
|
+ // 3) 租赁视角的空置/已用可由总体减去其它租赁项倒推得到,确保不丢失总量一致性
|
|
|
+
|
|
|
+ // 总面积(总体口径)
|
|
|
BigDecimal totalBuildArea = allPark.stream()
|
|
|
.map(IndustrialPark::getCBuildingArea)
|
|
|
.filter(Objects::nonNull)
|
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
|
- BigDecimal expiringSoonArea = roomBuckets.get(expiringSoon)
|
|
|
- .stream()
|
|
|
- .map(IndustrialPark::getCBuildingArea)
|
|
|
+ // 总体空置(使用总体数据,不从租赁数据直接汇总)
|
|
|
+ BigDecimal totalVacantArea = allPark.stream()
|
|
|
+ .map(IndustrialPark::getCVacantArea)
|
|
|
.filter(Objects::nonNull)
|
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
- BigDecimal utilizedArea = roomBuckets.get(utilized)
|
|
|
+
|
|
|
+ // 总体已用(由总面积减总体空置得到)
|
|
|
+ BigDecimal totalUsedArea = totalBuildArea.subtract(totalVacantArea);
|
|
|
+
|
|
|
+ // --- 租赁口径计算:已预约 / 到期中止 / 即将到期 ---
|
|
|
+ BigDecimal expiringSoonArea = roomBuckets.get(expiringSoon)
|
|
|
.stream()
|
|
|
.map(IndustrialPark::getCBuildingArea)
|
|
|
.filter(Objects::nonNull)
|
|
|
@@ -836,16 +845,28 @@ public class DataCountService {
|
|
|
.map(IndustrialPark::getCBuildingArea)
|
|
|
.filter(Objects::nonNull)
|
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
- BigDecimal vacantArea = totalBuildArea.subtract(expiringSoonArea).subtract(utilizedArea).subtract(reservedArea).subtract(terminatedArea);
|
|
|
+
|
|
|
+ // --- 倒推租赁视角的空置和已用,保证与总体数据口径一致 ---
|
|
|
+ // 租赁空置(leasingVacant) = 总体空置 - 已预约 - 到期中止
|
|
|
+ BigDecimal leasingVacantArea = totalVacantArea
|
|
|
+ .subtract(reservedArea)
|
|
|
+ .subtract(terminatedArea)
|
|
|
+ .max(BigDecimal.ZERO);
|
|
|
+
|
|
|
+ // 租赁已用(leasingUsed) = 总体已用 - 即将到期(注意:总体已用 = leasingUsed + expiringSoon)
|
|
|
+ BigDecimal leasingUsedArea = totalUsedArea
|
|
|
+ .subtract(expiringSoonArea)
|
|
|
+ .max(BigDecimal.ZERO);
|
|
|
+
|
|
|
|
|
|
tempCacheTownData.put("leaseVacantRoomCount", roomBuckets.get(vacant).size());
|
|
|
- tempCacheTownData.put("leaseVacantAreaCount", vacantArea);
|
|
|
+ tempCacheTownData.put("leaseVacantAreaCount", leasingVacantArea);
|
|
|
|
|
|
tempCacheTownData.put("leaseExpiringSoonRoomCount", roomBuckets.get(expiringSoon).size());
|
|
|
tempCacheTownData.put("leaseExpiringSoonAreaCount", expiringSoonArea);
|
|
|
|
|
|
tempCacheTownData.put("leaseUtilizedRoomCount", roomBuckets.get(utilized).size());
|
|
|
- tempCacheTownData.put("leaseUtilizedAreaCount", utilizedArea);
|
|
|
+ tempCacheTownData.put("leaseUtilizedAreaCount", leasingUsedArea);
|
|
|
|
|
|
tempCacheTownData.put("leaseReservedRoomCount", roomBuckets.get(reserved).size());
|
|
|
tempCacheTownData.put("leaseReservedAreaCount", reservedArea);
|