caiaf 4 lat temu
rodzic
commit
091e6a347e

+ 11 - 11
revit-algorithm/src/main/kotlin/cn/sagacloud/server/algorithm/backstage/sync/SyncEquipPart.kt

@@ -285,15 +285,15 @@ class SyncEquipPart : SyncObject{
         return this
     }
 
-    fun syncPropertyId() {
-        val propertyList = dataCenterService.getPropertyById(propertyMap.keys.toMutableList() as ArrayList<String>, floor!!.projectId!!)
-        if(propertyList == null)
-            return
-        propertyList.forEach {
-            if(propertyMap.containsKey(it.id)){
-                it.equipId = propertyMap[it.id]
-            }
-        }
-        dataCenterService.propertyUpdate(propertyList, floor!!.projectId!!)
-    }
+//    fun syncPropertyId() {
+//        val propertyList = dataCenterService.getPropertyById(propertyMap.keys.toMutableList() as ArrayList<String>, floor!!.projectId!!)
+//        if(propertyList == null)
+//            return
+//        propertyList.forEach {
+//            if(propertyMap.containsKey(it.id)){
+//                it.equipId = propertyMap[it.id]
+//            }
+//        }
+//        dataCenterService.propertyUpdate(propertyList, floor!!.projectId!!)
+//    }
 }

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

@@ -291,17 +291,17 @@ class SyncEquipment : SyncObject{
         return this
     }
 
