Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	datacenter/src/main/resources/application-test.yml
zhangweixin 4 years ago
parent
commit
00c0192151

+ 78 - 0
datacenter/src/main/kotlin/com/persagy/server/models/entities/FloorModel.kt

@@ -0,0 +1,78 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *                      :*$@@%$*:                         ;:                ;;    ;;
+ *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+ *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+ *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+ *                   =@*                                  %!              @ $= % %@=   =%@!      %=
+ *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+ *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+ *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+ *          $@*   ;@@@%=!:                *@*
+ *          =@$    ;;;!=%@@@@=!           =@!
+ *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+ *            ;%@@$=$@@%*       *@@@$=%@@%;
+ *               ::;::             ::;::                                              All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+
+package com.persagy.server.models.entities
+
+import com.alibaba.fastjson.JSONArray
+import com.sun.org.apache.xpath.internal.operations.Bool
+import javax.persistence.Column
+import javax.persistence.Id
+import javax.persistence.Table
+
+/**
+ *
+ *
+ * @author jxing
+ */
+@Table(name = "revit.model_floor")
+open class FloorModel{
+    /** 表自增id */
+    @Column(name = "id")
+    @Id
+    var id: String? = null
+
+    /** 项目id */
+    @Column(name = "project_id")
+    var projectId: String? = null
+
+    /** 楼层名称 */
+    @Column(name = "floor_name")
+    var floorName: String? = null
+
+    /** 该楼层当前的模型id */
+    @Column(name = "current_model_id")
+    var currentModelId: String? = null
+
+    /** 该楼层所属的文件夹id */
+    @Column(name = "folder_id")
+    var folderId: String? = null
+
+    // new
+
+    /** 该楼层在物理世界上的楼层id */
+    var floorId: String? = null
+
+    /** 该楼层在物理世界上的楼层id */
+    var isCover: Boolean? = null
+
+    /** 该楼层在物理世界上的建筑id */
+    @Column(name = "building_id")
+    var buildingId: String? = null
+
+//    /** 该楼层在物理世界上的楼层id */
+//    @ApiModelProperty(value = "该楼层在物理世界上的楼层id")
+//    @Column(name = "bind_floor_ids")
+//    var floorIdList: ArrayList<String>? = null
+
+
+    var bind_floor_ids: String? = null
+
+
+}

+ 2 - 0
datacenter/src/main/kotlin/com/persagy/server/models/service/BaseDataService.kt

@@ -4,10 +4,12 @@ import cn.sagacloud.server.algorithm.models.entities.Door
 import com.persagy.mybatis.SMybatisDao
 import com.persagy.server.models.entities.Connector
 import com.persagy.server.models.entities.Equipment
+import com.persagy.server.models.entities.FloorModel
 import com.persagy.service.SObjectService
 
 object BaseDataService {
     val doorService = SObjectService(SMybatisDao(Door::class.java))
     val connectorService = SObjectService(SMybatisDao(Connector::class.java))
     val equipmentService = SObjectService(SMybatisDao(Equipment::class.java))
+    val floorModelService = SObjectService(SMybatisDao(FloorModel::class.java))
 }

+ 14 - 9
datacenter/src/main/kotlin/com/persagy/server/services/relation_calc/CalcSpecialService.kt

