From 46cf650a863f9181f78c09f9b1146972844449bc Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期五, 21 一月 2022 18:00:15 +0800
Subject: [PATCH] 优化通道选择是通道的查询

---
 src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java |   25 ++++++++++++++-----------
 1 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java
index 1c8f191..13277c2 100644
--- a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java
@@ -146,20 +146,23 @@
                 result.append(",  鍏宠仈鍥芥爣骞冲彴[ " + param.getPlatformGbId() + " ]澶辫触");
             }
         }
-        // 鏌ユ壘寮�鍚簡鍏ㄩ儴鐩存挱娴佸叡浜殑涓婄骇骞冲彴
-        List<ParentPlatform> parentPlatforms = parentPlatformMapper.selectAllAhareAllLiveStream();
-        if (parentPlatforms.size() > 0) {
-            for (ParentPlatform parentPlatform : parentPlatforms) {
-                param.setPlatformId(parentPlatform.getServerGBId());
-                param.setCatalogId(parentPlatform.getCatalogId());
-                String stream = param.getStream();
-                StreamProxyItem streamProxyItems = platformGbStreamMapper.selectOne(param.getApp(), stream, parentPlatform.getServerGBId());
-                if (streamProxyItems == null) {
-                    platformGbStreamMapper.add(param);
-                    eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), param, CatalogEvent.ADD);
+        if (!StringUtils.isEmpty(param.getGbId())) {
+            // 鏌ユ壘寮�鍚簡鍏ㄩ儴鐩存挱娴佸叡浜殑涓婄骇骞冲彴
+            List<ParentPlatform> parentPlatforms = parentPlatformMapper.selectAllAhareAllLiveStream();
+            if (parentPlatforms.size() > 0) {
+                for (ParentPlatform parentPlatform : parentPlatforms) {
+                    param.setPlatformId(parentPlatform.getServerGBId());
+                    param.setCatalogId(parentPlatform.getCatalogId());
+                    String stream = param.getStream();
+                    StreamProxyItem streamProxyItems = platformGbStreamMapper.selectOne(param.getApp(), stream, parentPlatform.getServerGBId());
+                    if (streamProxyItems == null) {
+                        platformGbStreamMapper.add(param);
+                        eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), param, CatalogEvent.ADD);
+                    }
                 }
             }
         }
+
         wvpResult.setMsg(result.toString());
         return wvpResult;
     }

--
Gitblit v1.8.0