浏览代码

Merge remote-tracking branch 'origin/develop' into develop

lijie 3 年之前
父节点
当前提交
09a2586c3c

+ 7 - 7
src/main/java/com/persagy/proxy/adm/model/AdmPoint.java

@@ -1,6 +1,6 @@
 package com.persagy.proxy.adm.model;
 
-import com.alibaba.fastjson.annotation.JSONField;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import com.persagy.proxy.relation.model.BaseEntity;
 import lombok.Data;
 
@@ -13,14 +13,14 @@ import lombok.Data;
 public class AdmPoint extends BaseEntity {
 
     /** 坐标x */
-    @JSONField(name = "X")
-    private Double X;
+    @JsonProperty("X")
+    private Double x;
 
     /** 坐标y */
-    @JSONField(name = "Y")
-    private Double Y;
+    @JsonProperty("Y")
+    private Double y;
 
     /** 坐标z */
-    @JSONField(name = "Z")
-    private Double Z;
+    @JsonProperty("Z")
+    private Double z;
 }

+ 1 - 2
src/main/java/com/persagy/proxy/adm/utils/AdmQueryCriteriaHelper.java

@@ -247,11 +247,10 @@ public class AdmQueryCriteriaHelper {
             boolean ifNot = true;
             if(column.indexOf("not") >= 0){
                 ifNot = false;
-                column = column.split(" ")[1];
+                column = column.replace("not","").trim();
             }
             ObjectNode node = criteria.putObject(column);
             node.put("$null", ifNot);
-
         } else {
             ObjectNode node = criteria.putObject(column);
             node.set(OPERATOR_MAP.get(operator), getJsonNode(node, value));

+ 7 - 3
src/main/java/com/persagy/proxy/object/controller/AdmSpaceController.java

@@ -30,6 +30,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 import javax.ws.rs.QueryParam;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -149,7 +150,9 @@ public class AdmSpaceController {
                     if(!flowBuild.contains("-")){
                         if(flowBuild.startsWith("Bd")){
                             admSpace.setBuildingId(flowBuild);
-                            admSpace.setFloorId(null);
+                            Map<String, Object> infos = new HashMap<String,Object>(16);
+                            infos.put("$remove","['floorId']");
+                            admSpace.setInfos(infos);
                         }
                     }else {
                         String[] str = flowBuild.split("-");
@@ -162,8 +165,9 @@ public class AdmSpaceController {
                         }
                     }
                 }else{
-                    admSpace.setBuildingId(null);
-                    admSpace.setFloorId(null);
+                    Map<String, Object> infos = new HashMap<String,Object>(16);
+                    infos.put("$remove","['floorId','buildingId']");
+                    admSpace.setInfos(infos);
                 }
             });
             vos.stream().forEach(space -> {

+ 3 - 5
src/main/java/com/persagy/proxy/object/model/AdmISpace.java

@@ -1,11 +1,9 @@
 package com.persagy.proxy.object.model;
 
-import com.persagy.proxy.adm.model.AdmPoint;
+import com.fasterxml.jackson.databind.node.ArrayNode;
 import lombok.Data;
 
-import java.util.ArrayList;
 import java.util.Date;
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -55,7 +53,7 @@ public class AdmISpace {
     private Float height;
 
     /** 图片 */
-    private ArrayList<AdmTaskPic> pic;
+    private ArrayNode pic;
     /** 空间是否受影响 */
     private String state;
     /** 空间常驻人数 */
@@ -74,7 +72,7 @@ public class AdmISpace {
     private String objectType = OBJ_TYPE;
 
     /** 轮廓线 */
-    private List<List<AdmPoint>> outline;
+    private ArrayNode outline;
 
     /** 对象类型code */
     private String classCode;

+ 2 - 2
src/main/java/com/persagy/proxy/object/model/AdmShaft.java

@@ -1,8 +1,8 @@
 package com.persagy.proxy.object.model;
 
 import com.alibaba.fastjson.annotation.JSONField;
+import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.persagy.proxy.adm.annotations.CascadeColumn;
-import com.persagy.proxy.adm.model.AdmPoint;
 import com.persagy.proxy.adm.model.AdmBaseEntity;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -44,7 +44,7 @@ public class AdmShaft extends AdmBaseEntity<AdmShaft> {
 
 
     /** BIM模型中轮廓坐标 */
-    private List<AdmPoint> outline;
+    private ArrayNode outline;
     /** 对象类型 */
     private String objectType = OBJ_TYPE;
     /** 级联-竖井内的设备 */

+ 2 - 22
src/main/java/com/persagy/proxy/object/model/AdmSpace.java

@@ -2,12 +2,10 @@ package com.persagy.proxy.object.model;
 
 import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.persagy.proxy.adm.annotations.CascadeColumn;
-import com.persagy.proxy.adm.model.AdmPoint;
 import com.persagy.proxy.adm.model.AdmBaseEntity;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
@@ -40,9 +38,9 @@ public class AdmSpace extends AdmBaseEntity<AdmSpace> {
     private String bimId;
 
     /** 楼层选定区域轮廓线 */
-    private ArrayList<ArrayList<ArrayList<AdmPoint>>> outline;
+    private ArrayNode outline;
     /** 轮廓线2 未使用*/
-    private ArrayList<ArrayList<ArrayList<AdmPoint>>> outline2;
+    private ArrayNode outline2;
     /** 图片 - 信息点里已存在的信息点不应在实体中重复定义为其他格式 */
     private ArrayNode pic;
     /** 空间是否受影响 */
@@ -140,22 +138,4 @@ public class AdmSpace extends AdmBaseEntity<AdmSpace> {
     /** 对象类型 */
     private String objectType = OBJ_TYPE;
 
-    public String getZoneType(){
-        return zoneType;
-
-    }
-    public void setZoneType(String zoneType){
-        this.zoneType = zoneType;
-        this.classCode = zoneType;
-    }
-
-    public String getClassCode(){
-        return classCode;
-    }
-    public void setClassCode(String classCode){
-        this.zoneType = classCode;
-        this.classCode = classCode;
-    }
-
-
 }

+ 7 - 6
src/main/java/com/persagy/proxy/report/controller/AdmReportEquipController.java

@@ -745,7 +745,6 @@ public class AdmReportEquipController {
     @PostMapping("/info-point")
     public AdmResponse infoPoint() {
         //return customSqlService.infoPoints()
-        
         JSONObject gatherInfoPoint = calInfoPointByObjType(AdmEquipment.OBJ_TYPE, false, false);
         JSONObject infoPoint = new JSONObject();
         infoPoint.put("dynamicInfoPoint",gatherInfoPoint.getString("gatherDynamicInfoPointCounts"));
@@ -901,16 +900,15 @@ public class AdmReportEquipController {
 
         for (int i=0;i<objList.size();i++) {
             JsonNode objectNode = JsonNodeUtils.toObjectNode(objList.get(i),null,null);
-            if (objectNode.get("infos") != null) {
-                Map<String,Object> dynamic = calculateInfoPoints(objectNode.get("infos").toString(), objectNode.get("classCode").textValue().toString(), dynamicInfoPointCodes);
-                Map<String,Object> staticMap = calculateInfoPoints(objectNode.get("infos").toString(), objectNode.get("classCode").textValue().toString(), staticInfoPointCodes);
+            if (StrUtil.isNotEmpty(objectNode.get("infos").textValue())) {
+                Map<String,Object> dynamic = calculateInfoPoints(objectNode.get("infos").toString(), objectNode.get("classCode").textValue(), dynamicInfoPointCodes);
+                Map<String,Object> staticMap = calculateInfoPoints(objectNode.get("infos").toString(), objectNode.get("classCode").textValue(), staticInfoPointCodes);
                 dynamicInfoPoint += Integer.parseInt(dynamic.get("counts").toString());
                 staticInfoPoint += Integer.parseInt(staticMap.get("counts").toString());
                 dynamicInfoPointCodes.remove(dynamic.get("next"));
                 staticInfoPointCodes.remove(staticMap.get("next"));
             }
         }
-
         hashMap.put("dynamicInfoPoint", dynamicInfoPoint);
         hashMap.put("staticInfoPoint", staticInfoPoint);
         hashMap.put("customInfoPoint", customInfoPoint);
@@ -921,7 +919,10 @@ public class AdmReportEquipController {
 
     /**
      * 计算信息点
-     *
+     * @param str infos
+     * @param type classCode
+     * @param infoPointCodes
+     * @return
      */
     private Map<String,Object> calculateInfoPoints(String str, String type, List<ObjectInfoDefine> infoPointCodes) {
         int counts = 0;