瀏覽代碼

********************WX******************
调整系统关系

zhangweixin 4 年之前
父節點
當前提交
005289c681
共有 17 個文件被更改,包括 1323 次插入38 次删除
  1. 6 0
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/objects/Shaft.kt
  2. 5 0
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/objects/VShaft.kt
  3. 48 0
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/rel/RShInBdList.kt
  4. 118 0
      datacenter/src/main/kotlin/com/persagy/server/controllers/rel/RShInBdController.kt
  5. 4 5
      datacenter/src/main/kotlin/com/persagy/server/mappers/IRelationExcelExportMapper.kt
  6. 3 3
      datacenter/src/main/kotlin/com/persagy/server/mappers/IRelationExcelImportMapper.kt
  7. 6 3
      datacenter/src/main/kotlin/com/persagy/server/services/graphtype/RelationTypeProjectService.kt
  8. 50 0
      datacenter/src/main/kotlin/com/persagy/server/services/objects/ShaftService.kt
  9. 238 0
      datacenter/src/main/kotlin/com/persagy/server/services/rel/RShInBdService.kt
  10. 3 2
      datacenter/src/main/kotlin/com/persagy/server/services/relation_calc/RelationCalcService.kt
  11. 2 2
      datacenter/src/main/resources/application-dev.yml
  12. 15 6
      datacenter/src/main/resources/application-test.yml
  13. 171 0
      datasyn/src/main/kotlin/com/persagy/server/syn/Configure.kt
  14. 193 0
      datasyn/src/main/kotlin/com/persagy/server/syn/jms/DataCenterSync.kt
  15. 444 9
      datasyn/src/main/kotlin/com/persagy/server/syn/services/jms/rel/AutomaticCalculationSync.kt
  16. 16 7
      datasyn/src/main/resources/application-test.yml
  17. 1 1
      equip-component/src/main/kotlin/com/persagy/server/service/objects/GeneralSystemService.kt

+ 6 - 0
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/objects/Shaft.kt

