|
@@ -199,19 +199,11 @@ public class ParkPreCounter {
|
|
|
// }
|
|
// }
|
|
|
public void runWithOutLease() {
|
|
public void runWithOutLease() {
|
|
|
//统计,当然房间不参与这个统计,因为没有租赁信息和子级
|
|
//统计,当然房间不参与这个统计,因为没有租赁信息和子级
|
|
|
- allLd.forEach(this::countParkByChild);
|
|
|
|
|
allLc.forEach(this::countParkByChild);
|
|
allLc.forEach(this::countParkByChild);
|
|
|
|
|
+ allLd.forEach(this::countParkByChild);
|
|
|
allLy.forEach(this::countParkByChild);
|
|
allLy.forEach(this::countParkByChild);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private List<JSONObject> findFathers(Collection<JSONObject> children, List<JSONObject> fatherRange) {
|
|
|
|
|
- Set<String> fatherCode = children.stream()
|
|
|
|
|
- .map(v -> v.getString(String.valueOf(ParkKey.c_parent_code)))
|
|
|
|
|
- .collect(Collectors.toSet());
|
|
|
|
|
- return fatherRange.stream()
|
|
|
|
|
- .filter(v -> fatherCode.contains(v.getString(String.valueOf(ParkKey.c_park_code))))
|
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 预计算单房间与相关租赁,会修改输入值,会自动统计变动对象
|
|
* 预计算单房间与相关租赁,会修改输入值,会自动统计变动对象
|
|
@@ -428,24 +420,58 @@ public class ParkPreCounter {
|
|
|
.map(parkDataCount::new)
|
|
.map(parkDataCount::new)
|
|
|
.reduce(new parkDataCount(), parkDataCount::add, parkDataCount::add);
|
|
.reduce(new parkDataCount(), parkDataCount::add, parkDataCount::add);
|
|
|
|
|
|
|
|
- JSONDataTool.updateDoubleValue(father, String.valueOf(ParkKey.c_building_area), countResult.buildArea.doubleValue(), parkNeedUploadId);
|
|
|
|
|
- JSONDataTool.updateDoubleValue(father, String.valueOf(ParkKey.c_sellable_area), countResult.sellableArea.doubleValue(), parkNeedUploadId);
|
|
|
|
|
- JSONDataTool.updateDoubleValue(father, String.valueOf(ParkKey.c_sold_area), countResult.soldArea.doubleValue(), parkNeedUploadId);
|
|
|
|
|
- JSONDataTool.updateDoubleValue(father, String.valueOf(ParkKey.c_rentable_area), countResult.rentableArea.doubleValue(), parkNeedUploadId);
|
|
|
|
|
- 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);
|
|
|
|
|
|
|
+ if ("2".equals(parkType)) {
|
|
|
|
|
+ //楼层特殊计算
|
|
|
|
|
+ //c_building_area 不再计算,楼层级的c_building_area现在是基础数据
|
|
|
|
|
+ //c_sellable_area和c_rentable_area字段弃用,写为0
|
|
|
|
|
+ JSONDataTool.updateDoubleValue(father, String.valueOf(ParkKey.c_sellable_area), 0d, parkNeedUploadId);
|
|
|
|
|
+ JSONDataTool.updateDoubleValue(father, String.valueOf(ParkKey.c_rentable_area), 0d, parkNeedUploadId);
|
|
|
|
|
+ //三个使用字段正常计算
|
|
|
|
|
+ JSONDataTool.updateDoubleValue(father, String.valueOf(ParkKey.c_sold_area), countResult.soldArea.doubleValue(), parkNeedUploadId);
|
|
|
|
|
+ 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);
|
|
|
|
|
+ //空置面积按建筑面积减去三个使用面积
|
|
|
|
|
+ Double buildArea = father.getDouble(String.valueOf(ParkKey.c_building_area));
|
|
|
|
|
+ buildArea = buildArea == null ? 0 : buildArea;
|
|
|
|
|
+ BigDecimal buildingArea = BigDecimal.valueOf(buildArea);
|
|
|
|
|
+ JSONDataTool.updateDoubleValue(
|
|
|
|
|
+ father,
|
|
|
|
|
+ String.valueOf(ParkKey.c_vacant_area),
|
|
|
|
|
+ buildingArea
|
|
|
|
|
+ .subtract(countResult.soldArea)
|
|
|
|
|
+ .subtract(countResult.rentedArea)
|
|
|
|
|
+ .subtract(countResult.selfUseArea)
|
|
|
|
|
+ .doubleValue(),
|
|
|
|
|
+ parkNeedUploadId);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ JSONDataTool.updateDoubleValue(father, String.valueOf(ParkKey.c_building_area), countResult.buildArea.doubleValue(), parkNeedUploadId);
|
|
|
|
|
+ JSONDataTool.updateDoubleValue(father, String.valueOf(ParkKey.c_sellable_area), countResult.sellableArea.doubleValue(), parkNeedUploadId);
|
|
|
|
|
+ JSONDataTool.updateDoubleValue(father, String.valueOf(ParkKey.c_sold_area), countResult.soldArea.doubleValue(), parkNeedUploadId);
|
|
|
|
|
+ JSONDataTool.updateDoubleValue(father, String.valueOf(ParkKey.c_rentable_area), countResult.rentableArea.doubleValue(), parkNeedUploadId);
|
|
|
|
|
+ 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();
|
|
int enterpriserCount = getChildEnterprise(fatherCodeKey,fatherParkCode).size();
|
|
|
|
|
|
|
|
JSONDataTool.updateIntValue(father,String.valueOf(ParkKey.c_enterprise_count),enterpriserCount,parkNeedUploadId);
|
|
JSONDataTool.updateIntValue(father,String.valueOf(ParkKey.c_enterprise_count),enterpriserCount,parkNeedUploadId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //simple tool
|
|
|
|
|
+
|
|
|
|
|
+ private List<JSONObject> findFathers(Collection<JSONObject> children, List<JSONObject> fatherRange) {
|
|
|
|
|
+ Set<String> fatherCode = children.stream()
|
|
|
|
|
+ .map(v -> v.getString(String.valueOf(ParkKey.c_parent_code)))
|
|
|
|
|
+ .collect(Collectors.toSet());
|
|
|
|
|
+ return fatherRange.stream()
|
|
|
|
|
+ .filter(v -> fatherCode.contains(v.getString(String.valueOf(ParkKey.c_park_code))))
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
+ }
|
|
|
private static BigDecimal nullToZero(BigDecimal v) {
|
|
private static BigDecimal nullToZero(BigDecimal v) {
|
|
|
return v == null ? BigDecimal.ZERO : v;
|
|
return v == null ? BigDecimal.ZERO : v;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //simple tool
|
|
|
|
|
private LocalDate getKeyAndPackToTime(JSONObject obj, String key) {
|
|
private LocalDate getKeyAndPackToTime(JSONObject obj, String key) {
|
|
|
if (obj == null) {return null;}
|
|
if (obj == null) {return null;}
|
|
|
Long time = obj.getLong(key);
|
|
Long time = obj.getLong(key);
|