Browse Source

设备识别更新本地编码 且 不符合识别规则的构件抛弃

caiaf 3 years ago
parent
commit
673470bbd6

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

@@ -203,9 +203,11 @@ class SyncEquipment : SyncObject{
     private fun addToUpdate(equip: Equipment, sb: StringBuilder, dcEquip: DCEquipment) {
         val point = equip.location?.points?.get(0)
         addLocationAndFloorId(point, dcEquip, sb)
-        if(dcEquip.localId.isNullOrBlank())
+        //更新的同时更新本地id
+//        if(dcEquip.localId.isNullOrBlank())
             dcEquip.localId = equip.localId
-        if(dcEquip.localName.isNullOrBlank())
+        //更新的同时更新本地名称
+//        if(dcEquip.localName.isNullOrBlank())
             dcEquip.localName = equip.localName
         dcEquip.familyName = equip.familyName
         dcEquip.familySymbol = equip.familySymbol

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

@@ -142,19 +142,19 @@ object EquipmentAnalyzer {
                             obj.wdCode = equipComp.aliasCode
                             obj.aliasName = equipComp.aliasName
                         }else{
-                            equipComp = equipCompService.select(SFilter.eq("bimTypeID",obj.bimTypeID!!)).entity()
-                            if(equipComp != null){
-                                obj.family = equipComp.classCode?:"XXXXXX"
-                                obj.bimTypeName = equipComp.bimTypeName
-                                obj.wdCode = equipComp.aliasCode
-                                obj.aliasName = equipComp.aliasName
-                            }else{
-                                obj.family = "OTXXXX"
-                            }
+//                            equipComp = equipCompService.select(SFilter.eq("bimTypeID",obj.bimTypeID!!)).entity()
+//                            if(equipComp != null){
+//                                obj.family = equipComp.classCode?:"XXXXXX"
+//                                obj.bimTypeName = equipComp.bimTypeName
+//                                obj.wdCode = equipComp.aliasCode
+//                                obj.aliasName = equipComp.aliasName
+//                            }else{
+                            obj.family = "OTXXXX"
+//                            }
                             //未识别的设备类型,类型码转换为"OTXXXX",OT表示“其他系统”,“XXXX”表示未识别的设备
                         }
                     }else{
-                        equipComp = equipCompService.select(SFilter.eq("bimTypeID",obj.bimTypeID!!)).entity()
+                        equipComp = equipCompService.select(SFilter.eq("bimTypeID",obj.bimTypeID!!), SFilter.or(SFilter.isNull("sysName"),SFilter.eq("sysName",""))).entity()
                         if(equipComp != null){
                             obj.family = equipComp.classCode?:"XXXXXX"
                             obj.bimTypeName = equipComp.bimTypeName

+ 1 - 1
scheduler/src/main/resources-test/application.yml

@@ -41,7 +41,7 @@ spring:
 #    driver-class-name:                  com.mysql.cj.jdbc.Driver
     driver-class-name:                  org.postgresql.Driver
 #    url:                                jdbc:mysql://172.16.0.235:3306/datacenter?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai  #&zeroDateTimeBehavior=convertToNull
-    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterwd
+    url:                                jdbc:postgresql://192.168.64.15:5432/datacenterwanda
       #?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai  #&zeroDateTimeBehavior=convertToNull
 #    username:                           root
 #    password:                           123456