Procházet zdrojové kódy

扩展forceUpdate范围

ximinghao před 1 měsícem
rodič
revize
b8c2841758

+ 16 - 8
src/main/java/com/skyversation/xjcy/computer/ParkPreCounter.java

@@ -181,14 +181,22 @@ public class ParkPreCounter {
         //更新并检查所有需更新房间
         List<JSONObject> updatedRooms = roomRange.stream()
                 .filter(this::countRoom).collect(Collectors.toList());
-        //按层级统计面积
-        //楼层
-        List<JSONObject> fatherLcs = findFathers(updatedRooms, allLc);
-        //楼栋
-        List<JSONObject> fatherLds = findFathers(fatherLcs, allLd);
-        //楼宇/产业园
-        List<JSONObject> fatherLys = findFathers(fatherLds, allLy);
-
+        List<JSONObject> fatherLys;
+        List<JSONObject> fatherLds;
+        List<JSONObject> fatherLcs;
+        if (forceUpdate){
+            fatherLcs =allLc;
+            fatherLds =allLd;
+            fatherLys =allLy;
+        }else {
+            //按层级统计面积
+            //楼层
+            fatherLcs = findFathers(updatedRooms, allLc);
+            //楼栋
+            fatherLds = findFathers(fatherLcs, allLd);
+            //楼宇/产业园
+            fatherLys = findFathers(fatherLds, allLy);
+        }
         //常规父子计算
         fatherLcs.forEach(this::countParkByChild);
         fatherLds.forEach(this::countParkByChild);