|
|
@@ -28,7 +28,9 @@ public class ParkPreCounter {
|
|
|
}
|
|
|
|
|
|
private enum ParkKey {
|
|
|
- c_park_code, c_zlqydm, c_zlqymc, c_room_status, c_room_sale_type, c_enterprise_count, c_floor_count, c_building_area, c_self_used_area, c_sellable_area, c_sold_area, c_rentable_area, c_rented_area, c_vacant_area, c_resource_type, c_parent_code
|
|
|
+ c_park_code, c_zlqydm, c_zlqymc, c_room_status, c_room_sale_type, c_enterprise_count, c_floor_count,
|
|
|
+ c_building_area, c_self_used_area, c_sellable_area, c_sold_area, c_rentable_area, c_rented_area,
|
|
|
+ c_vacant_area, c_resource_type, c_parent_code,parent_lc_code,parent_cyy_code,parent_ld_code
|
|
|
}
|
|
|
|
|
|
@AllArgsConstructor
|
|
|
@@ -165,6 +167,8 @@ public class ParkPreCounter {
|
|
|
List<JSONObject> fatherLds = findFathers(fatherLcs, allLd);
|
|
|
//楼宇/产业园
|
|
|
List<JSONObject> fatherLys = findFathers(fatherLds, allLy);
|
|
|
+
|
|
|
+ //常规父子计算
|
|
|
fatherLds.forEach(this::countParkByChild);
|
|
|
fatherLcs.forEach(this::countParkByChild);
|
|
|
fatherLys.forEach(this::countParkByChild);
|
|
|
@@ -243,7 +247,6 @@ public class ParkPreCounter {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
private void updateRoomLease(JSONObject room, JSONObject lease) {
|
|
|
if (lease == null || !checkLeaseWorking(lease)) {
|
|
|
//绑定企业信息
|
|
|
@@ -400,15 +403,19 @@ public class ParkPreCounter {
|
|
|
}
|
|
|
String parkType = father.getString(String.valueOf(ParkKey.c_resource_type));
|
|
|
List<JSONObject> childParkRange;
|
|
|
+ ParkKey fatherCodeKey = null;
|
|
|
switch (parkType) {
|
|
|
case "2":
|
|
|
childParkRange = allRoom;
|
|
|
+ fatherCodeKey = ParkKey.parent_lc_code;
|
|
|
break;
|
|
|
case "3":
|
|
|
childParkRange = allLc;
|
|
|
+ fatherCodeKey = ParkKey.parent_ld_code;
|
|
|
break;
|
|
|
case "4":
|
|
|
childParkRange = allLd;
|
|
|
+ fatherCodeKey = ParkKey.parent_cyy_code;
|
|
|
break;
|
|
|
default:
|
|
|
return;
|
|
|
@@ -428,6 +435,10 @@ public class ParkPreCounter {
|
|
|
JSONDataTool.updateDoubleValue(father, String.valueOf(ParkKey.c_rented_area), countResult.rentedArea.doubleValue(), parkNeedUploadId);
|
|
|
JSONDataTool.updateDoubleValue(father, String.valueOf(ParkKey.c_self_used_area), countResult.selfUseArea.doubleValue(), parkNeedUploadId);
|
|
|
JSONDataTool.updateDoubleValue(father, String.valueOf(ParkKey.c_vacant_area), countResult.vacantArea.doubleValue(), parkNeedUploadId);
|
|
|
+
|
|
|
+ int enterpriserCount = getChildEnterprise(fatherCodeKey,fatherParkCode).size();
|
|
|
+
|
|
|
+ JSONDataTool.updateIntValue(father,String.valueOf(ParkKey.c_enterprise_count),enterpriserCount,parkNeedUploadId);
|
|
|
}
|
|
|
|
|
|
private static BigDecimal nullToZero(BigDecimal v) {
|
|
|
@@ -455,4 +466,13 @@ public class ParkPreCounter {
|
|
|
return getKeyAndPackToTime(lease, String.valueOf(LeaseKey.c_end_date));
|
|
|
}
|
|
|
|
|
|
+ private Set<String> getChildEnterprise(ParkKey fatherCodeKey,String fartherCode){
|
|
|
+ return allRoom.stream()
|
|
|
+ .filter(Objects::nonNull)
|
|
|
+ .filter(room->room.getString(ParkKey.c_zlqydm.toString())!=null)
|
|
|
+ .filter(room-> Objects.equals(room.getString(fatherCodeKey.toString()), fartherCode))
|
|
|
+ .map(room->room.getString(ParkKey.c_zlqydm.toString()))
|
|
|
+ .collect(Collectors.toSet());
|
|
|
+ }
|
|
|
+
|
|
|
}
|