From dabee4ed7d503a06a78a7c12491416206a48eec1 Mon Sep 17 00:00:00 2001 From: XiaoQiTong <69035114+XiaoQiTong@users.noreply.github.com> Date: Sat, 15 Oct 2022 20:57:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8C=87=E5=AE=9A=E6=B5=81?= =?UTF-8?q?=E5=AA=92=E4=BD=93=E6=94=B6=E6=B5=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/mysql.sql | 1 + .../iot/vmp/service/impl/PlayServiceImpl.java | 2 +- .../service/impl/StreamProxyServiceImpl.java | 2 +- .../iot/vmp/storager/dao/DeviceMapper.java | 1 + web_src/src/components/dialog/deviceEdit.vue | 22 +++++++++---------- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/sql/mysql.sql b/sql/mysql.sql index 7b5d943a..8c6c7b0b 100644 --- a/sql/mysql.sql +++ b/sql/mysql.sql @@ -48,6 +48,7 @@ CREATE TABLE `device` ( `ssrcCheck` int DEFAULT '0', `geoCoordSys` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `treeType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'auto', PRIMARY KEY (`id`), UNIQUE KEY `device_deviceId_uindex` (`deviceId`) ) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java index c57ee175..9ce76ae0 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java @@ -407,7 +407,7 @@ public class PlayServiceImpl implements IPlayService { } String mediaServerId = device.getMediaServerId(); MediaServerItem mediaServerItem; - if (mediaServerId == null) { + if (mediaServerId == null || "".equals(device.getMediaServerId()) || "auto".equals(device.getMediaServerId())) { mediaServerItem = mediaServerService.getMediaServerForMinimumLoad(); } else { mediaServerItem = mediaServerService.getOne(mediaServerId); 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 aa197efa..db527e28 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 @@ -98,7 +98,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService { @Override public StreamInfo save(StreamProxyItem param) { MediaServerItem mediaInfo; - if (param.getMediaServerId() == null || "auto".equals(param.getMediaServerId())){ + if (param.getMediaServerId() == null || "".equals(param.getMediaServerId()) || "auto".equals(param.getMediaServerId())){ mediaInfo = mediaServerService.getMediaServerForMinimumLoad(); }else { mediaInfo = mediaServerService.getOne(param.getMediaServerId()); diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java index 7e8dd3c6..3f3301f6 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java @@ -93,6 +93,7 @@ public interface DeviceMapper { ", ssrcCheck=${ssrcCheck}" + ", geoCoordSys=#{geoCoordSys}" + ", treeType=#{treeType}" + + ", mediaServerId=#{mediaServerId}" + "WHERE deviceId='${deviceId}'"+ " "}) int update(Device device); diff --git a/web_src/src/components/dialog/deviceEdit.vue b/web_src/src/components/dialog/deviceEdit.vue index 12c0aa18..49322eb7 100644 --- a/web_src/src/components/dialog/deviceEdit.vue +++ b/web_src/src/components/dialog/deviceEdit.vue @@ -18,17 +18,17 @@ - - - - - - - - - - - + + + + + + +