From bea63f67e75ea6c38d946c2ee463260fcf815f87 Mon Sep 17 00:00:00 2001
From: Fang <costa11@qq.com>
Date: 星期一, 07 三月 2022 14:21:29 +0800
Subject: [PATCH] Merge branch '648540858:wvp-28181-2.0' into wvp-28181-2.0

---
 src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java
index 64f49ac..32a1305 100644
--- a/src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java
@@ -52,9 +52,9 @@
     private EventPublisher eventPublisher;
 
     @Override
-    public PageInfo<GbStream> getAll(Integer page, Integer count, String platFormId) {
+    public PageInfo<GbStream> getAll(Integer page, Integer count, String platFormId, String catalogId, String query, Boolean pushing, String mediaServerId) {
         PageHelper.startPage(page, count);
-        List<GbStream> all = gbStreamMapper.selectAll(platFormId);
+        List<GbStream> all = gbStreamMapper.selectAll(platFormId, catalogId, query, pushing, mediaServerId);
         return new PageInfo<>(all);
     }
 
@@ -70,6 +70,7 @@
         boolean result = false;
         TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition);
         ParentPlatform parentPlatform = platformMapper.getParentPlatByServerGBId(platformId);
+        if (catalogId == null) catalogId = parentPlatform.getCatalogId();
         try {
             List<DeviceChannel> deviceChannelList = new ArrayList<>();
             for (GbStream gbStream : gbStreams) {
@@ -102,7 +103,7 @@
         deviceChannel.setStatus(gbStream.isStatus()?1:0);
         deviceChannel.setParentId(catalogId ==null?gbStream.getCatalogId():catalogId);
         deviceChannel.setRegisterWay(1);
-        deviceChannel.setCivilCode(sipConfig.getDomain());
+        deviceChannel.setCivilCode(sipConfig.getDomain().substring(0, sipConfig.getDomain().length() - 2));
         deviceChannel.setModel("live");
         deviceChannel.setOwner("wvp-pro");
         deviceChannel.setParental(0);
@@ -117,14 +118,14 @@
         TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition);
         try {
             List<DeviceChannel> deviceChannelList = new ArrayList<>();
+            platformGbStreamMapper.delByAppAndStreamsByPlatformId(gbStreams, platformId);
             for (GbStream gbStream : gbStreams) {
-                platformGbStreamMapper.delByAppAndStreamAndPlatform(gbStream.getApp(), gbStream.getStream(), platformId);
                 DeviceChannel deviceChannel = new DeviceChannel();
                 deviceChannel.setChannelId(gbStream.getGbId());
                 deviceChannelList.add(deviceChannel);
-                eventPublisher.catalogEventPublish(platformId, deviceChannel, CatalogEvent.DEL);
             }
 
+            eventPublisher.catalogEventPublish(platformId, deviceChannelList, CatalogEvent.DEL);
             dataSourceTransactionManager.commit(transactionStatus);     //鎵嬪姩鎻愪氦
             result = true;
         }catch (Exception e) {
@@ -158,7 +159,9 @@
                 List<ParentPlatform> parentPlatforms = platformGbStreamMapper.selectByAppAndStream(gs.getApp(), gs.getStream());
                 if (parentPlatforms.size() > 0) {
                     for (ParentPlatform parentPlatform : parentPlatforms) {
-                        eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), gs, type);
+                        if (parentPlatform != null) {
+                            eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), gs, type);
+                        }
                     }
                 }
             }

--
Gitblit v1.8.0