浏览代码

建筑、楼层接口

lvxianyun 3 年之前
父节点
当前提交
1c211b7b84

+ 4 - 4
src/main/java/com/persagy/proxy/adm/controller/AdmBuildingController.java

@@ -77,15 +77,15 @@ public class AdmBuildingController {
 
     /**
      * 更新
-     * @param request
+     * @param createRequest
      * @return
      * @throws Exception
      */
     @PostMapping("/update")
-    public AdmResponse update(@RequestBody AdmQueryCriteria request) throws Exception {
+    public AdmResponse update(@RequestBody AdmCreateRequest<AdmBuilding> createRequest, @QueryParam("projectId") String projectId) throws Exception {
         // 组装上下文条件
-        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, null, AdmCommonConstant.APP_ID);
-        List<AdmBuilding> vos = CollUtil.newArrayList();
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        List<AdmBuilding> vos = CollUtil.newArrayList(createRequest.getContent());
         vos = service.doUpdate(context, AdmBuilding.class, vos);
         return AdmResponse.success(vos);
     }

+ 18 - 4
src/main/java/com/persagy/proxy/adm/controller/AdmFloorController.java

@@ -16,6 +16,7 @@ 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;
 
 /**
@@ -42,8 +43,8 @@ public class AdmFloorController {
     public AdmResponse create(@RequestBody AdmCreateRequest<AdmFloor> createRequest, @QueryParam("projectId") String projectId) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        List<AdmFloor> vos = CollUtil.newArrayList(createRequest.getContent());
-        vos = service.doInsert(context, AdmFloor.class, vos);
+        //List<AdmFloor> vos = CollUtil.newArrayList(createRequest.getContent());
+        List<AdmFloor> vos = service.doInsert(context, AdmFloor.class, createRequest.getContent());
         return AdmResponse.success(vos);
     }
 
@@ -92,6 +93,7 @@ public class AdmFloorController {
 
     /**
      * 更新 outline
+     * TODO 暂时不知道具体的参数,先做所有字段的更新,之后有具体场景再做细化
      * @param admFloor
      * @return
      * @throws Exception
@@ -99,8 +101,8 @@ public class AdmFloorController {
     @PostMapping("/update-outline")
     public AdmResponse updateOutline(@RequestBody AdmCreateRequest<AdmFloor> admFloor, @QueryParam("projectId") String projectId) throws Exception {
         // 组装上下文条件
-        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, null, AdmCommonConstant.APP_ID);
-        List<AdmFloor> vos = CollUtil.newArrayList();
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        List<AdmFloor> vos = CollUtil.newArrayList(admFloor.getContent());
         vos = service.doUpdate(context, AdmFloor.class, vos);
         return AdmResponse.success(vos);
     }
@@ -136,6 +138,18 @@ public class AdmFloorController {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
         request.setName("floor");
+        request.setProjection(null);
+        List<String> list = new ArrayList<>();
+        list.add("id");
+        list.add("name");
+        list.add("localId");
+        list.add("localName");
+        list.add("outline");
+        list.add("floorSequenceId");
+        list.add("modelId");
+        list.add("infos");
+        list.add("properties");
+        request.setProjection(list);
         return service.doQuery(context, request, AdmFloor.class);
     }
 

+ 0 - 2
src/main/java/com/persagy/proxy/adm/controller/AdmProjectController.java

@@ -1,12 +1,10 @@
 package com.persagy.proxy.adm.controller;
 
-import com.alibaba.fastjson.JSONArray;
 import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.model.AdmProject;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
 import com.persagy.proxy.adm.request.AdmResponse;
 import com.persagy.proxy.adm.service.IAdmProjectService;
-import com.persagy.proxy.common.entity.DmpResult;
 import com.persagy.proxy.common.entity.InstanceUrlParam;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;

+ 4 - 1
src/main/java/com/persagy/proxy/adm/model/AdmBuilding.java

@@ -44,5 +44,8 @@ public class AdmBuilding {
     private AdmProject project;
     /** 级联-楼层 */
     @CascadeColumn(graphCode = "ArchSubset", relCode = "Bd2Fl")
-    private List<AdmProject> floor;
+    private List<AdmFloor> floor;
+
+    /** 建筑类型code */
+    private String classCode = "building";
 }