Browse Source

竖井下的空间,参数调整

lvxianyun 3 years ago
parent
commit
f7dd53d0d7
1 changed files with 15 additions and 16 deletions
  1. 15 16
      src/main/java/com/persagy/proxy/adm/controller/AdmShaftController.java

+ 15 - 16
src/main/java/com/persagy/proxy/adm/controller/AdmShaftController.java

@@ -23,6 +23,7 @@ import com.persagy.proxy.adm.request.AdmResponse;
 import com.persagy.proxy.adm.service.IAdmBuildingService;
 import com.persagy.proxy.adm.service.IAdmRelationService;
 import com.persagy.proxy.adm.service.IAdmShaftService;
+import com.persagy.proxy.adm.service.IAdmSpaceService;
 import com.persagy.proxy.adm.utils.AdmContextUtil;
 import com.persagy.proxy.adm.utils.AdmQueryCriteriaHelper;
 import com.persagy.proxy.adm.utils.ObjectNameUtil;
@@ -49,6 +50,8 @@ public class AdmShaftController {
     private IAdmRelationService relationService;
     @Autowired
     private IAdmBuildingService buildingService;
+    @Autowired
+    private IAdmSpaceService spaceService;
 
     /**
      * 统计
@@ -127,7 +130,7 @@ public class AdmShaftController {
      * @throws Exception
      */
     @PostMapping("/update")
-    public AdmResponse update(@RequestBody AdmCreateRequest<AdmShaft> createRequest, @QueryParam("projectId") String projectId) throws Exception {        
+    public AdmResponse update(@RequestBody AdmCreateRequest<AdmShaft> createRequest) throws Exception {
         List<AdmShaft> vos = CollUtil.newArrayList(createRequest.getContent());
         vos = service.doUpdate(AdmContextUtil.toDmpContext(), AdmShaft.class, vos);
         return AdmResponse.success(vos);
@@ -285,28 +288,24 @@ public class AdmShaftController {
      * @throws Exception
      */
     @PostMapping("/shaft-zoneSpaceBaseTable")
-    public AdmResponse queryZoneSp(@RequestParam String shaftId,
-                             @RequestBody AdmQueryCriteria request) throws Exception {
+    public AdmResponse queryZoneSp(@QueryParam("ShaftId") String ShaftId, @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装条件
-        QueryCriteria queryCriteria = new QueryCriteria();
-        if(!StrUtil.isAllNotEmpty(shaftId,AdmContextUtil.toDmpContext().getProjectId())) {
-            return AdmResponse.failure("必填项:shaftId(竖井id)、projectId(项目id)");
+        request.setName(AdmSpace.OBJ_TYPE);
+        QueryCriteria queryCriteria = AdmQueryCriteriaHelper.toDmpCriteria(request);
+        if(!StrUtil.isNotEmpty(ShaftId)) {
+            return AdmResponse.failure("必填项:shaftId(竖井id)");
         }
+
         ObjectNode criteria = JsonNodeFactory.instance.objectNode();
         ObjectNode relationTO = JsonNodeFactory.instance.objectNode();
         relationTO.put("relCode", "Sh2Sp");
-        relationTO.put("objFrom", shaftId);
+        relationTO.put("graphCode","ArchSubset");
+        relationTO.put("objFrom", ShaftId);
         criteria.putPOJO("relationTo", relationTO);
-        criteria.put("objType", AdmSpace.OBJ_TYPE);
-        queryCriteria.setCriteria(relationTO);
+        queryCriteria.setCriteria(criteria);
 
-        List<ObjectNode> spaceList = DigitalObjectFacade.query(AdmContextUtil.toDmpContext().getGroupCode(), AdmContextUtil.toDmpContext().getProjectId(), AdmContextUtil.toDmpContext().getAppId(), null, queryCriteria);
-        if(CollUtil.isNotEmpty(spaceList)){
-            List<AdmSpace> vos = JSONUtil.toList(spaceList.toString(), AdmSpace.class);
-            return AdmResponse.success(spaceList);
-        }else{
-            return AdmResponse.success();
-        }
+        AdmResponse admResponse = spaceService.doQuery(AdmContextUtil.toDmpContext(), queryCriteria, AdmSpace.class);
+        return admResponse;
     }
 
     /**