@@ -120,6 +120,12 @@ class Shaft : BaseInfo() {
     var equipmentList: ArrayList<Equipment>? = null
 
     /** 级联-竖井内的系统 */
+    @Schema(description = "级联-竖井内的系统")
+    @SCascade(table="r_sh_in_bd", idColumn="shaft_id", childIdColumn="building_id")
+    var buildingList: ArrayList<Building>? = null
+
+
+    /** 级联-竖井内的系统 */
    @Schema(description = "级联-竖井内的系统")
     @SCascade(table="r_sy_in_sh", idColumn="shaft_id", childIdColumn="sys_id")
     var systemList: ArrayList<GeneralSystem>? = null

+ 5 - 0
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/objects/VShaft.kt

@@ -140,5 +140,10 @@ class VShaft : BaseInfo() {
     @SCascade(table="relationship.r_sh2sp", idColumn="id1", childIdColumn="id2", self = false,filter = "type = 'sh2sp'")
     var spaceList: ArrayList<ZoneSpace>? = null
 
+    /** 级联-竖井内的系统 */
+    @Schema(description = "级联-竖井内的系统")
+    @SCascade(table="r_sh_in_bd", idColumn="shaft_id", childIdColumn="building_id")
+    var buildingList: ArrayList<Building>? = null
+
 
 } // Class Shaft

+ 48 - 0
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/rel/RShInBdList.kt

@@ -0,0 +1,48 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.datacenter.models.entities.rel
+
+import com.persagy.server.datacenter.models.entities.base.RBaseInfo
+import io.swagger.v3.oas.annotations.media.Schema
+
+/**
+ * 竖井所在的建筑  一对多  一个竖井对应多个建筑
+ *
+ * @author 付国宝
+ */
+@Schema(description = "竖井所在的建筑")
+class RShInBdList : RBaseInfo() {
+
+    /** 竖井id */
+    @Schema(description = "竖井id")
+    var shaftId: String? = null
+
+    /** 建筑id列表 */
+    @Schema(description = "建筑id列表")
+    var buildingIdList: ArrayList<String>? = null
+
+}

+ 118 - 0
datacenter/src/main/kotlin/com/persagy/server/controllers/rel/RShInBdController.kt

@@ -0,0 +1,118 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.controllers.rel
+
+import com.persagy.server.datacenter.models.entities.rel.*
+import com.persagy.server.services.rel.RShInBdService
+import com.persagy.service.models.responses.SCreateResponse
+import io.swagger.v3.oas.annotations.Operation
+import io.swagger.v3.oas.annotations.tags.Tag
+import org.slf4j.LoggerFactory
+import org.springframework.web.bind.annotation.PostMapping
+import org.springframework.web.bind.annotation.RequestBody
+import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RestController
+
+/**
+ * 竖井所在建筑
+ *
+ * @author 付国宝
+ */
+@Tag(name = "030、关系-竖井所在建筑")
+@RestController
+@RequestMapping("/rel/sh-in-bd")
+class RShInBdController {
+
+    companion object {
+        /** 日志 */
+        private val logger = LoggerFactory.getLogger(RShInBdController::class.java)
+    } // Companion object
+//
+//    /**
+//     * 创建系统所在建筑关系
+//     *
+//     * @param    rSyInBd     系统和建筑的关系对象
+//     * @return               创建的结果信息
+//     */
+//    @Operation(summary = "创建系统所在建筑关系", description = "必填项:SysId(系统id)、BuildingId(建筑id)")
+//    @PostMapping(value = ["/link"])
+//    fun create(@RequestBody rSyInBd: RSyInBd): SCreateResponse<RSyInBd> {
+//        logger.debug("build = ${rSyInBd.toJson()}")
+//        return RSyInBdService.create(rSyInBd)
+//    } //Function create()
+//
+//    /**
+//     * 根据对象删除
+//     *
+//     * @param    rSyInBd      对象
+//     * @return                删除的结果信息
+//     */
+//    @Operation(summary = "根据对象删除系统所在建筑关系,只针对一个对象", description = "必填项:SysId(系统id)、BuildingId(建筑id)")
+//    @PostMapping(value = ["/unlink"])
+//    fun delete(@RequestBody rSyInBd: RSyInBd): SBaseResponse {
+//        return RSyInBdService.deletes(rSyInBd)
+//    } // Function delete()
+
+    /**
+     * 创建竖井所在建筑关系
+     *
+     * @param    rSyInBd     竖井和建筑的关系对象
+     * @return               创建的结果信息
+     */
+    @Operation(summary = "竖井所在建筑,系统一对多建筑", description = "必填项:shaftId(系统id)、BuildingIdList(建筑id列表),测方法会覆盖以前的记录")
+    @PostMapping(value = ["/link-bd"])
+    fun createBd(@RequestBody rShInBd: RShInBdList): SCreateResponse<RShInBd>{
+        return RShInBdService.createSh(rShInBd)
+    } // Function createBd()
+
+//    /**
+//     * 创建所在建筑的系统关系
+//     *
+//     * @param    rSyInBd      系统和建筑的关系对象
+//     * @return                创建的结果信息
+//     */
+//    @Operation(summary = "所在建筑的系统,建筑一对多系统", description = "必填项:sysIdList(系统id列表)、BuildingId(建筑id),测方法会覆盖以前的记录")
+//    @PostMapping(value = ["/link-sy"])
+//    fun createSy(@RequestBody rSyInBd: RBdInSyList): SCreateResponse<RSyInBd>{
+//        logger.debug("build = ${rSyInBd.toJson()}")
+//        return  RSyInBdService.createsBd(rSyInBd)
+//    } // Function createSy()
+//
+//    /**
+//     * 创建系统所在建筑关系
+//     *
+//     * @param    rSyInBd     系统和建筑的关系对象
+//     * @return               创建的结果信息
+//     */
+//    @Operation(summary = "系统所在建筑,系统一对多建筑,此方法不会覆盖", description = "必填项:SysId(系统id)、BuildingIdList(建筑id列表)")
+//    @PostMapping(value = ["/link-bd-sy"])
+//    fun createSyBd(@RequestBody rSyInBd: RSyInBdList): SCreateResponse<RSyInBd>{
+//        logger.debug("build = ${rSyInBd.toJson()}")
+//        return RSyInBdService.createSy(rSyInBd)
+//    } // Function createBd()
+
+}

+ 4 - 5
datacenter/src/main/kotlin/com/persagy/server/mappers/IRelationExcelExportMapper.kt

@@ -99,11 +99,10 @@ interface IRelationExcelExportMapper {
      * @param   type            关系类型
      * @return  关系记录
      */
-    @Select("SELECT r.building_id AS id, bd.name, bd.local_id, bd.local_name, '建筑' AS object_type,\n" +
-            "r.equip_id AS _id, eq.name AS _name, eq.local_id AS _local_id, eq.local_name as _local_name , '设备' AS _object_type,eq.cad_id as _cad_id , \n" +
-            "(SELECT local_name FROM public.building WHERE id = eq.building_id) AS _building_name,\n" +
-            "(SELECT local_name FROM public.floor WHERE id = eq.floor_id) AS _floor_name\n" +
-            "FROM public.r_eq_for_bd r JOIN equipment AS eq ON r.equip_id = eq.id JOIN building AS bd ON r.building_id = bd.id WHERE r.project_id = #{projectId} ")
+    @Select("SELECT r.eq_id AS id, eq.name, eq.local_id, eq.local_name, '设备' AS object_type,eq.cad_id as cad_id ," +
+            "(SELECT local_name FROM public.building WHERE id = eq.building_id) AS building_name,(SELECT local_name FROM public.floor WHERE id = eq.floor_id)" +
+            " AS floor_namer,bd_id AS _id, bd.name AS _name, bd.local_id AS _local_id, bd.local_name as _local_name , '建筑' AS _object_type" +
+            " FROM relationship.r_eq2bd r JOIN equipment AS eq ON r.eq_id = eq.id JOIN building AS bd ON r.bd_id = bd.id WHERE r.project_id = #{projectId} ")
     fun eq2bd_for(projectId: String): List<HashMap<String, Any?>>
 
     /**

+ 3 - 3
datacenter/src/main/kotlin/com/persagy/server/mappers/IRelationExcelImportMapper.kt

@@ -100,7 +100,7 @@ interface IRelationExcelImportMapper {
      * @param   id2             设备ID
      * @return  excel需要的记录
      */
-    @Insert("INSERT INTO public.r_eq_for_fl(equip_id,floor_id,project_id, sign) VALUES(#{id2}, #{id1},#{projectId}, 1)")
+    @Insert("INSERT INTO public.r_eq_for_fl(equip_id,floor_id,project_id, sign) VALUES(#{id1}, #{id2},#{projectId}, 1)")
     fun eq2fl(projectId: String, type: String, id1: String, id2: String)
 
     /**
@@ -124,8 +124,8 @@ interface IRelationExcelImportMapper {
      * @param   id2             空间ID
      * @return  excel需要的记录
      */
-    @Insert("INSERT INTO relationship.r_eq2sp(project_id, eq_id, sp_id, type, sign) VALUES(#{projectId}, #{id1}, #{id2}, #{type}, 1)")
-    fun eq2sp(projectId: String, type: String, id1: String, id2: String)
+    @Insert("INSERT INTO relationship.r_eq2sp(project_id, eq_id, sp_id, type, sign,zone_type) VALUES(#{projectId}, #{id1}, #{id2}, #{type}, 1,#{zoneType})")
+    fun eq2sp(projectId: String, type: String, id1: String, id2: String, zoneType: String)
 
     /**
      * 设备与空间关系

+ 6 - 3
datacenter/src/main/kotlin/com/persagy/server/services/graphtype/RelationTypeProjectService.kt

@@ -475,11 +475,13 @@ object RelationTypeProjectService : RService<RelationTypeProject>(SMybatisDao(Re
                 excelImport.javaClass.getDeclaredMethod("sh2flfor", String::class.java, String::class.java, String::class.java, String::class.java)
             }else if (relType == "sh2sh_ArchForArch"){
                 excelImport.javaClass.getDeclaredMethod("sh2shfor", String::class.java, String::class.java, String::class.java, String::class.java)
-            }else if(relType == "sy2sh_for"){
+            }else if(relType =="eq2fl_for"){
+                excelImport.javaClass.getDeclaredMethod("eq2fl", String::class.java, String::class.java, String::class.java, String::class.java)
+            } else if(relType == "sy2sh_for"){
                 cmd = "sy2shfor"
                 excelImport.javaClass.getDeclaredMethod(cmd, String::class.java, String::class.java, String::class.java, String::class.java)
             } else if (cmd == "sp2sp"||cmd == "bd2sp"||cmd == "fl2sp"||cmd == "sh2sp"
-                    ||cmd == "sp2bd"||cmd == "sp2fl"||cmd == "sp2sh"){
+                    ||cmd == "sp2bd"||cmd == "sp2fl"||cmd == "sp2sh"||cmd == "eq2sp"){
                 logger.debug("建筑和空间")
                  excelImport.javaClass.getDeclaredMethod(cmd, String::class.java, String::class.java, String::class.java, String::class.java, String::class.java)
             } else {
@@ -543,13 +545,14 @@ object RelationTypeProjectService : RService<RelationTypeProject>(SMybatisDao(Re
                     }
 
                     logger.debug("建筑和空间333333333333333333333333333333333333")
-                    if (cmd == "sp2sp"||cmd == "bd2sp"||cmd == "fl2sp"||cmd == "sh2sp"){
+                    if (cmd == "sp2sp"||cmd == "bd2sp"||cmd == "fl2sp"||cmd == "sh2sp"||cmd == "eq2sp"){
                         val space = spaceService.select(SFilter.eq("id", id2)).entity()
                         zoneType =  space!!.classCode
                     }else if (cmd == "sp2bd"||cmd == "sp2fl"||cmd == "sp2sh") {
                         val space = spaceService.select(SFilter.eq("id", id1)).entity()
                         zoneType =  space!!.classCode
                     }
+                    logger.debug("cmd = ${cmd}********************************************")
                     if(zoneType.isNullOrEmpty()) {
                         importMethod.invoke(excelImport, projectId, type, id1, id2)
                     } else {

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

@@ -32,6 +32,7 @@ import com.google.gson.reflect.TypeToken
 import com.persagy.base.utils.SJsonUtil
 import com.persagy.database.SFilter
 import com.persagy.database.SPageQueryInfo
+import com.persagy.database.extensions.keyValue
 import com.persagy.mybatis.SMybatisDao
 import com.persagy.server.Opt
 import com.persagy.server.datacenter.models.entities.assistant.ShaftFuncType
@@ -41,8 +42,10 @@ import com.persagy.server.datacenter.models.entities.objects.*
 import com.persagy.server.datacenter.models.entities.rel.*
 import com.persagy.server.datacenter.models.entities.task.BuildingDic
 import com.persagy.server.datacenter.models.entities.task.FloorDic
+import com.persagy.server.services.base.RService
 import com.persagy.server.services.base.Service
 import com.persagy.server.services.log.DataCenterLogsService
+import com.persagy.server.services.rel.RSpInBdService
 import com.persagy.server.synchronize.MessageHandler
 import com.persagy.server.utils.IdUtils
 import com.persagy.server.utils.ShaftNameUtil
@@ -73,6 +76,9 @@ object ShaftService : Service<Shaft>(SMybatisDao(Shaft::class.java)) {
 
     /** 竖井视图服务 */
     var vShaftService = SObjectService(SMybatisDao(VShaft::class.java))
+    /** 竖井和建筑关系 */
+    var rShInBdService = SObjectService(SMybatisDao(RShInBd::class.java))
+
     /**
      * 创建之前操作
      *
@@ -96,6 +102,50 @@ object ShaftService : Service<Shaft>(SMybatisDao(Shaft::class.java)) {
         return true
     } // Function onCreateBefore()
 
+
+    override fun onCreateSuccess(entityList: ArrayList<Shaft>) {
+        super.onCreateSuccess(entityList)
+        for (entity in entityList) {
+
+            try {
+                rabbitMqService.sendObjects(Opt.projectId!!, Opt.CREATE,entity.id!!)
+            } catch (e: Exception) {
+                e.printStackTrace()
+            }
+
+            if (!entity.buildingList.isNullOrEmpty()){
+                for (building in entity.buildingList!!) {
+                    try {
+                        val rShInBd = RShInBd()
+                        rShInBd.buildingId = building.id
+                        rShInBd.shaftId = entity.id
+                        rShInBd.projectId = entity.projectId
+                        rShInBd.type = "bd2sh"
+                        val insert = rShInBdService.insert(rShInBd)
+                        if (insert) {
+                            try {
+                                /** 发送消息 */
+                                RService.rabbitMqService.sendRel(Opt.projectId!!, "sh2bd","11",rShInBd.buildingId!!,rShInBd.shaftId!!)
+                            } catch (e: Exception) {
+                                e.printStackTrace()
+                            }
+                        }
+                    } catch (e: Exception) {
+                        e.printStackTrace()
+                    }
+                }
+            }
+            try {
+                /** 日志 */
+                DataCenterLogsService.addLogs(Opt.projectId!!,"create",entity.objectType!!,
+                    entity.id!!,entity,Opt.account,Opt.coming)
+            } catch (e: Exception) {
+                e.printStackTrace()
+            }
+
+        }
+    }
+
     /**
      * 查询竖井信息-包含统计信息
      *

+ 238 - 0
datacenter/src/main/kotlin/com/persagy/server/services/rel/RShInBdService.kt

@@ -0,0 +1,238 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.services.rel
+
+import com.persagy.base.extensions.toJson
+import com.persagy.mybatis.SMybatisDao
+import com.persagy.server.Opt
+import com.persagy.server.datacenter.models.entities.rel.*
+import com.persagy.server.services.base.RService
+import com.persagy.service.SPageContext
+import com.persagy.service.models.enums.SResponseType
+import com.persagy.service.models.responses.SBaseResponse
+import com.persagy.service.models.responses.SCreateResponse
+
+/**
+ * 系统所在建筑关系服务
+ *
+ * @author 付国宝
+ */
+object RShInBdService: RService<RShInBd>(SMybatisDao(RShInBd::class.java)) {
+
+//    /**
+//     * 创建系统所在建筑关系
+//     *
+//     * @param    rSyInBd    系统所在建筑关系对象
+//     */
+//    fun create(rSyInBd: RSyInBd): SCreateResponse<RSyInBd> {
+//        return try {
+//
+//            rSyInBd.projectId = Opt.projectId
+//            val isInsert = insert(rSyInBd)
+//            if (isInsert){
+//                /** 发送消息 */
+//                rabbitMqService.sendRel(Opt.projectId!!, "sy2bd_in","11",rSyInBd.sysId!!,rSyInBd.buildingId!!)
+//                SCreateResponse(SResponseType.success)
+//            }else{
+//                SCreateResponse(SResponseType.failure)
+//            }
+//        } catch (e: Exception){
+//            e.printStackTrace()
+//            SCreateResponse(SResponseType.failure,e.message.toString())
+//        }
+//    } // Function create()
+
+    /**
+     * 根据对象删除
+     *
+     * @param    rSyInBd    关系对象实例
+     * @return
+     */
+    fun deletes(rShInBd: RShInBd): SBaseResponse {
+        return try {
+            val isDelete = delete(rShInBd)
+            /** 删除成功 */
+            if (isDelete) {
+                /** 发送消息 */
+                rabbitMqService.sendRel(Opt.projectId!!, "sy2bd_in","12",rShInBd.shaftId!!,rShInBd.buildingId!!)
+                val sBaseResponse = SBaseResponse(SResponseType.success)
+                sBaseResponse.message = rShInBd.toJson()
+                sBaseResponse
+            } else {
+                SBaseResponse(SResponseType.failure)
+            }
+        }catch (e: Exception){
+            e.printStackTrace()
+            return SBaseResponse(SResponseType.failure, e.message!!)
+        }
+    } // Function deletes()
+
+    /**
+     * 创建系统所在建筑关系
+     *
+     * @param    rShInBdList    系统和建筑关系的对象列表
+     */
+    fun createSh(rShInBdList: RShInBdList): SCreateResponse<RShInBd>{
+        return try {
+            /** 成功集合 */
+            val successList = ArrayList<Any>()
+            /** 失败集合 */
+            val failureList = ArrayList<Any>()
+            delete("shaftId = '${rShInBdList.shaftId}'")
+            val projectId = SPageContext.getHeader("projectId")
+            if (rShInBdList.buildingIdList!=null&&rShInBdList.buildingIdList!!.size>0){
+                for (buildingId in rShInBdList.buildingIdList!!){
+                    val rShInBd = RShInBd()
+                    rShInBd.shaftId = rShInBdList.shaftId
+                    rShInBd.buildingId = buildingId
+                    rShInBd.projectId = projectId
+                    rShInBd.type = "bd2sh"
+                    val replace = replace(rShInBd)
+                    if (replace){
+                        successList.add(buildingId)
+                    }else{
+                        failureList.add(rShInBd)
+                    }
+                }
+                if (successList.size>0){
+                    try {
+                        /** 发送消息 */
+                        rabbitMqService.sendRel(Opt.projectId!!, "bd2sh","13",rShInBdList.shaftId!!,successList.toJson())
+                    } catch (e: Exception) {
+                        e.printStackTrace()
+                    }
+                    val sCreateResponse = SCreateResponse<RShInBd>(SResponseType.success)
+                    if (failureList.size>0){
+                        sCreateResponse.message ="失败对象:"+failureList.toJson()
+                    }
+                    sCreateResponse
+                }else{
+                    SCreateResponse(SResponseType.failure)
+                }
+            }else{
+
+                try {
+                    /** 发送消息 */
+                    rabbitMqService.sendRel(Opt.projectId!!, "bd2sh","15",rShInBdList.shaftId!!,successList.toJson())
+                } catch (e: Exception) {
+                    e.printStackTrace()
+                }
+                SCreateResponse(SResponseType.success)
+            }
+
+        } catch (e: Exception) {
+            e.printStackTrace()
+            SCreateResponse(SResponseType.failure,e.message.toString())
+        }
+    } // Function createSy()
+
+//    /**
+//     * 创建系统所在建筑关系
+//     *
+//     * @param    rSyInBdList    系统和建筑关系的对象列表
+//     */
+//    fun createSyBd(rSyInBdList: RSyInBdList): SCreateResponse<RSyInBd>{
+//        return try {
+//            /** 成功集合 */
+//            val successList = ArrayList<Any>()
+//            /** 失败集合 */
+//            val failureList = ArrayList<Any>()
+//            for (buildingId in rSyInBdList.buildingIdList!!){
+//                val rSyInBd = RSyInBd()
+//                rSyInBd.sysId = rSyInBdList.sysId
+//                rSyInBd.buildingId = buildingId
+//                rSyInBd.projectId = Opt.projectId
+//                val replace = replace(rSyInBd)
+//                if (replace){
+//                    successList.add(buildingId)
+//                }else{
+//                    failureList.add(rSyInBd)
+//                }
+//            }
+//            if (successList.size>0){
+//                /** 发送消息 */
+//                rabbitMqService.sendRel(Opt.projectId!!, "sy2bd_in","14",rSyInBdList.sysId!!,successList.toJson()!!)
+//                val sCreateResponse = SCreateResponse<RSyInBd>(SResponseType.success)
+//                if (failureList.size>0){
+//                    sCreateResponse.message ="失败对象:"+failureList.toJson()
+//                }
+//                sCreateResponse
+//            }else{
+//                SCreateResponse(SResponseType.failure)
+//            }
+//        } catch (e: Exception) {
+//            e.printStackTrace()
+//            SCreateResponse(SResponseType.failure,e.message.toString())
+//        }
+//    } // Function createSy()
+
+//    /**
+//     * 创建所在建筑的系统关系
+//     *
+//     * @param    rBdInSyList    系统和建筑关系的对象列表
+//     */
+//    fun createsBd(rBdInSyList: RBdInSyList): SCreateResponse<RSyInBd>{
+//        return try {
+//            /** 成功集合 */
+//            val successList = ArrayList<Any>()
+//            /** 失败集合 */
+//            val failureList = ArrayList<Any>()
+//            delete("buildingId = '${rBdInSyList.buildingId}'")
+//            val projectId = SPageContext.getHeader("projectId")
+//            for (sysId in rBdInSyList.sysIdList!!){
+//                val rSyInBd = RSyInBd()
+//                rSyInBd.buildingId = rBdInSyList.buildingId
+//                rSyInBd.sysId = sysId
+//                rSyInBd.projectId = projectId
+//                val replace = replace(rSyInBd)
+//                if (replace){
+//                    successList.add(sysId)
+//                }else{
+//                    failureList.add(rSyInBd)
+//                }
+//            }
+//            if (successList.size>0){
+//                /** 发送消息 */
+//                rabbitMqService.sendRel(Opt.projectId!!, "sy2bd_in","13",rBdInSyList.buildingId!!,successList.toJson()!!)
+//                if (failureList.size>0){
+//                    val sCreateResponse = SCreateResponse<RSyInBd>(SResponseType.success)
+//                    sCreateResponse.message ="失败对象:"+failureList.toJson()
+//                    sCreateResponse
+//                }else{
+//                    val sCreateResponse = SCreateResponse<RSyInBd>(SResponseType.success)
+//                    sCreateResponse
+//                }
+//            }else{
+//                SCreateResponse(SResponseType.failure)
+//            }
+//        } catch (e:Exception){
+//            e.printStackTrace()
+//            SCreateResponse(SResponseType.failure,e.message.toString())
+//        }
+//    } // Function createsBd()
+
+} // Object RSyInBdService

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

