|
@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.skyversation.xjcy.bean.*;
|
|
import com.skyversation.xjcy.bean.*;
|
|
|
import com.skyversation.xjcy.enums.EnterpriseLevel;
|
|
import com.skyversation.xjcy.enums.EnterpriseLevel;
|
|
|
-import com.skyversation.xjcy.query.DMSQuery;
|
|
|
|
|
import com.skyversation.xjcy.util.SpecialisationStringCollector;
|
|
import com.skyversation.xjcy.util.SpecialisationStringCollector;
|
|
|
import com.skyversation.xjcy.util.TimeUtil;
|
|
import com.skyversation.xjcy.util.TimeUtil;
|
|
|
import lombok.NoArgsConstructor;
|
|
import lombok.NoArgsConstructor;
|
|
@@ -104,14 +103,16 @@ public class DataCountService {
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
|
}
|
|
}
|
|
|
- //统一查询所有需要的数据避免处理时间太长token过期,数据量大不了所以不做流式
|
|
|
|
|
- List<IndustrialPark> allIndustrialPark = dmsService.query(token, DMSQuery.INDUSTRIAL_PARK, IndustrialPark.class);
|
|
|
|
|
- List<Enterprise> allEnterprise = dmsService.query(token, DMSQuery.ENTERPRISE, Enterprise.class);
|
|
|
|
|
- List<EnterpriseEconomic> inDateEnterpriseEconomic = dmsService.query(token, DMSQuery.ECONOMIC_ALL_INDEED, EnterpriseEconomic.class);
|
|
|
|
|
- List<Order> allOrder = dmsService.query(token, DMSQuery.ORDER, Order.class);
|
|
|
|
|
- List<LeaseDetail> lastLeaseDetail = dmsService.query(token, DMSQuery.LAST_LEASE_DETAIL, LeaseDetail.class);
|
|
|
|
|
- List<LeaseDetail> lastYearLease = dmsService.query(token, DMSQuery.LAST_YEAR_LEASE_DETAIL, LeaseDetail.class);
|
|
|
|
|
|
|
|
|
|
|
|
+ LocalDate now = LocalDate.now();
|
|
|
|
|
+
|
|
|
|
|
+ //统一查询所有需要的数据避免处理时间太长token过期,数据量大不了所以不做流式
|
|
|
|
|
+ List<IndustrialPark> allIndustrialPark = dmsService.query(token, DMSService.DMSQuery.INDUSTRIAL_PARK, IndustrialPark.class, now);
|
|
|
|
|
+ List<Enterprise> allEnterprise = dmsService.query(token, DMSService.DMSQuery.ENTERPRISE, Enterprise.class, now);
|
|
|
|
|
+ List<EnterpriseEconomic> inDateEnterpriseEconomic = dmsService.query(token, DMSService.DMSQuery.ECONOMIC_ALL_INDEED, EnterpriseEconomic.class, now);
|
|
|
|
|
+ List<Order> allOrder = dmsService.query(token, DMSService.DMSQuery.ORDER, Order.class, now);
|
|
|
|
|
+ List<LeaseDetail> lastLeaseDetail = dmsService.query(token, DMSService.DMSQuery.LAST_LEASE_DETAIL, LeaseDetail.class, now);
|
|
|
|
|
+ List<LeaseDetail> lastYearLease = dmsService.query(token, DMSService.DMSQuery.LAST_YEAR_LEASE_DETAIL, LeaseDetail.class, now);
|
|
|
//处理一下拿到的数据,建一建索引
|
|
//处理一下拿到的数据,建一建索引
|
|
|
Map<String, List<EnterpriseEconomic>> enterpriseEconomicMap = new HashMap<>();
|
|
Map<String, List<EnterpriseEconomic>> enterpriseEconomicMap = new HashMap<>();
|
|
|
inDateEnterpriseEconomic.forEach(e -> {
|
|
inDateEnterpriseEconomic.forEach(e -> {
|
|
@@ -125,10 +126,26 @@ public class DataCountService {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ lastLeaseDetail = new ArrayList<>(lastLeaseDetail.stream()
|
|
|
|
|
+ .collect(Collectors.toMap(
|
|
|
|
|
+ LeaseDetail::getCRoomCode,
|
|
|
|
|
+ p -> p,
|
|
|
|
|
+ (existing, replacement) ->{
|
|
|
|
|
+ LocalDate existingEnd = existing.getCEndDate();
|
|
|
|
|
+ LocalDate replacementEnd = replacement.getCEndDate();
|
|
|
|
|
+
|
|
|
|
|
+ if (existingEnd == null) return replacement;
|
|
|
|
|
+ if (replacementEnd == null) return existing;
|
|
|
|
|
+
|
|
|
|
|
+ return existingEnd.isAfter(replacementEnd) ? existing : replacement;
|
|
|
|
|
+ }
|
|
|
|
|
+ ))
|
|
|
|
|
+ .values());
|
|
|
|
|
+
|
|
|
//楼宇/企业/企业经济数据遍历,全镇级/产业园级/楼栋级一并处理
|
|
//楼宇/企业/企业经济数据遍历,全镇级/产业园级/楼栋级一并处理
|
|
|
|
|
|
|
|
//遍历并计算企业相关的结果
|
|
//遍历并计算企业相关的结果
|
|
|
- countEnterprise(allEnterprise, enterpriseEconomicMap);
|
|
|
|
|
|
|
+ countEnterprise(allEnterprise, enterpriseEconomicMap, now);
|
|
|
|
|
|
|
|
//遍历计算产业园相关
|
|
//遍历计算产业园相关
|
|
|
countIndustrialPark(allIndustrialPark);
|
|
countIndustrialPark(allIndustrialPark);
|
|
@@ -137,11 +154,21 @@ public class DataCountService {
|
|
|
countOrder(allOrder);
|
|
countOrder(allOrder);
|
|
|
|
|
|
|
|
//租赁信息相关统计
|
|
//租赁信息相关统计
|
|
|
- countLease(lastLeaseDetail);
|
|
|
|
|
|
|
+ countLease(lastLeaseDetail,now);
|
|
|
|
|
+
|
|
|
|
|
+ countRoomStatusByLease(lastLeaseDetail, now);
|
|
|
|
|
+
|
|
|
|
|
+ countHistoryData(allEnterprise, allIndustrialPark, lastYearLease, now);
|
|
|
|
|
+
|
|
|
|
|
+ cacheTownData = tempCacheTownData;
|
|
|
|
|
+ cacheParkData = tempCacheParkData;
|
|
|
|
|
+ cacheBuildData = tempCacheBuildData;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ private void countHistoryData(List<Enterprise> allEnterprise, List<IndustrialPark> allIndustrialPark, List<LeaseDetail> lastYearLease, LocalDate now) {
|
|
|
//历史企业总数统计
|
|
//历史企业总数统计
|
|
|
//历史数据,所以不论企业现状如何
|
|
//历史数据,所以不论企业现状如何
|
|
|
- Map<String, List<Enterprise>> enterpriseMap = TimeUtil.split(allEnterprise);
|
|
|
|
|
|
|
+ Map<String, List<Enterprise>> enterpriseMap = TimeUtil.split(allEnterprise, now);
|
|
|
Map<String, Integer> enterpriseByMonth = enterpriseMap.entrySet()
|
|
Map<String, Integer> enterpriseByMonth = enterpriseMap.entrySet()
|
|
|
.stream().collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().size()));
|
|
.stream().collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().size()));
|
|
|
|
|
|
|
@@ -150,22 +177,22 @@ public class DataCountService {
|
|
|
Map<String, List<Enterprise>> enterpriseInTownMap = TimeUtil.split(allEnterprise
|
|
Map<String, List<Enterprise>> enterpriseInTownMap = TimeUtil.split(allEnterprise
|
|
|
.stream()
|
|
.stream()
|
|
|
.filter(e -> Objects.equals(e.getCSsxqCode(), "#YIDIQIYE"))
|
|
.filter(e -> Objects.equals(e.getCSsxqCode(), "#YIDIQIYE"))
|
|
|
- .collect(Collectors.toList()));
|
|
|
|
|
|
|
+ .collect(Collectors.toList()), now);
|
|
|
Map<String, Integer> enterpriseInTownByMonth = enterpriseInTownMap.entrySet()
|
|
Map<String, Integer> enterpriseInTownByMonth = enterpriseInTownMap.entrySet()
|
|
|
.stream().collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().size()));
|
|
.stream().collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().size()));
|
|
|
|
|
|
|
|
//历史房间总数统计
|
|
//历史房间总数统计
|
|
|
Map<String, List<IndustrialPark>> industrialParkMap = TimeUtil.split(allIndustrialPark
|
|
Map<String, List<IndustrialPark>> industrialParkMap = TimeUtil.split(allIndustrialPark
|
|
|
.stream()
|
|
.stream()
|
|
|
- .filter(e->Objects.equals(e.getCResourceType(),"1"))
|
|
|
|
|
- .collect(Collectors.toList())
|
|
|
|
|
- );
|
|
|
|
|
- Map<String,Integer> roomByMonth = industrialParkMap.entrySet().stream().collect(
|
|
|
|
|
|
|
+ .filter(e -> Objects.equals(e.getCResourceType(), "1"))
|
|
|
|
|
+ .collect(Collectors.toList()),
|
|
|
|
|
+ now);
|
|
|
|
|
+ Map<String, Integer> roomByMonth = industrialParkMap.entrySet().stream().collect(
|
|
|
Collectors.toMap(Map.Entry::getKey, e -> e.getValue().size())
|
|
Collectors.toMap(Map.Entry::getKey, e -> e.getValue().size())
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
//历史已使用房间总数统计
|
|
//历史已使用房间总数统计
|
|
|
- Map<String, List<LeaseDetail>> leaseMap = TimeUtil.split(lastYearLease);
|
|
|
|
|
|
|
+ Map<String, List<LeaseDetail>> leaseMap = TimeUtil.split(lastYearLease, now);
|
|
|
Map<String, Long> leaseByMonth = leaseMap.entrySet()
|
|
Map<String, Long> leaseByMonth = leaseMap.entrySet()
|
|
|
.stream()
|
|
.stream()
|
|
|
.collect(
|
|
.collect(
|
|
@@ -187,16 +214,10 @@ public class DataCountService {
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
tempCacheTownData.put("enterpriseByMonth", enterpriseByMonth);
|
|
tempCacheTownData.put("enterpriseByMonth", enterpriseByMonth);
|
|
|
tempCacheTownData.put("enterpriseInTownByMonth", enterpriseInTownByMonth);
|
|
tempCacheTownData.put("enterpriseInTownByMonth", enterpriseInTownByMonth);
|
|
|
tempCacheTownData.put("leaseByMonth", leaseByMonth);
|
|
tempCacheTownData.put("leaseByMonth", leaseByMonth);
|
|
|
tempCacheTownData.put("roomByMonth", roomByMonth);
|
|
tempCacheTownData.put("roomByMonth", roomByMonth);
|
|
|
-
|
|
|
|
|
- cacheTownData = tempCacheTownData;
|
|
|
|
|
- cacheParkData = tempCacheParkData;
|
|
|
|
|
- cacheBuildData = tempCacheBuildData;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -455,7 +476,7 @@ public class DataCountService {
|
|
|
tempCacheTownData.put("areaUsed", totalBuildArea.subtract(totalVacantArea));
|
|
tempCacheTownData.put("areaUsed", totalBuildArea.subtract(totalVacantArea));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void countEnterprise(List<Enterprise> allEnterprise, Map<String, List<EnterpriseEconomic>> enterpriseEconomicMap) {
|
|
|
|
|
|
|
+ private void countEnterprise(List<Enterprise> allEnterprise, Map<String, List<EnterpriseEconomic>> enterpriseEconomicMap, LocalDate now) {
|
|
|
int inTownCount = 0;
|
|
int inTownCount = 0;
|
|
|
int gsqyCount = 0;
|
|
int gsqyCount = 0;
|
|
|
int aliveCount = 0;
|
|
int aliveCount = 0;
|
|
@@ -491,9 +512,9 @@ public class DataCountService {
|
|
|
List<EnterpriseEconomic> economicBy12Month = new ArrayList<>();
|
|
List<EnterpriseEconomic> economicBy12Month = new ArrayList<>();
|
|
|
List<EnterpriseEconomic> economicByYtdThisYear = new ArrayList<>();
|
|
List<EnterpriseEconomic> economicByYtdThisYear = new ArrayList<>();
|
|
|
List<EnterpriseEconomic> economicByYtdLastYear = new ArrayList<>();
|
|
List<EnterpriseEconomic> economicByYtdLastYear = new ArrayList<>();
|
|
|
- List<String> Last12Month = SpecialisationStringCollector.YearMonthByLast12Month();
|
|
|
|
|
- List<String> ytdThisYear = SpecialisationStringCollector.YearMonthByYtd();
|
|
|
|
|
- List<String> ytdLastYear = SpecialisationStringCollector.YearMonthByYtd(1);
|
|
|
|
|
|
|
+ List<String> Last12Month = SpecialisationStringCollector.YearMonthByLast12Month(now);
|
|
|
|
|
+ List<String> ytdThisYear = SpecialisationStringCollector.YearMonthByYtd(now);
|
|
|
|
|
+ List<String> ytdLastYear = SpecialisationStringCollector.YearMonthByYtd(1, now);
|
|
|
Optional.ofNullable(enterpriseEconomicList).orElse(new ArrayList<>()).stream()
|
|
Optional.ofNullable(enterpriseEconomicList).orElse(new ArrayList<>()).stream()
|
|
|
.filter(e -> !"4".equals(e.getCDataStatus()))
|
|
.filter(e -> !"4".equals(e.getCDataStatus()))
|
|
|
.forEach(e -> {
|
|
.forEach(e -> {
|
|
@@ -547,13 +568,11 @@ public class DataCountService {
|
|
|
tempCacheTownData.put("orderCount", orderCount);
|
|
tempCacheTownData.put("orderCount", orderCount);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void countLease(List<LeaseDetail> allLease) {
|
|
|
|
|
|
|
+ private void countLease(List<LeaseDetail> allLease,LocalDate now) {
|
|
|
List<LeaseDetail> timeoutIn1Month = new ArrayList<>();
|
|
List<LeaseDetail> timeoutIn1Month = new ArrayList<>();
|
|
|
List<LeaseDetail> timeoutIn3Month = new ArrayList<>();
|
|
List<LeaseDetail> timeoutIn3Month = new ArrayList<>();
|
|
|
|
|
|
|
|
- LocalDate now = LocalDate.now();
|
|
|
|
|
|
|
|
|
|
- Map<String, LeaseDetail> leaseMap = new HashMap<>();
|
|
|
|
|
for (LeaseDetail lease : allLease) {
|
|
for (LeaseDetail lease : allLease) {
|
|
|
if (lease.getCEndDate() != null) {
|
|
if (lease.getCEndDate() != null) {
|
|
|
if (lease.getCEndDate().isAfter(now)) {
|
|
if (lease.getCEndDate().isAfter(now)) {
|
|
@@ -564,77 +583,100 @@ public class DataCountService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- leaseMap.put(lease.getCRoomCode(), lease);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ timeoutIn1Month.sort(Comparator.comparing(LeaseDetail::getCEndDate));
|
|
|
|
|
+ timeoutIn3Month.sort(Comparator.comparing(LeaseDetail::getCEndDate));
|
|
|
|
|
|
|
|
- int vacantRoomCount = 0;
|
|
|
|
|
- BigDecimal vacantAreaCount = BigDecimal.ZERO;
|
|
|
|
|
- int expiringSoonRoomCount = 0;
|
|
|
|
|
- BigDecimal expiringSoonAreaCount = BigDecimal.ZERO;
|
|
|
|
|
- int utilizedRoomCount = 0;
|
|
|
|
|
- BigDecimal utilizedAreaCount = BigDecimal.ZERO;
|
|
|
|
|
- int reservedRoomCount = 0;
|
|
|
|
|
- BigDecimal reservedAreaCount = BigDecimal.ZERO;
|
|
|
|
|
- int terminatedRoomCount = 0;
|
|
|
|
|
- BigDecimal terminatedAreaCount = BigDecimal.ZERO;
|
|
|
|
|
|
|
+ List<LeaseDetail> sortedLeaseTimeout = Stream.concat(timeoutIn1Month.stream(), timeoutIn3Month.stream())
|
|
|
|
|
+ .sorted(Comparator.comparing(LeaseDetail::getCEndDate))
|
|
|
|
|
+ .limit(25)
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
+
|
|
|
|
|
+ tempCacheTownData.put("leaseTimeoutIn1Month", timeoutIn1Month.size());
|
|
|
|
|
+ tempCacheTownData.put("leaseTimeoutIn3Month", timeoutIn3Month.size());
|
|
|
|
|
+ tempCacheTownData.put("leaseTimeout", sortedLeaseTimeout);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void countRoomStatusByLease(List<LeaseDetail> allLease, LocalDate now) {
|
|
|
|
|
+
|
|
|
|
|
+ Map<String, LeaseDetail> leaseMap = allLease.stream().collect(
|
|
|
|
|
+ Collectors.toMap(
|
|
|
|
|
+ LeaseDetail::getCRoomCode,
|
|
|
|
|
+ v -> v
|
|
|
|
|
+ )
|
|
|
|
|
+ );
|
|
|
|
|
+ String vacant = "vacant";
|
|
|
|
|
+ String expiringSoon = "expiringSoon";
|
|
|
|
|
+ String utilized = "utilized";
|
|
|
|
|
+ String reserved = "reserved";
|
|
|
|
|
+ String terminated = "terminated";
|
|
|
|
|
+ String[] buckets = new String[]{vacant, expiringSoon, utilized, reserved, terminated};
|
|
|
|
|
+
|
|
|
|
|
+ Map<String, List<IndustrialPark>> roomBuckets = new HashMap<>();
|
|
|
|
|
+
|
|
|
|
|
+ for (String bucket : buckets) {
|
|
|
|
|
+ roomBuckets.put(bucket, new ArrayList<>());
|
|
|
|
|
+ }
|
|
|
for (List<IndustrialPark> roomList : roomMap.values()) {
|
|
for (List<IndustrialPark> roomList : roomMap.values()) {
|
|
|
for (IndustrialPark room : roomList) {
|
|
for (IndustrialPark room : roomList) {
|
|
|
LeaseDetail lease = leaseMap.get(room.getCParkCode());
|
|
LeaseDetail lease = leaseMap.get(room.getCParkCode());
|
|
|
if (lease == null) {
|
|
if (lease == null) {
|
|
|
- vacantRoomCount++;
|
|
|
|
|
- vacantAreaCount = vacantAreaCount.add(Optional.ofNullable(room.getCBuildingArea()).orElse(BigDecimal.ZERO));
|
|
|
|
|
|
|
+ roomBuckets.get(vacant).add(room);
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
if (lease.getCEndDate().isAfter(now) && lease.getCStartDate().isBefore(now)) {
|
|
if (lease.getCEndDate().isAfter(now) && lease.getCStartDate().isBefore(now)) {
|
|
|
- utilizedRoomCount++;
|
|
|
|
|
- utilizedAreaCount = utilizedAreaCount.add(Optional.ofNullable(room.getCBuildingArea()).orElse(BigDecimal.ZERO));
|
|
|
|
|
|
|
+ roomBuckets.get(utilized).add(room);
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
if (lease.getCStartDate().isAfter(now) && lease.getCEndDate().isAfter(now)) {
|
|
if (lease.getCStartDate().isAfter(now) && lease.getCEndDate().isAfter(now)) {
|
|
|
- reservedRoomCount++;
|
|
|
|
|
- reservedAreaCount = reservedAreaCount.add(Optional.ofNullable(room.getCBuildingArea()).orElse(BigDecimal.ZERO));
|
|
|
|
|
|
|
+ roomBuckets.get(reserved).add(room);
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
if (lease.getCEndDate().isBefore(now) && lease.getCEndDate().plusMonths(1).isAfter(now)) {
|
|
if (lease.getCEndDate().isBefore(now) && lease.getCEndDate().plusMonths(1).isAfter(now)) {
|
|
|
- terminatedRoomCount++;
|
|
|
|
|
- terminatedAreaCount = terminatedAreaCount.add(Optional.ofNullable(room.getCBuildingArea()).orElse(BigDecimal.ZERO));
|
|
|
|
|
|
|
+ roomBuckets.get(terminated).add(room);
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
if (lease.getCEndDate().isAfter(now) && lease.getCEndDate().isBefore(now.plusMonths(3))) {
|
|
if (lease.getCEndDate().isAfter(now) && lease.getCEndDate().isBefore(now.plusMonths(3))) {
|
|
|
- expiringSoonRoomCount++;
|
|
|
|
|
- expiringSoonAreaCount = expiringSoonAreaCount.add(Optional.ofNullable(room.getCBuildingArea()).orElse(BigDecimal.ZERO));
|
|
|
|
|
|
|
+ roomBuckets.get(expiringSoon).add(room);
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
- vacantRoomCount++;
|
|
|
|
|
- vacantAreaCount = vacantAreaCount.add(Optional.ofNullable(room.getCBuildingArea()).orElse(BigDecimal.ZERO));
|
|
|
|
|
|
|
+ roomBuckets.get(vacant).add(room);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ tempCacheTownData.put("leaseVacantRoomCount", roomBuckets.get(vacant).size());
|
|
|
|
|
+ tempCacheTownData.put("leaseVacantAreaCount", roomBuckets.get(vacant)
|
|
|
|
|
+ .stream()
|
|
|
|
|
+ .map(IndustrialPark::getCBuildingArea)
|
|
|
|
|
+ .filter(Objects::nonNull)
|
|
|
|
|
+ .reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
|
|
|
|
|
|
|
- timeoutIn1Month.sort(Comparator.comparing(LeaseDetail::getCEndDate));
|
|
|
|
|
- timeoutIn3Month.sort(Comparator.comparing(LeaseDetail::getCEndDate));
|
|
|
|
|
-
|
|
|
|
|
- List<LeaseDetail> sortedLeaseTimeout = Stream.concat(timeoutIn1Month.stream(), timeoutIn3Month.stream())
|
|
|
|
|
- .sorted(Comparator.comparing(LeaseDetail::getCEndDate))
|
|
|
|
|
- .limit(25)
|
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
-
|
|
|
|
|
- tempCacheTownData.put("leaseTimeoutIn1Month", timeoutIn1Month.size());
|
|
|
|
|
- tempCacheTownData.put("leaseTimeoutIn3Month", timeoutIn3Month.size());
|
|
|
|
|
- tempCacheTownData.put("leaseTimeout", sortedLeaseTimeout);
|
|
|
|
|
- tempCacheTownData.put("leaseVacantRoomCount", vacantRoomCount);
|
|
|
|
|
- tempCacheTownData.put("leaseVacantAreaCount", vacantAreaCount);
|
|
|
|
|
-
|
|
|
|
|
- tempCacheTownData.put("leaseExpiringSoonRoomCount", expiringSoonRoomCount);
|
|
|
|
|
- tempCacheTownData.put("leaseExpiringSoonAreaCount", expiringSoonAreaCount);
|
|
|
|
|
|
|
+ tempCacheTownData.put("leaseExpiringSoonRoomCount", roomBuckets.get(expiringSoon).size());
|
|
|
|
|
+ tempCacheTownData.put("leaseExpiringSoonAreaCount", roomBuckets.get(expiringSoon)
|
|
|
|
|
+ .stream()
|
|
|
|
|
+ .map(IndustrialPark::getCBuildingArea)
|
|
|
|
|
+ .filter(Objects::nonNull)
|
|
|
|
|
+ .reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
|
|
|
|
|
|
|
- tempCacheTownData.put("leaseUtilizedRoomCount", utilizedRoomCount);
|
|
|
|
|
- tempCacheTownData.put("leaseUtilizedAreaCount", utilizedAreaCount);
|
|
|
|
|
|
|
+ tempCacheTownData.put("leaseUtilizedRoomCount", roomBuckets.get(utilized).size());
|
|
|
|
|
+ tempCacheTownData.put("leaseUtilizedAreaCount", roomBuckets.get(utilized)
|
|
|
|
|
+ .stream()
|
|
|
|
|
+ .map(IndustrialPark::getCBuildingArea)
|
|
|
|
|
+ .filter(Objects::nonNull)
|
|
|
|
|
+ .reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
|
|
|
|
|
|
|
- tempCacheTownData.put("leaseReservedRoomCount", reservedRoomCount);
|
|
|
|
|
- tempCacheTownData.put("leaseReservedAreaCount", reservedAreaCount);
|
|
|
|
|
|
|
+ tempCacheTownData.put("leaseReservedRoomCount", roomBuckets.get(reserved).size());
|
|
|
|
|
+ tempCacheTownData.put("leaseReservedAreaCount", roomBuckets.get(reserved)
|
|
|
|
|
+ .stream()
|
|
|
|
|
+ .map(IndustrialPark::getCBuildingArea)
|
|
|
|
|
+ .filter(Objects::nonNull)
|
|
|
|
|
+ .reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
|
|
|
|
|
|
|
- tempCacheTownData.put("leaseTerminatedRoomCount", terminatedRoomCount);
|
|
|
|
|
- tempCacheTownData.put("leaseTerminatedAreaCount", terminatedAreaCount);
|
|
|
|
|
|
|
+ tempCacheTownData.put("leaseTerminatedRoomCount", roomBuckets.get(terminated).size());
|
|
|
|
|
+ tempCacheTownData.put("leaseTerminatedAreaCount", roomBuckets.get(terminated)
|
|
|
|
|
+ .stream()
|
|
|
|
|
+ .map(IndustrialPark::getCBuildingArea)
|
|
|
|
|
+ .filter(Objects::nonNull)
|
|
|
|
|
+ .reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public JSONObject getTownData() {
|
|
public JSONObject getTownData() {
|