caiaf 4 lat temu
rodzic
commit
1dc7f2e2de

+ 8 - 1
revit-algorithm/src/main/kotlin/cn/sagacloud/server/algorithm/backstage/state/DataCheckState_10.kt

@@ -12,6 +12,7 @@ import cn.sagacloud.server.algorithm.models.scheduler.SagaCheckResult
 import cn.sagacloud.server.algorithm.models.scheduler.UnitCheckResult
 import cn.sagacloud.server.algorithm.services.BaseDataService
 import cn.sagacloud.server.algorithm.services.CommonService
+import cn.sagacloud.server.algorithm.services.endpoint.ModelFileService
 import cn.sagacloud.server.algorithm.services.excel.ExcelService
 import cn.sagacloud.server.algorithm.services.message.MessageService
 import cn.sagacloud.server.algorithm.services.modelCheck.TaskService
@@ -19,6 +20,7 @@ import cn.sagacloud.server.algorithm.services.monitor.ModelMonitorService
 import com.alibaba.fastjson.JSON
 import com.alibaba.fastjson.JSONObject
 import com.sybotan.database.SFilter
+import com.sybotan.service.models.requests.SUpdateRequest
 import com.sybotan.service.utils.SSpringContextUtil
 import org.slf4j.LoggerFactory
 import org.springframework.beans.factory.annotation.Autowired
@@ -57,6 +59,7 @@ class DataCheckState_10 : ModelState {
      */
     override fun prepareModel() {
         modelList = dataService.modelFileService.select(SFilter.eq("status", 10), SFilter.eq("removed", false)).exec()
+//        modelList = dataService.modelFileService.select(SFilter.eq("id","101c741c879c11eb8c275fda20e508c5")).exec()
     }
 
     /**
@@ -103,7 +106,7 @@ class DataCheckState_10 : ModelState {
                     monitorService.endSchedulerCheckDownload(it.id!!, task!!.downloadFinishTime)
                     when (task!!.status) {
                         2 -> {
-                            //monitorService.beginCheck(it.id!!, checkTime)
+                            monitorService. beginCheck(it.id!!, checkTime)
                         }
                         3 -> {
                             // 失败, 文件下载异常
@@ -212,6 +215,10 @@ class DataCheckState_10 : ModelState {
                         monitorService.modelCheck(it.id!!, singleModelCheckBegin!!, singleModelCheckEnd!!)
                         messageService.sendMessage(message)
                     }
+                    val request = SUpdateRequest<ModelFile>()
+                    request.content = updateList
+                    dataService.modelFileService.updateList(request)
+
                 } catch (e: Exception) {
                     monitorService.modelCheck(it.id!!, e.message + CommonService.getStackTrace(e), false)
                 }

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

@@ -115,7 +115,8 @@ class SyncEquipment : SyncObject{
         dataCenter.forEach { (_, dcEquip) ->
             if(dcEquip.bimId != null && bimMap.contains(dcEquip.bimId!!)){
                 val equip = bimMap[dcEquip.bimId!!]
-                if(!equip!!.family.equals(dcEquip.classCode)){
+                if(!dcEquip.classCode!!.endsWith(equip!!.family!!)){
+//                if(!equip!!.family.equals(dcEquip.classCode)){
                     // 需要先删除, 后添加
                     deleteList.add(dcEquip)
                     return@forEach