浏览代码

******************WX *********************
修改关系发送消息

zhangweixin 4 年之前
父节点
当前提交
435f1f37e1

+ 6 - 2
datacenter/src/main/kotlin/com/persagy/server/services/rel/REqForSpBaseService.kt

@@ -110,8 +110,12 @@ object REqForSpBaseService: RService<REqForSpBase>(SMybatisDao(REqForSpBase::cla
                     rEq2Sp.type = "eq2sp_for"
                     val isDelete = rEq2SpService.delete(rEq2Sp)
                     if (isDelete) {
-                        /** 发送消息 */
-                        rabbitMqService.sendRel(Opt.projectId!!, "EquipforSpace","12",rEqForSpBase.equipId!!,rEqForSpBase.spaceId!!)
+                        try {
+                            /** 发送消息 */
+                            rabbitMqService.sendRel(Opt.projectId!!, "EquipforSpace","12",rEqForSpBase.equipId!!,rEqForSpBase.spaceId!!)
+                        } catch (e: Exception) {
+                            e.printStackTrace()
+                        }
                     }
                 } catch (e: Exception) {
                     e.printStackTrace()

+ 12 - 2
datacenter/src/main/kotlin/com/persagy/server/services/rel/REqInSpBaseService.kt

@@ -110,6 +110,7 @@ object REqInSpBaseService: RService<REqInSpBase>(SMybatisDao(REqInSpBase::class.
      */
     fun deletes(type: String, rEqInSpBaseList: ArrayList<REqInSpBase>): SBaseResponse {
         return try {
+
             val projectId = SPageContext.getHeader("projectId")
             val list= ArrayList<REq2Sp>()
             for (rEqInSpBase in rEqInSpBaseList){
@@ -120,9 +121,18 @@ object REqInSpBaseService: RService<REqInSpBase>(SMybatisDao(REqInSpBase::class.
                 rEq2Sp.zoneType = type
                 rEq2Sp.type = "eq2sp_in"
                 list.add(rEq2Sp)
+                val delete = REq2SpService.delete(rEq2Sp)
+                if (delete) {
+                    try {
+                        /** 发送消息 */
+                        rabbitMqService.sendRel(Opt.projectId!!, "EquipinSpace","12",rEq2Sp.id1!!,rEq2Sp.id2!!)
+                    } catch (e: Exception) {
+                        e.printStackTrace()
+                    }
+                }
             }
-            REq2SpService.deleteByKeysList(list)
-
+//            REq2SpService.deleteByKeysList(list)
+            SBaseResponse(SResponseType.success)
         } catch (e: Exception) {
             e.printStackTrace()
             return SBaseResponse(SResponseType.failure, e.message!!)