caiaf пре 4 година
родитељ
комит
d423c3ec30

+ 0 - 1
.gitignore

@@ -3,4 +3,3 @@
 .gradle
 build
 out
-gradle.properties

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

@@ -50,6 +50,9 @@ open class EquipComp {
     @ApiModelProperty(value = "设备设施类编码")
     @Column(name = "class_code")
     var classCode: String? = null
+    set(value) {
+        field = value?.trim()
+    }
 
 
     /** 设备设施类名称 */

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

@@ -70,6 +70,10 @@ class Equipment : BaseComponent(){
     @JSONField(name = "Family")
     @JsonProperty("Family")
     var family: String? = null
+    set(value) {
+        field = value?.trim()
+    }
+
 
     /** 类型中文名称 */
     @ApiModelProperty(value = "类型中文名称")

+ 37 - 13
revit-algorithm/src/main/kotlin/cn/sagacloud/server/algorithm/services/json/JSONAnalyzerService.kt

@@ -184,13 +184,22 @@ open class JSONAnalyzerService {
         if (!result) {
             return "处理BoundarySegment异常"
         }
+
+        //修改万达管道名称对应标准管道名称
+        val pdCompService = SObjectService(SMybatisDao(PipeDuctComp::class.java))  // 管道对照
+        val pdComps = pdCompService.selectAll().exec()
+        val map = HashMap<String, String>()
+        for (pdComp in pdComps) {
+            map[pdComp.pPdName!!] = pdComp.pdName!!
+        }
+
         // 处理Pipe
         val revitIdMap = HashMap<String, BaseComponent>() //     revit_id --> 对象
         result = result and RevitIdAnalyzer.analyzePipesDucts(
                 dataService.pipeService as SObjectService<BaseComponent>,
                 baseObj,
                 //baseObj.elements!!.pipes as ArrayList<BaseComponent>?,
-                pipeConvert(null, baseObj.elements!!.pipes),
+                pipeConvert(null, baseObj.elements!!.pipes,map),
                 revitIdMap,
                 "Pipe"
         )
@@ -202,7 +211,7 @@ open class JSONAnalyzerService {
                 dataService.pipeService as SObjectService<BaseComponent>,
                 baseObj,
 //                baseObj.elements!!.flexPipes as ArrayList<BaseComponent>?,
-                pipeConvert(null, baseObj.elements!!.pipes),
+                pipeConvert(null, baseObj.elements!!.pipes,map),
                 revitIdMap,
                 "FlexPipe"
         )
@@ -214,7 +223,7 @@ open class JSONAnalyzerService {
                 dataService.ductService as SObjectService<BaseComponent>,
                 baseObj,
 //                baseObj.elements!!.ducts as ArrayList<BaseComponent>?,
-                pipeConvert(baseObj.elements!!.ducts, null),
+                pipeConvert(baseObj.elements!!.ducts, null,map),
                 revitIdMap,
                 "Duct"
         )
@@ -226,13 +235,14 @@ open class JSONAnalyzerService {
                 dataService.ductService as SObjectService<BaseComponent>,
                 baseObj,
 //                baseObj.elements!!.flexDucts as ArrayList<BaseComponent>?,
-                pipeConvert(baseObj.elements!!.ducts, null),
+                pipeConvert(baseObj.elements!!.ducts, null,map),
                 revitIdMap,
                 "FlexDuct"
         )
         if (!result) {
             return "处理FlexDuct异常"
         }
+
         // 处理other
         result = result and RevitIdAnalyzer.analyze(
                 dataService.otherService as SObjectService<BaseComponent>,
@@ -286,16 +296,19 @@ open class JSONAnalyzerService {
         if (!result) {
             return "处理component异常"
         }
+
         // 处理连接件
         result = result and RevitIdAnalyzer.analyzeConnector(
                 dataService.connectorService,
                 baseObj,
-                baseObj.elements!!.connectors,
+                //连接件转换
+                connectorConvert(baseObj.elements!!.connectors,map),
                 revitIdMap
         )
         if (!result) {
             return "处理连接件异常"
         }
+
         // 处理level, 标高
         result = result and BaseBehavier.analyze(
                 dataService.levelService as SObjectService<BaseComponent>,
@@ -374,14 +387,7 @@ open class JSONAnalyzerService {
     /**
      * @Description: 管道类型转换
      */
-    fun pipeConvert(ducts: ArrayList<Duct>?, pipes: ArrayList<Pipe>?): ArrayList<BaseComponent>? {
-        //修改万达管道名称对应标准管道名称
-        val pdCompService = SObjectService(SMybatisDao(PipeDuctComp::class.java))  // 管道对照
-        val pdComps = pdCompService.selectAll().exec()
-        val map = HashMap<String, String>()
-        for (pdComp in pdComps) {
-            map[pdComp.pPdName!!] = pdComp.pdName!!
-        }
+    fun pipeConvert(ducts: ArrayList<Duct>?, pipes: ArrayList<Pipe>?,map: HashMap<String, String>): ArrayList<BaseComponent>? {
         if (ducts != null) {
             for (duct in ducts) {
                 if(!duct.mepSystemType.isNullOrEmpty()){
@@ -407,4 +413,22 @@ open class JSONAnalyzerService {
         }
 
     }
+
+    /**
+     * @Description: 连接件转换
+     */
+    fun connectorConvert(connectors: ArrayList<Connector>?,map: HashMap<String, String>): ArrayList<Connector>? {
+        if (connectors != null) {
+            for (connector in connectors) {
+                if(!connector.mepSystemType.isNullOrEmpty()){
+                    if (map.containsKey(connector.mepSystemType!!)) {
+                        connector.mepSystemType = map[connector.mepSystemType!!]
+                    }
+                }
+
+            }
+        }
+        return connectors
+    }
+
 }