|
@@ -20,8 +20,7 @@
|
|
|
|
|
|
package cn.sagacloud.server.algorithm.services.json
|
|
|
|
|
|
-import cn.sagacloud.server.algorithm.models.entities.BaseComponent
|
|
|
-import cn.sagacloud.server.algorithm.models.entities.WindowDoorBase
|
|
|
+import cn.sagacloud.server.algorithm.models.entities.*
|
|
|
import cn.sagacloud.server.algorithm.models.jsonAnalyzer.AllComponents
|
|
|
import cn.sagacloud.server.algorithm.models.jsonAnalyzer.BaseObj
|
|
|
import cn.sagacloud.server.algorithm.models.modelFile.ModelFile
|
|
@@ -34,6 +33,7 @@ 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
|
|
@@ -189,7 +189,8 @@ open class JSONAnalyzerService {
|
|
|
result = result and RevitIdAnalyzer.analyzePipesDucts(
|
|
|
dataService.pipeService as SObjectService<BaseComponent>,
|
|
|
baseObj,
|
|
|
- baseObj.elements!!.pipes as ArrayList<BaseComponent>?,
|
|
|
+ //baseObj.elements!!.pipes as ArrayList<BaseComponent>?,
|
|
|
+ pipeConvert(null, baseObj.elements!!.pipes),
|
|
|
revitIdMap,
|
|
|
"Pipe"
|
|
|
)
|
|
@@ -200,7 +201,8 @@ open class JSONAnalyzerService {
|
|
|
result = result and RevitIdAnalyzer.analyzePipesDucts(
|
|
|
dataService.pipeService as SObjectService<BaseComponent>,
|
|
|
baseObj,
|
|
|
- baseObj.elements!!.flexPipes as ArrayList<BaseComponent>?,
|
|
|
+// baseObj.elements!!.flexPipes as ArrayList<BaseComponent>?,
|
|
|
+ pipeConvert(null, baseObj.elements!!.pipes),
|
|
|
revitIdMap,
|
|
|
"FlexPipe"
|
|
|
)
|
|
@@ -211,7 +213,8 @@ open class JSONAnalyzerService {
|
|
|
result = result and RevitIdAnalyzer.analyzePipesDucts(
|
|
|
dataService.ductService as SObjectService<BaseComponent>,
|
|
|
baseObj,
|
|
|
- baseObj.elements!!.ducts as ArrayList<BaseComponent>?,
|
|
|
+// baseObj.elements!!.ducts as ArrayList<BaseComponent>?,
|
|
|
+ pipeConvert(baseObj.elements!!.ducts, null),
|
|
|
revitIdMap,
|
|
|
"Duct"
|
|
|
)
|
|
@@ -222,7 +225,8 @@ open class JSONAnalyzerService {
|
|
|
result = result and RevitIdAnalyzer.analyzePipesDucts(
|
|
|
dataService.ductService as SObjectService<BaseComponent>,
|
|
|
baseObj,
|
|
|
- baseObj.elements!!.flexDucts as ArrayList<BaseComponent>?,
|
|
|
+// baseObj.elements!!.flexDucts as ArrayList<BaseComponent>?,
|
|
|
+ pipeConvert(baseObj.elements!!.ducts, null),
|
|
|
revitIdMap,
|
|
|
"FlexDuct"
|
|
|
)
|
|
@@ -366,4 +370,41 @@ open class JSONAnalyzerService {
|
|
|
}
|
|
|
return dataService.projectService.select(SFilter.eq("id", projectId)).entity() != null;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Description: 管道类型转换
|
|
|
+ */
|
|
|
+ fun pipeConvert(ducts: ArrayList<Duct>?, pipes: ArrayList<Pipe>?): ArrayList<BaseComponent>? {
|
|
|
+ //修改万达管道名称对应标准管道名称
|
|
|
+ val pdCompService = SObjectService(SMybatisDao(PipeDuctComp::class.java)) // 管道对照
|
|
|
+ val pdComps = pdCompService.selectAll().exec()
|
|
|
+ val map = HashMap<String, String>()
|
|
|
+ for (pdComp in pdComps) {
|
|
|
+ map[pdComp.pPdName!!] = pdComp.pdName!!
|
|
|
+ }
|
|
|
+ if (ducts != null) {
|
|
|
+ for (duct in ducts) {
|
|
|
+ if(!duct.mepSystemType.isNullOrEmpty()){
|
|
|
+ if (map.containsKey(duct.mepSystemType!!)) {
|
|
|
+ duct.mepSystemType = map[duct.mepSystemType!!]
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return ducts as ArrayList<BaseComponent>?
|
|
|
+ } else if (pipes != null) {
|
|
|
+ for (pipe in pipes) {
|
|
|
+ if(!pipe.mepSystemType.isNullOrEmpty()){
|
|
|
+ if (map.containsKey(pipe.mepSystemType!!)) {
|
|
|
+ pipe.mepSystemType = map[pipe.mepSystemType!!]
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return pipes as ArrayList<BaseComponent>?
|
|
|
+ } else {
|
|
|
+ return null
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|