Browse Source

同步构件名

caiaf 3 years ago
parent
commit
ce693f386a

+ 7 - 0
revit-algorithm/src/main/kotlin/cn/sagacloud/server/algorithm/backstage/model/datacenter/DCEquipment.kt

@@ -2,6 +2,8 @@ package cn.sagacloud.server.algorithm.backstage.model.datacenter
 
 
 import cn.sagacloud.server.algorithm.backstage.model.datacenter.DCDataBase
 import cn.sagacloud.server.algorithm.backstage.model.datacenter.DCDataBase
 import com.alibaba.fastjson.annotation.JSONField
 import com.alibaba.fastjson.annotation.JSONField
+import io.swagger.annotations.ApiModelProperty
+import javax.persistence.Column
 
 
 /**
 /**
  *
  *
@@ -52,4 +54,9 @@ open class DCEquipment : DCDataBase() {
     /** 转换后的信息点 */
     /** 转换后的信息点 */
     @JSONField(name = "infos")
     @JSONField(name = "infos")
     var infos: Map<String,String>? = null
     var infos: Map<String,String>? = null
+
+    /** 构件分类名称 */
+    @ApiModelProperty(value = "构件分类名称")
+    @JSONField(name = "bimTypeName")
+    var bimTypeName: String? = null
 }
 }

+ 2 - 0
revit-algorithm/src/main/kotlin/cn/sagacloud/server/algorithm/backstage/sync/SyncEquipment.kt

@@ -161,6 +161,7 @@ class SyncEquipment : SyncObject{
             dcEquip.familySymbol = it.value.familySymbol
             dcEquip.familySymbol = it.value.familySymbol
             dcEquip.modelId = it.value.modelId
             dcEquip.modelId = it.value.modelId
             dcEquip.bimTypeID = it.value.bimTypeID
             dcEquip.bimTypeID = it.value.bimTypeID
+            dcEquip.bimTypeName = it.value.bimTypeName
             dcEquip.infos = it.value.infos
             dcEquip.infos = it.value.infos
             generateCADID(dcEquip)
             generateCADID(dcEquip)
             val point = it.value.location?.points?.get(0)
             val point = it.value.location?.points?.get(0)
@@ -208,6 +209,7 @@ class SyncEquipment : SyncObject{
         dcEquip.familySymbol = equip.familySymbol
         dcEquip.familySymbol = equip.familySymbol
         dcEquip.modelId = equip.modelId
         dcEquip.modelId = equip.modelId
         dcEquip.bimTypeID = equip.bimTypeID
         dcEquip.bimTypeID = equip.bimTypeID
+        dcEquip.bimTypeName =  equip.bimTypeName
         updateList.add(dcEquip)
         updateList.add(dcEquip)
         if(equip.propertyId != null && dcEquip.id != null)
         if(equip.propertyId != null && dcEquip.id != null)
             propertyMap[equip.propertyId!!] = dcEquip.id!!
             propertyMap[equip.propertyId!!] = dcEquip.id!!

+ 5 - 0
revit-algorithm/src/main/kotlin/cn/sagacloud/server/algorithm/models/entities/Equipment.kt

@@ -156,4 +156,9 @@ class Equipment : BaseComponent(){
     @ApiModelProperty(value = "转换后的信息点")
     @ApiModelProperty(value = "转换后的信息点")
     @Column(name = "infos")
     @Column(name = "infos")
     var infos: Map<String,String>? = null
     var infos: Map<String,String>? = null
+
+    /** 构件分类名称 */
+    @ApiModelProperty(value = "构件分类名称")
+    @Column(name = "bim_type_name")
+    var bimTypeName: String? = null
 }
 }

+ 3 - 0
revit-algorithm/src/main/kotlin/cn/sagacloud/server/algorithm/services/json/EquipmentAnalyzer.kt

@@ -138,10 +138,12 @@ object EquipmentAnalyzer {
                         equipComp = equipCompService.select(SFilter.eq("bimTypeID",obj.bimTypeID!!), SFilter.eq("sysName",obj.sysName!!)).entity()
                         equipComp = equipCompService.select(SFilter.eq("bimTypeID",obj.bimTypeID!!), SFilter.eq("sysName",obj.sysName!!)).entity()
                         if(equipComp != null){
                         if(equipComp != null){
                             obj.family = equipComp.classCode?:"XXXXXX"
                             obj.family = equipComp.classCode?:"XXXXXX"
+                            obj.bimTypeName = equipComp.bimTypeName
                         }else{
                         }else{
                             equipComp = equipCompService.select(SFilter.eq("bimTypeID",obj.bimTypeID!!)).entity()
                             equipComp = equipCompService.select(SFilter.eq("bimTypeID",obj.bimTypeID!!)).entity()
                             if(equipComp != null){
                             if(equipComp != null){
                                 obj.family = equipComp.classCode?:"XXXXXX"
                                 obj.family = equipComp.classCode?:"XXXXXX"
+                                obj.bimTypeName = equipComp.bimTypeName
                             }else{
                             }else{
                                 obj.family = "OTXXXX"
                                 obj.family = "OTXXXX"
                             }
                             }
@@ -151,6 +153,7 @@ object EquipmentAnalyzer {
                         equipComp = equipCompService.select(SFilter.eq("bimTypeID",obj.bimTypeID!!)).entity()
                         equipComp = equipCompService.select(SFilter.eq("bimTypeID",obj.bimTypeID!!)).entity()
                         if(equipComp != null){
                         if(equipComp != null){
                             obj.family = equipComp.classCode?:"XXXXXX"
                             obj.family = equipComp.classCode?:"XXXXXX"
+                            obj.bimTypeName = equipComp.bimTypeName
                         }else{
                         }else{
                             obj.family = "OTXXXX"
                             obj.family = "OTXXXX"
                         }
                         }