Browse Source

设备:字段json处理
系统:增加展示字段

lvxianyun 3 years ago
parent
commit
3ef896d4aa

+ 50 - 0
src/main/java/com/persagy/proxy/adm/model/AdmEquipment.java

@@ -1,9 +1,12 @@
 package com.persagy.proxy.adm.model;
 
+import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.annotation.JSONField;
 import com.persagy.proxy.adm.annotations.CascadeColumn;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import javax.persistence.Column;
 import java.util.List;
 
 /**
@@ -26,6 +29,7 @@ public class AdmEquipment extends AdmSBaseEntity<AdmEquipment>{
     /** 设计图纸中编码 */
     private String cadId;
     /** RFID标识 */
+    @JSONField(name = "rFID")
     private String rfId;
 
 
@@ -121,6 +125,24 @@ public class AdmEquipment extends AdmSBaseEntity<AdmEquipment>{
     private AdmProject project;
     /**BIM模型中坐标json,坐标x,y,z */
     private AdmBIMLocation locationJson;
+    public AdmBIMLocation getLocationJson() {
+        if (StrUtil.isNotEmpty(bimLocation)){
+            String[] split = bimLocation.split(",");
+            AdmBIMLocation bimLocation = new AdmBIMLocation();
+            if (split.length == 3){
+                bimLocation.setX(Double.valueOf(split[0]));
+                bimLocation.setY(Double.valueOf(split[1]));
+                bimLocation.setZ(Double.valueOf(split[2]));
+            }else if (split.length == 2){
+                bimLocation.setX(Double.valueOf(split[0]));
+                bimLocation.setY(Double.valueOf(split[1]));
+                bimLocation.setZ(0.0);
+            }
+            return bimLocation;
+        }
+        return null;
+    }
+
     /** 级联-设备服务所在的空 */
     @CascadeColumn(graphCode = "MechForArch", relCode = "Eq2Sp")
     private List<AdmSpace> zoneSpaceForBase;
@@ -137,4 +159,32 @@ public class AdmEquipment extends AdmSBaseEntity<AdmEquipment>{
     @CascadeColumn(graphCode = "MechSubset", relCode = "Eq2Ec")
     private List<AdmComponent> component;
 
+    /******************************** 报表使用 **************************************/
+    /** 资产id */
+    @Column(name = "link_id")
+    private String linkId;
+
+    /** 资产名称 */
+    @Column(name = "link_name")
+    private String linkEquipName;
+
+    /** 资产本地名称 */
+    @Column(name = "link_local_name")
+    private String linkEquipLocalName;
+
+    /** 资产分类 */
+    @Column(name = "link_family")
+    private String linkFamily;
+
+    /** 系统对象 */
+    @CascadeColumn(graphCode = "MechSubset", relCode = "Sy2Eq", selectToObj = false)
+    private List<AdmSystem> linkSystem;
+
+    /** 部件数量 */
+    private Integer count = 0;
+
+    /** 级联-部件   table  对应关系表   idColumn 对应 本类的id    childIdColumn 级联对象的关系id */
+    //@CascadeColumn(table="equipment", idColumn="class_code", childIdColumn="parent_id")
+    private List<AdmObjectType> componentCategory;
+
 }

+ 8 - 0
src/main/java/com/persagy/proxy/adm/model/AdmSystem.java

@@ -59,4 +59,12 @@ public class AdmSystem extends AdmSBaseEntity<AdmSystem> {
     private List<AdmBuilding> buildingList;
     /** 建筑楼层 */
     private List<AdmBuildingFloorInfo> buildingFloorInfoList;
+
+    /** 供展示使用,并非实体中的字段 **/
+    /** 设备id*/
+    private String equipId;
+    /** 设备名称*/
+    private String equipName;
+    /** 设备本地名称*/
+    private String equipLocalName;
 }