Browse Source

********************WX***********************
控制连接

zhangweixin 4 years ago
parent
commit
dd4f1cc92a

+ 11 - 0
data-core/src/main/kotlin/com/persagy/server/datacenter/dao/mappers/SchemeMapper.kt

@@ -31,6 +31,7 @@ import com.persagy.server.datacenter.models.entities.dict.Family
 import org.apache.ibatis.annotations.Mapper
 import org.apache.ibatis.annotations.Param
 import org.apache.ibatis.annotations.Select
+import org.apache.ibatis.annotations.Update
 import org.springframework.stereotype.Repository
 
 /**
@@ -124,5 +125,15 @@ interface SchemeMapper {
 
 
 
+    /** 楼层绑定的模型变更清除设备的建筑楼层 */
+    @Update("UPDATE  equipment set building_id =null, floor_id = null WHERE   project_id = #{projectId} AND bim_id LIKE concat(#{oldBimId},'%')")
+    fun updateEquip(@Param("projectId") projectId: String,@Param("oldBimId") oldBimId: String)
+
+    /** 楼层绑定的模型变更清除模型空间的建筑楼层 */
+    @Update("UPDATE  zone_ispace set building_id =null, floor_id = null WHERE   project_id = #{projectId} AND bim_id LIKE concat(#{oldBimId},'%')")
+    fun updateISpace(@Param("projectId") projectId: String,@Param("oldBimId") oldBimId: String)
+
+
+
 
 } // interface SchemeMapper

+ 3 - 3
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/task/FloorDic.kt

@@ -40,15 +40,15 @@ class FloorDic {
     /** floorId */
     @Schema(description = "floorId")
     @Column(name = "floor_id")
-    var floorId: String? = null
+    var id: String? = null
 
     /** 名称 */
     @Schema(description = "floorName")
     @Column(name = "floor_name")
-    var floorName: String? = null
+    var name: String? = null
 
     /** 本地名称 */
     @Schema(description = "floorLocalName")
     @Column(name = "floor_local_name")
-    var floorLocalName: String? = null
+    var localName: String? = null
 }

+ 5 - 0
datacenter/src/main/kotlin/com/persagy/server/services/assistant/SchemeService.kt

@@ -142,6 +142,11 @@ open class SchemeService {
                oldBimIdNew = oldBimId
            }
             val rUpDateEquipAndSapce = mapper.rUpDateEquipAndSapce(projectId, oldBimIdNew, bimId, floorId)
+//           /** 执行设备和模型空间修改操作 */
+//           if (!oldBimId.isNullOrEmpty()&&oldBimId!= bimId ) {
+//               mapper.updateEquip(projectId,oldBimId)
+//               mapper.updateISpace(projectId,oldBimId)
+//           }
 
            val floorEntity = FloorService.select(SFilter.eq("id", floorId)).entity()
            if (floorEntity!=null){

+ 4 - 4
datacenter/src/main/kotlin/com/persagy/server/services/objects/ShaftService.kt

@@ -402,15 +402,15 @@ object ShaftService : Service<Shaft>(SMybatisDao(Shaft::class.java)) {
                     /** 排序处理 */
                     val setId = HashSet<String>()
                     for (floor in siInSpList){
-                        setId.add(floor.floorId!!)
+                        setId.add(floor.id!!)
                     }
                     val floorLists = ArrayList<FloorDic>()
                     val floorList = FloorService.select(SFilter.inList("id", setId.toList())).order("floorSequenceId desc").exec()
                     for (floors in floorList){
                         val floorDic = FloorDic()
-                        floorDic.floorId = floors.id
-                        floorDic.floorLocalName = floors.localName
-                        floorDic.floorName = floors.name
+                        floorDic.id = floors.id
+                        floorDic.localName = floors.localName
+                        floorDic.name = floors.name
                         floorLists.add(floorDic)
                     }
                     floor.floor = floorLists

+ 2 - 2
datacenter/src/main/resources/application-dev.yml

@@ -34,8 +34,8 @@ spring:
     type:                               com.alibaba.druid.pool.DruidDataSource
     driver-class-name:                  org.postgresql.Driver
 #    url:                                jdbc:postgresql://60.205.177.43:5432/datacenterlabsl
-    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
-#    url:                                jdbc:postgresql://192.168.64.15:5432/datacenter
+#    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
+    url:                                jdbc:postgresql://192.168.64.15:5432/datacenter
 #    url:                                jdbc:postgresql://39.102.40.239:5432/datacenter
     username:                           postgres
 #    password:                           persagy_2020qwe!@#