|
@@ -20,6 +20,7 @@
|
|
|
|
|
|
package cn.sagacloud.server.algorithm.services.json
|
|
|
|
|
|
+import cn.sagacloud.server.algorithm.controllers.TestModelController
|
|
|
import cn.sagacloud.server.algorithm.models.entities.*
|
|
|
import cn.sagacloud.server.algorithm.models.jsonAnalyzer.AllComponents
|
|
|
import cn.sagacloud.server.algorithm.models.jsonAnalyzer.BaseObj
|
|
@@ -31,12 +32,11 @@ import com.alibaba.fastjson.JSONObject
|
|
|
import com.alibaba.fastjson.util.ParameterizedTypeImpl
|
|
|
import com.fasterxml.jackson.databind.DeserializationFeature
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper
|
|
|
-import com.persagy.revit.services.json.EquipmentAnalyzer
|
|
|
import com.sybotan.database.SFilter
|
|
|
-import com.sybotan.mybatis.SMybatisDao
|
|
|
import com.sybotan.service.SObjectService
|
|
|
import com.sybotan.service.models.enums.SResponseType
|
|
|
import com.sybotan.service.models.responses.SBaseResponse
|
|
|
+import org.slf4j.LoggerFactory
|
|
|
import org.springframework.stereotype.Component
|
|
|
import java.io.InputStream
|
|
|
import java.lang.reflect.Type
|
|
@@ -60,6 +60,11 @@ open class JSONAnalyzerService {
|
|
|
// private var modelService = SObjectService(SMybatisDao(ModelFile::class.java))
|
|
|
// private var boundarySegmentService = SObjectService(SMybatisDao(BoundarySegment::class.java))
|
|
|
|
|
|
+ companion object {
|
|
|
+ // 日志
|
|
|
+ private val logger = LoggerFactory.getLogger(JSONAnalyzerService::class.java)
|
|
|
+ } // Companion object
|
|
|
+
|
|
|
var dataService = BaseDataService
|
|
|
|
|
|
/**
|
|
@@ -114,6 +119,8 @@ open class JSONAnalyzerService {
|
|
|
if (!result) {
|
|
|
return "获取model异常"
|
|
|
}
|
|
|
+ logger.debug("异常1*************************************************************************************************")
|
|
|
+
|
|
|
// 处理VirtualWall, 填充数据, replace插入表
|
|
|
result = result and BaseBehavier.analyze(
|
|
|
dataService.virtualWallService as SObjectService<BaseComponent>,
|
|
@@ -123,6 +130,7 @@ open class JSONAnalyzerService {
|
|
|
if (!result) {
|
|
|
return "处理VirtualWall异常"
|
|
|
}
|
|
|
+ logger.debug("异常2*************************************************************************************************")
|
|
|
// 处理Wall, 填充数据, replace插入表
|
|
|
result = result and BaseBehavier.analyze(
|
|
|
dataService.wallService as SObjectService<BaseComponent>,
|
|
@@ -132,6 +140,7 @@ open class JSONAnalyzerService {
|
|
|
if (!result) {
|
|
|
return "处理Wall异常"
|
|
|
}
|
|
|
+ logger.debug("异常3*************************************************************************************************")
|
|
|
// 处理door, 填充数据, 填充wallId, replace插入表
|
|
|
result = result and DoorWindowAnalyzer.analyze(
|
|
|
dataService.doorService as SObjectService<WindowDoorBase>,
|
|
@@ -141,6 +150,7 @@ open class JSONAnalyzerService {
|
|
|
if (!result) {
|
|
|
return "处理door异常"
|
|
|
}
|
|
|
+ logger.debug("异常4*************************************************************************************************")
|
|
|
// 处理Window, 填充数据, 填充wallId, replace插入表
|
|
|
result = result and DoorWindowAnalyzer.analyze(
|
|
|
dataService.windowService as SObjectService<WindowDoorBase>,
|
|
@@ -150,6 +160,7 @@ open class JSONAnalyzerService {
|
|
|
if (!result) {
|
|
|
return "处理Window异常"
|
|
|
}
|
|
|
+ logger.debug("异常5*************************************************************************************************")
|
|
|
// 处理column, 填充数据, replace插入表
|
|
|
result = result and BaseBehavier.analyze(
|
|
|
dataService.columnService as SObjectService<BaseComponent>,
|
|
@@ -159,11 +170,13 @@ 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){
|
|
@@ -172,7 +185,7 @@ open class JSONAnalyzerService {
|
|
|
return "处理Room异常"
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ logger.debug("异常8*************************************************************************************************")
|
|
|
|
|
|
// //处理Room, 填充数据, replace插入表
|
|
|
// result = result and RoomAnalyzer.analyze(dataService.roomService, baseObj, baseObj.elements!!.rooms)
|
|
@@ -190,7 +203,7 @@ open class JSONAnalyzerService {
|
|
|
if (!result) {
|
|
|
return "处理BoundarySegment异常"
|
|
|
}
|
|
|
-
|
|
|
+ logger.debug("异常9*************************************************************************************************")
|
|
|
var pipes = baseObj.elements!!.pipes as ArrayList<BaseComponent>?
|
|
|
var flexPipes = baseObj.elements!!.flexPipes as ArrayList<BaseComponent>?
|
|
|
var ducts = baseObj.elements!!.ducts as ArrayList<BaseComponent>?
|
|
@@ -228,6 +241,7 @@ open class JSONAnalyzerService {
|
|
|
if (!result) {
|
|
|
return "处理Pipe异常"
|
|
|
}
|
|
|
+ logger.debug("异常10*************************************************************************************************")
|
|
|
// 处理flexPipe
|
|
|
result = result and RevitIdAnalyzer.analyzePipesDucts(
|
|
|
dataService.pipeService as SObjectService<BaseComponent>,
|
|
@@ -241,6 +255,7 @@ open class JSONAnalyzerService {
|
|
|
if (!result) {
|
|
|
return "处理FlexPipe异常"
|
|
|
}
|
|
|
+ logger.debug("异常11*************************************************************************************************")
|
|
|
// 处理duct
|
|
|
result = result and RevitIdAnalyzer.analyzePipesDucts(
|
|
|
dataService.ductService as SObjectService<BaseComponent>,
|
|
@@ -254,6 +269,7 @@ open class JSONAnalyzerService {
|
|
|
if (!result) {
|
|
|
return "处理Duct异常"
|
|
|
}
|
|
|
+ logger.debug("异常12*************************************************************************************************")
|
|
|
// 处理flexDuct
|
|
|
result = result and RevitIdAnalyzer.analyzePipesDucts(
|
|
|
dataService.ductService as SObjectService<BaseComponent>,
|
|
@@ -267,7 +283,7 @@ open class JSONAnalyzerService {
|
|
|
if (!result) {
|
|
|
return "处理FlexDuct异常"
|
|
|
}
|
|
|
-
|
|
|
+ logger.debug("异常13*************************************************************************************************")
|
|
|
// 处理other
|
|
|
result = result and RevitIdAnalyzer.analyze(
|
|
|
dataService.otherService as SObjectService<BaseComponent>,
|
|
@@ -278,6 +294,7 @@ open class JSONAnalyzerService {
|
|
|
if (!result) {
|
|
|
return "处理other异常"
|
|
|
}
|
|
|
+ logger.debug("异常14*************************************************************************************************")
|
|
|
// 处理joinObject
|
|
|
result = result and RevitIdAnalyzer.analyze(
|
|
|
dataService.joinObjectService as SObjectService<BaseComponent>,
|
|
@@ -288,6 +305,7 @@ open class JSONAnalyzerService {
|
|
|
if (!result) {
|
|
|
return "处理joinObject异常"
|
|
|
}
|
|
|
+ logger.debug("异常15*************************************************************************************************")
|
|
|
// 处理equipment
|
|
|
// result = result and EquipmentAnalyzer.analyze(
|
|
|
// dataService.equipmentService,
|
|
@@ -302,7 +320,8 @@ open class JSONAnalyzerService {
|
|
|
dataService.equipmentService,
|
|
|
baseObj,
|
|
|
baseObj.elements!!.equipments,
|
|
|
- bimIdPrefix, revitIdMap,
|
|
|
+ bimIdPrefix,
|
|
|
+ revitIdMap,
|
|
|
checkProject,
|
|
|
dataService.equipCompService,
|
|
|
dataService.infoPointCompService,
|
|
@@ -312,6 +331,7 @@ open class JSONAnalyzerService {
|
|
|
if (!result) {
|
|
|
return "处理equipment异常"
|
|
|
}
|
|
|
+ logger.debug("异常16*************************************************************************************************")
|
|
|
// 处理部件(component)
|
|
|
result = result and EquipmentAnalyzer.analyzeComponent(
|
|
|
dataService.componentService,
|
|
@@ -323,7 +343,7 @@ open class JSONAnalyzerService {
|
|
|
if (!result) {
|
|
|
return "处理component异常"
|
|
|
}
|
|
|
-
|
|
|
+ logger.debug("异常17*************************************************************************************************")
|
|
|
// 处理连接件
|
|
|
result = result and RevitIdAnalyzer.analyzeConnector(
|
|
|
dataService.connectorService,
|
|
@@ -336,7 +356,7 @@ open class JSONAnalyzerService {
|
|
|
if (!result) {
|
|
|
return "处理连接件异常"
|
|
|
}
|
|
|
-
|
|
|
+ logger.debug("异常18*************************************************************************************************")
|
|
|
// 处理level, 标高
|
|
|
result = result and BaseBehavier.analyze(
|
|
|
dataService.levelService as SObjectService<BaseComponent>,
|
|
@@ -346,6 +366,7 @@ open class JSONAnalyzerService {
|
|
|
if (!result) {
|
|
|
return "处理level异常"
|
|
|
}
|
|
|
+ logger.debug("异常19*************************************************************************************************")
|
|
|
// 处理grid, 轴网
|
|
|
result = result and BaseBehavier.analyze(
|
|
|
dataService.gridService as SObjectService<BaseComponent>,
|
|
@@ -355,6 +376,7 @@ open class JSONAnalyzerService {
|
|
|
if (!result) {
|
|
|
return "处理grid异常"
|
|
|
}
|
|
|
+ logger.debug("异常20*************************************************************************************************")
|
|
|
return null
|
|
|
}
|
|
|
|