@@ -269,15 +269,20 @@ open class CalcSpecialService {
         val fMap = HashMap<String,HashSet<String>>()
         val dMap = HashMap<String,HashSet<String>>()
         val modelIds  = ArrayList<String>()
-
+        val modelFloorIds = ArrayList<String>()
         for (building in buildings) {
             val buildingId = building.id!!
             val floors = FloorService.select(SFilter.eq("projectId",projectId), SFilter.eq("buildingId",buildingId)).exec()
             for (floor in floors) {
                 if (!floor.modelId.isNullOrEmpty()) {
-                    modelIds.add(floor.modelId!!)
+                    modelFloorIds.add(floor.modelId!!)
                 }
-
+            }
+            val modelFloors = BaseDataService.floorModelService.select(SFilter.eq("projectId",projectId), SFilter.inList("id",modelFloorIds)).exec()
+            for (modelFloor in modelFloors) {
+               if(!modelFloor.currentModelId.isNullOrEmpty()) {
+                   modelIds.add(modelFloor.currentModelId!!)
+               }
             }
             val riserMap = riserConnect("DomainHvac","",modelIds)
 
@@ -356,7 +361,7 @@ open class CalcSpecialService {
                             belongMap[belong] = belongs
                         }
                     }
-                    if(connector.riserState != null && connector.riserState!! > 0 && listOf("Duct","Pipe").contains(connector.belongType)){
+//                    if(connector.riserState != null && connector.riserState!! > 0 && listOf("Duct","Pipe").contains(connector.belongType)){
                         for (key in riserMap.keys) {
                             if(key == belong){
                                 belongMap[belong]!!.addAll(riserMap[key]!!)
@@ -364,7 +369,7 @@ open class CalcSpecialService {
                                 break
                             }
                         }
-                    }
+//                    }
                 }
             }
             var fBlockId: Int =0
@@ -427,8 +432,8 @@ open class CalcSpecialService {
                             connectedBlock.id2 = e2.id!!
                             connectedBlock.type1 = "Equipment"
                             connectedBlock.type2 = "Equipment"
-//                                connectedBlock.modelId1 = connectorMap[key]!!.modelId
-//                                connectedBlock.modelId2 = connectorMap[s]!!.modelId
+                                connectedBlock.modelId1 = e1.floorId
+                                connectedBlock.modelId2 = e2.floorId
 //                                connectedBlock.domain = connector.domain
 //                                connectedBlock.mepSystemType = connector.mepSystemType
                             connectedBlock.projectId = projectId
@@ -459,8 +464,8 @@ open class CalcSpecialService {
                             connectedBlock.id2 = e2.id!!
                             connectedBlock.type1 = "Equipment"
                             connectedBlock.type2 = "Equipment"
-//                                connectedBlock.modelId1 = connectorMap[key]!!.modelId
-//                                connectedBlock.modelId2 = connectorMap[s]!!.modelId
+                            connectedBlock.modelId1 = e1.floorId
+                            connectedBlock.modelId2 = e2.floorId
 //                                connectedBlock.domain = connector.domain
 //                                connectedBlock.mepSystemType = connector.mepSystemType
                             connectedBlock.projectId = projectId

+ 2 - 2
datacenter/src/main/kotlin/com/persagy/server/services/relation_calc/RelationCalcService.kt

@@ -1255,7 +1255,7 @@ open class RelationCalcService {
                                     for (connectedBlock in connectedBlocks) {
                                         val typeCode1 = connectedBlock.typeCode1
                                         val typeCode2 = connectedBlock.typeCode2
-                                        if(sourceList.contains(typeCode1) && rEq2Sp.id1 == connectedBlock.id1){
+                                        if(codeList.contains(typeCode2) && rEq2Sp.id1 == connectedBlock.id1){
                                             val fullREq2Sp = REq2Sp()
 //                                            fullREq2Sp.type = relType
 //                                            fullREq2Sp.graphCode = graphCode
@@ -1267,7 +1267,7 @@ open class RelationCalcService {
                                             fullREq2Sp.sign =2
                                             rEq2Sps.add(fullREq2Sp)
 
-                                        }else if(sourceList.contains(typeCode2) && rEq2Sp.id1 == connectedBlock.id2){
+                                        }else if(codeList.contains(typeCode1) && rEq2Sp.id1 == connectedBlock.id2){
                                             val fullREq2Sp = REq2Sp()
 //                                            fullREq2Sp.type = relType
 //                                            fullREq2Sp.graphCode = graphCode