-    fun syncPropertyId() {
-        val propertyList = dataCenterService.getPropertyById(propertyMap.keys.toMutableList() as ArrayList<String>, floor!!.projectId!!)
-        if(propertyList == null)
-            return
-        propertyList.forEach {
-            if(propertyMap.containsKey(it.id)){
-                it.equipId = propertyMap[it.id]
-            }
-        }
-        dataCenterService.propertyUpdate(propertyList, floor!!.projectId!!)
-    }
+//    fun syncPropertyId() {
+//        val propertyList = dataCenterService.getPropertyById(propertyMap.keys.toMutableList() as ArrayList<String>, floor!!.projectId!!)
+//        if(propertyList == null)
+//            return
+//        propertyList.forEach {
+//            if(propertyMap.containsKey(it.id)){
+//                it.equipId = propertyMap[it.id]
+//            }
+//        }
+//        dataCenterService.propertyUpdate(propertyList, floor!!.projectId!!)
+//    }
 
     companion object {
         fun generateCADID(dcEquip: DCEquipment) {

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

@@ -73,8 +73,8 @@ class SyncUtil {
         monitorService.syncDatacenter(model.id!!, syncFloor, arrayListOf(syncModelComponent, syncEquip, syncComponent, syncISpace), bimIdPrefix)
 
         // 处理模型中绑定过propertyId的设备和部件
-        syncEquip.syncPropertyId()
-        syncComponent.syncPropertyId()
+//        syncEquip.syncPropertyId()
+//        syncComponent.syncPropertyId()
 
         // 上传底图, 并更新楼层的FloorMap
         var baseResult = uploadBaseGraph(model.id!!, zipBaseGraph(model.id!!))

+ 2 - 2
revit-algorithm/src/main/kotlin/cn/sagacloud/server/algorithm/models/config/DataCenterConfig.kt

@@ -26,8 +26,8 @@ class DataCenterConfig {
     lateinit var floorUpdate: String
     lateinit var floorCreate: String
     lateinit var floorBind: String
-    lateinit var propertyQuery: String
-    lateinit var propertyUpdate: String
+//    lateinit var propertyQuery: String
+//    lateinit var propertyUpdate: String
     lateinit var windowCreate: String
     lateinit var vwallCreate: String
     lateinit var doorCreate: String

+ 20 - 20
revit-algorithm/src/main/kotlin/cn/sagacloud/server/algorithm/services/datacenter/DataCenterRequest.kt

@@ -285,16 +285,16 @@ class DataCenterRequest{
     /**
      * 资产查询
      */
-    fun propertyQuery(request : QueryRequest, projectId : String) : QueryResponse<DCProperty>? {
-        try {
-            val postBody = JSON.toJSONString(request)
-            val resultStr : String
-            resultStr = HttpService.sendPostDataCenter(properties.datacenter.propertyQuery, postBody, projectId)
-            return JSON.parseObject(resultStr, object : TypeReference<QueryResponse<DCProperty>>() { })
-        } catch (e: Exception) {
-        }
-        return null
-    }
+//    fun propertyQuery(request : QueryRequest, projectId : String) : QueryResponse<DCProperty>? {
+//        try {
+//            val postBody = JSON.toJSONString(request)
+//            val resultStr : String
+//            resultStr = HttpService.sendPostDataCenter(properties.datacenter.propertyQuery, postBody, projectId)
+//            return JSON.parseObject(resultStr, object : TypeReference<QueryResponse<DCProperty>>() { })
+//        } catch (e: Exception) {
+//        }
+//        return null
+//    }
 
     /**
      * 部件查询
@@ -344,16 +344,16 @@ class DataCenterRequest{
      * 部件更新
      *
      */
-    fun propertyUpdate(request : UpdateRequest<DCProperty>, projectId : String) : BaseResponse?{
-        try {
-            val postBody = JSON.toJSONString(request)
-            val resultStr : String
-            resultStr = HttpService.sendPostDataCenter(properties.datacenter.propertyUpdate, postBody, projectId)
-            return JSON.parseObject(resultStr, object : TypeReference<BaseResponse>() { })
-        } catch (e: Exception) {
-        }
-        return null
-    }
+//    fun propertyUpdate(request : UpdateRequest<DCProperty>, projectId : String) : BaseResponse?{
+//        try {
+//            val postBody = JSON.toJSONString(request)
+//            val resultStr : String
+//            resultStr = HttpService.sendPostDataCenter(properties.datacenter.propertyUpdate, postBody, projectId)
+//            return JSON.parseObject(resultStr, object : TypeReference<BaseResponse>() { })
+//        } catch (e: Exception) {
+//        }
+//        return null
+//    }
 
     /**
      * 绑定楼层接口

+ 39 - 37
revit-algorithm/src/main/kotlin/cn/sagacloud/server/algorithm/services/datacenter/DataCenterService.kt

@@ -90,17 +90,17 @@ class DataCenterService {
         return null
     }
 
-    /**
-     * 根据资产id获取资产
-     */
-    fun getPropertyById(propertyIds : ArrayList<String>, projectId: String) : ArrayList<DCProperty>?{
-        val body = QueryRequest()
-        body.filters = generateSelectStr(propertyIds, "id")
-        val response = request.propertyQuery(body, projectId)
-        if(response != null && response.result == "success")
-            return response.content
-        return null
-    }
+//    /**
+//     * 根据资产id获取资产
+//     */
+//    fun getPropertyById(propertyIds : ArrayList<String>, projectId: String) : ArrayList<DCProperty>?{
+//        val body = QueryRequest()
+//        body.filters = generateSelectStr(propertyIds, "id")
+//        val response = request.propertyQuery(body, projectId)
+//        if(response != null && response.result == "success")
+//            return response.content
+//        return null
+//    }
 
     /**
      * 根据楼层id获取楼层下的设备
@@ -418,19 +418,19 @@ class DataCenterService {
         return false
     }
 
-    /**
-     * 更新资产
-     */
-    fun propertyUpdate(updateList: ArrayList<DCProperty>, projectId: String?) : Boolean {
-        val updateRequest = UpdateRequest<DCProperty>()
-        updateRequest.content = updateList
-        val result = request.propertyUpdate(updateRequest, projectId!!)
-        if(result != null && "success" == result.result){
-            return true
-        }
-        logger.error(result.toString())
-        return false
-    }
+//    /**
+//     * 更新资产
+//     */
+//    fun propertyUpdate(updateList: ArrayList<DCProperty>, projectId: String?) : Boolean {
+//        val updateRequest = UpdateRequest<DCProperty>()
+//        updateRequest.content = updateList
+//        val result = request.propertyUpdate(updateRequest, projectId!!)
+//        if(result != null && "success" == result.result){
+//            return true
+//        }
+//        logger.error(result.toString())
+//        return false
+//    }
 
     /**
      * 元空间更新
@@ -524,7 +524,9 @@ class DataCenterService {
         if(result != null && "success" == result.result){
             return true
         }
-        logger.error(result.toJson())
+        if(result != null){
+            logger.error(result.toJson())
+        }
         logger.error(createRequest.toJson())
         return false
     }
@@ -542,18 +544,18 @@ class DataCenterService {
             else
                 tmp.addAll(arr.subList(index, arr.size))
             when(operator){
-                DataCenterOperator.componentCreate ->{
-                    if (!componentCreate(tmp as ArrayList<DCComponent>, projectId, out as ArrayList<DCComponent>))
-                        throw Exception("创建部件失败")
-                }
-                DataCenterOperator.componentDelete ->{
-                    if (!componentDelete(tmp as ArrayList<DCComponent>, projectId))
-                        throw Exception("删除部件失败")
-                }
-                DataCenterOperator.componentUpdate ->{
-                    if (!componentUpdate(tmp as ArrayList<DCComponent>, projectId))
-                        throw Exception("更新部件失败")
-                }
+//                DataCenterOperator.componentCreate ->{
+//                    if (!componentCreate(tmp as ArrayList<DCComponent>, projectId, out as ArrayList<DCComponent>))
+//                        throw Exception("创建部件失败")
+//                }
+//                DataCenterOperator.componentDelete ->{
+//                    if (!componentDelete(tmp as ArrayList<DCComponent>, projectId))
+//                        throw Exception("删除部件失败")
+//                }
+//                DataCenterOperator.componentUpdate ->{
+//                    if (!componentUpdate(tmp as ArrayList<DCComponent>, projectId))
+//                        throw Exception("更新部件失败")
+//                }
                 DataCenterOperator.equipCreate ->{
                     if (!equipCreate(tmp as ArrayList<DCEquipment>, projectId, out as ArrayList<DCEquipment>))
                         throw Exception("创建设备失败")

+ 3 - 3
revit-algorithm/src/main/resources-test/application.yml

@@ -129,9 +129,9 @@ properties:
     floorCreate: ${properties.datacenter.url}object/floor/create
     # 绑定楼层接口
     floorBind: ${properties.datacenter.url}rel/update/equip-ispace
-    # 资产接口
-    propertyQuery: ${properties.datacenter.url}object/property/query
-    propertyUpdate: ${properties.datacenter.url}object/property/update
+#    # 资产接口
+#    propertyQuery: ${properties.datacenter.url}object/property/query
+#    propertyUpdate: ${properties.datacenter.url}object/property/update
     # 同步构件接口
     windowCreate: ${properties.datacenter.url}window/create_ignore
     vwallCreate: ${properties.datacenter.url}vwall/create_ignore