소스 검색

query-new 系统查询 返回结果展示格式化

lvxianyun 3 년 전
부모
커밋
469d4f9304

+ 9 - 3
src/main/java/com/persagy/proxy/adm/controller/AdmSystemController.java

@@ -227,6 +227,7 @@ public class AdmSystemController {
     public AdmResponse queryNew(@QueryParam("buildingId") String buildingId,
                                 @QueryParam("floorId") String floorId, @RequestBody AdmQueryCriteria request) throws Exception {
         AdmResponse syses = new AdmResponse();
+        List<AdmSystem> admSystemList = new ArrayList<>();
         if(StrUtil.isAllEmpty(buildingId,floorId)){
             //case one 查询全部系统,级联建筑,建筑级联楼层
             AdmQueryCriteria admQueryCriteriaBd = new AdmQueryCriteria();
@@ -243,7 +244,7 @@ public class AdmSystemController {
             syses = service.doQuery(AdmContextUtil.toDmpContext(),request,AdmSystem.class);
             //处理数据 BuildingFloorInfo
             if(CollUtil.isNotEmpty(syses.getContent())){
-                List<AdmSystem> admSystemList = (List<AdmSystem>) syses.getContent();
+                admSystemList = (List<AdmSystem>) syses.getContent();
                 admSystemList.stream().forEach(admSystem -> {
                     List<AdmBuildingFloorInfo> buildingFloorInfoList = new ArrayList<>();
                     List<AdmBuilding> buildingList = admSystem.getBuildingList();
@@ -281,7 +282,7 @@ public class AdmSystemController {
                 return AdmResponse.failure("请求参数错误");
             }
             criteria.put("objType", AdmSystem.OBJ_TYPE);
-            List<AdmSystem> admSystemList = new ArrayList<>();
+
             if (StrUtil.isAllNotEmpty(buildingId, floorId)) {
                 if(!"1".equals(floorId)){
                     //case two 明确建筑、明确楼层的 系统
@@ -316,7 +317,7 @@ public class AdmSystemController {
                     if(CollUtil.isNotEmpty(admSystemList)){
                         //处理数据 BuildingFloorInfo
                         admSystemList = dealBdFlInfo(null,null, admSystemList);
-                        syses.setContent(admSystemList);
+
                     }
                 }
             }
@@ -324,6 +325,11 @@ public class AdmSystemController {
                 syses.setTotal(admSystemList.size()*1l);
 
         }
+        if(CollUtil.isNotEmpty(admSystemList)){
+            syses.setContent(admSystemList);
+        }else{
+            syses.setContent(new ArrayList<>(1));
+        }
         return syses;
     }
 

+ 20 - 0
src/main/java/com/persagy/proxy/adm/model/AdmBuildingFloorInfo.java

@@ -25,4 +25,24 @@ public class AdmBuildingFloorInfo {
     /** 楼层名称 */
     @JSONField(name = "FloorName")
     private String floorName;
+
+    @JSONField(name = "BuildName")
+    public String getBuildName() {
+        return buildName;
+    }
+
+    @JSONField(name = "FloorID")
+    public String getFloorID() {
+        return floorID;
+    }
+
+    @JSONField(name = "FloorName")
+    public String getFloorName() {
+        return floorName;
+    }
+
+    @JSONField(name = "BuildID")
+    public String getBuildID() {
+        return buildID;
+    }
 }