瀏覽代碼

暂时修改object/zone/query接口

zhangqiankun 3 年之前
父節點
當前提交
faab091887

+ 26 - 15
src/main/java/com/persagy/proxy/adm/controller/AdmSpaceController.java

@@ -1,14 +1,27 @@
 package com.persagy.proxy.adm.controller;
 
-import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.util.StrUtil;
-import cn.hutool.json.JSONUtil;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.ws.rs.QueryParam;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
 import com.alibaba.fastjson.JSONObject;
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.dmp.basic.utils.JsonNodeUtils;
-import com.persagy.proxy.adm.model.*;
+import com.persagy.proxy.adm.handler.SpaceRelationInfoHandler;
+import com.persagy.proxy.adm.model.AdmBuilding;
+import com.persagy.proxy.adm.model.AdmDCSQueryRequest;
+import com.persagy.proxy.adm.model.AdmFloor;
+import com.persagy.proxy.adm.model.AdmSpace;
+import com.persagy.proxy.adm.model.AdmUpDataFloorAndBuildingRequests;
 import com.persagy.proxy.adm.request.AdmCreateRequest;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
 import com.persagy.proxy.adm.request.AdmResponse;
@@ -19,15 +32,10 @@ import com.persagy.proxy.adm.service.IAdmSpaceService;
 import com.persagy.proxy.adm.utils.AdmContextUtil;
 import com.persagy.proxy.adm.utils.ObjectNameUtil;
 import com.persagy.proxy.common.entity.RelationDTO;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 
-import javax.ws.rs.QueryParam;
-import java.util.ArrayList;
-import java.util.List;
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONUtil;
 
 /**
  * Adm 空间 API
@@ -46,6 +54,8 @@ public class AdmSpaceController {
     private IAdmRelationService relationService;
     @Autowired
     private IAdmFloorService floorService;
+    @Autowired
+    private SpaceRelationInfoHandler spaceRelationInfoHandler;
 
     /**
      * 统计
@@ -127,13 +137,14 @@ public class AdmSpaceController {
      * @throws Exception
      */
     @PostMapping("/query")
-    public ObjectNode query(@RequestBody AdmDCSQueryRequest request) throws Exception {
-        AdmResponse response = service.doQuerySpaces( AdmContextUtil.toDmpContext(), request);
+    public JSONObject query(@RequestBody AdmDCSQueryRequest request) throws Exception {
+        /*AdmResponse response = service.doQuerySpaces( AdmContextUtil.toDmpContext(), request);
         ObjectNode objectNode = JsonNodeUtils.toObjectNode(response, null, null);
         if(StrUtil.isNotEmpty(request.getZoneType())){
             objectNode.put("zoneType", request.getZoneType());
         }
-        return objectNode;
+        return objectNode;*/
+    	return this.spaceRelationInfoHandler.querySpaceInfo(request);
     }
 
     /**

+ 3 - 1
src/main/java/com/persagy/proxy/adm/handler/SpaceRelationInfoHandler.java

@@ -6,6 +6,7 @@ import java.util.List;
 import java.util.Set;
 
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -36,6 +37,7 @@ import lombok.RequiredArgsConstructor;
  * @author zhangqiankun
  * @date 2021年10月18日 下午6:04:24
  */
+@Component
 @RequiredArgsConstructor
 public class SpaceRelationInfoHandler {
 	
@@ -53,7 +55,7 @@ public class SpaceRelationInfoHandler {
 	 * @return
 	 * @throws Exception
 	 */
-	public JSONObject query(AdmDCSQueryRequest request) throws Exception {
+	public JSONObject querySpaceInfo(AdmDCSQueryRequest request) throws Exception {
 		List<ObjectNode> resultList = null;
 		String groupCode = AppContext.getContext().getGroupCode();
 		String projectId = AppContext.getContext().getProjectId();