Browse Source

fix :FOV-41

lvxianyun 3 years ago
parent
commit
a8bc03f279

+ 22 - 23
src/main/java/com/persagy/proxy/object/controller/AdmSystemController.java

@@ -286,32 +286,31 @@ public class AdmSystemController {
                 admSystemList = (List<AdmSystem>) syses.getContent();
                 admSystemList.stream().forEach(admSystem -> {
                     List<AdmBuilding> buildingList = admSystem.getBuildingList();
-                    if(CollUtil.isEmpty(buildingList)){
-                        admSystem.setBuildingFloorInfoList(new ArrayList<>(1));
-                    }
                     List<ObjectNode> buildingFloorInfoList = new ArrayList<>();
-                    buildingList.stream().forEach(admBuilding -> {
-                        ObjectNode info = JsonNodeFactory.instance.objectNode();
-                        info.put("BuildID",admBuilding.getId());
-                        info.put("BuildName",admBuilding.getLocalName());
-                        buildingFloorInfoList.add(info);
-                    });
-
-                    admSystem.setBuildingList(null);
-                    Map<String, AdmBuilding> admBuildingMap = CollUtil.fieldValueMap(buildingList, BaseEntity.PROP_ID);
-                    List<AdmFloor> admFloorList = admSystem.getFloorList();
-                    if(CollUtil.isNotEmpty(admFloorList)){
-                        Map<String, AdmFloor> admFloorMap = CollUtil.fieldValueMap(admFloorList, "buildingId");
-                        admFloorList.stream().forEach(admFloor -> {
-                            ObjectNode infobd = JsonNodeFactory.instance.objectNode();
-                            infobd.put("BuildID",admFloor.getBuildingId());
-                            infobd.put("BuildName",admBuildingMap.get(admFloor.getBuildingId()).getLocalName());
-                            infobd.put("FloorID",admFloor.getId());
-                            infobd.put("FloorName",admFloor.getLocalName());
-                            buildingFloorInfoList.add(infobd);
+                    if(CollUtil.isNotEmpty(buildingList)){
+                        buildingList.stream().forEach(admBuilding -> {
+                            ObjectNode info = JsonNodeFactory.instance.objectNode();
+                            info.put("BuildID",admBuilding.getId());
+                            info.put("BuildName",admBuilding.getLocalName());
+                            buildingFloorInfoList.add(info);
                         });
+
+                        admSystem.setBuildingList(null);
+                        Map<String, AdmBuilding> admBuildingMap = CollUtil.fieldValueMap(buildingList, BaseEntity.PROP_ID);
+                        List<AdmFloor> admFloorList = admSystem.getFloorList();
+                        if(CollUtil.isNotEmpty(admFloorList)){
+                            Map<String, AdmFloor> admFloorMap = CollUtil.fieldValueMap(admFloorList, "buildingId");
+                            admFloorList.stream().forEach(admFloor -> {
+                                ObjectNode infobd = JsonNodeFactory.instance.objectNode();
+                                infobd.put("BuildID",admFloor.getBuildingId());
+                                infobd.put("BuildName",admBuildingMap.get(admFloor.getBuildingId()).getLocalName());
+                                infobd.put("FloorID",admFloor.getId());
+                                infobd.put("FloorName",admFloor.getLocalName());
+                                buildingFloorInfoList.add(infobd);
+                            });
+                        }
+                        admSystem.setFloorList(null);
                     }
-                    admSystem.setFloorList(null);
                     admSystem.setBuildingFloorInfoList(buildingFloorInfoList);
                 });
                 syses.setContent(CollUtil.isEmpty(admSystemList) ? new ArrayList<>(1) : admSystemList);