Browse Source

fix :FOV-64

lvxianyun 3 years ago
parent
commit
502df29a6b

+ 11 - 26
src/main/java/com/persagy/proxy/object/controller/AdmSystemController.java

@@ -272,8 +272,7 @@ public class AdmSystemController {
         List<AdmSystem> admSystemList = new ArrayList<>();
         if(StrUtil.isAllEmpty(buildingId,floorId)){
             //case one 查询全部系统,级联建筑,建筑级联楼层
-            AdmQueryCriteria admQueryCriteriaBd = new AdmQueryCriteria();
-            admQueryCriteriaBd.setName("buildingList");
+
             AdmQueryCriteria admQueryCriteriaFl = new AdmQueryCriteria();
             admQueryCriteriaFl.setName("floorList");
             List<AdmQueryCriteria> cascadeFlBd = new ArrayList<>(1);
@@ -283,7 +282,6 @@ public class AdmSystemController {
             admQueryCriteriaFl.setCascade(cascadeFlBd);
 
             List<AdmQueryCriteria> cascade = new ArrayList<>(1);
-            cascade.add(admQueryCriteriaBd);
             cascade.add(admQueryCriteriaFl);
             request.setCascade(cascade);
             syses = service.doQuery(AdmContextUtil.toDmpContext(),request,AdmSystem.class);
@@ -291,32 +289,19 @@ public class AdmSystemController {
             if(CollUtil.isNotEmpty(syses.getContent())){
                 admSystemList = (List<AdmSystem>) syses.getContent();
                 admSystemList.stream().forEach(admSystem -> {
-                    List<AdmBuilding> buildingList = admSystem.getBuildingList();
                     List<ObjectNode> buildingFloorInfoList = new ArrayList<>();
-                    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);
+                    List<AdmFloor> admFloorList = admSystem.getFloorList();
+                    if(CollUtil.isNotEmpty(admFloorList)){
+                        admFloorList.stream().forEach(admFloor -> {
+                            ObjectNode infobd = JsonNodeFactory.instance.objectNode();
+                            infobd.put("BuildID",admFloor.getBuildingId());
+                            infobd.put("BuildName",admFloor.getBuilding() != null ? admFloor.getBuilding().getLocalName() : "");
+                            infobd.put("FloorID",admFloor.getId());
+                            infobd.put("FloorName",admFloor.getLocalName());
+                            buildingFloorInfoList.add(infobd);
                         });
-
-                        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",admFloor.getBuilding() != null ? admFloor.getBuilding().getLocalName() : ((CollUtil.isNotEmpty(admBuildingMap) && admBuildingMap.get(admFloor.getBuildingId()) != null) ? 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);