Browse Source

Merge branch 'develop' of http://39.106.8.246:3003/BDTP/adm-middleware.git into develop

zhangqiankun 3 years ago
parent
commit
b4bea2bbeb

+ 20 - 5
src/main/java/com/persagy/proxy/object/controller/AdmISpaceController.java

@@ -8,7 +8,9 @@ import com.persagy.proxy.adm.request.AdmCreateRequest;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
 import com.persagy.proxy.adm.request.AdmResponse;
 import com.persagy.proxy.adm.utils.AdmContextUtil;
+import com.persagy.proxy.object.model.AdmFloor;
 import com.persagy.proxy.object.model.AdmISpace;
+import com.persagy.proxy.object.service.IAdmFloorService;
 import com.persagy.proxy.object.service.IAdmISpaceService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -29,6 +31,8 @@ import java.util.List;
 public class AdmISpaceController {
     @Autowired
     private IAdmISpaceService service;
+    @Autowired
+    private IAdmFloorService floorService;
 
     /**
      * 统计
@@ -105,14 +109,25 @@ public class AdmISpaceController {
      */
     @PostMapping("/query")
     public AdmResponse query(@RequestBody JSONObject param) throws Exception {
-        AdmQueryCriteria request = JsonHelper.toSingleEntity(param, AdmQueryCriteria.class);
-        request.setName(AdmISpace.OBJ_TYPE);
+        AdmQueryCriteria admQueryCriteriaFl = new AdmQueryCriteria();
+        admQueryCriteriaFl.setName(AdmFloor.OBJ_TYPE);
+
         if (StrUtil.isNotBlank(param.getString("floorId"))){
-            String filters = " floorId = '"+param.getString("floorId")+"' ";
-            request.addFilters(filters);
+            String filters = " id = '"+param.getString("floorId")+"' ";
+            admQueryCriteriaFl.addFilters(filters);
         }
-        AdmResponse admResponse = service.doQuery(AdmContextUtil.toDmpContext(), request, AdmISpace.class);
+        AdmResponse response = floorService.query(admQueryCriteriaFl);
+        AdmResponse admResponse = new AdmResponse();
         admResponse.setMessage(param.getString("floorId"));
+        if(CollUtil.isNotEmpty(response.getContent())){
+            AdmFloor admFloor = (AdmFloor) response.getContent().get(0);
+            if(admFloor!= null && StrUtil.isNotEmpty(admFloor.getBimIdPre())){
+                AdmQueryCriteria request = JsonHelper.toSingleEntity(param, AdmQueryCriteria.class);
+                request.setName(AdmISpace.OBJ_TYPE);
+                request.setFilters(" bimId startwith '"+admFloor.getBimIdPre()+"';");
+                service.doQuery(AdmContextUtil.toDmpContext(), request, AdmISpace.class);
+            }
+        }
         return admResponse;
     }