From f6c48588daba63846a9e70ef10fe7af2fceab035 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期四, 22 二月 2024 17:22:28 +0800
Subject: [PATCH] 支持支持主码流子码流切换

---
 src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java
index 9f2b5e0..0412fc8 100755
--- a/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java
@@ -1,5 +1,6 @@
 package com.genersoft.iot.vmp.service.impl;
 
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.genersoft.iot.vmp.gb28181.bean.*;
 import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
 import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
@@ -27,6 +28,7 @@
  * @author lin
  */
 @Service
+@DS("master")
 public class PlatformChannelServiceImpl implements IPlatformChannelService {
 
     private final static Logger logger = LoggerFactory.getLogger(PlatformChannelServiceImpl.class);
@@ -165,10 +167,9 @@
             catalogId = null;
         }
 
-        if ((result = platformChannelMapper.delChannelForGBByCatalogId(platformId, catalogId)) > 0) {
-            List<DeviceChannel> deviceChannels = platformChannelMapper.queryAllChannelInCatalog(platformId, catalogId);
-            eventPublisher.catalogEventPublish(platformId, deviceChannels, CatalogEvent.DEL);
-        }
-        return result;
+        List<DeviceChannel> deviceChannels = platformChannelMapper.queryAllChannelInCatalog(platformId, catalogId);
+        eventPublisher.catalogEventPublish(platformId, deviceChannels, CatalogEvent.DEL);
+
+        return platformChannelMapper.delChannelForGBByCatalogId(platformId, catalogId);
     }
 }

--
Gitblit v1.8.0