Parcourir la source

update:修改空间或房间判断

zhangweixin il y a 3 ans
Parent
commit
c2a593bcec

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

@@ -38,4 +38,10 @@ open class Project {
     @Column(name = "type")
     var type: String? = null
 
+    /** 空间或房间 */
+    @ApiModelProperty(value = "空间或房间")
+    @Column(name = "room_space")
+    var roomSpace: String? = null
+
+
 }

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

@@ -170,21 +170,35 @@ open class JSONAnalyzerService {
         if (!result) {
             return "处理column异常"
         }
-        logger.debug("异常6*************************************************************************************************")
-        // 处理Space, 填充数据, replace插入表
-        result = result and SpaceAnalyzer.analyze(dataService.spaceService, baseObj, baseObj.elements!!.spaces)
-        if (!result) {
-            return "处理Space异常"
-        }
-        logger.debug("异常7*************************************************************************************************")
-        //---------------------------------------------------------
-        //12.20临时演示方案,room当作space
-        if(checkProject){
+
+        /** 空间或房间识别 */
+        if (checkProject) {
             result = result and Space2Analyzer.analyze(dataService.spaceService, baseObj, baseObj.elements!!.rooms)
             if (!result) {
                 return "处理Room异常"
             }
+        }else {
+            result = result and SpaceAnalyzer.analyze(dataService.spaceService, baseObj, baseObj.elements!!.spaces)
+            if (!result) {
+                return "处理Space异常"
+            }
         }
+
+//        logger.debug("异常6*************************************************************************************************")
+//        // 处理Space, 填充数据, replace插入表
+//        result = result and SpaceAnalyzer.analyze(dataService.spaceService, baseObj, baseObj.elements!!.spaces)
+//        if (!result) {
+//            return "处理Space异常"
+//        }
+//        logger.debug("异常7*************************************************************************************************")
+//        //---------------------------------------------------------
+//        //12.20临时演示方案,room当作space
+//        if(checkProject){
+//            result = result and Space2Analyzer.analyze(dataService.spaceService, baseObj, baseObj.elements!!.rooms)
+//            if (!result) {
+//                return "处理Room异常"
+//            }
+//        }
         logger.debug("异常8*************************************************************************************************")
 
 //        //处理Room, 填充数据, replace插入表
@@ -435,7 +449,7 @@ open class JSONAnalyzerService {
         val projectConfig = dataService.projectService.select(SFilter.eq("id", projectId)).entity()
         return if(projectConfig == null){
             false
-        }else projectConfig.type == "wanda"
+        }else projectConfig.roomSpace == "room"
     }
 
     /**