@@ -459,7 +459,7 @@ open class RelationCalcService {
                     } catch (e: Exception) {
                         e.printStackTrace()
                     }
-                    val entity = RUpDateEquipAndSapceService.relationTypeProjectservice.select(SFilter.eq("projectId", projectId), SFilter.eq("relationType", "Fl2Fl")).entity()
+                    val entity = RUpDateEquipAndSapceService.relationTypeProjectservice.select(SFilter.eq("projectId", projectId), SFilter.eq("relationType", "fl2fl")).entity()
                     if (entity != null) {
                         entity.computationalState = 1
                         entity.computingTime = IdUtils.time()
@@ -713,8 +713,9 @@ open class RelationCalcService {
                 upDate(projectId, "sh2bd")
                 return SBaseResponse(SResponseType.success)
             } else {
-                upDateBiaoji(projectId, "sh2bd", 1)
+//                upDateBiaoji(projectId, "sh2bd", 1)
             }
+            upDate(projectId,"sh2bd")
             return SBaseResponse(SResponseType.success)
         } catch (e: Exception) {
             e.printStackTrace()

+ 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!@#

+ 15 - 6
datacenter/src/main/resources/application-test.yml

@@ -28,18 +28,27 @@ server:
 
 spring:
   datasource:
-    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
-#    url:                                jdbc:postgresql://datacenter:5432/datacenter
+#    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
+    url:                                jdbc:postgresql://datacenter:5432/datacenter
     username:                           postgres
     password:                           cGVyc2FneV8yMDIwcXdlIUAj
 
+#  rabbitmq:
+#    host: 192.168.100.108
+#    port: 9936
+#    username: pbsage
+#    password: pbsage123
+#    #虚拟host 可以不设置,使用server默认host
+#    virtual-host: /adm
+
   rabbitmq:
-    host: 192.168.100.108
+    host: 192.168.64.15
     port: 9936
-    username: pbsage
-    password: pbsage123
+    username: admin
+    password: brzj123456
     #虚拟host 可以不设置,使用server默认host
-    virtual-host: /adm
+    virtual-host: /test
+
 
   servlet:
     multipart:

+ 171 - 0
datasyn/src/main/kotlin/com/persagy/server/syn/Configure.kt

@@ -422,6 +422,177 @@ object Configure {
     }
 
 
+    /**
+     * 设备和设备的关系
+     */
+//    fun relContrastEqSyn(code: String): String{
+//
+//        if (code == "eq2eq_LUDistribution_1") {
+//            /** 低压配电普通连接 */
+//            return  "LUDistribution,Normal"
+//        }else if (code == "eq2eq_LUDistribution_2") {
+//            /** 低压配电互备连接 */
+//            return  "LUDistribution,Backup"
+//        }else if (code == "eq2eq_HUDistribution_1") {
+//            /** 高压变配电普通连接 */
+//            return  "HUDistribution,Normal"
+//        }else if (code == "eq2eq_HUDistribution_2") {
+//            /** 高压变配电互备连接 */
+//            return  "HUDistribution,Backup"
+//        }
+//         if (graphCode == "HUDistribution"&&type == "Backup") {
+//            /** 高压变配电互备连接 */
+//            return "eq2eq_HUDistribution_2"
+//        } else if (graphCode == "ChillWaterLoop"&&type == "Supply") {
+//            /** 空调冷冻水供水 */
+//            return "eq2eq_ChillWaterLoop_1"
+//        } else if (graphCode == "ChillWaterLoop"&&type == "Return") {
+//            /** 空调冷冻水回水 */
+//            return "eq2eq_ChillWaterLoop_2"
+//        } else if (graphCode == "ChillWaterLoop"&&type == "Bypass") {
+//            /** 空调冷冻水旁通 */
+//            return "eq2eq_ChillWaterLoop_3"
+//        } else if (graphCode == "ChillWaterLoop"&&type == "Fill") {
+//            /** 空调冷冻水补水 */
+//            return "eq2eq_ChillWaterLoop_4"
+//        } else if (graphCode == "CoolingWaterLoop"&&type == "Supply") {
+//            /** 空调冷却水供水 */
+//            return "eq2eq_CoolingWaterLoop_1"
+//        } else if (graphCode == "CoolingWaterLoop"&&type == "Return") {
+//            /** 空调冷却水回水 */
+//            return "eq2eq_CoolingWaterLoop_2"
+//        } else if (graphCode == "CoolingWaterLoop"&&type == "Bypass") {
+//            /** 空调冷却水旁通 */
+//            return "eq2eq_CoolingWaterLoop_3"
+//        } else if (graphCode == "CoolingWaterLoop"&&type == "Fill") {
+//            /** 空调冷冻水补水 */
+//            return "eq2eq_ChillWaterLoop_4"
+//        } else if (graphCode == "HeatWaterLoop"&&type == "Supply") {
+//            /** 采暖水供水 */
+//            return "eq2eq_HeatWaterLoop_1"
+//        } else if (graphCode == "HeatWaterLoop"&&type == "Return") {
+//            /** 采暖水回水 */
+//            return "eq2eq_HeatWaterLoop_2"
+//        } else if (graphCode == "HeatWaterLoop"&&type == "Bypass") {
+//            /** 采暖水旁通 */
+//            return "eq2eq_HeatWaterLoop_3"
+//        } else if (graphCode == "HeatWaterLoop"&&type == "Fill") {
+//            /** 采暖水补水 */
+//            return "eq2eq_HeatWaterLoop_4"
+//        } else if (graphCode == "CondWaterNetwork"&&type == "Discharge") {
+//            /** 空调冷凝水排水 */
+//            return "eq2eq_CondWaterNetwork_1"
+//        } else if (graphCode == "ACAirNetwork"&&type == "Supply") {
+//            /** 空调送风 */
+//            return "eq2eq_ACAirNetwork_1"
+//        } else if (graphCode == "ACAirNetwork"&&type == "Return") {
+//            /** 空调回风 */
+//            return "eq2eq_ACAirNetwork_2"
+//        } else if (graphCode == "ACAirNetwork"&&type == "Discharge") {
+//            /** 空调排风 */
+//            return "eq2eq_ACAirNetwork_3"
+//        } else if (graphCode == "FreshAirNetwork"&&type == "Fresh") {
+//            /** 新风送风 */
+//            return "eq2eqFreshAirNetwork_1"
+//        } else if (graphCode == "VentNetwork"&&type == "Supply") {
+//            /** 通风送风 */
+//            return "eq2eq_VentNetwork_1"
+//        } else if (graphCode == "VentNetwork"&&type == "Discharge") {
+//            /** 通风排风 */
+//            return "eq2eq_VentNetwork_2"
+//        } else if (graphCode == "VentNetwork"&&type == "Uncertain") {
+//            /** 通风不确定 */
+//            return "eq2eq_VentNetwork_3"
+//        } else if (graphCode == "VRFNetwork"&&type == "SupplyReturn") {
+//            /** 多联机供回制冷剂 */
+//            return "eq2eq_VRFNetwork_1"
+//        } else if (graphCode == "DomesticWaterNetwork"&&type == "Supply") {
+//            /** 生活给水供水 */
+//            return "eq2eq_SupplyWaterNetwork_1"
+//        } else if (graphCode == "DomesticWaterNetwork"&&type == "Bypass") {
+//            /** 生活给水旁通 */
+//            return "eq2eq_SupplyWaterNetwork_2"
+//        } else if (graphCode == "DrainingWaterNetwork"&&type == "Discharge") {
+//            /** 污水排水 */
+//            return "eq2eq_DrainingWaterNetwork_1"
+//        } else if (graphCode == "DrainingWaterNetwork"&&type == "Bypass") {
+//            /** 污水旁通 */
+//            return "eq2eq_DrainingWaterNetwork_2"
+//        } else if (graphCode == "RecycleWaterNetwork"&&type == "Supply") {
+//            /** 中水供水 */
+//            return "eq2eq_RecycleWaterNetwork_1"
+//        } else if (graphCode == "RecycleWaterNetwork"&&type == "Bypass") {
+//            /** 中水旁通 */
+//            return "eq2eq_RecycleWaterNetwork_2"
+//        } else if (graphCode == "DrinkingWaterNetwork"&&type == "Supply") {
+//            /** 直饮水供水 */
+//            return "eq2eq_DrinkingWaterNetwork_1"
+//        } else if (graphCode == "DrinkingWaterNetwork"&&type == "Bypass") {
+//            /** 直饮水旁通 */
+//            return "eq2eq_DrinkingWaterNetwork_2"
+//        } else if (graphCode == "DHWNetwork"&&type == "Supply") {
+//            /** 生活热水供水 */
+//            return "eq2eq_DHWNetwork_1"
+//        } else if (graphCode == "DHWNetwork"&&type == "Bypass") {
+//            /** 生活热水旁通 */
+//            return "eq2eq_DHWNetwork_2"
+//        } else if (graphCode == "GasNetwork"&&type == "Supply") {
+//            /** 燃气供气 */
+//            return "eq2eq_GasNetwork_1"
+//        } else if (graphCode == "GasNetwork"&&type == "Bypass") {
+//            /** 燃气旁通 */
+//            return "eq2eq_GasNetwork_2"
+//        } else if (graphCode == "FireWaterNetwork"&&type == "Supply") {
+//            /** 消防给水供水 */
+//            return "eq2eq_FireWaterNetwork_1"
+//        } else if (graphCode == "FireWaterNetwork"&&type == "Bypass") {
+//            /** 消防给水旁通 */
+//            return "eq2eq_FireWaterNetwork_2"
+//        } else if (graphCode == "FireVentNetwork"&&type == "Discharge") {
+//            /** 消防排烟 */
+//            return "eq2eq_FireVentNetwork_1"
+//        } else if (graphCode == "WENetwork"&&type == "Normal") {
+//            /** 通信连接 */
+//            return "eq2eq_SensorNetwork_1"
+//        } else if (graphCode == "MechCtrl"&&type == "SyCtrl") {
+//            /** 系统控制关系 */
+//            return "eq2eq_ControlRelation_1"
+//        } else if (graphCode == "MechCtrl"&&type == "EqCtrl") {
+//            /** 设备控制关系 */
+//            return "eq2eq_ControlRelation_1"
+//        } else if (graphCode == "MechPower"&&type == "SyNormal") {
+//            /** 系统常规电源 */
+//            return "eq2eq_EquipPower_3"
+//        } else if (graphCode == "MechPower"&&type == "SyBackup") {
+//            /** 系统备用电源 */
+//            return "eq2eq_EquipPower_4"
+//        } else if (graphCode == "MechPower"&&type == "EqNormal") {
+//            /** 设备常规电源 */
+//            return "eq2eq_EquipPower_1"
+//        } else if (graphCode == "MechPower"&&type == "EqBackup") {
+//            /** 设备备用电源 */
+//            return "eq2eq_EquipPower_2"
+//        } else if (graphCode == "SensorRelationship"&&type == "Ss2Eq") {
+//            /** 传感器测量设备关系 */
+//            return "eq2eq_SensorRelationship_ss2eq"
+//        } else if (graphCode == "SensorRelationship"&&type == "Ss2Sy") {
+//            /** 传感器测量系统关系 */
+//            return "eq2sy_SensorRelationship_ss2sy"
+//        } else if (graphCode == "SensorRelationship"&&type == "Ss2Sp") {
+//            /** 传感器测量空间关系 */
+//            return "eq2sp_SensorRelationship_ss2sp"
+//        } else if (graphCode == "ValveRelationship"&&type == "Vv2Eq") {
+//            /** 阀门限制设备关系 */
+//            return "eq2eq_ValveRelationship_vv2eq"
+//        } else if (graphCode == "ValveRelationship"&&type == "Vv2Sy") {
+//            /** 阀门限制系统关系 */
+//            return "eq2sy_ValveRelationship_vv2sy"
+//        } else {
+//            return ""
+//        }
+//    }
+
+
 
 
 

+ 193 - 0
datasyn/src/main/kotlin/com/persagy/server/syn/jms/DataCenterSync.kt

@@ -1397,6 +1397,199 @@ class DataCenterSync {
                         }
                     }
                 }
