From f7006e4881b176c12e3ba07af7025b0ef4a1508c Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期三, 15 六月 2022 14:55:33 +0800
Subject: [PATCH] 修复播放中zlm离线导致的bye发送失败

---
 src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java |    7 +++++--
 1 files changed, 5 insertions(+), 2 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 b65f826..c813b11 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
@@ -70,7 +70,9 @@
         boolean result = false;
         TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition);
         ParentPlatform parentPlatform = platformMapper.getParentPlatByServerGBId(platformId);
-        if (catalogId == null) catalogId = parentPlatform.getCatalogId();
+        if (catalogId == null) {
+            catalogId = parentPlatform.getCatalogId();
+        }
         try {
             List<DeviceChannel> deviceChannelList = new ArrayList<>();
             for (GbStream gbStream : gbStreams) {
@@ -104,7 +106,8 @@
         deviceChannel.setStatus(1);
         deviceChannel.setParentId(catalogId ==null?gbStream.getCatalogId():catalogId);
         deviceChannel.setRegisterWay(1);
-        if (catalogId.length() <= 10) { // 鐖惰妭鐐规槸琛屾斂鍖哄垝,鍒欒缃瓹ivilCode浣跨敤姝よ鏀垮尯鍒�
+        if (catalogId.length() > 0 && catalogId.length() <= 10) {
+            // 鐖惰妭鐐规槸琛屾斂鍖哄垝,鍒欒缃瓹ivilCode浣跨敤姝よ鏀垮尯鍒�
             deviceChannel.setCivilCode(catalogId);
         }else {
             deviceChannel.setCivilCode(platform.getAdministrativeDivision());

--
Gitblit v1.8.0