2 Commits 1b6bb5bb95 ... 322aadfc87

Author SHA1 Message Date
  caiaf 322aadfc87 Merge branch 'master' of http://39.106.8.246:3003/server/datacenter-wanda 3 years ago
  caiaf a471fad6df 删除没用关系 3 years ago
26 changed files with 434 additions and 3335 deletions
  1. 2 0
      data-core/src/main/kotlin/com/persagy/server/datacenter/datacenter/models/jms/MessageNotice.kt
  2. 3 3
      datacenter/src/main/kotlin/com/persagy/server/datacenter/jms/RabbitMqService.kt
  3. 1 1
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/graphtype/RelationTypeProjectService.kt
  4. 1 1
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/REq2SpService.kt
  5. 87 87
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/REqForBdService.kt
  6. 86 86
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/REqForFlService.kt
  7. 87 87
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/REqForShService.kt
  8. 0 166
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/REqForSpBaseService.kt
  9. 0 224
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/REqInShService.kt
  10. 0 299
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/REqInSpBaseService.kt
  11. 0 204
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RFlThroughFlService.kt
  12. 0 444
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RShContainSpBaseService.kt
  13. 0 238
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RShaftThroughShaftService.kt
  14. 121 121
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RSpInBdService.kt
  15. 7 7
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RSyEqService.kt
  16. 0 182
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RSyForBdService.kt
  17. 0 182
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RSyForFlService.kt
  18. 0 181
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RSyForShService.kt
  19. 0 212
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RSyForSpBaseService.kt
  20. 5 5
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RSyInBdService.kt
  21. 5 5
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RSyInFlService.kt
  22. 8 8
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RSyInShService.kt
  23. 0 344
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RSyInSpBaseService.kt
  24. 0 227
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RTnInSpBaseService.kt
  25. 1 1
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/relation_calc/ManualRelationCalcService.kt
  26. 20 20
      datacenter/src/main/kotlin/com/persagy/server/datacenter/services/relation_calc/RelationCalcService.kt

+ 2 - 0
data-core/src/main/kotlin/com/persagy/server/datacenter/datacenter/models/jms/MessageNotice.kt