+                "sh2sp_ArchForArch" -> {
+                    /** 竖井服务于空间 */
+                    when(message.ops) {
+                        "11" -> { // 创建关系
+                            equipInSpaceSync.equipInSpaceCreate(message, "ArchForArch", "Sh2Sp", null)
+                        }
+                        "12" -> { // 删除关系
+                            equipInSpaceSync.delRel(message, "ArchForArch", "Sh2Sp")
+                        }
+                        "20" -> {
+                            /** 关系计算-整体同步 */
+                            automaticCalculationSync.sh2SpFor(message)
+                        }
+                    }
+                }
+                "sh2sh_ArchForArch" -> {
+                    /** 竖井服务于竖井 */
+                    when(message.ops) {
+                        "11" -> { // 创建关系
+                            equipInSpaceSync.equipInSpaceCreate(message, "ArchForArch", "Sh2Sh", null)
+                        }
+                        "12" -> { // 删除关系
+                            equipInSpaceSync.delRel(message, "ArchForArch", "Sh2Sh")
+                        }
+                        "20" -> {
+                            /** 关系计算-整体同步 */
+                            automaticCalculationSync.sh2ShFor(message)
+                        }
+                    }
+                }
+                "sh2fl_ArchForArch" -> {
+                    /** 竖井服务于楼层 */
+                    when(message.ops) {
+                        "11" -> { // 创建关系
+                            equipInSpaceSync.equipInSpaceCreate(message, "ArchForArch", "Sh2Fl", null)
+                        }
+                        "12" -> { // 删除关系
+                            equipInSpaceSync.delRel(message, "ArchForArch", "Sh2Fl")
+                        }
+                        "20" -> {
+                            /** 关系计算-整体同步 */
+                            automaticCalculationSync.sh2FlFor(message)
+                        }
+                    }
+                }
+                "sh2bd_ArchForArch" -> {
+                    /** 竖井服务于楼层 */
+                    when(message.ops) {
+                        "11" -> { // 创建关系
+                            equipInSpaceSync.equipInSpaceCreate(message, "ArchForArch", "Sh2Bd", null)
+                        }
+                        "12" -> { // 删除关系
+                            equipInSpaceSync.delRel(message, "ArchForArch", "Sh2Bd")
+                        }
+                        "20" -> {
+                            /** 关系计算-整体同步 */
+                            automaticCalculationSync.sh2BdFor(message)
+                        }
+                    }
+                }
+                "fl2bd_ArchForArch" -> {
+                    /** 楼层服务于建筑 */
+                    when(message.ops) {
+                        "11" -> { // 创建关系
+                            equipInSpaceSync.equipInSpaceCreate(message, "ArchForArch", "Fl2Bd", null)
+                        }
+                        "12" -> { // 删除关系
+                            equipInSpaceSync.delRel(message, "ArchForArch", "Fl2Bd")
+                        }
+                        "20" -> {
+                            /** 关系计算-整体同步 */
+                            automaticCalculationSync.fl2BdFor(message)
+                        }
+                    }
+                }
+                "fl2fl_ArchForArch" -> {
+                    /** 楼层服务于楼层 */
+                    when(message.ops) {
+                        "11" -> { // 创建关系
+                            equipInSpaceSync.equipInSpaceCreate(message, "ArchForArch", "Fl2Fl", null)
+                        }
+                        "12" -> { // 删除关系
+                            equipInSpaceSync.delRel(message, "ArchForArch", "Fl2Fl")
+                        }
+                        "20" -> {
+                            /** 关系计算-整体同步 */
+                            automaticCalculationSync.fl2FlFor(message)
+                        }
+                    }
+                }
+                "fl2sh_ArchForArch" -> {
+                    /** 楼层服务于楼层 */
+                    when(message.ops) {
+                        "11" -> { // 创建关系
+                            equipInSpaceSync.equipInSpaceCreate(message, "ArchForArch", "Fl2Sh", null)
+                        }
+                        "12" -> { // 删除关系
+                            equipInSpaceSync.delRel(message, "ArchForArch", "Fl2Sh")
+                        }
+                        "20" -> {
+                            /** 关系计算-整体同步 */
+                            automaticCalculationSync.fl2ShFor(message)
+                        }
+                    }
+                }
+
+                "fl2sp_ArchForArch" -> {
+                    /** 楼层服务于空间 */
+                    when(message.ops) {
+                        "11" -> { // 创建关系
+                            equipInSpaceSync.equipInSpaceCreate(message, "ArchForArch", "Fl2Sp", null)
+                        }
+                        "12" -> { // 删除关系
+                            equipInSpaceSync.delRel(message, "ArchForArch", "Fl2Sp")
+                        }
+                        "20" -> {
+                            /** 关系计算-整体同步 */
+                            automaticCalculationSync.fl2SpFor(message)
+                        }
+                    }
+                }
+
+                "bd2sp_ArchForArch" -> {
+                    /** 建筑服务于空间 */
+                    when(message.ops) {
+                        "11" -> { // 创建关系
+                            equipInSpaceSync.equipInSpaceCreate(message, "ArchForArch", "Bd2Sp", null)
+                        }
+                        "12" -> { // 删除关系
+                            equipInSpaceSync.delRel(message, "ArchForArch", "Bd2Sp")
+                        }
+                        "20" -> {
+                            /** 关系计算-整体同步 */
+                            automaticCalculationSync.bd2SpFor(message)
+                        }
+                    }
+                }
+                "bd2sh_ArchForArch" -> {
+                    /** 建筑服务于竖井 */
+                    when(message.ops) {
+                        "11" -> { // 创建关系
+                            equipInSpaceSync.equipInSpaceCreate(message, "ArchForArch", "Bd2Sh", null)
+                        }
+                        "12" -> { // 删除关系
+                            equipInSpaceSync.delRel(message, "ArchForArch", "Bd2Sh")
+                        }
+                        "20" -> {
+                            /** 关系计算-整体同步 */
+                            automaticCalculationSync.bd2ShFor(message)
+                        }
+                    }
+                }
+                "bd2fl_ArchForArch" -> {
+                    /** 建筑服务于楼层 */
+                    when(message.ops) {
+                        "11" -> { // 创建关系
+                            equipInSpaceSync.equipInSpaceCreate(message, "ArchForArch", "Bd2Fl", null)
+                        }
+                        "12" -> { // 删除关系
+                            equipInSpaceSync.delRel(message, "ArchForArch", "Bd2Fl")
+                        }
+                        "20" -> {
+                            /** 关系计算-整体同步 */
+                            automaticCalculationSync.bd2FlFor(message)
+                        }
+                    }
+                }
+                "bd2bd_ArchForArch" -> {
+                    /** 建筑服务于楼层 */
+                    when(message.ops) {
+                        "11" -> { // 创建关系
+                            equipInSpaceSync.equipInSpaceCreate(message, "ArchForArch", "Bd2Bd", null)
+                        }
+                        "12" -> { // 删除关系
+                            equipInSpaceSync.delRel(message, "ArchForArch", "Bd2Bd")
+                        }
+                        "20" -> {
+                            /** 关系计算-整体同步 */
+                            automaticCalculationSync.bd2BdFor(message)
+                        }
+                    }
+                }
+
+                else ->{
+                    if (message.type == "eq2eq_SupplyWaterNetwork_1"||message.type == "eq2eq_SupplyWaterNetwork_2"||message.type == "eq2eq_DrainingWaterNetwork_1"||message.type == "eq2eq_DrainingWaterNetwork_2"
+                        ||message.type == "eq2eq_DrinkingWaterNetwork_1"||message.type == "eq2eq_DrinkingWaterNetwork_2"||message.type == "eq2eq_DHWNetwork_1"||message.type == "eq2eq_DHWNetwork_2"
+                        ||message.type == "eq2eq_GasNetwork_1"||message.type == "eq2eq_GasNetwork_2"||message.type == "eq2eq_FireWaterNetwork_1"||message.type == "eq2eq_FireWaterNetwork_2"
+                        ||message.type == "eq2eq_FireVentNetwork_1"||message.type == "eq2eq_RecycleWaterNetwork_1" ||message.type == "eq2eq_RecycleWaterNetwork_2"){
+
+
+
+                    }
+                }
             }
         }
     }

