Browse Source

floor接口

lvxianyun 3 years ago
parent
commit
adc34a0972

+ 2 - 15
src/main/java/com/persagy/proxy/adm/controller/AdmFloorController.java

@@ -16,7 +16,6 @@ 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;
 
 /**
@@ -103,7 +102,7 @@ public class AdmFloorController {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
         List<AdmFloor> vos = CollUtil.newArrayList(admFloor.getContent());
-        vos = service.doUpdate(context, AdmFloor.class, vos);
+        vos = service.doUpdateOutLine(context, AdmFloor.class, vos);
         return AdmResponse.success(vos);
     }
 
@@ -138,19 +137,7 @@ 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);
+        return service.doQueryOutLine(context, request, AdmFloor.class);
     }
 
 }

+ 2 - 1
src/main/java/com/persagy/proxy/adm/model/AdmFloor.java

@@ -1,5 +1,6 @@
 package com.persagy.proxy.adm.model;
 
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.proxy.adm.annotations.CascadeColumn;
 import lombok.Data;
 
@@ -57,7 +58,7 @@ public class AdmFloor {
     private String modelId;
 
     /** 楼层选定区域轮廓线 */
-    private List<AdmPointPosition> outline;
+    private List<ObjectNode> outline;
 
     /** 数量 */
     private String count;

+ 13 - 0
src/main/java/com/persagy/proxy/adm/service/IAdmFloorService.java

@@ -1,6 +1,11 @@
 package com.persagy.proxy.adm.service;
 
 import com.persagy.proxy.adm.model.AdmFloor;
+import com.persagy.proxy.adm.request.AdmQueryCriteria;
+import com.persagy.proxy.adm.request.AdmResponse;
+import com.persagy.proxy.common.entity.InstanceUrlParam;
+
+import java.util.List;
 
 /**
  * ADM 楼层 接口类
@@ -8,4 +13,12 @@ import com.persagy.proxy.adm.model.AdmFloor;
  * @date 2021/8/16
  */
 public interface IAdmFloorService extends IAdmBaseService<AdmFloor>{
+
+    public List<AdmFloor> doUpdateOutLine(InstanceUrlParam context, Class<AdmFloor> clazz, List<AdmFloor> voList);
+    /**
+     * 查询outLine
+     * @param request
+     * @return
+     */
+    AdmResponse doQueryOutLine(InstanceUrlParam context, AdmQueryCriteria request, Class<AdmFloor> clazz);
 }

+ 49 - 1
src/main/java/com/persagy/proxy/adm/service/impl/AdmFloorServiceImpl.java

@@ -1,9 +1,15 @@
 package com.persagy.proxy.adm.service.impl;
 
 import com.persagy.proxy.adm.model.AdmFloor;
+import com.persagy.proxy.adm.request.AdmQueryCriteria;
+import com.persagy.proxy.adm.request.AdmResponse;
 import com.persagy.proxy.adm.service.IAdmFloorService;
+import com.persagy.proxy.common.entity.InstanceUrlParam;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * ADM 楼层 实现类
  * @author lvxy
@@ -11,4 +17,46 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class AdmFloorServiceImpl extends AbstractAdmBaseServiceImpl<AdmFloor> implements IAdmFloorService {
-}
+    @Override
+    public List<AdmFloor> doUpdateOutLine(InstanceUrlParam context, Class<AdmFloor> clazz, List<AdmFloor> voList) {
+        //根据楼层id 更新中台的floor中infos.outline中的信息,outline中的id默认为空或者省略,查询需要单独处理
+        //更新outLing信息
+        List<AdmFloor> vList = doUpdate(context, clazz, voList);
+        //修改关系计算相关信息
+       /* List<String> listtype = new ArrayList<String>();
+        listtype.add("Sh2Bd");
+        listtype.add("Bd2Sp");
+        listtype.add("Fl2Sp");
+        listtype.add("Sy2Bd");
+        listtype.add("Sy2Fl");
+        listtype.add("Eq2Fl");
+        listtype.add("Pe2Bd");
+        listtype.add("Pe2Fl");
+        for (String type : listtype){
+            JSONObject entity =  EquipmentService.relationTypeProjectservice.select(SFilter.eq("projectId", Opt.projectId!!), SFilter.eq("relationType", type)).entity()
+            if (entity!=null){
+                entity.computationalState = 2
+                EquipmentService.relationTypeProjectservice.update(entity)
+            }
+        }*/
+        return vList;
+    }
+
+    @Override
+    public AdmResponse doQueryOutLine(InstanceUrlParam context, AdmQueryCriteria request, Class<AdmFloor> clazz) {
+        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 doQuery(context, request, clazz);
+    }
+
+}