@@ -37,6 +37,8 @@ class MessageNotice (
     var projectId: String,
     /** 对象或关系 */
     var objOrRel: String,
+    /** 图类型 */
+    graphCode: String?,
     /** 操作类型 */
     type: String,
     /** 操作符 */

+ 3 - 3
datacenter/src/main/kotlin/com/persagy/server/datacenter/jms/RabbitMqService.kt

@@ -141,7 +141,7 @@ class RabbitMqService: RabbitMqBaseService() {
         /** 生成 id */
         val id = UUID.randomUUID().toString().replace("-", "")
         /** 消息对象 */
-        val messageNotice = MessageNotice(projectId, "objects", type, null, id,
+        val messageNotice = MessageNotice(projectId, "objects", null,type, null, id,
             hashSetOf(objId), null, null)
         /** 发送消息 */
         sendMessage(Opt.exchange!!,Opt.routingKey!!,messageNotice)
@@ -155,12 +155,12 @@ class RabbitMqService: RabbitMqBaseService() {
      * @param fromId        主 id
      * @param toId          从 id
      */
-    fun sendRel(projectId: String,type: String,ops: String,fromId: String,toId: String){
+    fun sendRel(projectId: String,graphCode: String? ,type: String,ops: String,fromId: String,toId: String){
         try {
             /** 生成 id */
             val id = UUID.randomUUID().toString().replace("-", "")
             /** 消息对象 */
-            val messageNotice = MessageNotice(projectId, "rel", type, ops, id,
+            val messageNotice = MessageNotice(projectId, "rel",graphCode, type, ops, id,
                 null, fromId, toId)
             /** 发送消息 */
             sendMessage(Opt.exchange!!,Opt.routingKey!!,messageNotice)

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

@@ -304,7 +304,7 @@ object RelationTypeProjectService : RService<RelationTypeProject>(SMybatisDao(Re
             val outFile = File("/tmp/relation-$projectId-${graphCode}${relType}${zone}.xlsx")
             workbook.write(outFile.outputStream())
             /** 发送消息 */
-            rabbitMqService.sendRel(Opt.projectId!!, relType,"20","123","456")
+            rabbitMqService.sendRel(Opt.projectId!!,graphCode, relType,"20","123","456")
         } catch (e: Exception) {
             e.printStackTrace()
             return SBaseResponse(SResponseType.failure, e.message!!)

+ 1 - 1
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/REq2SpService.kt

@@ -55,7 +55,7 @@ object REq2SpService: SObjectService<REq2Sp>(SMybatisDao(REq2Sp::class.java)) {
             /** 发送消息 */
 //            messageHandler.sendMessage(jsonObject.toString())
             /** 发送消息 */
-            rabbitMqService.sendRel(Opt.projectId!!, "EquipinSpace","12",rEqInSpZoneLighting.id1!!,rEqInSpZoneLighting.id2!!)
+            rabbitMqService.sendRel(Opt.projectId!!, rEqInSpZoneLighting.graphCode!!,rEqInSpZoneLighting.type!!,"12",rEqInSpZoneLighting.id1!!,rEqInSpZoneLighting.id2!!)
 //            kafkaService.sendNotice("datacenterrel", RelationNotice(projectId!!, "EquipinSpace", "12", IdUtils.uuidCreate(), rEqInSpZoneLighting.spaceId!!, rEqInSpZoneLighting.equipId),false)
         }
     } // Fun onDeleteSuccess

+ 87 - 87
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/REqForBdService.kt

@@ -58,7 +58,7 @@ object REqForBdService: RService<REqForBd>(SMybatisDao(REqForBd::class.java)) {
             val isInsert = insert(rEqForBd)
             if (isInsert){
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Eq2Bd","11",rEqForBd.equipId!!,rEqForBd.buildingId!!)
+                rabbitMqService.sendRel(Opt.projectId!!, rEqForBd.graphCode!!,rEqForBd.type!!,"11",rEqForBd.equipId!!,rEqForBd.buildingId!!)
                 SCreateResponse(SResponseType.success)
             }else{
                 SCreateResponse(SResponseType.failure)
@@ -81,7 +81,7 @@ object REqForBdService: RService<REqForBd>(SMybatisDao(REqForBd::class.java)) {
             /** 删除成功 */
             if (isDelete) {
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Eq2Bd","12",rEqForBd.equipId!!,rEqForBd.buildingId!!)
+                rabbitMqService.sendRel(Opt.projectId!!, rEqForBd.graphCode!!,rEqForBd.type!!,"12",rEqForBd.equipId!!,rEqForBd.buildingId!!)
                 val sBaseResponse = SBaseResponse(SResponseType.success)
                 sBaseResponse.message = rEqForBd.toJson()
                 sBaseResponse
@@ -94,89 +94,89 @@ object REqForBdService: RService<REqForBd>(SMybatisDao(REqForBd::class.java)) {
         }
     }
 
-    /**
-     * 创建设备服务于建筑关系
-     *
-     * @param    rEqForBdList     设备和建筑关系的对象列表
-     */
-    fun createEq(rEqForBdList: REqForBdList): SCreateResponse<REqForBd> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            delete("equipId = '${rEqForBdList.equipId}'")
-            for (buildingId in rEqForBdList.buildingIdList!!){
-                val rEqForBd = REqForBd()
-                rEqForBd.equipId = rEqForBdList.equipId
-                rEqForBd.buildingId = buildingId
-                rEqForBd.projectId = Opt.projectId
-                val replace = replace(rEqForBd)
-                if (replace){
-                    successList.add(buildingId)
-                }else{
-                    failureList.add(rEqForBd)
-                }
-            }
-            if (successList.size>0){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Eq2Bd","13",rEqForBdList.equipId!!,successList.toJson()!!)
-                val sCreateResponse = SCreateResponse<REqForBd>(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())
-        }
-    }
-
-    /**
-     * 创建服务于建筑的设备关系
-     *
-     * @param    rEqForBdList    设备和建筑关系的对象列表
-     */
-    fun createsBd(rEqForBdList: RBdForEqList): SCreateResponse<REqForBd> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            delete("buildingID = '${rEqForBdList.buildingId}'")
-            val projectId = SPageContext.getHeader("ProjectId")
-            for (equipId in rEqForBdList.equipIdList!!){
-                val rEqForBd = REqForBd()
-                rEqForBd.buildingId = rEqForBdList.buildingId
-                rEqForBd.equipId = equipId
-                rEqForBd.projectId = projectId
-                val replace = replace(rEqForBd)
-                if (replace){
-                    successList.add(equipId)
-                }else{
-                    failureList.add(rEqForBd)
-                }
-            }
-            if (successList.size>0){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Eq2Bd","13",rEqForBdList.buildingId!!,successList.toJson()!!)
-                if (failureList.size>0){
-                    val sCreateResponse = SCreateResponse<REqForBd>(SResponseType.success)
-                    sCreateResponse.message ="失败对象:"+failureList.toJson()
-                    sCreateResponse
-                }else{
-                    val sCreateResponse = SCreateResponse<REqForBd>(SResponseType.success)
-                    sCreateResponse
-                }
-            }else{
-                SCreateResponse(SResponseType.failure)
-            }
-        } catch (e:Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    }
+//    /**
+//     * 创建设备服务于建筑关系
+//     *
+//     * @param    rEqForBdList     设备和建筑关系的对象列表
+//     */
+//    fun createEq(rEqForBdList: REqForBdList): SCreateResponse<REqForBd> {
+//        return try {
+//            /** 成功集合 */
+//            val successList = ArrayList<Any>()
+//            /** 失败集合 */
+//            val failureList = ArrayList<Any>()
+//            delete("equipId = '${rEqForBdList.equipId}'")
+//            for (buildingId in rEqForBdList.buildingIdList!!){
+//                val rEqForBd = REqForBd()
+//                rEqForBd.equipId = rEqForBdList.equipId
+//                rEqForBd.buildingId = buildingId
+//                rEqForBd.projectId = Opt.projectId
+//                val replace = replace(rEqForBd)
+//                if (replace){
+//                    successList.add(buildingId)
+//                }else{
+//                    failureList.add(rEqForBd)
+//                }
+//            }
+//            if (successList.size>0){
+//                /** 发送消息 */
+//                rabbitMqService.sendRel(Opt.projectId!!, rEqForBd.graphCode!!,rEqForBd.type!!,"13",rEqForBdList.equipId!!,successList.toJson()!!)
+//                val sCreateResponse = SCreateResponse<REqForBd>(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())
+//        }
+//    }
+//
+//    /**
+//     * 创建服务于建筑的设备关系
+//     *
+//     * @param    rEqForBdList    设备和建筑关系的对象列表
+//     */
+//    fun createsBd(rEqForBdList: RBdForEqList): SCreateResponse<REqForBd> {
+//        return try {
+//            /** 成功集合 */
+//            val successList = ArrayList<Any>()
+//            /** 失败集合 */
+//            val failureList = ArrayList<Any>()
+//            delete("buildingID = '${rEqForBdList.buildingId}'")
+//            val projectId = SPageContext.getHeader("ProjectId")
+//            for (equipId in rEqForBdList.equipIdList!!){
+//                val rEqForBd = REqForBd()
+//                rEqForBd.buildingId = rEqForBdList.buildingId
+//                rEqForBd.equipId = equipId
+//                rEqForBd.projectId = projectId
+//                val replace = replace(rEqForBd)
+//                if (replace){
+//                    successList.add(equipId)
+//                }else{
+//                    failureList.add(rEqForBd)
+//                }
+//            }
+//            if (successList.size>0){
+//                /** 发送消息 */
+//                rabbitMqService.sendRel(Opt.projectId!!, "Eq2Bd","13",rEqForBdList.buildingId!!,successList.toJson()!!)
+//                if (failureList.size>0){
+//                    val sCreateResponse = SCreateResponse<REqForBd>(SResponseType.success)
+//                    sCreateResponse.message ="失败对象:"+failureList.toJson()
+//                    sCreateResponse
+//                }else{
+//                    val sCreateResponse = SCreateResponse<REqForBd>(SResponseType.success)
+//                    sCreateResponse
+//                }
+//            }else{
+//                SCreateResponse(SResponseType.failure)
+//            }
+//        } catch (e:Exception){
+//            e.printStackTrace()
+//            SCreateResponse(SResponseType.failure,e.message.toString())
+//        }
+//    }
 }

+ 86 - 86
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/REqForFlService.kt

@@ -57,7 +57,7 @@ object REqForFlService: RService<REqForFl>(SMybatisDao(REqForFl::class.java)) {
             val isInsert = insert(rEqForFl)
             if (isInsert){
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Eq2Fl","11",rEqForFl.equipId!!,rEqForFl.floorId!!)
+                rabbitMqService.sendRel(Opt.projectId!!, rEqForFl.graphCode!!,rEqForFl.type!!,"11",rEqForFl.equipId!!,rEqForFl.floorId!!)
                 SCreateResponse(SResponseType.success)
             }else{
                 SCreateResponse(SResponseType.failure)
@@ -79,7 +79,7 @@ object REqForFlService: RService<REqForFl>(SMybatisDao(REqForFl::class.java)) {
             /** 删除成功 */
             if (isDelete) {
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Eq2Fl","12",rEqForFl.equipId!!,rEqForFl.floorId!!)
+                rabbitMqService.sendRel(Opt.projectId!!, rEqForFl.graphCode!!,rEqForFl.type!!,"12",rEqForFl.equipId!!,rEqForFl.floorId!!)
                 val sBaseResponse = SBaseResponse(SResponseType.success)
                 sBaseResponse.message = rEqForFl.toJson()
                 sBaseResponse
@@ -92,89 +92,89 @@ object REqForFlService: RService<REqForFl>(SMybatisDao(REqForFl::class.java)) {
         }
     } // Function deletes()
 
-    /**
-     * 创建设备服务于楼层关系
-     *
-     * @param   rEqForFlList    设备和楼层关系的对象列表
-     */
-    fun createEq(rEqForFlList: REqForFlList): SCreateResponse<REqForFl> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            delete("equipId = '${rEqForFlList.equipId}'")
-            for (floorId in rEqForFlList.floorIdList!!){
-                val rEqForFl = REqForFl()
-                rEqForFl.equipId = rEqForFlList.equipId
-                rEqForFl.floorId = floorId
-                rEqForFl.projectId = Opt.projectId
-                val replace = replace(rEqForFl)
-                if (replace){
-                    successList.add(floorId)
-                }else{
-                    failureList.add(rEqForFl)
-                }
-            }
-            if (successList.size>0){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Eq2Fl","13",rEqForFlList.equipId!!,successList.toJson()!!)
-                val sCreateResponse = SCreateResponse<REqForFl>(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())
-        }
-    }
-
-    /**
-     * 创建服务于楼层的设备关系
-     *
-     * @param    rEqForFlList     设备和楼层关系的对象列表
-     */
-    fun createsFl(rEqForFlList: RFlForEqList): SCreateResponse<REqForFl> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            delete("floorId = '${rEqForFlList.floorId}'")
-            for (equipId in rEqForFlList.equipIdList!!){
-                val rEqForFl = REqForFl()
-                rEqForFl.floorId = rEqForFlList.floorId
-                rEqForFl.equipId = equipId
-                rEqForFl.projectId = Opt.projectId
-                val replace = replace(rEqForFl)
-                if (replace){
-                    successList.add(equipId)
-                }else{
-                    failureList.add(rEqForFl)
-                }
-            }
-            if (successList.size>0){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Eq2Fl","13",rEqForFlList.floorId!!,successList.toJson()!!)
-                if (failureList.size>0){
-                    val sCreateResponse = SCreateResponse<REqForFl>(SResponseType.success)
-                    sCreateResponse.message ="失败对象:"+failureList.toJson()
-                    sCreateResponse
-                }else{
-                    val sCreateResponse = SCreateResponse<REqForFl>(SResponseType.success)
-                    sCreateResponse
-                }
-            }else{
-                SCreateResponse(SResponseType.failure)
-            }
-        } catch (e:Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    }
+//    /**
+//     * 创建设备服务于楼层关系
+//     *
+//     * @param   rEqForFlList    设备和楼层关系的对象列表
+//     */
+//    fun createEq(rEqForFlList: REqForFlList): SCreateResponse<REqForFl> {
+//        return try {
+//            /** 成功集合 */
+//            val successList = ArrayList<Any>()
+//            /** 失败集合 */
+//            val failureList = ArrayList<Any>()
+//            delete("equipId = '${rEqForFlList.equipId}'")
+//            for (floorId in rEqForFlList.floorIdList!!){
+//                val rEqForFl = REqForFl()
+//                rEqForFl.equipId = rEqForFlList.equipId
+//                rEqForFl.floorId = floorId
+//                rEqForFl.projectId = Opt.projectId
+//                val replace = replace(rEqForFl)
+//                if (replace){
+//                    successList.add(floorId)
+//                }else{
+//                    failureList.add(rEqForFl)
+//                }
+//            }
+//            if (successList.size>0){
+//                /** 发送消息 */
+//                rabbitMqService.sendRel(Opt.projectId!!, "Eq2Fl","13",rEqForFlList.equipId!!,successList.toJson()!!)
+//                val sCreateResponse = SCreateResponse<REqForFl>(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())
+//        }
+//    }
+//
+//    /**
+//     * 创建服务于楼层的设备关系
+//     *
+//     * @param    rEqForFlList     设备和楼层关系的对象列表
+//     */
+//    fun createsFl(rEqForFlList: RFlForEqList): SCreateResponse<REqForFl> {
+//        return try {
+//            /** 成功集合 */
+//            val successList = ArrayList<Any>()
+//            /** 失败集合 */
+//            val failureList = ArrayList<Any>()
+//            delete("floorId = '${rEqForFlList.floorId}'")
+//            for (equipId in rEqForFlList.equipIdList!!){
+//                val rEqForFl = REqForFl()
+//                rEqForFl.floorId = rEqForFlList.floorId
+//                rEqForFl.equipId = equipId
+//                rEqForFl.projectId = Opt.projectId
+//                val replace = replace(rEqForFl)
+//                if (replace){
+//                    successList.add(equipId)
+//                }else{
+//                    failureList.add(rEqForFl)
+//                }
+//            }
+//            if (successList.size>0){
+//                /** 发送消息 */
+//                rabbitMqService.sendRel(Opt.projectId!!, "Eq2Fl","13",rEqForFlList.floorId!!,successList.toJson()!!)
+//                if (failureList.size>0){
+//                    val sCreateResponse = SCreateResponse<REqForFl>(SResponseType.success)
+//                    sCreateResponse.message ="失败对象:"+failureList.toJson()
+//                    sCreateResponse
+//                }else{
+//                    val sCreateResponse = SCreateResponse<REqForFl>(SResponseType.success)
+//                    sCreateResponse
+//                }
+//            }else{
+//                SCreateResponse(SResponseType.failure)
+//            }
+//        } catch (e:Exception){
+//            e.printStackTrace()
+//            SCreateResponse(SResponseType.failure,e.message.toString())
+//        }
+//    }
 
 }

+ 87 - 87
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/REqForShService.kt

@@ -56,7 +56,7 @@ object REqForShService: RService<REqForSh>(SMybatisDao(REqForSh::class.java)) {
             val isInsert = insert(rEqForSh)
             if (isInsert){
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Eq2Sh","11",rEqForSh.equipId!!,rEqForSh.shaftId!!)
+                rabbitMqService.sendRel(Opt.projectId!!, rEqForSh.graphCode!!,rEqForSh.type!!,"11",rEqForSh.equipId!!,rEqForSh.shaftId!!)
                 SCreateResponse(SResponseType.success)
             }else{
                 SCreateResponse(SResponseType.failure)
@@ -78,7 +78,7 @@ object REqForShService: RService<REqForSh>(SMybatisDao(REqForSh::class.java)) {
             /** 删除成功 */
             if (isDelete) {
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Eq2Sh","12",rEqForSh.equipId!!,rEqForSh.shaftId!!)
+                rabbitMqService.sendRel(Opt.projectId!!, rEqForSh.graphCode!!,rEqForSh.type!!,"12",rEqForSh.equipId!!,rEqForSh.shaftId!!)
                 val sBaseResponse = SBaseResponse(SResponseType.success)
                 sBaseResponse.message = rEqForSh.toJson()
                 sBaseResponse
@@ -91,90 +91,90 @@ object REqForShService: RService<REqForSh>(SMybatisDao(REqForSh::class.java)) {
         }
     } // Function deletes()
 
-    /**
-     * 创建设备服务于竖井关系
-     *
-     * @param    rEqForShList    设备和竖井关系的对象列表
-     */
-    fun createEq(rEqForShList: REqForShList): SCreateResponse<REqForSh> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            delete("equipId = '${rEqForShList.equipId}'")
-            val projectId = SPageContext.getHeader("projectId")
-            for (shaftId in rEqForShList.shaftIdList!!){
-                val rEqForSh = REqForSh()
-                rEqForSh.equipId = rEqForShList.equipId
-                rEqForSh.shaftId = shaftId
-                rEqForSh.projectId = projectId
-                val replace = replace(rEqForSh)
-                if (replace){
-                    successList.add(shaftId)
-                }else{
-                    failureList.add(rEqForSh)
-                }
-            }
-            if (successList.size>0){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Eq2Sh","13",rEqForShList.equipId!!,successList.toJson()!!)
-                val sCreateResponse = SCreateResponse<REqForSh>(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())
-        }
-    }
-
-    /**
-     * 创建服务于竖井的设备关系
-     *
-     * @param    rEqForShList    设备和竖井关系的对象列表
-     */
-    fun createsSh(rEqForShList: RShForEqList): SCreateResponse<REqForSh> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            delete("shaftId = '${rEqForShList.shaftId}'")
-            for (equipId in rEqForShList.equipIdList!!){
-                val rEqForSh = REqForSh()
-                rEqForSh.shaftId = rEqForShList.shaftId
-                rEqForSh.equipId = equipId
-                rEqForSh.projectId = Opt.projectId
-                val replace = replace(rEqForSh)
-                if (replace){
-                    successList.add(equipId)
-                }else{
-                    failureList.add(rEqForSh)
-                }
-            }
-            if (successList.size>0){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Eq2Sh","13",rEqForShList.shaftId!!,successList.toJson()!!)
-                if (failureList.size>0){
-                    val sCreateResponse = SCreateResponse<REqForSh>(SResponseType.success)
-                    sCreateResponse.message ="失败对象:"+failureList.toJson()
-                    sCreateResponse
-                }else{
-                    val sCreateResponse = SCreateResponse<REqForSh>(SResponseType.success)
-                    sCreateResponse
-                }
-            }else{
-                SCreateResponse(SResponseType.failure)
-            }
-        } catch (e:Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    }
+//    /**
+//     * 创建设备服务于竖井关系
+//     *
+//     * @param    rEqForShList    设备和竖井关系的对象列表
+//     */
+//    fun createEq(rEqForShList: REqForShList): SCreateResponse<REqForSh> {
+//        return try {
+//            /** 成功集合 */
+//            val successList = ArrayList<Any>()
+//            /** 失败集合 */
+//            val failureList = ArrayList<Any>()
+//            delete("equipId = '${rEqForShList.equipId}'")
+//            val projectId = SPageContext.getHeader("projectId")
+//            for (shaftId in rEqForShList.shaftIdList!!){
+//                val rEqForSh = REqForSh()
+//                rEqForSh.equipId = rEqForShList.equipId
+//                rEqForSh.shaftId = shaftId
+//                rEqForSh.projectId = projectId
+//                val replace = replace(rEqForSh)
+//                if (replace){
+//                    successList.add(shaftId)
+//                }else{
+//                    failureList.add(rEqForSh)
+//                }
+//            }
+//            if (successList.size>0){
+//                /** 发送消息 */
+//                rabbitMqService.sendRel(Opt.projectId!!, "Eq2Sh","13",rEqForShList.equipId!!,successList.toJson()!!)
+//                val sCreateResponse = SCreateResponse<REqForSh>(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())
+//        }
+//    }
+//
+//    /**
+//     * 创建服务于竖井的设备关系
+//     *
+//     * @param    rEqForShList    设备和竖井关系的对象列表
+//     */
+//    fun createsSh(rEqForShList: RShForEqList): SCreateResponse<REqForSh> {
+//        return try {
+//            /** 成功集合 */
+//            val successList = ArrayList<Any>()
+//            /** 失败集合 */
+//            val failureList = ArrayList<Any>()
+//            delete("shaftId = '${rEqForShList.shaftId}'")
+//            for (equipId in rEqForShList.equipIdList!!){
+//                val rEqForSh = REqForSh()
+//                rEqForSh.shaftId = rEqForShList.shaftId
+//                rEqForSh.equipId = equipId
+//                rEqForSh.projectId = Opt.projectId
+//                val replace = replace(rEqForSh)
+//                if (replace){
+//                    successList.add(equipId)
+//                }else{
+//                    failureList.add(rEqForSh)
+//                }
+//            }
+//            if (successList.size>0){
+//                /** 发送消息 */
+//                rabbitMqService.sendRel(Opt.projectId!!, "Eq2Sh","13",rEqForShList.shaftId!!,successList.toJson()!!)
+//                if (failureList.size>0){
+//                    val sCreateResponse = SCreateResponse<REqForSh>(SResponseType.success)
+//                    sCreateResponse.message ="失败对象:"+failureList.toJson()
+//                    sCreateResponse
+//                }else{
+//                    val sCreateResponse = SCreateResponse<REqForSh>(SResponseType.success)
+//                    sCreateResponse
+//                }
+//            }else{
+//                SCreateResponse(SResponseType.failure)
+//            }
+//        } catch (e:Exception){
+//            e.printStackTrace()
+//            SCreateResponse(SResponseType.failure,e.message.toString())
+//        }
+//    }
 
 }

+ 0 - 166
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/REqForSpBaseService.kt

@@ -1,166 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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.wanda.rel.REq2Sp
-import com.persagy.server.datacenter.models.entities.rel.REqForSpBase
-import com.persagy.server.datacenter.models.entities.rel.RSpForEqBaseList
-import com.persagy.server.datacenter.services.base.RService
-import com.persagy.service.SObjectService
-import com.persagy.service.models.enums.SResponseType
-import com.persagy.service.models.requests.SCreateRequest
-import com.persagy.service.models.responses.SBaseResponse
-import com.persagy.service.models.responses.SCreateResponse
-
-/**
- * 设备服务于业务空间关系服务
- *
- * @author 付国宝
- */
-object REqForSpBaseService: RService<REqForSpBase>(SMybatisDao(REqForSpBase::class.java)){
-
-
-    var rEq2SpService = SObjectService(SMybatisDao( REq2Sp::class.java))
-
-    /**
-     * 创建设备服务于空间关系
-     *
-     * @param    rEqForSpBase    设备服务于空间关系对象
-     */
-    fun create(type: String, rEqForSpBase: SCreateRequest<REqForSpBase>): SCreateResponse<REqForSpBase> {
-        return try {
-            for (rEqForSp in rEqForSpBase.content){
-
-                try {
-                    val rEq2Sp = REq2Sp()
-                    rEq2Sp.id1 = rEqForSp.equipId
-                    rEq2Sp.id2 = rEqForSp.spaceId
-                    rEq2Sp.projectId = Opt.projectId
-                    rEq2Sp.sign = 1
-                    rEq2Sp.zoneType = type
-                    rEq2Sp.type = "eq2sp_for"
-                    val isInsert = rEq2SpService.insert(rEq2Sp)
-                    if (isInsert){
-                        /** 发送消息 */
-                        rabbitMqService.sendRel(Opt.projectId!!, "EquipforSpace","11",rEqForSp.equipId!!,rEqForSp.spaceId!!)
-                    }else{
-
-                    }
-                }catch (e: Exception){
-                    e.printStackTrace()
-                }
-            }
-            SCreateResponse(SResponseType.success)
-
-        } catch (e: Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    }
-
-    /**
-     * 根据对象删除
-     *
-     * @param    rEqForSpBaseList    关系对象实例
-     */
-    fun deletes(type: String, rEqForSpBaseList: ArrayList<REqForSpBase>): SBaseResponse {
-        return try {
-            for (rEqForSpBase in rEqForSpBaseList){
-                try {
-                    /** 删除成功 */
-                    val rEq2Sp = REq2Sp()
-                    rEq2Sp.projectId = Opt.projectId
-                    rEq2Sp.id1 = rEqForSpBase.equipId
-                    rEq2Sp.id2 = rEqForSpBase.spaceId
-                    rEq2Sp.zoneType = type
-                    rEq2Sp.type = "eq2sp_for"
-                    val isDelete = rEq2SpService.delete(rEq2Sp)
-                    if (isDelete) {
-                        /** 发送消息 */
-                        rabbitMqService.sendRel(Opt.projectId!!, "EquipforSpace","12",rEqForSpBase.equipId!!,rEqForSpBase.spaceId!!)
-                    }
-                } catch (e: Exception) {
-                    e.printStackTrace()
-                }
-            }
-            SBaseResponse(SResponseType.success)
-        } catch (e: Exception) {
-            e.printStackTrace()
-            return SBaseResponse(SResponseType.failure, e.message!!)
-        }
-    }
-
-    /**
-     * 创建服务于业务空间的设备关系
-     *
-     * @param    rEqForSpBaseList    设备和业务空间关系的对象列表
-     */
-    fun createsSpEq(type: String,rEqForSpBaseList: RSpForEqBaseList): SCreateResponse<RSpForEqBaseList> {
-        return try {
-
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            for (equipId in rEqForSpBaseList.equipIdList!!){
-                val rEq2Sp = REq2Sp()
-                rEq2Sp.id2 = rEqForSpBaseList.spaceId
-                rEq2Sp.id1 = equipId
-                rEq2Sp.projectId = Opt.projectId
-                rEq2Sp.sign = 1
-                rEq2Sp.zoneType = type
-                rEq2Sp.type = "eq2sp_for"
-                val replace = rEq2SpService.replace(rEq2Sp)
-                if (replace){
-                    successList.add(equipId)
-                }else{
-                    failureList.add(rEq2Sp)
-                }
-            }
-            if (successList.size>0){
-                rabbitMqService.sendRel(Opt.projectId!!, "EquipforSpace","14",rEqForSpBaseList.spaceId!!,successList.toJson()!!)
-                if (failureList.size>0){
-                    val sCreateResponse = SCreateResponse<RSpForEqBaseList>(SResponseType.success)
-                    sCreateResponse.message ="失败对象:"+failureList.toJson()
-                    sCreateResponse
-                }else{
-                    val sCreateResponse = SCreateResponse<RSpForEqBaseList>(SResponseType.success)
-                    sCreateResponse
-                }
-            }else{
-                SCreateResponse(SResponseType.failure)
-            }
-        } catch (e:Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    }
-
-}

+ 0 - 224
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/REqInShService.kt

@@ -1,224 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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.REqInSh
-import com.persagy.server.datacenter.models.entities.rel.REqInShList
-import com.persagy.server.datacenter.models.entities.rel.RShInEqList
-import com.persagy.server.datacenter.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 REqInShService: RService<REqInSh>(SMybatisDao(REqInSh::class.java)) {
-
-    /**
-     * 创建设备所在竖井关系
-     *
-     * @param    rEqInSh     设备所在竖井关系对象
-     */
-    fun create(rEqInSh: REqInSh): SCreateResponse<REqInSh>{
-        return try {
-            val projectId = SPageContext.getHeader("projectId")
-            rEqInSh.projectId = projectId
-            val isInsert = insert(rEqInSh)
-            if (isInsert){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "EquipinShaft","11",rEqInSh.equipId!!,rEqInSh.shaftId!!)
-                SCreateResponse(SResponseType.success)
-            }else{
-                SCreateResponse(SResponseType.failure)
-            }
-        } catch (e: Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    } // Function create()
-
-    /**
-     * 根据对象删除
-     *
-     * @param     rEqInSh      关系对象实例
-     * @return
-     */
-    fun deletes(rEqInSh: REqInSh): SBaseResponse{
-        return try {
-            val isDelete = delete(rEqInSh)
-            /** 删除成功 */
-            if (isDelete) {
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "EquipinShaft","12",rEqInSh.equipId!!,rEqInSh.shaftId!!)
-                val sBaseResponse = SBaseResponse(SResponseType.success)
-                sBaseResponse.message = rEqInSh.toJson()
-                sBaseResponse
-            } else {
-                SBaseResponse(SResponseType.failure)
-            }
-        }catch (e: Exception){
-            e.printStackTrace()
-            return SBaseResponse(SResponseType.failure, e.message!!)
-        }
-    } // Function deletes()
-
-    /**
-     * 创建设备所在竖井关系
-     *
-     * @param    rEqInShList     设备和竖井关系的对象列表
-     */
-    fun createEq(rEqInShList: REqInShList): SCreateResponse<REqInSh>{
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            delete("equipId = '${rEqInShList.equipId}'")
-            for (shaftId in rEqInShList.shaftIdList!!){
-                val rEqInSh = REqInSh()
-                rEqInSh.equipId = rEqInShList.equipId
-                rEqInSh.shaftId = shaftId
-                rEqInSh.projectId = Opt.projectId
-                val replace = replace(rEqInSh)
-                if (replace){
-                    successList.add(shaftId)
-                }else{
-                    failureList.add(rEqInSh)
-                }
-            }
-            if (successList.size>0){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "EquipinShaft","13",rEqInShList.equipId!!,successList.toJson()!!)
-                val sCreateResponse = SCreateResponse<REqInSh>(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())
-        }
-    }
-
-    /**
-     * 创建所在竖井的设备关系
-     *
-     * @param    rShInEqList     设备和竖井关系的对象列表
-     */
-    fun createsSh(rShInEqList: RShInEqList): SCreateResponse<REqInSh>{
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            delete("shaftID = '${rShInEqList.shaftId}'")
-            val projectId = SPageContext.getHeader("projectId")
-            for (equipId in rShInEqList.equipIdList!!){
-                val rEqInSh = REqInSh()
-                rEqInSh.shaftId = rShInEqList.shaftId
-                rEqInSh.equipId = equipId
-                rEqInSh.projectId = projectId
-                val replace = replace(rEqInSh)
-                if (replace){
-                    successList.add(equipId)
-                }else{
-                    failureList.add(rEqInSh)
-                }
-            }
-            if (successList.size>0){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "EquipinShaft","13",rShInEqList.shaftId!!,successList.toJson()!!)
-                if (failureList.size>0){
-                    val sCreateResponse = SCreateResponse<REqInSh>(SResponseType.success)
-                    sCreateResponse.message ="失败对象:"+failureList.toJson()
-                    sCreateResponse
-                }else{
-                    val sCreateResponse = SCreateResponse<REqInSh>(SResponseType.success)
-                    sCreateResponse
-                }
-            }else{
-                SCreateResponse(SResponseType.failure)
-            }
-        } catch (e:Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    }
-
-    /**
-     * 创建所在竖井的设备关系
-     *
-     * @param    rShInEqList     设备和竖井关系的对象列表
-     */
-    fun createsShEq(rShInEqList: RShInEqList): SCreateResponse<REqInSh>{
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            for (equipId in rShInEqList.equipIdList!!){
-                val rEqInSh = REqInSh()
-                rEqInSh.shaftId = rShInEqList.shaftId
-                rEqInSh.equipId = equipId
-                rEqInSh.projectId = Opt.projectId
-                val replace = replace(rEqInSh)
-                if (replace){
-                    successList.add(equipId)
-                }else{
-                    failureList.add(rEqInSh)
-                }
-            }
-            if (successList.size>0){
-                rabbitMqService.sendRel(Opt.projectId!!, "EquipinShaft","14",rShInEqList.shaftId!!,successList.toJson()!!)
-                if (failureList.size>0){
-                    val sCreateResponse = SCreateResponse<REqInSh>(SResponseType.success)
-                    sCreateResponse.message ="失败对象:"+failureList.toJson()
-                    sCreateResponse
-                }else{
-                    val sCreateResponse = SCreateResponse<REqInSh>(SResponseType.success)
-                    sCreateResponse
-                }
-            }else{
-                SCreateResponse(SResponseType.failure)
-            }
-        } catch (e:Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    }
-
-}

+ 0 - 299
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/REqInSpBaseService.kt

@@ -1,299 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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.wanda.rel.REq2Sp
-import com.persagy.server.datacenter.models.entities.rel.REqInSpBase
-import com.persagy.server.datacenter.models.entities.rel.REqInSpBaseList
-import com.persagy.server.datacenter.models.entities.rel.RSpInEqBaseList
-import com.persagy.server.datacenter.services.base.RService
-import com.persagy.service.SObjectService
-import com.persagy.service.SPageContext
-import com.persagy.service.models.enums.SResponseType
-import com.persagy.service.models.requests.SCreateRequest
-import com.persagy.service.models.responses.SBaseResponse
-import com.persagy.service.models.responses.SCreateResponse
-import org.json.JSONObject
-
-/**
- * 设备所在业务空间关系服务
- *
- * @author 付国宝
- */
-object REqInSpBaseService: RService<REqInSpBase>(SMybatisDao(REqInSpBase::class.java)) {
-
-    /**
-     * 设备所在业务空间
-     */
-    var rEq2SpService = SObjectService(SMybatisDao( REq2Sp::class.java))
-
-    /**
-     * 创建设备所在业务空间关系
-     *
-     * @param    rEqInSpBase    设备所在业务空间关系对象
-     */
-    fun create(type: String, rEqInSpBaseList: SCreateRequest<REqInSpBase>): SCreateResponse<REqInSpBase> {
-        return try {
-            val projectId = SPageContext.getHeader("projectId")
-            for (rEqInSpBase in rEqInSpBaseList.content){
-                try {
-                    val rEq2Sp = REq2Sp()
-                    rEq2Sp.zoneType = type
-                    rEq2Sp.type = "eq2sp_in"
-                    rEq2Sp.sign = 1
-                    rEq2Sp.id1 = rEqInSpBase.equipId
-                    rEq2Sp.id2 = rEqInSpBase.spaceId
-                    rEq2Sp.projectId = projectId
-                    val replace = rEq2SpService.replace(rEq2Sp)
-                    if (replace){
-                        val jsonObject = JSONObject()
-                        jsonObject.put("type", "11")
-                        jsonObject.put("projectId", projectId)
-                        jsonObject.put("id", rEqInSpBase.spaceId)
-                        jsonObject.put("obj_type", "EquipinSpace")
-                        jsonObject.put("linkId",rEqInSpBase.equipId)
-
-                        /** 发送消息 */
-//                        messageHandler.sendMessage(jsonObject.toString())
-                        /** 发送消息 */
-                        rabbitMqService.sendRel(Opt.projectId!!, "EquipinSpace","11",rEqInSpBase.equipId!!,rEqInSpBase.spaceId!!)
-                    }
-                } catch (e: Exception) {
-                    e.printStackTrace()
-                }
-            }
-            SCreateResponse(SResponseType.success)
-
-        } catch (e: Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    } // Function create()
-
-    /**
-     * 根据对象删除
-     *
-     * @param    rEqInSpBaseList    关系对象实例
-     */
-    fun deletes(type: String, rEqInSpBaseList: ArrayList<REqInSpBase>): SBaseResponse {
-        return try {
-            val projectId = SPageContext.getHeader("projectId")
-            val list= ArrayList<REq2Sp>()
-            for (rEqInSpBase in rEqInSpBaseList){
-                val rEq2Sp = REq2Sp()
-                rEq2Sp.projectId = projectId
-                rEq2Sp.id1 = rEqInSpBase.equipId
-                rEq2Sp.id2 = rEqInSpBase.spaceId
-                rEq2Sp.zoneType = type
-                rEq2Sp.type = "eq2sp_in"
-                list.add(rEq2Sp)
-            }
-            REq2SpService.deleteByKeysList(list)
-
-        } catch (e: Exception) {
-            e.printStackTrace()
-            return SBaseResponse(SResponseType.failure, e.message!!)
-        }
-    } // Function deletes()
-
-    /**
-     * 创建设备所在业务空间关系
-     *
-     * @param    rEqInSpBaseList    设备和业务空间关系的对象列表
-     */
-    fun createEq(rEqInSpBaseList: REqInSpBaseList): SCreateResponse<REqInSpBase> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            REq2SpService.delete("id1 = '${rEqInSpBaseList.equipId}'")
-            for (spaceId in rEqInSpBaseList.spaceIdList!!){
-                val rEqInSpBase = REqInSpBase()
-                rEqInSpBase.equipId = rEqInSpBaseList.equipId
-                rEqInSpBase.spaceId = spaceId
-                rEqInSpBase.projectId = Opt.projectId
-                val replace = replace(rEqInSpBase)
-                if (replace){
-                    successList.add(spaceId)
-                }else{
-                    failureList.add(rEqInSpBase)
-                }
-            }
-            if (successList.size>0){
-                val jsonObject = JSONObject()
-                jsonObject.put("type", "13")
-                jsonObject.put("projectId", Opt.projectId)
-                jsonObject.put("id", rEqInSpBaseList.equipId)
-                jsonObject.put("obj_type", "EquipinSpace")
-                jsonObject.put("linkId",successList.toJson())
-
-                /** 发送消息 */
-//                RService.messageHandler.sendMessage(jsonObject.toString())
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "EquipinSpace","13",rEqInSpBaseList.equipId!!,successList.toJson()!!)
-                val sCreateResponse = SCreateResponse<REqInSpBase>(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 createEq()
-
-    /**
-     * 创建所在业务空间的设备关系
-     *
-     * @param    rEqInSpBaseList    设备和业务空间关系的对象列表
-     */
-    fun createsSp(rEqInSpBaseList: RSpInEqBaseList): SCreateResponse<REqInSpBase> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            REq2SpService.delete("id2 = '${rEqInSpBaseList.spaceId}'")
-            for (equipId in rEqInSpBaseList.equipIdList!!){
-                val rEqInSpBase = REqInSpBase()
-                rEqInSpBase.spaceId = rEqInSpBaseList.spaceId
-                rEqInSpBase.equipId = equipId
-                rEqInSpBase.projectId = Opt.projectId
-                val replace = replace(rEqInSpBase)
-                if (replace){
-                    successList.add(equipId)
-                }else{
-                    failureList.add(rEqInSpBase)
-                }
-            }
-            if (successList.size>0){
-                val jsonObject = JSONObject()
-                jsonObject.put("type", "13")
-                jsonObject.put("projectId", Opt.projectId)
-                jsonObject.put("id", rEqInSpBaseList.spaceId)
-                jsonObject.put("obj_type", "EquipinSpace")
-                jsonObject.put("linkId",successList.toJson())
-
-                /** 发送消息 */
-//                RService.messageHandler.sendMessage(jsonObject.toString())
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "EquipinSpace","13",rEqInSpBaseList.spaceId!!,successList.toJson()!!)
-                if (failureList.size>0){
-                    val sCreateResponse = SCreateResponse<REqInSpBase>(SResponseType.success)
-                    sCreateResponse.message ="失败对象:"+failureList.toJson()
-                    sCreateResponse
-                }else{
-                    val sCreateResponse = SCreateResponse<REqInSpBase>(SResponseType.success)
-                    sCreateResponse
-                }
-            }else{
-                SCreateResponse(SResponseType.failure)
-            }
-        } catch (e:Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    } // Function createsSp()
-
-    /**
-     * 创建所在业务空间的设备关系
-     *
-     * @param    rEqInSpBaseList    设备和业务空间关系的对象列表
-     */
-    fun createsSpEq(type: String,rEqInSpBaseList: RSpInEqBaseList): SCreateResponse<RSpInEqBaseList> {
-        return try {
-            val projectId = SPageContext.getHeader("projectId")
-            /** 业务空间类型服务 */
-
-            if (!type.isNullOrEmpty()){
-                try {
-                    /** 成功集合 */
-                    val successList = ArrayList<Any>()
-                    /** 失败集合 */
-                    val failureList = ArrayList<Any>()
-                    for (rEqInSpBase in rEqInSpBaseList.equipIdList!!){
-                        val rEq2Sp = REq2Sp()
-                        rEq2Sp.id1 = rEqInSpBase
-                        rEq2Sp.id2 = rEqInSpBaseList.spaceId
-                        rEq2Sp.projectId = projectId
-                        rEq2Sp.sign = 1
-                        rEq2Sp.type ="eq2sp_in"
-                        rEq2Sp.zoneType =  type
-                        val replace = rEq2SpService.replace(rEq2Sp)
-                        if (replace){
-                            successList.add(rEq2Sp.id1!!)
-                        }else{
-                            failureList.add(rEq2Sp)
-                        }
-                    }
-
-                    if (successList.size>0){
-                        val jsonObject = JSONObject()
-                        jsonObject.put("type", "14")
-                        jsonObject.put("projectId", projectId)
-                        jsonObject.put("id", rEqInSpBaseList.spaceId)
-                        jsonObject.put("obj_type", "EquipinSpace")
-                        jsonObject.put("linkId",successList.toJson())
-                        /** 发送消息 */
-//                        messageHandler.sendMessage(jsonObject.toString())
-                        rabbitMqService.sendRel(Opt.projectId!!, "EquipinSpace","14",rEqInSpBaseList.spaceId!!,successList.toJson()!!)
-                        if (failureList.size>0){
-                            val sCreateResponse = SCreateResponse<RSpInEqBaseList>(SResponseType.success)
-                            sCreateResponse.message ="失败对象:"+failureList.toJson()
-                            sCreateResponse
-                        }else{
-                            val sCreateResponse = SCreateResponse<RSpInEqBaseList>(SResponseType.success)
-                            sCreateResponse
-                        }
-                    }else{
-                        SCreateResponse(SResponseType.failure)
-                    }
-                } catch (e: Exception) {
-                    e.printStackTrace()
-                }
-                val sCreateResponse = SCreateResponse<RSpInEqBaseList>(SResponseType.success)
-                sCreateResponse
-            }else{
-                val sCreateResponse = SCreateResponse<RSpInEqBaseList>(SResponseType.failure)
-                sCreateResponse.message = "空间分区类型不存在:$type"
-                sCreateResponse
-            }
-
-        } catch (e:Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    } // Function createsSp()
-
-} // Object REqInSpBaseService

+ 0 - 204
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RFlThroughFlService.kt

@@ -1,204 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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.RFlThroughFl
-import com.persagy.server.datacenter.models.entities.rel.RFloorOtherThroughFloorList
-import com.persagy.server.datacenter.models.entities.rel.RFloorThroughFloorOtherList
-import com.persagy.server.datacenter.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 RFlThroughFlService : RService<RFlThroughFl>(SMybatisDao(RFlThroughFl::class.java)) {
-
-    /**
-     * 创建楼层的贯通关系
-     *
-     * @param   rFlThroughFl    楼层的贯通关系对象
-     */
-    fun create(rFlThroughFl: RFlThroughFl): SCreateResponse<RFlThroughFl> {
-        return try {
-            val projectId = SPageContext.getHeader("projectId")
-            rFlThroughFl.projectId = projectId
-            val isInsert = insert(rFlThroughFl)
-            if (isInsert){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Fl2Fl","11",rFlThroughFl.floorId!!,rFlThroughFl.floorOtherId!!)
-                SCreateResponse(SResponseType.success)
-            }else{
-                SCreateResponse(SResponseType.failure)
-            }
-        } catch (e: Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    } // Tenant create()
-
-    /**
-     * 根据对象删除
-     *
-     * @param   rFlThroughFl    关系对象实例
-     */
-    fun deletes(rFlThroughFl: RFlThroughFl): SBaseResponse {
-        return try {
-            val isDelete = delete(rFlThroughFl)
-            /** 删除成功 */
-            if (isDelete) {
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Fl2Fl","12",rFlThroughFl.floorId!!,rFlThroughFl.floorOtherId!!)
-                val sBaseResponse = SBaseResponse(SResponseType.success)
-                sBaseResponse.message = rFlThroughFl.toJson()
-                sBaseResponse
-            } else {
-                SBaseResponse(SResponseType.failure)
-            }
-        } catch (e: Exception) {
-            e.printStackTrace()
-            return SBaseResponse(SResponseType.failure, e.message!!)
-        }
-    } // Tenant deletes()
-
-    /**
-     * 创建楼层的贯通关系
-     *
-     * @param   rFloorThroughFloorOtherList    楼层和楼层列表关系对象
-     */
-    fun createFl(rFloorThroughFloorOtherList: RFloorThroughFloorOtherList): SCreateResponse<RFlThroughFl> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-
-            try {
-                delete("floorId = '${rFloorThroughFloorOtherList.floorId}'")
-                delete("floorOtherId = '${rFloorThroughFloorOtherList.floorId}'")
-            } catch (e: Exception) {
-                e.printStackTrace()
-            }
-            if (rFloorThroughFloorOtherList.floorOtherIdList!=null&&rFloorThroughFloorOtherList.floorOtherIdList!!.isNotEmpty()){
-                for (floorOtherId in rFloorThroughFloorOtherList.floorOtherIdList!!){
-                    val rFlThroughFl = RFlThroughFl()
-                    rFlThroughFl.floorId = rFloorThroughFloorOtherList.floorId
-                    rFlThroughFl.floorOtherId = floorOtherId
-                    rFlThroughFl.projectId = Opt.projectId
-                    val replace = replace(rFlThroughFl)
-                    if (replace){
-                        successList.add(floorOtherId)
-                    }else{
-                        failureList.add(rFlThroughFl)
-                    }
-                }
-                if (successList.size>0){
-                    /** 发送消息 */
-                    rabbitMqService.sendRel(Opt.projectId!!, "Fl2Fl","13",rFloorThroughFloorOtherList.floorId!!,successList.toJson()!!)
-
-                    val sCreateResponse = SCreateResponse<RFlThroughFl>(SResponseType.success)
-                    if (failureList.size>0){
-                        sCreateResponse.message ="失败对象:"+failureList.toJson()
-                    }
-                    sCreateResponse
-                }else{
-                    SCreateResponse(SResponseType.failure)
-                }
-            }else{
-                SCreateResponse(SResponseType.success)
-            }
-
-        } catch (e: Exception) {
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    } // Tenant createFl()
-
-    /**
-     * 创建楼层的贯通关系
-     *
-     * @param   rFollrOtherThroughFloorList    楼层列表和楼层关系对象
-     */
-    fun createsFl(rFollrOtherThroughFloorList: RFloorOtherThroughFloorList): SCreateResponse<RFlThroughFl> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-
-            try {
-                delete("floorId = '${rFollrOtherThroughFloorList.floorOtherId}'")
-                delete("floorOtherId = '${rFollrOtherThroughFloorList.floorOtherId}'")
-            } catch (e: Exception) {
-                e.printStackTrace()
-            }
-            val projectId = SPageContext.getHeader("projectId")
-            if (rFollrOtherThroughFloorList.floorIdList!=null&&rFollrOtherThroughFloorList.floorIdList!!.isNotEmpty()){
-                for (floorId in rFollrOtherThroughFloorList.floorIdList!!){
-                    val rFlThroughFl = RFlThroughFl()
-                    rFlThroughFl.floorOtherId = rFollrOtherThroughFloorList.floorOtherId
-                    rFlThroughFl.floorId = floorId
-                    rFlThroughFl.projectId = projectId
-                    val replace = replace(rFlThroughFl)
-                    if (replace){
-                        successList.add(floorId)
-                    }else{
-                        failureList.add(rFlThroughFl)
-                    }
-                }
-                if (successList.size>0){
-                    /** 发送消息 */
-                    rabbitMqService.sendRel(Opt.projectId!!, "Fl2Fl","13",rFollrOtherThroughFloorList.floorOtherId!!,successList.toJson()!!)
-                    if (failureList.size>0){
-                        val sCreateResponse = SCreateResponse<RFlThroughFl>(SResponseType.success)
-                        sCreateResponse.message ="失败对象:"+failureList.toJson()
-                        sCreateResponse
-                    }else{
-                        val sCreateResponse = SCreateResponse<RFlThroughFl>(SResponseType.success)
-                        sCreateResponse
-                    }
-                }else{
-                    SCreateResponse(SResponseType.failure)
-                }
-            }else{
-                SCreateResponse(SResponseType.success)
-            }
-
-        } catch (e:Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    }
-
-}

+ 0 - 444
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RShContainSpBaseService.kt

@@ -1,444 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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.services.rel
-
-import com.persagy.base.extensions.toJson
-import com.persagy.database.SFilter
-import com.persagy.mybatis.SMybatisDao
-import com.persagy.server.Opt
-import com.persagy.server.datacenter.models.entities.dict.SpaceInfoDic
-import com.persagy.server.datacenter.models.entities.rel.RSh2Sp
-import com.persagy.server.datacenter.models.entities.rel.RShContainSpBase
-import com.persagy.server.datacenter.models.entities.rel.RShContainSpBaseList
-import com.persagy.server.datacenter.services.base.RService
-import com.persagy.server.datacenter.services.objects.EquipmentService
-import com.persagy.server.datacenter.wanda.obj.ZoneSpace
-import com.persagy.server.services.rel.RSpContainShBaseList
-import com.persagy.service.SBaseService
-import com.persagy.service.SPageContext
-import com.persagy.service.models.enums.SResponseType
-import com.persagy.service.models.requests.SCreateRequest
-import com.persagy.service.models.requests.SQueryRequest
-import com.persagy.service.models.responses.SBaseResponse
-import com.persagy.service.models.responses.SCreateResponse
-import com.persagy.service.models.responses.SQueryResponse
-
-/**
- * 竖井下的业务空间关系服务 目前只支持 默认空间同步
- *
- * @author 付国宝
- */
-object RShContainSpBaseService: RService<RShContainSpBase>(SMybatisDao(RShContainSpBase::class.java)) {
-
-    val rSh2SpService = RService(SMybatisDao(RSh2Sp::class.java))
-
-    /**
-     * 创建竖井下业务空间关系
-     *
-     * @param    rShContainSpBaseList    竖井和业务空间的关系对象
-     */
-    fun create(rShContainSpBaseList: SCreateRequest<RShContainSpBase>): SCreateResponse<RShContainSpBase> {
-        return try {
-
-            for (rShContainSpBase in rShContainSpBaseList.content){
-                val rSh2Sp = RSh2Sp()
-                rSh2Sp.id2 = rShContainSpBase.spaceId
-                rSh2Sp.id1 = rShContainSpBase.shaftId
-                rSh2Sp.projectId = Opt.projectId
-                rSh2Sp.sign = 1
-                rSh2Sp.zoneType = rShContainSpBase.objectType
-                rSh2Sp.type = "sh2sp"
-                val isInsert = rSh2SpService.insert(rSh2Sp)
-                if (isInsert){
-                    /** 发送消息 */
-                    rabbitMqService.sendRel(Opt.projectId!!, "sh2sp","11",rShContainSpBase.shaftId!!,rShContainSpBase.spaceId!!)
-                }
-            }
-
-            val sCreateResponse = SCreateResponse<RShContainSpBase>(SResponseType.success)
-            sCreateResponse
-        } catch (e: Exception) {
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    }
-
-    /**
-     * 根据对象删除
-     *
-     * @param    rShContainSpBase    关系对象实例
-     * @return
-     */
-    fun deletes(type: String, rShContainSpBaseList: ArrayList<RShContainSpBase>): SBaseResponse {
-        return try {
-
-            for (rShContainSpBase in rShContainSpBaseList){
-                val rSh2Sp = RSh2Sp()
-                rSh2Sp.id2 = rShContainSpBase.spaceId
-                rSh2Sp.id1 = rShContainSpBase.shaftId
-                rSh2Sp.projectId = Opt.projectId
-                rSh2Sp.zoneType = type
-                rSh2Sp.type = "sh2sp"
-                val isDelete = rSh2SpService.delete(rSh2Sp)
-                if (isDelete) {
-                    /** 发送消息 */
-                    rabbitMqService.sendRel(Opt.projectId!!, "sh2sp","12",rShContainSpBase.shaftId!!,rShContainSpBase.spaceId!!)
-                }
-            }
-            val sBaseResponse = SBaseResponse(SResponseType.success)
-            sBaseResponse
-
-        } catch (e: Exception) {
-            e.printStackTrace()
-            return SBaseResponse(SResponseType.failure, e.message!!)
-        }
-    }
-
-    /**
-     * 创建竖井下业务空间关系
-     *
-     * @param    rShContainSpBaseList    竖井和业务空间的关系对象列表
-     */
-    fun createSh(rShContainSpBaseList: RShContainSpBaseList): SCreateResponse<RShContainSpBase> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            rSh2SpService.delete("id1 = '${rShContainSpBaseList.shaftId}'")
-            val projectId = SPageContext.getHeader("projectId")
-            for (spaceId in rShContainSpBaseList.spaceIdList!!){
-                val rSh2Sp = RSh2Sp()
-                rSh2Sp.id1 = rShContainSpBaseList.shaftId
-                rSh2Sp.id2 = spaceId
-                rSh2Sp.projectId = projectId
-                rSh2Sp.zoneType = rShContainSpBaseList.zoneType
-                rSh2Sp.sign = 1
-                rSh2Sp.type = "sh2sp"
-                val replace = rSh2SpService.replace(rSh2Sp)
-                if (replace){
-                    successList.add(spaceId)
-                }else{
-                    failureList.add(rSh2Sp)
-                }
-            }
-            if (successList.size>0){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sh2sp","13",rShContainSpBaseList.shaftId!!,successList.toJson()!!)
-                val sCreateResponse = SCreateResponse<RShContainSpBase>(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 createSh()
-
-    /**
-     * 创建竖井下业务空间关系
-     *
-     * @param    rShContainSpBaseList    竖井和业务空间的关系对象列表
-     */
-    fun createsSp(rShContainSpBaseList: RSpContainShBaseList): SCreateResponse<RShContainSpBase> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            rSh2SpService.delete("id2 = '${rShContainSpBaseList.spaceId}'")
-
-            for (shaftId in rShContainSpBaseList.shaftIdList!!){
-                val rSh2Sp = RSh2Sp()
-                rSh2Sp.id2 = rShContainSpBaseList.spaceId
-                rSh2Sp.id1 = shaftId
-                rSh2Sp.projectId = Opt.projectId
-                rSh2Sp.zoneType = rShContainSpBaseList.zoneType
-                rSh2Sp.sign = 1
-                rSh2Sp.type = "sh2sp"
-                val replace = rSh2SpService.replace(rSh2Sp)
-                if (replace){
-                    successList.add(shaftId)
-                }else{
-                    failureList.add(rSh2Sp)
-                }
-            }
-            if (successList.size>0){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sh2sp","13",rShContainSpBaseList.spaceId!!,successList.toJson()!!)
-                if (failureList.size>0){
-                    val sCreateResponse = SCreateResponse<RShContainSpBase>(SResponseType.success)
-                    sCreateResponse.message ="失败对象:"+failureList.toJson()
-                    sCreateResponse
-                }else{
-                    val sCreateResponse = SCreateResponse<RShContainSpBase>(SResponseType.success)
-                    sCreateResponse
-                }
-            }else{
-                SCreateResponse(SResponseType.failure)
-            }
-        } catch (e:Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    } // Function createsSp()
-
-    /**
-     * 创建竖井下业务空间关系
-     *
-     * @param    rShContainSpBaseList    竖井和业务空间的关系对象列表
-     */
-    fun createShSps(type: String?,rShContainSpBaseList: RShContainSpBaseList): SCreateResponse<RShContainSpBaseList> {
-        return try {
-
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            val projectId = SPageContext.getHeader("projectId")
-            if (!rShContainSpBaseList.spaceIdList.isNullOrEmpty()&&!type.isNullOrEmpty()){
-                for (spaceId in rShContainSpBaseList.spaceIdList!!){
-                    val rSh2Sp = RSh2Sp()
-                    rSh2Sp.id1 = rShContainSpBaseList.shaftId
-                    rSh2Sp.id2 = spaceId
-                    rSh2Sp.projectId = projectId
-                    rSh2Sp.zoneType = type
-                    rSh2Sp.sign = 1
-                    rSh2Sp.type = "sh2sp"
-                    val replace = rSh2SpService.replace(rSh2Sp)
-                    if (replace){
-                        successList.add(spaceId)
-                    }else{
-                        failureList.add(rSh2Sp)
-                    }
-                }
-                if (successList.size>0){
-                    /** 发送消息 */
-                    rabbitMqService.sendRel(Opt.projectId!!, "sh2sp","14",rShContainSpBaseList.shaftId!!,successList.toJson()!!)
-                    try {
-                        /** 处理关系标记 */
-                        val listType = ArrayList<String>()
-                        listType.add("sh2bd")
-                        listType.add("eq2sh")
-                        for (type in listType){
-                            val entity = EquipmentService.relationTypeProjectservice.select(SFilter.eq("projectId", projectId!!), SFilter.eq("relationType", type)).entity()
-                            if (entity!=null){
-                                entity.computationalState = 2
-                                EquipmentService.relationTypeProjectservice.update(entity)
-                            }
-                        }
-                    } catch (e: Exception) {
-                        e.printStackTrace()
-                    }
-                    val sCreateResponse = SCreateResponse<RShContainSpBaseList>(SResponseType.success)
-                    if (failureList.size>0){
-                        sCreateResponse.message ="失败对象:"+failureList.toJson()
-                    }
-                    sCreateResponse
-                }else{
-                    SCreateResponse(SResponseType.failure)
-                }
-            }else{
-                val sCreateResponse = SCreateResponse<RShContainSpBaseList>(SResponseType.success)
-                sCreateResponse.message = "空间类型和空间列表不能为空"
-                sCreateResponse
-            }
-        } catch (e: Exception) {
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    }
-
-
-    /**
-     * 创建竖井下业务空间关系
-     *
-     * @param    rSpContainShBaseList    竖井和业务空间的关系对象列表
-     */
-    fun createSpShs(type: String,rSpContainShBaseList: RSpContainShBaseList): SCreateResponse<RSpContainShBaseList> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            val projectId = SPageContext.getHeader("projectId")
-
-            if (!rSpContainShBaseList.shaftIdList.isNullOrEmpty()){
-                for (shaftId in rSpContainShBaseList.shaftIdList!!){
-                    val rSh2Sp = RSh2Sp()
-                    rSh2Sp.id2 = rSpContainShBaseList.spaceId
-                    rSh2Sp.id1 = shaftId
-                    rSh2Sp.projectId = projectId
-                    rSh2Sp.zoneType = type
-                    rSh2Sp.sign = 1
-                    rSh2Sp.type = "sh2sp"
-                    val replace = rSh2SpService.replace(rSh2Sp)
-                    if (replace){
-                        successList.add(rSh2Sp)
-                    }else{
-                        failureList.add(rSh2Sp)
-                    }
-                }
-                if (successList.size>0){
-                    /** 发送消息 */
-                    rabbitMqService.sendRel(Opt.projectId!!, "sh2sp","14",rSpContainShBaseList.spaceId!!,successList.toJson()!!)
-
-                    if (failureList.size>0){
-                        val sCreateResponse = SCreateResponse<RSpContainShBaseList>(SResponseType.success)
-                        sCreateResponse.message ="失败对象:"+failureList.toJson()
-                        sCreateResponse
-                    }else{
-                        val sCreateResponse = SCreateResponse<RSpContainShBaseList>(SResponseType.success)
-                        sCreateResponse
-                    }
-
-                }else{
-                    SCreateResponse(SResponseType.failure)
-                }
-            }else{
-                SCreateResponse(SResponseType.success)
-            }
-
-        } catch (e: Exception) {
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    }
-
-    /**
-     * 创建竖井下业务空间关系
-     *
-     * @param    rShContainSpBaseList    竖井和业务空间的关系对象列表
-     */
-    fun createShSpsReplace(type: String,buildingId: String,floorId: String,rShContainSpBaseList: RShContainSpBaseList): SCreateResponse<RShContainSpBaseList> {
-        return try {
-            val projectId = SPageContext.getHeader("projectId")
-            val allSpaceIdList = ArrayList<String>()//和竖井关联的并且为当前空间类型的业务空间id列表
-            val spaceIdList = ArrayList<String>()//和竖井关联且为当前空间类型、所在建筑楼层为当前建筑楼层的的业务空间id列表
-            val allSpaceIdFilterList = ArrayList<SFilter>()
-            val zoneSpaceBaseTableService = SBaseService(SMybatisDao(ZoneSpace::class.java))
-
-
-            //查出和当前竖井关联并为当前空间类型的的业务空间id
-            val list1 =  rSh2SpService.select(SFilter.eq("projectId",projectId!!),SFilter.eq("Id1",rShContainSpBaseList.shaftId!!),SFilter.eq("zoneType",type)).projection("id2").distinct().exec()
-            for(rShContainSpBase in list1){
-                allSpaceIdList.add(rShContainSpBase.id2!!)
-            }
-            allSpaceIdFilterList.add(SFilter.eq("projectId",projectId))
-            allSpaceIdFilterList.add(SFilter.eq("classCode",type))
-            allSpaceIdFilterList.add(SFilter.eq("buildingId",buildingId))
-            allSpaceIdFilterList.add(SFilter.eq("floorId",floorId))
-            if (allSpaceIdList.size>0){
-                allSpaceIdFilterList.add(SFilter.inList("id",allSpaceIdList))
-            }
-            var spaceList = zoneSpaceBaseTableService.select(allSpaceIdFilterList).projection("id").exec()
-            for(zoneSpaceBaseTable in spaceList){
-                spaceIdList.add(zoneSpaceBaseTable.id!!)
-            }
-
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            if (spaceIdList.size>0){
-                for(oldSpaceId in spaceIdList){
-                    rSh2SpService.delete("Id1 = '${rShContainSpBaseList.shaftId}' and Id2 = '${oldSpaceId}' and type = 'sh2sp'")
-                }
-            }
-            if (!rShContainSpBaseList.spaceIdList.isNullOrEmpty()){
-                for (spaceId in rShContainSpBaseList.spaceIdList!!){
-                    val rSh2Sp = RSh2Sp()
-                    rSh2Sp.id1 = rShContainSpBaseList.shaftId
-                    rSh2Sp.id2 = spaceId
-                    rSh2Sp.projectId = projectId
-                    rSh2Sp.sign = 1
-                    rSh2Sp.zoneType = type
-                    rSh2Sp.type = "sh2sp"
-                    val replace = rSh2SpService.replace(rSh2Sp)
-                    if (replace){
-                        successList.add(rSh2Sp)
-                    }else{
-                        failureList.add(rSh2Sp)
-                    }
-                }
-                if (successList.size>0){
-                    try {
-                        /** 处理关系标记 */
-                        val listType = ArrayList<String>()
-                        listType.add("sh2bd")
-                        listType.add("eq2sh")
-                        for (type in listType){
-                            val entity = EquipmentService.relationTypeProjectservice.select(SFilter.eq("projectId", projectId), SFilter.eq("relationType", type)).entity()
-                            if (entity!=null){
-                                entity.computationalState = 2
-                                EquipmentService.relationTypeProjectservice.update(entity)
-                            }
-                        }
-                    } catch (e: Exception) {
-                        e.printStackTrace()
-                    }
-                    val sCreateResponse = SCreateResponse<RShContainSpBaseList>(SResponseType.success)
-                    if (failureList.size>0){
-                        sCreateResponse.message ="失败对象:"+failureList.toJson()
-                    }
-                    sCreateResponse
-                }else{
-                    SCreateResponse(SResponseType.failure)
-                }
-            }else{
-                SCreateResponse(SResponseType.success)
-            }
-
-        } catch (e: Exception) {
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    }
-
-    /**
-     * 查询空间类型和名称
-     */
-    fun spaceTypeQuery(projectId: String, shaftId: String): SQueryResponse<SpaceInfoDic> {
-        return try {
-            var request = SQueryRequest()
-            val service = SBaseService(SMybatisDao(SpaceInfoDic::class.java))
-            val queryBuilder = service.select(request.filters)
-            queryBuilder.tableName = "public.f_get_sh_space_type('$projectId','$shaftId')"
-            val pageQuery = queryBuilder.pageQuery(1, 1000)
-            SQueryResponse(pageQuery)
-        } catch (e: Exception) {
-            e.printStackTrace()
-            SQueryResponse(SResponseType.failure, e.message!!)
-        }
-    } //  Fun spaceTypeQuery
-
-
-}

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

@@ -1,238 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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.database.SFilter
-import com.persagy.mybatis.SMybatisDao
-import com.persagy.server.Opt
-import com.persagy.server.datacenter.models.entities.rel.RShaftThroughShaft
-import com.persagy.server.datacenter.models.entities.rel.RShaftThroughShaftOtherList
-import com.persagy.server.datacenter.services.base.RService
-import com.persagy.server.datacenter.services.objects.EquipmentService
-import com.persagy.service.models.enums.SResponseType
-import com.persagy.service.models.responses.SBaseResponse
-import com.persagy.service.models.responses.SCreateResponse
-import org.slf4j.LoggerFactory
-
-/**
- * 竖井的贯通关系服务
- *
- * @author 付国宝
- */
-object RShaftThroughShaftService : RService<RShaftThroughShaft>(SMybatisDao(RShaftThroughShaft::class.java)) {
-
-    /** 日志 */
-    private val logger = LoggerFactory.getLogger(RShaftThroughShaftService::class.java)
-
-    /**
-     * 创建竖井的贯通关系
-     *
-     * @param   rFlThroughFl    竖井的贯通关系对象
-     */
-    fun create(rFlThroughFl: RShaftThroughShaft): SCreateResponse<RShaftThroughShaft> {
-        return try {
-
-            rFlThroughFl.projectId = Opt.projectId
-            val isInsert = insert(rFlThroughFl)
-            if (isInsert){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Sh2Sh","11",rFlThroughFl.shaftId!!,rFlThroughFl.shaftOtherId!!)
-                SCreateResponse(SResponseType.success)
-            }else{
-                SCreateResponse(SResponseType.failure)
-            }
-        } catch (e: Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    } // Tenant create()
-
-    /**
-     * 根据对象删除
-     *
-     * @param   rFlThroughFl    关系对象实例
-     */
-    fun deletes(rFlThroughFl: RShaftThroughShaft): SBaseResponse {
-        return try {
-
-            val isDelete = delete(rFlThroughFl)
-
-            val rShaftThroughShaft = RShaftThroughShaft()
-            rShaftThroughShaft.shaftId = rFlThroughFl.shaftOtherId
-            rShaftThroughShaft.shaftOtherId = rFlThroughFl.shaftId
-            val isDeletes = delete(rShaftThroughShaft)
-            /** 删除成功 */
-            if (isDelete||isDeletes) {
-
-                try {
-                    /** 处理关系标记 */
-                    val listType = ArrayList<String>()
-                    listType.add("sh2sh")
-                    for (type in listType){
-                        val entity = EquipmentService.relationTypeProjectservice.select(SFilter.eq("projectId", Opt.projectId!!), SFilter.eq("relationType", type)).entity()
-                        if (entity!=null){
-                            entity.computationalState = 2
-                            EquipmentService.relationTypeProjectservice.update(entity)
-                        }
-                    }
-                } catch (e: Exception) {
-                    e.printStackTrace()
-                }
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Sh2Sh","12",rFlThroughFl.shaftId!!,rFlThroughFl.shaftOtherId!!)
-                val sBaseResponse = SBaseResponse(SResponseType.success)
-                sBaseResponse.message = rFlThroughFl.toJson()
-                sBaseResponse
-            } else {
-                SBaseResponse(SResponseType.failure)
-            }
-        } catch (e: Exception) {
-            e.printStackTrace()
-            return SBaseResponse(SResponseType.failure, e.message!!)
-        }
-    } // Tenant deletes()
-
-    /**
-     * 创建竖井的贯通关系
-     *
-     * @param   rFloorThroughFloorOtherList    竖井和竖井列表关系对象
-     */
-    fun createShaft(rFloorThroughFloorOtherList: RShaftThroughShaftOtherList): SCreateResponse<RShaftThroughShaft> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-
-            try {
-                delete("floorId = '${rFloorThroughFloorOtherList.shaftId}'")
-                delete("floorOtherId = '${rFloorThroughFloorOtherList.shaftId}'")
-            } catch (e: Exception) {
-                e.printStackTrace()
-            }
-            if (rFloorThroughFloorOtherList.shaftOtherIdList!=null&&rFloorThroughFloorOtherList.shaftOtherIdList!!.isNotEmpty()){
-                for (floorOtherId in rFloorThroughFloorOtherList.shaftOtherIdList!!){
-                    val rFlThroughFl = RShaftThroughShaft()
-                    rFlThroughFl.shaftId = rFloorThroughFloorOtherList.shaftId
-                    rFlThroughFl.shaftOtherId = floorOtherId
-                    rFlThroughFl.projectId = Opt.projectId
-                    val replace = replace(rFlThroughFl)
-                    if (replace){
-                        successList.add(floorOtherId)
-                    }else{
-                        failureList.add(rFlThroughFl)
-                    }
-                }
-                if (successList.size>0){
-                    /** 发送消息 */
-                    rabbitMqService.sendRel(Opt.projectId!!, "Sh2Sh","13",rFloorThroughFloorOtherList.shaftId!!,successList.toJson()!!)
-                    val sCreateResponse = SCreateResponse<RShaftThroughShaft>(SResponseType.success)
-                    if (failureList.size>0){
-                        sCreateResponse.message ="失败对象:"+failureList.toJson()
-                    }
-                    sCreateResponse
-                }else{
-                    SCreateResponse(SResponseType.failure)
-                }
-            }else{
-                SCreateResponse(SResponseType.success)
-            }
-
-        } catch (e: Exception) {
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    } // Tenant createShaft()
-
-
-    /**
-     * 创建竖井的贯通关系
-     *
-     * @param   rFloorThroughFloorOtherList    竖井和竖井列表关系对象
-     */
-    fun createShaftAll(rFloorThroughFloorOtherList: RShaftThroughShaftOtherList): SCreateResponse<RShaftThroughShaft> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-
-
-            if (rFloorThroughFloorOtherList.shaftOtherIdList!=null&&rFloorThroughFloorOtherList.shaftOtherIdList!!.isNotEmpty()){
-                for (floorOtherId in rFloorThroughFloorOtherList.shaftOtherIdList!!){
-                    val rFlThroughFl = RShaftThroughShaft()
-                    rFlThroughFl.shaftId = rFloorThroughFloorOtherList.shaftId
-                    rFlThroughFl.shaftOtherId = floorOtherId
-                    rFlThroughFl.projectId = Opt.projectId
-                    logger.debug("关系= ${rFlThroughFl.toJson()}")
-                    val replace = replace(rFlThroughFl)
-                    if (replace){
-                        successList.add(floorOtherId)
-                    }else{
-                        failureList.add(rFlThroughFl)
-                    }
-                }
-                if (successList.size>0){
-
-                    try {
-                        /** 处理关系标记 */
-                        val listType = ArrayList<String>()
-                        listType.add("sh2sh")
-                        for (type in listType){
-                            val entity = EquipmentService.relationTypeProjectservice.select(SFilter.eq("projectId", Opt.projectId!!), SFilter.eq("relationType", type)).entity()
-                            if (entity!=null){
-                                entity.computationalState = 2
-                                EquipmentService.relationTypeProjectservice.update(entity)
-                            }
-                        }
-                    } catch (e: Exception) {
-                        e.printStackTrace()
-                    }
-
-                    /** 发送消息 */
-                    rabbitMqService.sendRel(Opt.projectId!!, "Sh2Sh","14",rFloorThroughFloorOtherList.shaftId!!,successList.toJson()!!)
-                    val sCreateResponse = SCreateResponse<RShaftThroughShaft>(SResponseType.success)
-                    if (failureList.size>0){
-                        sCreateResponse.message ="失败对象:"+failureList.toJson()
-                    }
-                    sCreateResponse
-                }else{
-                    SCreateResponse(SResponseType.failure)
-                }
-            }else{
-                SCreateResponse(SResponseType.success)
-            }
-
-        } catch (e: Exception) {
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    } // Tenant createShaftAll()
-
-
-}

+ 121 - 121
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RSpInBdService.kt

@@ -45,126 +45,126 @@ import com.persagy.service.models.responses.SCreateResponse
  */
 object RSpInBdService: RService<RSpinBd>(SMybatisDao(RSpinBd::class.java)) {
 
-    /**
-     * 创建业务空间和建筑的关系
-     */
-    fun  spInBdCreates(rSiInSpBase: SCreateRequest<RSpinBd>): SCreateResponse<RSpinBd> {
-        try {
-            val projectId = SPageContext.getHeader("projectId")
-            val contentList = rSiInSpBase.content
-            if (contentList.isNotEmpty()){
-                for (rSpinBd in contentList){
-
-                    if (!rSpinBd.objectType.isNullOrEmpty()){
-                        rSpinBd.projectId = projectId
-                        val insert = insert(rSpinBd)
-                        if (insert){
-                            /** 关系创建成功 */
-                            /** 发送消息 */
-                            rabbitMqService.sendRel(Opt.projectId!!, "Bd2Sp","11",rSpinBd.buildingId!!,rSpinBd.spaceId!!)
-                        }
-                    }else{
-                        val sCreateResponse = SCreateResponse<RSpinBd>(SResponseType.failure)
-                        sCreateResponse.message = "空间类型不能为空"
-                        return  sCreateResponse
-                    }
-                }
-                val sCreateResponse = SCreateResponse<RSpinBd>(SResponseType.success)
-                return sCreateResponse
-            }else{
-                val sCreateResponse = SCreateResponse<RSpinBd>(SResponseType.failure)
-                sCreateResponse.message = "列表不可以为空"
-                return sCreateResponse
-            }
-
-        } catch (e: Exception) {
-            e.printStackTrace()
-            return SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    } // Function spInBdCreates()
-
-
-    /**
-     * 删除业务空间也建筑的关系
-     */
-    fun spInBdDeLs(rSpinBdList: ArrayList<RSpinBd>): SBaseResponse {
-        try {
-            val projectId = SPageContext.getHeader("projectId")
-            if (!rSpinBdList.isNullOrEmpty()){
-                for (rSpinBd in rSpinBdList){
-                    if (!rSpinBd.spaceId.isNullOrEmpty()&&!rSpinBd.buildingId.isNullOrEmpty()){
-                        rSpinBd.projectId = projectId
-                        val delete = delete(rSpinBd)
-                        if (delete){
-                            /** 删除成功 */
-                            /** 发送消息 */
-                           rabbitMqService.sendRel(Opt.projectId!!, "Bd2Sp","12",rSpinBd.buildingId!!,rSpinBd.spaceId!!)
-                        }
-                    }else{
-                        val sBaseResponse = SBaseResponse(SResponseType.failure)
-                        sBaseResponse.message = "spaceId和buildingId 不可以为空"
-                        return sBaseResponse
-                    }
-                }
-                return SBaseResponse(SResponseType.success)
-            }else{
-                val sBaseResponse = SBaseResponse(SResponseType.failure)
-                sBaseResponse.message = "列表不能为空"
-                return sBaseResponse
-            }
-        } catch (e: Exception) {
-            e.printStackTrace()
-            return SBaseResponse(SResponseType.failure, e.message!!)
-        }
-    } // Function spInBdDeLs()
-
-    /**
-     * 修改业务空间所在的建筑
-     */
-    fun spInBdUpdates(request: SUpdateRequest<RSpinBd>): SBaseResponse{
-        try {
-            val projectId = SPageContext.getHeader("projectId")
-            val contentList = request.content
-            if (!contentList.isNullOrEmpty()){
-
-                for (content in contentList){
-                    if (!content.buildingId.isNullOrEmpty()&&!content.spaceId.isNullOrEmpty()&&!content.objectType.isNullOrEmpty()){
-
-                        try {
-                            val delete = delete(SFilter.eq("projectId", projectId!!), SFilter.eq("SpaceId", content.spaceId!!))
-                            if (delete){
-                                /** 删除原始的空间和建筑的数据 */
-
-                            }
-                        } catch (e: Exception) {
-                            e.printStackTrace()
-                        }
-
-                        val insert = insert(content)
-                        if (insert){
-                            /** 添加关系 */
-                            /** 发送消息 */
-                            rabbitMqService.sendRel(Opt.projectId!!, "Bd2Sp","13",content.buildingId!!,content.spaceId!!)
-                        }
-
-                    }else{
-                        val sBaseResponse = SBaseResponse(SResponseType.failure)
-                        sBaseResponse.message = "buildingId、spaceId、objectType 不能为空"
-                        return sBaseResponse
-                    }
-                }
-                return SBaseResponse(SResponseType.success)
-            }else{
-                val sBaseResponse = SBaseResponse(SResponseType.failure)
-                sBaseResponse.message = "列表不能为空"
-                return sBaseResponse
-            }
-
-        } catch (e: Exception) {
-            e.printStackTrace()
-            return SBaseResponse(SResponseType.failure,e.message.toString())
-        }
-
-    } // Function spInBdUpdates()
+//    /**
+//     * 创建业务空间和建筑的关系
+//     */
+//    fun  spInBdCreates(rSiInSpBase: SCreateRequest<RSpinBd>): SCreateResponse<RSpinBd> {
+//        try {
+//            val projectId = SPageContext.getHeader("projectId")
+//            val contentList = rSiInSpBase.content
+//            if (contentList.isNotEmpty()){
+//                for (rSpinBd in contentList){
+//
+//                    if (!rSpinBd.objectType.isNullOrEmpty()){
+//                        rSpinBd.projectId = projectId
+//                        val insert = insert(rSpinBd)
+//                        if (insert){
+//                            /** 关系创建成功 */
+//                            /** 发送消息 */
+//                            rabbitMqService.sendRel(Opt.projectId!!, rSiInSpBase.graphCode!!,rSiInSpBase.type!!,"11",rSpinBd.buildingId!!,rSpinBd.spaceId!!)
+//                        }
+//                    }else{
+//                        val sCreateResponse = SCreateResponse<RSpinBd>(SResponseType.failure)
+//                        sCreateResponse.message = "空间类型不能为空"
+//                        return  sCreateResponse
+//                    }
+//                }
+//                val sCreateResponse = SCreateResponse<RSpinBd>(SResponseType.success)
+//                return sCreateResponse
+//            }else{
+//                val sCreateResponse = SCreateResponse<RSpinBd>(SResponseType.failure)
+//                sCreateResponse.message = "列表不可以为空"
+//                return sCreateResponse
+//            }
+//
+//        } catch (e: Exception) {
+//            e.printStackTrace()
+//            return SCreateResponse(SResponseType.failure,e.message.toString())
+//        }
+//    } // Function spInBdCreates()
+
+
+//    /**
+//     * 删除业务空间也建筑的关系
+//     */
+//    fun spInBdDeLs(rSpinBdList: ArrayList<RSpinBd>): SBaseResponse {
+//        try {
+//            val projectId = SPageContext.getHeader("projectId")
+//            if (!rSpinBdList.isNullOrEmpty()){
+//                for (rSpinBd in rSpinBdList){
+//                    if (!rSpinBd.spaceId.isNullOrEmpty()&&!rSpinBd.buildingId.isNullOrEmpty()){
+//                        rSpinBd.projectId = projectId
+//                        val delete = delete(rSpinBd)
+//                        if (delete){
+//                            /** 删除成功 */
+//                            /** 发送消息 */
+//                           rabbitMqService.sendRel(Opt.projectId!!, "Bd2Sp","12",rSpinBd.buildingId!!,rSpinBd.spaceId!!)
+//                        }
+//                    }else{
+//                        val sBaseResponse = SBaseResponse(SResponseType.failure)
+//                        sBaseResponse.message = "spaceId和buildingId 不可以为空"
+//                        return sBaseResponse
+//                    }
+//                }
+//                return SBaseResponse(SResponseType.success)
+//            }else{
+//                val sBaseResponse = SBaseResponse(SResponseType.failure)
+//                sBaseResponse.message = "列表不能为空"
+//                return sBaseResponse
+//            }
+//        } catch (e: Exception) {
+//            e.printStackTrace()
+//            return SBaseResponse(SResponseType.failure, e.message!!)
+//        }
+//    } // Function spInBdDeLs()
+
+//    /**
+//     * 修改业务空间所在的建筑
+//     */
+//    fun spInBdUpdates(request: SUpdateRequest<RSpinBd>): SBaseResponse{
+//        try {
+//            val projectId = SPageContext.getHeader("projectId")
+//            val contentList = request.content
+//            if (!contentList.isNullOrEmpty()){
+//
+//                for (content in contentList){
+//                    if (!content.buildingId.isNullOrEmpty()&&!content.spaceId.isNullOrEmpty()&&!content.objectType.isNullOrEmpty()){
+//
+//                        try {
+//                            val delete = delete(SFilter.eq("projectId", projectId!!), SFilter.eq("SpaceId", content.spaceId!!))
+//                            if (delete){
+//                                /** 删除原始的空间和建筑的数据 */
+//
+//                            }
+//                        } catch (e: Exception) {
+//                            e.printStackTrace()
+//                        }
+//
+//                        val insert = insert(content)
+//                        if (insert){
+//                            /** 添加关系 */
+//                            /** 发送消息 */
+//                            rabbitMqService.sendRel(Opt.projectId!!, "Bd2Sp","13",content.buildingId!!,content.spaceId!!)
+//                        }
+//
+//                    }else{
+//                        val sBaseResponse = SBaseResponse(SResponseType.failure)
+//                        sBaseResponse.message = "buildingId、spaceId、objectType 不能为空"
+//                        return sBaseResponse
+//                    }
+//                }
+//                return SBaseResponse(SResponseType.success)
+//            }else{
+//                val sBaseResponse = SBaseResponse(SResponseType.failure)
+//                sBaseResponse.message = "列表不能为空"
+//                return sBaseResponse
+//            }
+//
+//        } catch (e: Exception) {
+//            e.printStackTrace()
+//            return SBaseResponse(SResponseType.failure,e.message.toString())
+//        }
+//
+//    } // Function spInBdUpdates()
 
 } // Object RSpInBdService

+ 7 - 7
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RSyEqService.kt

@@ -61,7 +61,7 @@ object RSyEqService : RService<RSyEq>(SMybatisDao(RSyEq::class.java)) {
             val isInsert = replace(rSyEq)
             if (isInsert){
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "SystemEquip","11",rSyEq.sysId!!,rSyEq.equipId!!)
+                rabbitMqService.sendRel(Opt.projectId!!, null,"SystemEquip","11",rSyEq.sysId!!,rSyEq.equipId!!)
                 SCreateResponse(SResponseType.success)
             }else{
                 SCreateResponse(SResponseType.failure)
@@ -104,7 +104,7 @@ object RSyEqService : RService<RSyEq>(SMybatisDao(RSyEq::class.java)) {
                     sBaseResponse.message = rSyEq.toJson()
                     try {
                         /** 发送消息 */
-                        rabbitMqService.sendRel(Opt.projectId!!, "SystemEquip","12",rSyEq.sysId!!,rSyEq.equipId!!)
+                        rabbitMqService.sendRel(Opt.projectId!!,null, "SystemEquip","12",rSyEq.sysId!!,rSyEq.equipId!!)
                     } catch (e: Exception) {
                         e.printStackTrace()
                     }
@@ -151,7 +151,7 @@ object RSyEqService : RService<RSyEq>(SMybatisDao(RSyEq::class.java)) {
 
                     try {
                         /** 发送消息 */
-                        rabbitMqService.sendRel(Opt.projectId!!, "SystemEquip","13",rSyEqList.sysId!!,successList.toJson()!!)
+                        rabbitMqService.sendRel(Opt.projectId!!, null,"SystemEquip","13",rSyEqList.sysId!!,successList.toJson()!!)
                     } catch (e: Exception) {
                         e.printStackTrace()
                     }
@@ -208,7 +208,7 @@ object RSyEqService : RService<RSyEq>(SMybatisDao(RSyEq::class.java)) {
                 if (successList.size>0){
                     try {
                         /** 发送消息 */
-                        rabbitMqService.sendRel(Opt.projectId!!, "SystemEquip","13",rSyEqList.equipId!!,successList.toJson()!!)
+                        rabbitMqService.sendRel(Opt.projectId!!, null,"SystemEquip","13",rSyEqList.equipId!!,successList.toJson()!!)
                     } catch (e: Exception) {
                         e.printStackTrace()
                     }
@@ -260,7 +260,7 @@ object RSyEqService : RService<RSyEq>(SMybatisDao(RSyEq::class.java)) {
                 if (successList.size>0){
                     try {
                         /** 发送消息 */
-                        rabbitMqService.sendRel(Opt.projectId!!, "SystemEquip","14",rSyEqList.sysId!!,successList.toJson()!!)
+                        rabbitMqService.sendRel(Opt.projectId!!,null, "SystemEquip","14",rSyEqList.sysId!!,successList.toJson()!!)
                     } catch (e: Exception) {
                         e.printStackTrace()
                     }
@@ -321,7 +321,7 @@ object RSyEqService : RService<RSyEq>(SMybatisDao(RSyEq::class.java)) {
         try {
             for (rSyEq in entityList){
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "SystemEquip","11",rSyEq.sysId!!,rSyEq.equipId!!)
+                rabbitMqService.sendRel(Opt.projectId!!,null, "SystemEquip","11",rSyEq.sysId!!,rSyEq.equipId!!)
             }
         } catch (e: Exception) {
             e.printStackTrace()
@@ -336,7 +336,7 @@ object RSyEqService : RService<RSyEq>(SMybatisDao(RSyEq::class.java)) {
         try {
             for (rSyEq in entityList){
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "SystemEquip","12",rSyEq.sysId!!,rSyEq.equipId!!)
+                rabbitMqService.sendRel(Opt.projectId!!, null,"SystemEquip","12",rSyEq.sysId!!,rSyEq.equipId!!)
             }
         } catch (e: Exception) {
             e.printStackTrace()

+ 0 - 182
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RSyForBdService.kt

@@ -1,182 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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.RBdForSyList
-import com.persagy.server.datacenter.models.entities.rel.RSyForBd
-import com.persagy.server.datacenter.models.entities.rel.RSyForBdList
-import com.persagy.server.datacenter.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 RSyForBdService: RService<RSyForBd>(SMybatisDao(RSyForBd::class.java)){
-
-    /**
-     * 创建系统服务于建筑关系
-     *
-     * @param   rSyForBd    系统服务于建筑关系对象
-     */
-    fun create(rSyForBd: RSyForBd): SCreateResponse<RSyForBd> {
-        return try {
-            val projectId = SPageContext.getHeader("projectId")
-            rSyForBd.projectId = projectId
-            val isInsert = insert(rSyForBd)
-            if (isInsert){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2bd_for","11",rSyForBd.sysId!!,rSyForBd.buildingId!!)
-                SCreateResponse(SResponseType.success)
-            }else{
-                SCreateResponse(SResponseType.failure)
-            }
-        } catch (e: Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    } //Function create()
-
-    /**
-     * 根据对象删除
-     *
-     * @param    rSyForBd     关系对象实例
-     * @return
-     */
-    fun deletes(rSyForBd: RSyForBd): SBaseResponse {
-        return try {
-            val isDelete = delete(rSyForBd)
-            /** 删除成功 */
-            if (isDelete) {
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2bd_for","12",rSyForBd.sysId!!,rSyForBd.buildingId!!)
-                val sBaseResponse = SBaseResponse(SResponseType.success)
-                sBaseResponse.message = rSyForBd.toJson()
-                sBaseResponse
-            } else {
-                SBaseResponse(SResponseType.failure)
-            }
-        } catch (e: Exception) {
-            e.printStackTrace()
-            return SBaseResponse(SResponseType.failure, e.message!!)
-        }
-    } // Function deletes()
-
-    /**
-     * 创建系统服务于建筑关系
-     *
-     * @param    rSyForBdList     系统和建筑关系的对象列表
-     */
-    fun createSy(rSyForBdList: RSyForBdList): SCreateResponse<RSyForBd> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            delete("sysId= '${rSyForBdList.sysId}'")
-            val projectId = SPageContext.getHeader("projectId")
-            for (buildingId in rSyForBdList.buildingIdList!!){
-                val rSyForBd = RSyForBd()
-                rSyForBd.sysId = rSyForBdList.sysId
-                rSyForBd.buildingId = buildingId
-                rSyForBd.projectId = projectId
-                val replace = replace(rSyForBd)
-                if (replace){
-                    successList.add(buildingId)
-                }else{
-                    failureList.add(rSyForBd)
-                }
-            }
-            if (successList.size>0){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2bd_for","13",rSyForBdList.sysId!!,successList.toJson()!!)
-                val sCreateResponse = SCreateResponse<RSyForBd>(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    rBdForSyList    系统和建筑关系的对象列表
-     */
-    fun createsBd(rBdForSyList: RBdForSyList): SCreateResponse<RSyForBd> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            delete("buildingId = '${rBdForSyList.buildingId}'")
-            for (sysId in rBdForSyList.sysIdList!!){
-                val rSyForBd = RSyForBd()
-                rSyForBd.buildingId = rBdForSyList.buildingId
-                rSyForBd.sysId = sysId
-                rSyForBd.projectId = Opt.projectId
-                val replace = replace(rSyForBd)
-                if (replace){
-                    successList.add(sysId)
-                }else{
-                    failureList.add(rSyForBd)
-                }
-            }
-            if (successList.size>0){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2bd_for","13",rBdForSyList.buildingId!!,successList.toJson()!!)
-                if (failureList.size>0){
-                    val sCreateResponse = SCreateResponse<RSyForBd>(SResponseType.success)
-                    sCreateResponse.message ="失败对象:"+failureList.toJson()
-                    sCreateResponse
-                }else{
-                    val sCreateResponse = SCreateResponse<RSyForBd>(SResponseType.success)
-                    sCreateResponse
-                }
-            }else{
-                SCreateResponse(SResponseType.failure)
-            }
-        } catch (e:Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    } // Function createsBd()
-
-}

+ 0 - 182
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RSyForFlService.kt

@@ -1,182 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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.RFlForSyList
-import com.persagy.server.datacenter.models.entities.rel.RSyForFl
-import com.persagy.server.datacenter.models.entities.rel.RSyForFlList
-import com.persagy.server.datacenter.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 RSyForFlService: RService<RSyForFl>(SMybatisDao(RSyForFl::class.java)){
-
-    /**
-     * 创建系统服务于楼层关系
-     *
-     * @param   rSyForFl    系统服务于楼层关系对象
-     */
-    fun create(rSyForFl: RSyForFl):SCreateResponse<RSyForFl> {
-        return try {
-
-            rSyForFl.projectId = Opt.projectId
-            val isInsert = insert(rSyForFl)
-            if(isInsert){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2fl_for","11",rSyForFl.sysId!!,rSyForFl.floorId!!)
-                SCreateResponse(SResponseType.success)
-            }else{
-                SCreateResponse(SResponseType.failure)
-            }
-        } catch (e: Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure, e.message.toString())
-        }
-    } // Function create()
-
-    /**
-     * 根据对象删除
-     *
-     * @param    rSyForFl    关系对象实例
-     * @return
-     */
-    fun deletes(rSyForFl: RSyForFl): SBaseResponse {
-        return try {
-            val isDelete = delete(rSyForFl)
-            /** 删除成功 */
-            if (isDelete){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2fl_for","12",rSyForFl.sysId!!,rSyForFl.floorId!!)
-                val sBaseResponse = SBaseResponse(SResponseType.success)
-                sBaseResponse.message = rSyForFl.toJson()
-                sBaseResponse
-            }else{
-                SBaseResponse(SResponseType.failure)
-            }
-        } catch (e: Exception){
-            e.printStackTrace()
-            SBaseResponse(SResponseType.failure, e.message!!)
-        }
-    } // Function deletes()
-
-    /**
-     * 创建系统服务于楼层关系
-     *
-     * @param    rSyForFlList    系统和楼层关系的对象列表
-     */
-    fun createSy(rSyForFlList: RSyForFlList): SCreateResponse<RSyForFl> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            delete("sysId = '${rSyForFlList.sysId}'")
-            val projectId = SPageContext.getHeader("projectId")
-            for (floorId in rSyForFlList.floorIdList!!){
-                val rSyForFl = RSyForFl()
-                rSyForFl.sysId = rSyForFlList.sysId
-                rSyForFl.floorId = floorId
-                rSyForFl.projectId = projectId
-                val replace = replace(rSyForFl)
-                if (replace){
-                    successList.add(floorId)
-                }else{
-                    failureList.add(rSyForFl)
-                }
-            }
-            if(successList.size > 0){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2fl_for","13",rSyForFlList.sysId!!,successList.toJson()!!)
-                val sCreateResponse = SCreateResponse<RSyForFl>(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   rSyForFlList    系统和楼层对应关系列表
-     */
-    fun createsFl(rSyForFlList: RFlForSyList): SCreateResponse<RSyForFl> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            delete("floorId = '${rSyForFlList.floorId}'")
-            for (sysId in rSyForFlList.sysIdList!!){
-                val rSyForFl = RSyForFl()
-                rSyForFl.floorId = rSyForFlList.floorId
-                rSyForFl.sysId = sysId
-                rSyForFl.projectId = Opt.projectId
-                val replace = replace(rSyForFl)
-                if (replace){
-                    successList.add(sysId)
-                }else{
-                    failureList.add(rSyForFl)
-                }
-            }
-            if (successList.size > 0 ){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2fl_for","13",rSyForFlList.floorId!!,successList.toJson()!!)
-                if (failureList.size > 0){
-                    val sCreateResponse = SCreateResponse<RSyForFl>(SResponseType.success)
-                    sCreateResponse.message = "失败对象" + failureList.toJson()
-                    sCreateResponse
-                }else{
-                    val sCreateResponse = SCreateResponse<RSyForFl>(SResponseType.failure)
-                    sCreateResponse
-                }
-            }else{
-                SCreateResponse(SResponseType.failure)
-            }
-        }catch (e:Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure, e.message.toString())
-        }
-    } // Function createsFl()
-
-}

+ 0 - 181
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RSyForShService.kt

@@ -1,181 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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.RShForSyList
-import com.persagy.server.datacenter.models.entities.rel.RSyForSh
-import com.persagy.server.datacenter.models.entities.rel.RSyForShList
-import com.persagy.server.datacenter.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 RSyForShService: RService<RSyForSh>(SMybatisDao(RSyForSh::class.java)) {
-    /**
-     * 创建系统服务于竖井关系
-     *
-     * @param   rSyForSh    系统服务于竖井关系对象
-     */
-    fun create(rSyForSh: RSyForSh): SCreateResponse<RSyForSh> {
-        return try {
-            val projectId = SPageContext.getHeader("projectId")
-            rSyForSh.projectId = projectId
-            val isInsert = insert(rSyForSh)
-            if(isInsert){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2sh_for","11",rSyForSh.sysId!!,rSyForSh.shaftId!!)
-                SCreateResponse(SResponseType.success)
-            }else{
-                SCreateResponse(SResponseType.failure)
-            }
-        } catch (e: Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure, e.message.toString())
-        }
-    } // Function create()
-
-    /**
-     * 根据对象删除
-     *
-     * @param    rSyForSh    关系对象实例
-     * @return
-     */
-    fun deletes(rSyForSh: RSyForSh): SBaseResponse {
-        return try {
-            val isDelete = delete(rSyForSh)
-            /** 删除成功 */
-            if (isDelete){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2sh_for","12",rSyForSh.sysId!!,rSyForSh.shaftId!!)
-                val sBaseResponse = SBaseResponse(SResponseType.success)
-                sBaseResponse.message = rSyForSh.toJson()
-                sBaseResponse
-            }else{
-                SBaseResponse(SResponseType.failure)
-            }
-        } catch (e: Exception){
-            e.printStackTrace()
-            SBaseResponse(SResponseType.failure, e.message!!)
-        }
-    } // Function deletes()
-
-    /**
-     * 创建系统服务于竖井关系
-     *
-     * @param    rSyForShList    系统和竖井关系的对象列表
-     */
-    fun createSy(rSyForShList: RSyForShList): SCreateResponse<RSyForSh> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            delete("sysId = '${rSyForShList.sysId}'")
-            val projectId = SPageContext.getHeader("projectId")
-            for (shaftId in rSyForShList.shaftIdList!!){
-                val rSyForSh = RSyForSh()
-                rSyForSh.sysId = rSyForShList.sysId
-                rSyForSh.shaftId = shaftId
-                rSyForSh.projectId = projectId
-                val replace = replace(rSyForSh)
-                if (replace){
-                    successList.add(shaftId)
-                }else{
-                    failureList.add(rSyForSh)
-                }
-            }
-            if(successList.size > 0){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2sh_for","13",rSyForShList.sysId!!,successList.toJson())
-                val sCreateResponse = SCreateResponse<RSyForSh>(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   rSyForShList    系统和竖井对应关系列表
-     */
-    fun createsSh(rSyForShList: RShForSyList): SCreateResponse<RSyForSh> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            delete("shaftId = '${rSyForShList.shaftId}'")
-            for (sysId in rSyForShList.sysIdList!!){
-                val rSyForSh = RSyForSh()
-                rSyForSh.shaftId = rSyForShList.shaftId
-                rSyForSh.sysId = sysId
-                rSyForSh.projectId = Opt.projectId
-                val replace = replace(rSyForSh)
-                if (replace){
-                    successList.add(sysId)
-                }else{
-                    failureList.add(rSyForSh)
-                }
-            }
-            if (successList.size > 0 ){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2sh_for","13",rSyForShList.shaftId!!,successList.toJson())
-                if (failureList.size > 0){
-                    val sCreateResponse = SCreateResponse<RSyForSh>(SResponseType.success)
-                    sCreateResponse.message = "失败对象" + failureList.toJson()
-                    sCreateResponse
-                }else{
-                    val sCreateResponse = SCreateResponse<RSyForSh>(SResponseType.failure)
-                    sCreateResponse
-                }
-            }else{
-                SCreateResponse(SResponseType.failure)
-            }
-        }catch (e:Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure, e.message.toString())
-        }
-    } // Function createsFl()
-
-}

+ 0 - 212
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RSyForSpBaseService.kt

@@ -1,212 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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.services.rel
-
-import com.persagy.base.extensions.toJson
-import com.persagy.database.SFilter
-import com.persagy.mybatis.SMybatisDao
-import com.persagy.server.Opt
-import com.persagy.server.datacenter.models.entities.rel.RSpForSyBaseList
-import com.persagy.server.datacenter.models.entities.rel.RSyForSpBase
-import com.persagy.server.datacenter.models.entities.rel.RSyForSpBaseList
-import com.persagy.server.datacenter.services.base.RService
-import com.persagy.server.datacenter.services.objects.ZoneSpaceBaseService
-import com.persagy.server.datacenter.wanda.rel.RSy2Sp
-import com.persagy.service.SObjectService
-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 RSyForSpBaseService: RService<RSyForSpBase>(SMybatisDao(RSyForSpBase::class.java)) {
-
-    var rSy2SpService = SObjectService(SMybatisDao( RSy2Sp::class.java))
-    /**
-     * 创建系统服务于业务空间关系
-     *
-     * @param   rSyForSpBase    系统服务于业务空间关系对象
-     */
-    fun create(rSyForSpBase: RSyForSpBase): SCreateResponse<RSyForSpBase> {
-        return try {
-            val projectId = SPageContext.getHeader("projectId")
-            rSyForSpBase.projectId = projectId
-            val rSy2Sp = RSy2Sp()
-            rSy2Sp.id1 = rSyForSpBase.sysId
-            rSy2Sp.id2 = rSyForSpBase.spaceId
-            rSy2Sp.zoneType = rSyForSpBase.objectType
-            rSy2Sp.sign = 1
-            rSy2Sp.projectId = projectId
-            rSy2Sp.type = "sy2sp_for"
-            val isInsert = rSy2SpService.insert(rSy2Sp)
-            if (isInsert){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2sp_for","11",rSyForSpBase.sysId!!,rSyForSpBase.spaceId!!)
-                SCreateResponse(SResponseType.success)
-            }else{
-                SCreateResponse(SResponseType.failure)
-            }
-        } catch (e: Exception) {
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    } // Function create()
-
-    /**
-     * 根据对象删除
-     *
-     * @param   rSyForSpBase    关系对象实例
-     * @return
-     */
-    fun deletes(rSyForSpBase: RSyForSpBase): SBaseResponse {
-        return try {
-            val projectId = SPageContext.getHeader("projectId")
-            val entity = ZoneSpaceBaseService.select(SFilter.eq("projectId", projectId!!), SFilter.eq("id", rSyForSpBase.spaceId!!)).entity()
-            val rSy2Sp = RSy2Sp()
-            rSy2Sp.id1 = rSyForSpBase.sysId
-            rSy2Sp.id2 = rSyForSpBase.spaceId
-            rSy2Sp.projectId = projectId
-            rSy2Sp.type = "sy2sp_for"
-            rSy2Sp.zoneType = entity!!.classCode
-            val isDelete = rSy2SpService.delete(rSy2Sp)
-            /** 删除成功 */
-            if (isDelete) {
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2sp_for","12",rSyForSpBase.sysId!!,rSyForSpBase.spaceId!!)
-                val sBaseResponse = SBaseResponse(SResponseType.success)
-                sBaseResponse.message = rSyForSpBase.toJson()
-                sBaseResponse
-            } else {
-                SBaseResponse(SResponseType.failure)
-            }
-        } catch (e: Exception) {
-            e.printStackTrace()
-            return SBaseResponse(SResponseType.failure, e.message!!)
-        }
-    } // Function deletes()
-
-    /**
-     * 创建系统服务于业务空间关系
-     *
-     * @param   rSyForSpBaseList    系统服务于业务空间关系对象列表
-     */
-    fun createSy(rSyForSpBaseList: RSyForSpBaseList): SCreateResponse<RSyForSpBase> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            rSy2SpService.delete("id1 = '${rSyForSpBaseList.sysId}'")
-            val projectId = SPageContext.getHeader("projectId")
-            for (spaceId in rSyForSpBaseList.spaceIdList!!){
-                val entity = ZoneSpaceBaseService.select(SFilter.eq("projectId", projectId!!), SFilter.eq("id", spaceId)).entity()
-                val rSy2Sp = RSy2Sp()
-                rSy2Sp.id1 = rSyForSpBaseList.sysId
-                rSy2Sp.id2 = spaceId
-                rSy2Sp.zoneType = entity!!.classCode
-                rSy2Sp.sign = 1
-                rSy2Sp.projectId = projectId
-                rSy2Sp.type = "sy2sp_for"
-                val replace = rSy2SpService.replace(rSy2Sp)
-                if (replace){
-                    successList.add(rSy2Sp)
-                }else{
-                    failureList.add(rSy2Sp)
-                }
-            }
-            if (successList.size>0){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2sp_for","13",rSyForSpBaseList.sysId!!,successList.toJson())
-                val sCreateResponse = SCreateResponse<RSyForSpBase>(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   rSyForSpBaseList    服务于业务空间的系统关系对象列表
-     */
-    fun createsSp(rSyForSpBaseList: RSpForSyBaseList): SCreateResponse<RSyForSpBase> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            val projectId = SPageContext.getHeader("projectId")
-            rSy2SpService.delete("id2 = '${rSyForSpBaseList.spaceId}'")
-            val entity = ZoneSpaceBaseService.select(SFilter.eq("projectId", projectId!!), SFilter.eq("id", rSyForSpBaseList.spaceId!!)).entity()
-
-            for (sysId in rSyForSpBaseList.sysIdList!!){
-                val rSy2Sp = RSy2Sp()
-                rSy2Sp.id2 = rSyForSpBaseList.spaceId
-                rSy2Sp.id1 = sysId
-                rSy2Sp.projectId = projectId
-                rSy2Sp.zoneType = entity!!.classCode
-                rSy2Sp.sign = 1
-                rSy2Sp.type = "sy2sp_for"
-                val replace = rSy2SpService.replace(rSy2Sp)
-                if (replace){
-                    successList.add(rSy2Sp)
-                }else{
-                    failureList.add(rSy2Sp)
-                }
-            }
-            if (successList.size>0){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2sp_for","13",rSyForSpBaseList.spaceId!!,successList.toJson())
-                if (failureList.size>0){
-                    val sCreateResponse = SCreateResponse<RSyForSpBase>(SResponseType.success)
-                    sCreateResponse.message ="失败对象:"+failureList.toJson()
-                    sCreateResponse
-                }else{
-                    val sCreateResponse = SCreateResponse<RSyForSpBase>(SResponseType.success)
-                    sCreateResponse
-                }
-            }else{
-                SCreateResponse(SResponseType.failure)
-            }
-        } catch (e:Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    } // Function createsSp()
-
-} // Object RSyForSpBaseService

+ 5 - 5
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RSyInBdService.kt

@@ -57,7 +57,7 @@ object RSyInBdService: RService<RSyInBd>(SMybatisDao(RSyInBd::class.java)) {
             val isInsert = insert(rSyInBd)
             if (isInsert){
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2bd_in","11",rSyInBd.sysId!!,rSyInBd.buildingId!!)
+                rabbitMqService.sendRel(Opt.projectId!!, null,"sy2bd_in","11",rSyInBd.sysId!!,rSyInBd.buildingId!!)
                 SCreateResponse(SResponseType.success)
             }else{
                 SCreateResponse(SResponseType.failure)
@@ -80,7 +80,7 @@ object RSyInBdService: RService<RSyInBd>(SMybatisDao(RSyInBd::class.java)) {
             /** 删除成功 */
             if (isDelete) {
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2bd_in","12",rSyInBd.sysId!!,rSyInBd.buildingId!!)
+                rabbitMqService.sendRel(Opt.projectId!!, null,"sy2bd_in","12",rSyInBd.sysId!!,rSyInBd.buildingId!!)
                 val sBaseResponse = SBaseResponse(SResponseType.success)
                 sBaseResponse.message = rSyInBd.toJson()
                 sBaseResponse
@@ -121,7 +121,7 @@ object RSyInBdService: RService<RSyInBd>(SMybatisDao(RSyInBd::class.java)) {
                 }
                 if (successList.size>0){
                     /** 发送消息 */
-                    rabbitMqService.sendRel(Opt.projectId!!, "sy2bd_in","13",rSyInBdList.sysId!!,successList.toJson())
+                    rabbitMqService.sendRel(Opt.projectId!!, null,"sy2bd_in","13",rSyInBdList.sysId!!,successList.toJson())
                     val sCreateResponse = SCreateResponse<RSyInBd>(SResponseType.success)
                     if (failureList.size>0){
                         sCreateResponse.message ="失败对象:"+failureList.toJson()
@@ -165,7 +165,7 @@ object RSyInBdService: RService<RSyInBd>(SMybatisDao(RSyInBd::class.java)) {
             }
             if (successList.size>0){
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2bd_in","14",rSyInBdList.sysId!!,successList.toJson()!!)
+                rabbitMqService.sendRel(Opt.projectId!!, null,"sy2bd_in","14",rSyInBdList.sysId!!,successList.toJson()!!)
                 val sCreateResponse = SCreateResponse<RSyInBd>(SResponseType.success)
                 if (failureList.size>0){
                     sCreateResponse.message ="失败对象:"+failureList.toJson()
@@ -207,7 +207,7 @@ object RSyInBdService: RService<RSyInBd>(SMybatisDao(RSyInBd::class.java)) {
             }
             if (successList.size>0){
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2bd_in","13",rBdInSyList.buildingId!!,successList.toJson()!!)
+                rabbitMqService.sendRel(Opt.projectId!!, null,"sy2bd_in","13",rBdInSyList.buildingId!!,successList.toJson()!!)
                 if (failureList.size>0){
                     val sCreateResponse = SCreateResponse<RSyInBd>(SResponseType.success)
                     sCreateResponse.message ="失败对象:"+failureList.toJson()

+ 5 - 5
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RSyInFlService.kt

@@ -65,7 +65,7 @@ object RSyInFlService: RService<RSyInFl>(SMybatisDao(RSyInFl::class.java)) {
             val isInsert = insert(rSyInFl)
             if (isInsert){
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2fl","11",rSyInFl.sysId!!,rSyInFl.floorId!!)
+                rabbitMqService.sendRel(Opt.projectId!!, null,"sy2fl","11",rSyInFl.sysId!!,rSyInFl.floorId!!)
                 SCreateResponse(SResponseType.success)
             }else{
                 SCreateResponse(SResponseType.failure)
@@ -88,7 +88,7 @@ object RSyInFlService: RService<RSyInFl>(SMybatisDao(RSyInFl::class.java)) {
             /** 删除成功 */
             if (isDelete) {
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2fl","12",rSyInFl.sysId!!,rSyInFl.floorId!!)
+                rabbitMqService.sendRel(Opt.projectId!!,null, "sy2fl","12",rSyInFl.sysId!!,rSyInFl.floorId!!)
                 val sBaseResponse = SBaseResponse(SResponseType.success)
                 sBaseResponse.message = rSyInFl.toJson()
                 sBaseResponse
@@ -136,7 +136,7 @@ object RSyInFlService: RService<RSyInFl>(SMybatisDao(RSyInFl::class.java)) {
                 }
                 if (successList.size>0){
                     /** 发送消息 */
-                    rabbitMqService.sendRel(Opt.projectId!!, "sy2fl","13",rSyInFlList.sysId!!,successList.toJson())
+                    rabbitMqService.sendRel(Opt.projectId!!, null,"sy2fl","13",rSyInFlList.sysId!!,successList.toJson())
                     val sCreateResponse = SCreateResponse<RSyInFl>(SResponseType.success)
                     if (failureList.size>0){
                         sCreateResponse.message ="失败对象:"+failureList.toJson()
@@ -190,7 +190,7 @@ object RSyInFlService: RService<RSyInFl>(SMybatisDao(RSyInFl::class.java)) {
             }
             if (successList.size>0){
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2fl","14",rSyInFlList.sysId!!,successList.toJson())
+                rabbitMqService.sendRel(Opt.projectId!!,null, "sy2fl","14",rSyInFlList.sysId!!,successList.toJson())
                 val sCreateResponse = SCreateResponse<RSyInFl>(SResponseType.success)
                 if (failureList.size>0){
                     sCreateResponse.message ="失败对象:"+failureList.toJson()
@@ -240,7 +240,7 @@ object RSyInFlService: RService<RSyInFl>(SMybatisDao(RSyInFl::class.java)) {
             }
             if (successList.size>0){
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sy2fl","13",rFlInSyList.floorId!!,successList.toJson())
+                rabbitMqService.sendRel(Opt.projectId!!,null, "sy2fl","13",rFlInSyList.floorId!!,successList.toJson())
                 if (failureList.size>0){
                     val sCreateResponse = SCreateResponse<RSyInFl>(SResponseType.success)
                     sCreateResponse.message ="失败对象:"+failureList.toJson()

+ 8 - 8
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RSyInShService.kt

@@ -57,7 +57,7 @@ object RSyInShService: RService<RSyInSh>(SMybatisDao(RSyInSh::class.java)) {
             val isInsert = insert(rSyInSh)
             if (isInsert){
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Sy2Sh","11",rSyInSh.sysId!!,rSyInSh.shaftId!!)
+                rabbitMqService.sendRel(Opt.projectId!!,null, "Sy2Sh","11",rSyInSh.sysId!!,rSyInSh.shaftId!!)
                 SCreateResponse(SResponseType.success)
             }else{
                 SCreateResponse(SResponseType.failure)
@@ -80,7 +80,7 @@ object RSyInShService: RService<RSyInSh>(SMybatisDao(RSyInSh::class.java)) {
             /** 删除成功 */
             if (isDelete) {
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Sy2Sh","12",rSyInSh.sysId!!,rSyInSh.shaftId!!)
+                rabbitMqService.sendRel(Opt.projectId!!,null, "Sy2Sh","12",rSyInSh.sysId!!,rSyInSh.shaftId!!)
                 val sBaseResponse = SBaseResponse(SResponseType.success)
                 sBaseResponse.message = rSyInSh.toJson()
                 sBaseResponse
@@ -120,7 +120,7 @@ object RSyInShService: RService<RSyInSh>(SMybatisDao(RSyInSh::class.java)) {
             }
             if (successList.size>0){
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Sy2Sh","13",rSyInShList.sysId!!,successList.toJson())
+                rabbitMqService.sendRel(Opt.projectId!!, null,"Sy2Sh","13",rSyInShList.sysId!!,successList.toJson())
                 val sCreateResponse = SCreateResponse<RSyInSh>(SResponseType.success)
                 if (failureList.size>0){
                     sCreateResponse.message ="失败对象:"+failureList.toJson()
@@ -162,7 +162,7 @@ object RSyInShService: RService<RSyInSh>(SMybatisDao(RSyInSh::class.java)) {
             }
             if (successList.size>0){
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Sy2Sh","13",rShInSyList.shaftId!!,successList.toJson())
+                rabbitMqService.sendRel(Opt.projectId!!,null, "Sy2Sh","13",rShInSyList.shaftId!!,successList.toJson())
                 if (failureList.size>0){
                     val sCreateResponse = SCreateResponse<RSyInSh>(SResponseType.success)
                     sCreateResponse.message ="失败对象:"+failureList.toJson()
@@ -206,7 +206,7 @@ object RSyInShService: RService<RSyInSh>(SMybatisDao(RSyInSh::class.java)) {
             }
             if (successList.size>0){
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Sy2Sh","14",rShInSyList.shaftId!!,successList.toJson())
+                rabbitMqService.sendRel(Opt.projectId!!, null,"Sy2Sh","14",rShInSyList.shaftId!!,successList.toJson())
                 if (failureList.size>0){
                     val sCreateResponse = SCreateResponse<RSyInSh>(SResponseType.success)
                     sCreateResponse.message ="失败对象:"+failureList.toJson()
@@ -250,7 +250,7 @@ object RSyInShService: RService<RSyInSh>(SMybatisDao(RSyInSh::class.java)) {
             }
             if (successList.size>0){
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Sy2Sh","14",rSyInShList.sysId!!,successList.toJson())
+                rabbitMqService.sendRel(Opt.projectId!!, null,"Sy2Sh","14",rSyInShList.sysId!!,successList.toJson())
                 val sCreateResponse = SCreateResponse<RSyInSh>(SResponseType.success)
                 if (failureList.size>0){
                     sCreateResponse.message ="失败对象:"+failureList.toJson()
@@ -272,7 +272,7 @@ object RSyInShService: RService<RSyInSh>(SMybatisDao(RSyInSh::class.java)) {
         super.onCreateSuccess(entityList)
         for (rSyInSh in entityList){
             /** 发送消息 */
-            rabbitMqService.sendRel(Opt.projectId!!, "Sy2Sh","11",rSyInSh.sysId!!,rSyInSh.shaftId!!)
+            rabbitMqService.sendRel(Opt.projectId!!,null, "Sy2Sh","11",rSyInSh.sysId!!,rSyInSh.shaftId!!)
         }
 
     } // Function onCreateSuccess()
@@ -285,7 +285,7 @@ object RSyInShService: RService<RSyInSh>(SMybatisDao(RSyInSh::class.java)) {
         val projectId = SPageContext.getHeader("projectId")
         for (rSyInSh in entityList){
             /** 发送消息 */
-            rabbitMqService.sendRel(Opt.projectId!!, "Sy2Sh","12",rSyInSh.sysId!!,rSyInSh.shaftId!!)
+            rabbitMqService.sendRel(Opt.projectId!!,null, "Sy2Sh","12",rSyInSh.sysId!!,rSyInSh.shaftId!!)
         }
     } // Function onDeleteSuccess()
 

+ 0 - 344
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RSyInSpBaseService.kt

@@ -1,344 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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.services.rel
-
-import com.persagy.base.extensions.toJson
-import com.persagy.database.SFilter
-import com.persagy.mybatis.SMybatisDao
-import com.persagy.server.Opt
-import com.persagy.server.datacenter.models.entities.rel.RSpInSyBaseList
-import com.persagy.server.datacenter.models.entities.rel.RSyInSpBase
-import com.persagy.server.datacenter.models.entities.rel.RSyInSpBaseList
-import com.persagy.server.datacenter.services.base.RService
-import com.persagy.server.datacenter.services.objects.EquipmentService
-import com.persagy.server.datacenter.services.objects.ZoneSpaceBaseService
-import com.persagy.server.datacenter.wanda.rel.RSy2Sp
-import com.persagy.service.SObjectService
-import com.persagy.service.SPageContext
-import com.persagy.service.models.enums.SResponseType
-import com.persagy.service.models.requests.SCreateRequest
-import com.persagy.service.models.responses.SBaseResponse
-import com.persagy.service.models.responses.SCreateResponse
-
-/**
- * 系统所在业务空间关系服务
- *
- * @author 付国宝
- */
-object RSyInSpBaseService: RService<RSyInSpBase>(SMybatisDao(RSyInSpBase::class.java)) {
-
-    private var rSy2SpService = SObjectService(SMybatisDao(RSy2Sp::class.java))
-    /**
-     * 创建系统所在业务空间关系
-     *
-     * @param   rSyInSpBaseList    系统所在业务空间关系对象
-     */
-    fun create(rSyInSpBaseList: SCreateRequest<RSyInSpBase>): SCreateResponse<RSyInSpBase> {
-        return try {
-            val projectId = SPageContext.getHeader("projectId")
-            for (rSyInSpBase in rSyInSpBaseList.content){
-                val rSy2Sp = RSy2Sp()
-                rSy2Sp.id1 = rSyInSpBase.sysId
-                rSy2Sp.id2 = rSyInSpBase.spaceId
-                rSy2Sp.sign = 1
-                rSy2Sp.zoneType = rSyInSpBase.objectType
-                rSy2Sp.type = "sy2sp"
-                rSy2Sp.projectId = projectId
-                val isInsert = rSy2SpService.insert(rSy2Sp)
-                if (isInsert){
-                    /** 发送消息 */
-                    rabbitMqService.sendRel(Opt.projectId!!, "Sy2Sp","11",rSyInSpBase.sysId!!,rSyInSpBase.spaceId!!)
-                }
-            }
-            try {
-                /** 处理关系标记 */
-                val listType = ArrayList<String>()
-                listType.add("sh2bd")
-                listType.add("eq2sh")
-                for (type in listType){
-                    val entity = EquipmentService.relationTypeProjectservice.select(SFilter.eq("projectId", projectId!!), SFilter.eq("relationType", type)).entity()
-                    if (entity!=null){
-                        entity.computationalState = 2
-                        EquipmentService.relationTypeProjectservice.update(entity)
-                    }
-                }
-            } catch (e: Exception) {
-                e.printStackTrace()
-            }
-            val sCreateResponse = SCreateResponse<RSyInSpBase>(SResponseType.success)
-            sCreateResponse
-        } catch (e: Exception) {
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    } // Function create()
-
-    /**
-     * 根据对象删除
-     *
-     * @param   rSyInSpBaseList    关系对象实例
-     * @return
-     */
-    fun deletes(type: String, rSyInSpBaseList: ArrayList<RSyInSpBase>): SBaseResponse {
-        return try {
-
-            val projectId = SPageContext.getHeader("projectId")
-            for (rSyInSpBase in rSyInSpBaseList){
-                val rSy2Sp = RSy2Sp()
-                rSy2Sp.id2 = rSyInSpBase.spaceId
-                rSy2Sp.id1 = rSyInSpBase.sysId
-                rSy2Sp.projectId = projectId
-                rSy2Sp.type = "sy2sp"
-                rSy2Sp.zoneType = type
-                val isDelete = rSy2SpService.delete(rSy2Sp)
-                if (isDelete) {
-                    /** 发送消息 */
-                    rabbitMqService.sendRel(Opt.projectId!!, "Sy2Sp","12",rSyInSpBase.sysId!!,rSyInSpBase.spaceId!!)
-                }
-            }
-            try {
-                /** 处理关系标记 */
-                val listType = ArrayList<String>()
-                listType.add("sh2bd")
-                listType.add("eq2sh")
-                for (type in listType){
-                    val entity = EquipmentService.relationTypeProjectservice.select(SFilter.eq("projectId", projectId!!), SFilter.eq("relationType", type)).entity()
-                    if (entity!=null){
-                        entity.computationalState = 2
-                        EquipmentService.relationTypeProjectservice.update(entity)
-                    }
-                }
-            } catch (e: Exception) {
-                e.printStackTrace()
-            }
-
-            val sBaseResponse = SBaseResponse(SResponseType.success)
-            sBaseResponse
-        } catch (e: Exception) {
-            e.printStackTrace()
-            return SBaseResponse(SResponseType.failure, e.message!!)
-        }
-    } // Function deletes()
-
-    /**
-     * 创建系统所在业务空间关系
-     *
-     * @param    rSyInSpBaseList    系统所在业务空间关系对象列表
-     */
-    fun createSy(rSyInSpBaseList: RSyInSpBaseList): SCreateResponse<RSyInSpBase> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            rSy2SpService.delete("id1 = '${rSyInSpBaseList.sysId}'")
-            val projectId = SPageContext.getHeader("projectId")
-            for (spaceId in rSyInSpBaseList.spaceIdList!!){
-                val entity = ZoneSpaceBaseService.select(SFilter.eq("projectId", projectId!!), SFilter.eq("id", spaceId)).entity()
-                val rSy2Sp = RSy2Sp()
-                rSy2Sp.id1 = rSyInSpBaseList.sysId
-                rSy2Sp.id2 = spaceId
-                rSy2Sp.sign = 1
-                rSy2Sp.zoneType = entity!!.classCode
-                rSy2Sp.type = "sy2sp"
-                rSy2Sp.projectId = projectId
-                val replace = rSy2SpService.replace(rSy2Sp)
-                if (replace){
-                    successList.add(spaceId)
-                }else{
-                    failureList.add(rSy2Sp)
-                }
-            }
-            if (successList.size>0){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Sy2Sp","13",rSyInSpBaseList.sysId!!,successList.toJson())
-                val sCreateResponse = SCreateResponse<RSyInSpBase>(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    rSyInSpBaseList    所在业务空间的系统关系对象列表
-     */
-    fun createsSp(rSyInSpBaseList: RSpInSyBaseList): SCreateResponse<RSyInSpBase> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            val projectId = SPageContext.getHeader("projectId")
-            delete("id2 = '${rSyInSpBaseList.spaceId}'")
-            val entity = ZoneSpaceBaseService.select(SFilter.eq("projectId", projectId!!), SFilter.eq("id", rSyInSpBaseList.spaceId!!)).entity()
-
-            for (sysId in rSyInSpBaseList.sysIdList!!){
-                val rSy2Sp = RSy2Sp()
-                rSy2Sp.id2 = rSyInSpBaseList.spaceId
-                rSy2Sp.id1 = sysId
-                rSy2Sp.projectId = projectId
-                rSy2Sp.sign = 1
-                rSy2Sp.zoneType = entity!!.classCode
-                rSy2Sp.type = "sy2sp"
-                val replace = rSy2SpService.replace(rSy2Sp)
-                if (replace){
-                    successList.add(sysId)
-                }else{
-                    failureList.add(rSy2Sp)
-                }
-            }
-            if (successList.size>0){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Sy2Sp","13",rSyInSpBaseList.spaceId!!,successList.toJson())
-                if (failureList.size>0){
-                    val sCreateResponse = SCreateResponse<RSyInSpBase>(SResponseType.success)
-                    sCreateResponse.message ="失败对象:"+failureList.toJson()
-                    sCreateResponse
-                }else{
-                    val sCreateResponse = SCreateResponse<RSyInSpBase>(SResponseType.success)
-                    sCreateResponse
-                }
-            }else{
-                SCreateResponse(SResponseType.failure)
-            }
-        } catch (e:Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    } // Function createsSp()
-
-    /**
-     * 创建所在业务空间的系统关系
-     *
-     * @param    rSyInSpBaseList    所在业务空间的系统关系对象列表
-     */
-    fun createsSpSys(type: String, rSyInSpBase: RSpInSyBaseList): SCreateResponse<RSpInSyBaseList> {
-        return try {
-
-
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            val projectId = SPageContext.getHeader("projectId")
-            for (sysId in rSyInSpBase.sysIdList!!){
-                val rSy2Sp = RSy2Sp()
-                rSy2Sp.id2 = rSyInSpBase.spaceId
-                rSy2Sp.id1 = sysId
-                rSy2Sp.projectId = projectId
-                rSy2Sp.sign = 1
-                rSy2Sp.zoneType = type
-                rSy2Sp.type = "sy2sp"
-                val replace = rSy2SpService.replace(rSy2Sp)
-                if (replace){
-                    successList.add(sysId)
-                }else{
-                    failureList.add(rSy2Sp)
-                }
-            }
-            if (successList.size>0){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Sy2Sp","14",rSyInSpBase.spaceId!!,successList.toJson())
-                if (failureList.size>0){
-                    val sCreateResponse = SCreateResponse<RSpInSyBaseList>(SResponseType.success)
-                    sCreateResponse.message ="失败对象:"+failureList.toJson()
-                    sCreateResponse
-                }else{
-                    val sCreateResponse = SCreateResponse<RSpInSyBaseList>(SResponseType.success)
-                    sCreateResponse
-                }
-            }else{
-                SCreateResponse(SResponseType.failure)
-            }
-
-        } catch (e:Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    } // Function createsSp()
-
-
-    /**
-     * 创建系统所在业务空间关系
-     *
-     * @param    rSyInSpBaseList    系统所在业务空间关系对象列表
-     */
-    fun createSySps(type: String, rSyInSpBase: RSyInSpBaseList): SCreateResponse<RSyInSpBaseList> {
-        return try {
-
-
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            val projectId = SPageContext.getHeader("projectId")
-            for (spaceId in rSyInSpBase.spaceIdList!!){
-                val rSy2Sp = RSy2Sp()
-                rSy2Sp.id1 = rSyInSpBase.sysId
-                rSy2Sp.id2 = spaceId
-                rSy2Sp.projectId = projectId
-                rSy2Sp.sign = 1
-                rSy2Sp.zoneType = type
-                rSy2Sp.type = "sy2sp"
-                val replace = rSy2SpService.replace(rSy2Sp)
-                if (replace){
-                    successList.add(spaceId)
-                }else{
-                    failureList.add(rSy2Sp)
-                }
-            }
-            if (successList.size>0){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Sy2Sp","14",rSyInSpBase.sysId!!,successList.toJson())
-                val sCreateResponse = SCreateResponse<RSyInSpBaseList>(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 createSySps()
-
-
-
-
-}

+ 0 - 227
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/RTnInSpBaseService.kt

@@ -1,227 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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.RSpInTnBaseList
-import com.persagy.server.datacenter.models.entities.rel.RTn2Sp
-import com.persagy.server.datacenter.models.entities.rel.RTnInSpBase
-import com.persagy.server.datacenter.models.entities.rel.RTnInSpBaseList
-import com.persagy.server.datacenter.services.base.RService
-import com.persagy.server.synchronize.MessageHandler
-import com.persagy.service.SObjectService
-import com.persagy.service.SPageContext
-import com.persagy.service.models.enums.SResponseType
-import com.persagy.service.models.requests.SCreateRequest
-import com.persagy.service.models.responses.SBaseResponse
-import com.persagy.service.models.responses.SCreateResponse
-import com.persagy.service.utils.SSpringContextUtil
-
-/**
- * 租户所租用的业务空间关系服务
- *
- * @author 付国宝
- */
-object RTnInSpBaseService: RService<RTnInSpBase>(SMybatisDao(RTnInSpBase::class.java)) {
-
-
-    /** 租户和业务空间的关系 */
-    var rTn2SpService = SObjectService(SMybatisDao(RTn2Sp::class.java))
-
-    /** MQ消息对象 */
-    private val messageHandler by lazy {
-        SSpringContextUtil.getBean(MessageHandler::class.java) as MessageHandler
-    }
-
-    /**
-     * 创建租户所租用的业务空间关系
-     *
-     * @param    rTnInSpBase    租户所租用的业务空间关系对象
-     */
-    fun create(type: String,rTnInSpBaseList: SCreateRequest<RTnInSpBase>): SCreateResponse<RTnInSpBase> {
-        return try {
-
-            if (!rTnInSpBaseList.content.isNullOrEmpty()){
-                for (rTnInSpBase in rTnInSpBaseList.content){
-                    val rTn2Sp = RTn2Sp()
-                    rTn2Sp.id2 = rTnInSpBase.spaceId
-                    rTn2Sp.id1 = rTnInSpBase.tenantId
-                    rTn2Sp.projectId = Opt.projectId
-                    rTn2Sp.sign = 1
-                    rTn2Sp.zoneType = type
-                    rTn2Sp.type = "tn2sp"
-                    val insert = rTn2SpService.insert(rTn2Sp)
-                    if (insert){
-                        try {
-                            /** 发送消息 */
-                            rabbitMqService.sendRel(Opt.projectId!!, "tn2sp","11", rTnInSpBase.tenantId!!,rTnInSpBase.spaceId!!)
-                        } catch (e: Exception) {
-                            e.printStackTrace()
-                        }
-                    }
-                }
-            }
-            SCreateResponse(SResponseType.success)
-
-        } catch (e: Exception) {
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    } // Function create()
-
-    /**
-     * 根据对象删除
-     *
-     * @param   rTnInSpBase    关系对象实例
-     * @return
-     */
-    fun deletes(type: String,rTnInSpBaseList: ArrayList<RTnInSpBase>): SBaseResponse {
-        return try {
-            for (rTnInSpBase in rTnInSpBaseList) {
-                val rTn2Sp = RTn2Sp()
-                rTn2Sp.id1 = rTnInSpBase.tenantId
-                rTn2Sp.id2 = rTnInSpBase.spaceId
-                rTn2Sp.zoneType = type
-                rTn2Sp.projectId = Opt.projectId
-                rTn2Sp.type = "tn2sp"
-                val delete = rTn2SpService.delete(rTn2Sp)
-                if (delete){
-                    /** 发送消息 */
-                    rabbitMqService.sendRel(Opt.projectId!!, "tn2sp","12", rTnInSpBase.tenantId!!,rTnInSpBase.spaceId!!)
-                }
-            }
-            val sBaseResponse = SBaseResponse(SResponseType.success)
-            sBaseResponse
-        } catch (e: Exception) {
-            e.printStackTrace()
-            return SBaseResponse(SResponseType.failure, e.message!!)
-        }
-    }
-
-    /**
-     * 创建租户所租用的业务空间关系
-     *
-     * @param   rTnInSpBaseList    租户所租用的业务空间关系对象列表
-     */
-    fun createTn(type: String, rTnInSpBaseList: RTnInSpBaseList): SCreateResponse<RTnInSpBase> {
-        return try {
-
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            rTn2SpService.delete("id1 = '${rTnInSpBaseList.tenantId}'")
-            val projectId = SPageContext.getHeader("projectId")
-            if (!rTnInSpBaseList.spaceIdList.isNullOrEmpty()) {
-                for (spaceId in rTnInSpBaseList.spaceIdList!!){
-                    val rTn2Sp = RTn2Sp()
-                    rTn2Sp.id1 = rTnInSpBaseList.tenantId
-                    rTn2Sp.id2 = spaceId
-                    rTn2Sp.projectId = projectId
-                    rTn2Sp.sign = 1
-                    rTn2Sp.zoneType = type
-                    rTn2Sp.type = "tn2sp"
-                    val replace = rTn2SpService.replace(rTn2Sp)
-                    if (replace){
-                        successList.add(spaceId)
-                    }else{
-                        failureList.add(rTn2Sp)
-                    }
-                }
-                if (successList.size>0){
-                    /** 发送消息 */
-                    rabbitMqService.sendRel(Opt.projectId!!, "tn2sp","13", rTnInSpBaseList.tenantId!!,successList.toJson())
-                    val sCreateResponse = SCreateResponse<RTnInSpBase>(SResponseType.success)
-                    if (failureList.size>0){
-                        sCreateResponse.message ="失败对象:"+failureList.toJson()
-                    }
-                    sCreateResponse
-                }else{
-                    SCreateResponse(SResponseType.failure)
-                }
-            }else {
-                SCreateResponse(SResponseType.success)
-            }
-
-
-        } catch (e: Exception) {
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    } // Function createTn()
-
-    /**
-     * 创建所租用的业务空间的租户关系
-     *
-     * @param     rTnInSpBaseList       所租用的业务空间的租户关系对象列表
-     */
-    fun createsSp(rTnInSpBaseList: RSpInTnBaseList): SCreateResponse<RTnInSpBase> {
-        return try {
-            /** 成功集合 */
-            val successList = ArrayList<Any>()
-            /** 失败集合 */
-            val failureList = ArrayList<Any>()
-            rTn2SpService.delete("id2 = '${rTnInSpBaseList.spaceId}'")
-            val projectId = SPageContext.getHeader("projectId")
-            for (tenantId in rTnInSpBaseList.tenantIdList!!){
-                val rTn2Sp = RTn2Sp()
-                rTn2Sp.id2 = rTnInSpBaseList.spaceId
-                rTn2Sp.id1 = tenantId
-                rTn2Sp.projectId = projectId
-                rTn2Sp.sign = 1
-                rTn2Sp.zoneType = rTnInSpBaseList.zoneType
-                rTn2Sp.type = "tn2sp"
-                val replace = rTn2SpService.replace(rTn2Sp)
-                if (replace){
-                    successList.add(tenantId)
-                }else{
-                    failureList.add(rTn2Sp)
-                }
-            }
-            if (successList.size>0){
-                /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "tn2sp","13", rTnInSpBaseList.spaceId!!,successList.toJson())
-                if (failureList.size>0){
-                    val sCreateResponse = SCreateResponse<RTnInSpBase>(SResponseType.success)
-                    sCreateResponse.message ="失败对象:"+failureList.toJson()
-                    sCreateResponse
-                }else{
-                    val sCreateResponse = SCreateResponse<RTnInSpBase>(SResponseType.success)
-                    sCreateResponse
-                }
-            }else{
-                SCreateResponse(SResponseType.failure)
-            }
-        } catch (e:Exception){
-            e.printStackTrace()
-            SCreateResponse(SResponseType.failure,e.message.toString())
-        }
-    }
-
-}

+ 1 - 1
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/relation_calc/ManualRelationCalcService.kt

@@ -1421,7 +1421,7 @@ open class ManualRelationCalcService {
                 }
                 if (delete){
                     /** 发送消息 */
-                    rabbitMqService.sendRel(Opt.projectId!!, manualRelationCalcDel.relType!!,"15",manualRelationCalcDel.fromId!!,"123456")
+                    rabbitMqService.sendRel(Opt.projectId!!,manualRelationCalcDel.graphicType, manualRelationCalcDel.relType!!,"15",manualRelationCalcDel.fromId!!,"123456")
                     return SBaseResponse(SResponseType.success)
                 }else{
                     return  SBaseResponse(SResponseType.failure)

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

@@ -163,7 +163,7 @@ open class RelationCalcService {
                 upDate(projectId, "bd2sp")
 //                upDate(projectId,"fl2sp")
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Bd2Sp", "20", "123", "456")
+                rabbitMqService.sendRel(Opt.projectId!!, null,"Bd2Sp", "20", "123", "456")
                 return SBaseResponse(SResponseType.success)
             } else {
                 upDateBiaoji(projectId, "bd2sp", 5)
@@ -184,7 +184,7 @@ open class RelationCalcService {
             val result = mapper.calcEq2Bd(projectId)
             if (result != null && result == 0) {
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Eq2Bd_in", "20", "123", "456")
+                rabbitMqService.sendRel(Opt.projectId!!, null,"Eq2Bd_in", "20", "123", "456")
                 return SBaseResponse(SResponseType.success)
             }
             return SBaseResponse(SResponseType.failure)
@@ -205,7 +205,7 @@ open class RelationCalcService {
             if (result != null && result == 0) {
                 upDate(projectId, "eq2fl")
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Eq2Bd_in", "20", "123", "456")
+                rabbitMqService.sendRel(Opt.projectId!!, null,"Eq2Bd_in", "20", "123", "456")
                 return SBaseResponse(SResponseType.success)
             } else {
                 upDateBiaoji(projectId, "eq2fl", 5)
@@ -234,7 +234,7 @@ open class RelationCalcService {
             val result = mapper.calcEq2Sh(projectId)
             if (result != null && result == 0) {
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Eq2Sh_in", "20", "123", "456")
+                rabbitMqService.sendRel(Opt.projectId!!, null,"Eq2Sh_in", "20", "123", "456")
                 upDate(projectId, "eq2sh")
                 upDate(projectId, "eq2sp_in")
                 upDate(projectId, "fl2sp")
@@ -380,7 +380,7 @@ open class RelationCalcService {
             if (result != null && result == 0) {
                 try {
                     /** 发送消息 */
-                    rabbitMqService.sendRel(Opt.projectId!!, "Eq2Sp_in", "20", tables!!, "456")
+                    rabbitMqService.sendRel(Opt.projectId!!, null,"Eq2Sp_in", "20", tables!!, "456")
                     upDate(projectId, "fl2sp")
                     upDate(projectId, "eq2fl")
                     val entity = relationTypeProjectservice.select(SFilter.eq("projectId", projectId), SFilter.eq("relationType", relType
@@ -426,7 +426,7 @@ open class RelationCalcService {
             if (result != null && result == 0) {
                 try {
                     /** 发送消息 */
-                    rabbitMqService.sendRel(Opt.projectId!!, "Fl2Fl_Through", "20", "123", "456")
+                    rabbitMqService.sendRel(Opt.projectId!!, null,"Fl2Fl_Through", "20", "123", "456")
                     val entity = RUpDateEquipAndSapceService.relationTypeProjectservice.select(SFilter.eq("projectId", projectId), SFilter.eq("relationTypeCode", "Fl2Fl")).entity()
                     if (entity != null) {
                         entity.computationalState = 1
@@ -522,7 +522,7 @@ open class RelationCalcService {
             val result = mapper.calcFl2Sp(tablesName, projectId)
             if (result != null && result == 0) {
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Fl2Sp_in", "20", tables!!, "456")
+                rabbitMqService.sendRel(Opt.projectId!!,null, "Fl2Sp_in", "20", tables!!, "456")
                 upDate(projectId, "fl2sp")
                 return SBaseResponse(SResponseType.success)
             } else {
@@ -664,7 +664,7 @@ open class RelationCalcService {
             val result = mapper.calcSh2Bd(projectId)
             if (result != null && result == 0) {
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Bd2Sh_in", "20", "123", "456")
+                rabbitMqService.sendRel(Opt.projectId!!, null,"Bd2Sh_in", "20", "123", "456")
                 upDate(projectId, "sh2bd")
                 return SBaseResponse(SResponseType.success)
             } else {
@@ -688,7 +688,7 @@ open class RelationCalcService {
             val result = mapper.calcSh2Sh(projectId)
             if (result != null && result == 0) {
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Sh2Sh_Through", "20", "123", "456")
+                rabbitMqService.sendRel(Opt.projectId!!, null,"Sh2Sh_Through", "20", "123", "456")
                 upDate(projectId, "sh2sh")
                 return SBaseResponse(SResponseType.success)
             } else {
@@ -717,7 +717,7 @@ open class RelationCalcService {
             logger.debug("系统= ${resultSy}")
             if (resultEq != null && resultSy != null && resultEq == 0 && resultSy == 0) {
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "syeq2bd", "20", "123", "456")
+                rabbitMqService.sendRel(Opt.projectId!!, null,"syeq2bd", "20", "123", "456")
                 upDate(projectId, "syeq2bd")
                 upDate(projectId, "eq2fl")
                 return SBaseResponse(SResponseType.success)
@@ -743,7 +743,7 @@ open class RelationCalcService {
             if (result != null && result == 0) {
 //                upDate(projectId,"sh2sh")
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "syeq2bd", "20", "123", "456")
+                rabbitMqService.sendRel(Opt.projectId!!, null,"syeq2bd", "20", "123", "456")
                 return SBaseResponse(SResponseType.success)
             }
             return SBaseResponse(SResponseType.failure)
@@ -765,7 +765,7 @@ open class RelationCalcService {
             val result = mapper.calcSy2Fl(projectId)
             if (result != null && result == 0) {
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Sy2Fl_in", "20", "123", "456")
+                rabbitMqService.sendRel(Opt.projectId!!,"", "Sy2Fl_in", "20", "123", "456")
                 upDate(projectId, "sy2fl")
                 upDate(projectId, "eq2fl")
                 return SBaseResponse(SResponseType.success)
@@ -795,7 +795,7 @@ open class RelationCalcService {
             val result = mapper.calcSy2Sh(projectId)
             if (result != null && result == 0) {
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Sy2Sh_in", "20", "123", "456")
+                rabbitMqService.sendRel(Opt.projectId!!, null,"Sy2Sh_in", "20", "123", "456")
                 upDate(projectId, "sy2sh")
                 upDate(projectId, "eq2sh")
                 upDate(projectId, "eq2fl")
@@ -830,7 +830,7 @@ open class RelationCalcService {
             val result = mapper.calcSy2Sp(projectId)
             if (result != null && result == 0) {
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "Sy2Sp_in", "20", "123", "456")
+                rabbitMqService.sendRel(Opt.projectId!!, null,"Sy2Sp_in", "20", "123", "456")
                 upDate(projectId, "sy2sp")
                 upDate(projectId, "fl2sp")
                 upDate(projectId, "sy2sp")
@@ -859,7 +859,7 @@ open class RelationCalcService {
             val result = mapper.calcsp2spTransport(projectId)
             if (result != null && result == 0) {
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sp2sp_TrafficNetwork_1", "20", "123", "456")
+                rabbitMqService.sendRel(Opt.projectId!!, null,"sp2sp_TrafficNetwork_1", "20", "123", "456")
                 upDate(projectId, "sp2sp_TrafficNetwork_1")
                 return SBaseResponse(SResponseType.success)
             } else {
@@ -881,7 +881,7 @@ open class RelationCalcService {
             val result = mapper.calcsp2spLight(projectId)
             if (result != null && result == 0) {
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sp2sp_RadiationNetwork_1", "20", "123", "456")
+                rabbitMqService.sendRel(Opt.projectId!!, null,"sp2sp_RadiationNetwork_1", "20", "123", "456")
                 upDate(projectId, "sp2sp_RadiationNetwork_1")
                 return SBaseResponse(SResponseType.success)
             } else {
@@ -903,7 +903,7 @@ open class RelationCalcService {
             val result = mapper.calcsp2spConvection(projectId)
             if (result != null && result == 0) {
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sp2sp_ConvectionNetwork_1", "20", "123", "456")
+                rabbitMqService.sendRel(Opt.projectId!!, null,"sp2sp_ConvectionNetwork_1", "20", "123", "456")
                 upDate(projectId, "sp2sp_ConvectionNetwork_1")
                 return SBaseResponse(SResponseType.success)
             } else {
@@ -925,7 +925,7 @@ open class RelationCalcService {
             val result = mapper.calcsp2spV2(projectId)
             if (result != null && result == 0) {
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "sp2sp_SpaceNeighborhood_5", "20", "123", "456")
+                rabbitMqService.sendRel(Opt.projectId!!, null,"sp2sp_SpaceNeighborhood_5", "20", "123", "456")
                 upDate(projectId, "sp2sp_SpaceNeighborhood_5")
                 return SBaseResponse(SResponseType.success)
             } else {
@@ -1046,7 +1046,7 @@ open class RelationCalcService {
             if (result != null && result == 0) {
                 try {
                     /** 发送消息 */
-                    rabbitMqService.sendRel(Opt.projectId!!, "eq2eq_SensorRelationship_ss2eq", "20", "123", "456")
+                    rabbitMqService.sendRel(Opt.projectId!!, null,"eq2eq_SensorRelationship_ss2eq", "20", "123", "456")
                     upDate(projectId, "fl2sp")
                     upDate(projectId, "eq2fl")
                     val entity = relationTypeProjectservice.select(SFilter.eq("projectId", projectId), SFilter.eq("relationType", "eq2sp_SensorRelationship_ss2sp")).entity()
@@ -1353,7 +1353,7 @@ open class RelationCalcService {
 
                 }
                 /** 发送消息 */
-                rabbitMqService.sendRel(Opt.projectId!!, "fengkou_for", "20", "123", "456")
+                rabbitMqService.sendRel(Opt.projectId!!, graphCode,relType, "20", "123", "456")
                 return SBaseResponse(SResponseType.success)
             } else {
 //                upDateBiaoji(projectId, "eq2fl", 1)