+ 444 - 9
datasyn/src/main/kotlin/com/persagy/server/syn/services/jms/rel/AutomaticCalculationSync.kt

@@ -30,9 +30,9 @@ import com.persagy.database.SFilter
 import com.persagy.mybatis.SMybatisDao
 import com.persagy.server.datacenter.models.entities.dictnew.DictProject
 import com.persagy.server.datacenter.models.entities.rel.*
-import com.persagy.server.datacenter.models.entities.rel.archforarch.RSp2Bd
-import com.persagy.server.datacenter.models.entities.rel.archforarch.RSp2Fl
-import com.persagy.server.datacenter.models.entities.rel.archforarch.RSp2Sh
+import com.persagy.server.datacenter.models.entities.rel.archforarch.*
+import com.persagy.server.datacenter.models.entities.rel.archforarch.RSh2Bd
+import com.persagy.server.datacenter.models.entities.rel.archforarch.RSh2Sp
 import com.persagy.server.datacenter.models.jms.SynchronousMessageRel
 import com.persagy.server.syn.Configure
 import com.persagy.server.syn.models.api.obj.EquipApi
@@ -74,12 +74,39 @@ class AutomaticCalculationSync {
     val rEq2EqService = SObjectService(SMybatisDao(REq2Eq::class.java))
     /** 设备服务于竖井 */
     val rEqForShService = SObjectService(SMybatisDao(REqForSh::class.java))
-    /** 空间和竖井 */
-    private val rSp2ShService = SObjectService(SMybatisDao(RSp2Sh::class.java))
-    /** 空间和楼层 */
-    private val rSp2FlService = SObjectService(SMybatisDao(RSp2Fl::class.java))
+
+    /** 区域服务-建筑和建筑 */
+    private val rBd2BdService = SObjectService(SMybatisDao(RBd2Bd::class.java))
+    /** 建筑和楼层 */
+    private val rBd2FlService = SObjectService(SMybatisDao(RBd2Fl::class.java))
+    /** 建筑和竖井 */
+    private val rBd2ShService = SObjectService(SMybatisDao(RBd2Sh::class.java))
+    /** 建筑和空间 */
+    private val rBd2SpService = SObjectService(SMybatisDao(RBd2Sp::class.java))
+    /** 区域服务-楼层和建筑 */
+    private val rFl2BdService = SObjectService(SMybatisDao(RFl2Bd::class.java))
+    /** 楼层和楼层 */
+    private val rFl2FlService = SObjectService(SMybatisDao(RFl2Fl::class.java))
+    /** 楼层和竖井 */
+    private val rFl2ShService = SObjectService(SMybatisDao(RFl2Sh::class.java))
+    /** 楼层和空间 */
+    private val rFl2SpService = SObjectService(SMybatisDao(RFl2Sp::class.java))
+    /** 区域服务-竖井和建筑 */
+    private val rSh2BdService = SObjectService(SMybatisDao(RSh2Bd::class.java))
+    /** 竖井和楼层 */
+    private val rSh2FlService = SObjectService(SMybatisDao(RSh2Fl::class.java))
+    /** 竖井和竖井 */
+    private val rSh2ShService = SObjectService(SMybatisDao(RSh2Sh::class.java))
+    /** 竖井和空间 */
+    private val rSh2SpService = SObjectService(SMybatisDao(RSh2Sp::class.java))
+
     /** 区域服务-空间和建筑 */
     private val rSp2BdService = SObjectService(SMybatisDao(RSp2Bd::class.java))
+    /** 空间和楼层 */
+    private val rSp2FlService = SObjectService(SMybatisDao(RSp2Fl::class.java))
+    /** 空间和竖井 */
+    private val rSp2ShService = SObjectService(SMybatisDao(RSp2Sh::class.java))
+
 
 
 
@@ -856,13 +883,13 @@ class AutomaticCalculationSync {
     fun sp2BdFor(message: SynchronousMessageRel) {
         val dictProject = dictProjectService.select(SFilter.eq("id", message.projectId!!)).entity()
         if (dictProject!=null) {
-            val rEq2SpList = rSp2BdService.select(SFilter.eq("projectId", message.projectId!!),SFilter.eq("type", "sp2bd_ArchForArch")).exec()
+            val rEq2SpList = rSh2SpService.select(SFilter.eq("projectId", message.projectId!!),SFilter.eq("type", "sp2bd_ArchForArch")).exec()
             message.sign = 0
             if (rEq2SpList.size>0) {
                 for (rEq2Sp in rEq2SpList) {
                     try {
                         /** 先执行删除 */
-                        val toJsonObj = Configure.toJsonObj("ArchForArch", "Sp2Bd", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val toJsonObj = Configure.toJsonObj("ArchForArch", "Sp2bd", rEq2Sp.id1!!, rEq2Sp.id1!!)
                         val delRel = EquipApi.delRel(dictProject.groupCode!!, message.projectId!!, toJsonObj)
                         /** 关系列表 */
                         val toJsonObjArray =
@@ -884,4 +911,412 @@ class AutomaticCalculationSync {
         }
     }
 
+    /**
+     * 竖井服务于空间
+     */
+    fun sh2SpFor(message: SynchronousMessageRel) {
+        val dictProject = dictProjectService.select(SFilter.eq("id", message.projectId!!)).entity()
+        if (dictProject!=null) {
+            val rEq2SpList = rSh2SpService.select(SFilter.eq("projectId", message.projectId!!),SFilter.eq("type", "sh2sp_ArchForArch")).exec()
+            message.sign = 0
+            if (rEq2SpList.size>0) {
+                for (rEq2Sp in rEq2SpList) {
+                    try {
+                        /** 先执行删除 */
+                        val toJsonObj = Configure.toJsonObj("ArchForArch", "Sh2Sp", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val delRel = EquipApi.delRel(dictProject.groupCode!!, message.projectId!!, toJsonObj)
+                        /** 关系列表 */
+                        val toJsonObjArray =
+                            Configure.toJsonObjArray("ArchForArch", "Sh2Sp", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val createRel = EquipApi.createRel(dictProject.groupCode!!, message.projectId!!, toJsonObjArray)
+                        if (!createRel){
+                            message.sign = 2
+                            message.count = message.count +1
+                        }
+                    } catch (e: Exception) {
+                        e.printStackTrace()
+                        message.sign = 2
+                        message.count = message.count +1
+                    }
+                }
+            }
+            /** 更改标记 */
+            synchronousMessageRelService.update(message)
+        }
+    }
+
+    /**
+     * 竖井服务于竖井
+     */
+    fun sh2ShFor(message: SynchronousMessageRel) {
+        val dictProject = dictProjectService.select(SFilter.eq("id", message.projectId!!)).entity()
+        if (dictProject!=null) {
+            val rEq2SpList = rSh2ShService.select(SFilter.eq("projectId", message.projectId!!),SFilter.eq("type", "sh2sh_ArchForArch")).exec()
+            message.sign = 0
+            if (rEq2SpList.size>0) {
+                for (rEq2Sp in rEq2SpList) {
+                    try {
+                        /** 先执行删除 */
+                        val toJsonObj = Configure.toJsonObj("ArchForArch", "Sh2Sh", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val delRel = EquipApi.delRel(dictProject.groupCode!!, message.projectId!!, toJsonObj)
+                        /** 关系列表 */
+                        val toJsonObjArray =
+                            Configure.toJsonObjArray("ArchForArch", "Sh2Sh", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val createRel = EquipApi.createRel(dictProject.groupCode!!, message.projectId!!, toJsonObjArray)
+                        if (!createRel){
+                            message.sign = 2
+                            message.count = message.count +1
+                        }
+                    } catch (e: Exception) {
+                        e.printStackTrace()
+                        message.sign = 2
+                        message.count = message.count +1
+                    }
+                }
+            }
+            /** 更改标记 */
+            synchronousMessageRelService.update(message)
+        }
+    }
+
+    /**
+     * 竖井服务于楼层
+     */
+    fun sh2FlFor(message: SynchronousMessageRel) {
+        val dictProject = dictProjectService.select(SFilter.eq("id", message.projectId!!)).entity()
+        if (dictProject!=null) {
+            val rEq2SpList = rSh2FlService.select(SFilter.eq("projectId", message.projectId!!),SFilter.eq("type", "sh2fl_ArchForArch")).exec()
+            message.sign = 0
+            if (rEq2SpList.size>0) {
+                for (rEq2Sp in rEq2SpList) {
+                    try {
+                        /** 先执行删除 */
+                        val toJsonObj = Configure.toJsonObj("ArchForArch", "Sh2Fl", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val delRel = EquipApi.delRel(dictProject.groupCode!!, message.projectId!!, toJsonObj)
+                        /** 关系列表 */
+                        val toJsonObjArray =
+                            Configure.toJsonObjArray("ArchForArch", "Sh2Fl", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val createRel = EquipApi.createRel(dictProject.groupCode!!, message.projectId!!, toJsonObjArray)
+                        if (!createRel){
+                            message.sign = 2
+                            message.count = message.count +1
+                        }
+                    } catch (e: Exception) {
+                        e.printStackTrace()
+                        message.sign = 2
+                        message.count = message.count +1
+                    }
+                }
+            }
+            /** 更改标记 */
+            synchronousMessageRelService.update(message)
+        }
+    }
+
+    /**
+     * 竖井服务于建筑
+     */
+    fun sh2BdFor(message: SynchronousMessageRel) {
+        val dictProject = dictProjectService.select(SFilter.eq("id", message.projectId!!)).entity()
+        if (dictProject!=null) {
+            val rEq2SpList = rSh2BdService.select(SFilter.eq("projectId", message.projectId!!),SFilter.eq("type", "sh2bd_ArchForArch")).exec()
+            message.sign = 0
+            if (rEq2SpList.size>0) {
+                for (rEq2Sp in rEq2SpList) {
+                    try {
+                        /** 先执行删除 */
+                        val toJsonObj = Configure.toJsonObj("ArchForArch", "Sh2Bd", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val delRel = EquipApi.delRel(dictProject.groupCode!!, message.projectId!!, toJsonObj)
+                        /** 关系列表 */
+                        val toJsonObjArray =
+                            Configure.toJsonObjArray("ArchForArch", "Sh2Bd", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val createRel = EquipApi.createRel(dictProject.groupCode!!, message.projectId!!, toJsonObjArray)
+                        if (!createRel){
+                            message.sign = 2
+                            message.count = message.count +1
+                        }
+                    } catch (e: Exception) {
+                        e.printStackTrace()
+                        message.sign = 2
+                        message.count = message.count +1
+                    }
+                }
+            }
+            /** 更改标记 */
+            synchronousMessageRelService.update(message)
+        }
+    }
+
+    /**
+     * 楼层服务于建筑
+     */
+    fun fl2BdFor(message: SynchronousMessageRel) {
+        val dictProject = dictProjectService.select(SFilter.eq("id", message.projectId!!)).entity()
+        if (dictProject!=null) {
+            val rEq2SpList = rFl2BdService.select(SFilter.eq("projectId", message.projectId!!),SFilter.eq("type", "fl2bd_ArchForArch")).exec()
+            message.sign = 0
+            if (rEq2SpList.size>0) {
+                for (rEq2Sp in rEq2SpList) {
+                    try {
+                        /** 先执行删除 */
+                        val toJsonObj = Configure.toJsonObj("ArchForArch", "Fl2Bd", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val delRel = EquipApi.delRel(dictProject.groupCode!!, message.projectId!!, toJsonObj)
+                        /** 关系列表 */
+                        val toJsonObjArray =
+                            Configure.toJsonObjArray("ArchForArch", "Fl2Bd", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val createRel = EquipApi.createRel(dictProject.groupCode!!, message.projectId!!, toJsonObjArray)
+                        if (!createRel){
+                            message.sign = 2
+                            message.count = message.count +1
+                        }
+                    } catch (e: Exception) {
+                        e.printStackTrace()
+                        message.sign = 2
+                        message.count = message.count +1
+                    }
+                }
+            }
+            /** 更改标记 */
+            synchronousMessageRelService.update(message)
+        }
+    }
+
+    /**
+     * 楼层服务于楼层
+     */
+    fun fl2FlFor(message: SynchronousMessageRel) {
+        val dictProject = dictProjectService.select(SFilter.eq("id", message.projectId!!)).entity()
+        if (dictProject!=null) {
+            val rEq2SpList = rFl2FlService.select(SFilter.eq("projectId", message.projectId!!),SFilter.eq("type", "fl2fl_ArchForArch")).exec()
+            message.sign = 0
+            if (rEq2SpList.size>0) {
+                for (rEq2Sp in rEq2SpList) {
+                    try {
+                        /** 先执行删除 */
+                        val toJsonObj = Configure.toJsonObj("ArchForArch", "Fl2Fl", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val delRel = EquipApi.delRel(dictProject.groupCode!!, message.projectId!!, toJsonObj)
+                        /** 关系列表 */
+                        val toJsonObjArray =
+                            Configure.toJsonObjArray("ArchForArch", "Fl2Fl", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val createRel = EquipApi.createRel(dictProject.groupCode!!, message.projectId!!, toJsonObjArray)
+                        if (!createRel){
+                            message.sign = 2
+                            message.count = message.count +1
+                        }
+                    } catch (e: Exception) {
+                        e.printStackTrace()
+                        message.sign = 2
+                        message.count = message.count +1
+                    }
+                }
+            }
+            /** 更改标记 */
+            synchronousMessageRelService.update(message)
+        }
+    }
+
+    /**
+     * 楼层服务于竖井
+     */
+    fun fl2ShFor(message: SynchronousMessageRel) {
+        val dictProject = dictProjectService.select(SFilter.eq("id", message.projectId!!)).entity()
+        if (dictProject!=null) {
+            val rEq2SpList = rFl2ShService.select(SFilter.eq("projectId", message.projectId!!),SFilter.eq("type", "fl2sh_ArchForArch")).exec()
+            message.sign = 0
+            if (rEq2SpList.size>0) {
+                for (rEq2Sp in rEq2SpList) {
+                    try {
+                        /** 先执行删除 */
+                        val toJsonObj = Configure.toJsonObj("ArchForArch", "Fl2Sh", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val delRel = EquipApi.delRel(dictProject.groupCode!!, message.projectId!!, toJsonObj)
+                        /** 关系列表 */
+                        val toJsonObjArray =
+                            Configure.toJsonObjArray("ArchForArch", "Fl2Sh", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val createRel = EquipApi.createRel(dictProject.groupCode!!, message.projectId!!, toJsonObjArray)
+                        if (!createRel){
+                            message.sign = 2
+                            message.count = message.count +1
+                        }
+                    } catch (e: Exception) {
+                        e.printStackTrace()
+                        message.sign = 2
+                        message.count = message.count +1
+                    }
+                }
+            }
+            /** 更改标记 */
+            synchronousMessageRelService.update(message)
+        }
+    }
+
+    /**
+     * 楼层服务于空间
+     */
+    fun fl2SpFor(message: SynchronousMessageRel) {
+        val dictProject = dictProjectService.select(SFilter.eq("id", message.projectId!!)).entity()
+        if (dictProject!=null) {
+            val rEq2SpList = rFl2SpService.select(SFilter.eq("projectId", message.projectId!!),SFilter.eq("type", "fl2sp_ArchForArch")).exec()
+            message.sign = 0
+            if (rEq2SpList.size>0) {
+                for (rEq2Sp in rEq2SpList) {
+                    try {
+                        /** 先执行删除 */
+                        val toJsonObj = Configure.toJsonObj("ArchForArch", "Fl2Sp", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val delRel = EquipApi.delRel(dictProject.groupCode!!, message.projectId!!, toJsonObj)
+                        /** 关系列表 */
+                        val toJsonObjArray =
+                            Configure.toJsonObjArray("ArchForArch", "Fl2Sp", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val createRel = EquipApi.createRel(dictProject.groupCode!!, message.projectId!!, toJsonObjArray)
+                        if (!createRel){
+                            message.sign = 2
+                            message.count = message.count +1
+                        }
+                    } catch (e: Exception) {
+                        e.printStackTrace()
+                        message.sign = 2
+                        message.count = message.count +1
+                    }
+                }
+            }
+            /** 更改标记 */
+            synchronousMessageRelService.update(message)
+        }
+    }
+
+    /**
+     * 建筑服务于空间
+     */
+    fun bd2SpFor(message: SynchronousMessageRel) {
+        val dictProject = dictProjectService.select(SFilter.eq("id", message.projectId!!)).entity()
+        if (dictProject!=null) {
+            val rEq2SpList = rBd2SpService.select(SFilter.eq("projectId", message.projectId!!),SFilter.eq("type", "bd2sp_ArchForArch")).exec()
+            message.sign = 0
+            if (rEq2SpList.size>0) {
+                for (rEq2Sp in rEq2SpList) {
+                    try {
+                        /** 先执行删除 */
+                        val toJsonObj = Configure.toJsonObj("ArchForArch", "Bd2Sp", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val delRel = EquipApi.delRel(dictProject.groupCode!!, message.projectId!!, toJsonObj)
+                        /** 关系列表 */
+                        val toJsonObjArray =
+                            Configure.toJsonObjArray("ArchForArch", "Bd2Sp", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val createRel = EquipApi.createRel(dictProject.groupCode!!, message.projectId!!, toJsonObjArray)
+                        if (!createRel){
+                            message.sign = 2
+                            message.count = message.count +1
+                        }
+                    } catch (e: Exception) {
+                        e.printStackTrace()
+                        message.sign = 2
+                        message.count = message.count +1
+                    }
+                }
+            }
+            /** 更改标记 */
+            synchronousMessageRelService.update(message)
+        }
+    }
+
+    /**
+     * 建筑服务于竖井
+     */
+    fun bd2ShFor(message: SynchronousMessageRel) {
+        val dictProject = dictProjectService.select(SFilter.eq("id", message.projectId!!)).entity()
+        if (dictProject!=null) {
+            val rEq2SpList = rBd2ShService.select(SFilter.eq("projectId", message.projectId!!),SFilter.eq("type", "bd2sh_ArchForArch")).exec()
+            message.sign = 0
+            if (rEq2SpList.size>0) {
+                for (rEq2Sp in rEq2SpList) {
+                    try {
+                        /** 先执行删除 */
+                        val toJsonObj = Configure.toJsonObj("ArchForArch", "Bd2Sh", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val delRel = EquipApi.delRel(dictProject.groupCode!!, message.projectId!!, toJsonObj)
+                        /** 关系列表 */
+                        val toJsonObjArray =
+                            Configure.toJsonObjArray("ArchForArch", "Bd2Sh", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val createRel = EquipApi.createRel(dictProject.groupCode!!, message.projectId!!, toJsonObjArray)
+                        if (!createRel){
+                            message.sign = 2
+                            message.count = message.count +1
+                        }
+                    } catch (e: Exception) {
+                        e.printStackTrace()
+                        message.sign = 2
+                        message.count = message.count +1
+                    }
+                }
+            }
+            /** 更改标记 */
+            synchronousMessageRelService.update(message)
+        }
+    }
+
+    /**
+     * 建筑服务于楼层
+     */
+    fun bd2FlFor(message: SynchronousMessageRel) {
+        val dictProject = dictProjectService.select(SFilter.eq("id", message.projectId!!)).entity()
+        if (dictProject!=null) {
+            val rEq2SpList = rBd2FlService.select(SFilter.eq("projectId", message.projectId!!),SFilter.eq("type", "bd2fl_ArchForArch")).exec()
+            message.sign = 0
+            if (rEq2SpList.size>0) {
+                for (rEq2Sp in rEq2SpList) {
+                    try {
+                        /** 先执行删除 */
+                        val toJsonObj = Configure.toJsonObj("ArchForArch", "Bd2Fl", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val delRel = EquipApi.delRel(dictProject.groupCode!!, message.projectId!!, toJsonObj)
+                        /** 关系列表 */
+                        val toJsonObjArray =
+                            Configure.toJsonObjArray("ArchForArch", "Bd2Fl", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val createRel = EquipApi.createRel(dictProject.groupCode!!, message.projectId!!, toJsonObjArray)
+                        if (!createRel){
+                            message.sign = 2
+                            message.count = message.count +1
+                        }
+                    } catch (e: Exception) {
+                        e.printStackTrace()
+                        message.sign = 2
+                        message.count = message.count +1
+                    }
+                }
+            }
+            /** 更改标记 */
+            synchronousMessageRelService.update(message)
+        }
+    }
+
+    /**
+     * 建筑服务于建筑
+     */
+    fun bd2BdFor(message: SynchronousMessageRel) {
+        val dictProject = dictProjectService.select(SFilter.eq("id", message.projectId!!)).entity()
+        if (dictProject!=null) {
+            val rEq2SpList = rBd2BdService.select(SFilter.eq("projectId", message.projectId!!),SFilter.eq("type", "bd2bd_ArchForArch")).exec()
+            message.sign = 0
+            if (rEq2SpList.size>0) {
+                for (rEq2Sp in rEq2SpList) {
+                    try {
+                        /** 先执行删除 */
+                        val toJsonObj = Configure.toJsonObj("ArchForArch", "Bd2bd", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val delRel = EquipApi.delRel(dictProject.groupCode!!, message.projectId!!, toJsonObj)
+                        /** 关系列表 */
+                        val toJsonObjArray =
+                            Configure.toJsonObjArray("ArchForArch", "Bd2bd", rEq2Sp.id1!!, rEq2Sp.id1!!)
+                        val createRel = EquipApi.createRel(dictProject.groupCode!!, message.projectId!!, toJsonObjArray)
+                        if (!createRel){
+                            message.sign = 2
+                            message.count = message.count +1
+                        }
+                    } catch (e: Exception) {
+                        e.printStackTrace()
+                        message.sign = 2
+                        message.count = message.count +1
+                    }
+                }
+            }
+            /** 更改标记 */
+            synchronousMessageRelService.update(message)
+        }
+    }
+
 }

+ 16 - 7
datasyn/src/main/resources/application-test.yml

@@ -12,21 +12,30 @@ eureka:
 
 spring:
   datasource:
-#    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://192.168.64.14:5432/datacenterlabsl
     username:                           postgres
     password:                           cGVyc2FneV8yMDIwcXdlIUAj
 
 
 
     #配置rabbitMq 服务器
+#  rabbitmq:
+#    host: 192.168.100.108
+#    port: 9936
+#    username: pbsage
+#    password: pbsage123
+#    #虚拟host 可以不设置,使用server默认host
+#    virtual-host: /adm
+
   rabbitmq:
-    host: 192.168.100.108
+    host: 192.168.64.15
     port: 9936
-    username: pbsage
-    password: pbsage123
+    username: admin
+    password: brzj123456
     #虚拟host 可以不设置,使用server默认host
-    virtual-host: /adm
+    virtual-host: /test
+
 
 saga:
   dataPlatform:                        http://192.168.64.17:8832
@@ -40,7 +49,7 @@ mqtopid:
 
 custom:
   #true 代表eureka  false  代表 http
-  eurekaorhttp:                       false
+  eurekaorhttp:                       true
 
 # 服务名
 servicename:

+ 1 - 1
equip-component/src/main/kotlin/com/persagy/server/service/objects/GeneralSystemService.kt

@@ -65,7 +65,7 @@ object GeneralSystemService : Service<GeneralSystem>(SMybatisDao(GeneralSystem::
 
             if (list.size>0){
                 listf.add(SFilter.eq("projectId", projectId!!))
-                listf.add(SFilter.not(SFilter.inList("SysID", list)))
+                listf.add(SFilter.not(SFilter.inList("id", list)))
             }else{
                 listf.add(SFilter.eq("projectId", projectId!!))
             }