From 35b3d7618dfd86c63f20d62d606d3d84dcac094a Mon Sep 17 00:00:00 2001
From: xiaoxie <hotcoffie@163.com>
Date: 星期四, 28 四月 2022 13:40:26 +0800
Subject: [PATCH] 修复多屏播放时播放器样式错位
---
src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java | 23 +++++++++++++++--------
1 files changed, 15 insertions(+), 8 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 5827985..b65f826 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
@@ -78,7 +78,7 @@
gbStream.setPlatformId(platformId);
// TODO 淇敼涓烘壒閲忔彁浜�
platformGbStreamMapper.add(gbStream);
- DeviceChannel deviceChannelListByStream = getDeviceChannelListByStream(gbStream, catalogId, parentPlatform.getDeviceGBId());
+ DeviceChannel deviceChannelListByStream = getDeviceChannelListByStream(gbStream, catalogId, parentPlatform);
deviceChannelList.add(deviceChannelListByStream);
}
dataSourceTransactionManager.commit(transactionStatus); //鎵嬪姩鎻愪氦
@@ -92,18 +92,23 @@
}
@Override
- public DeviceChannel getDeviceChannelListByStream(GbStream gbStream, String catalogId, String deviceGBId) {
+ public DeviceChannel getDeviceChannelListByStream(GbStream gbStream, String catalogId, ParentPlatform platform) {
DeviceChannel deviceChannel = new DeviceChannel();
deviceChannel.setChannelId(gbStream.getGbId());
deviceChannel.setName(gbStream.getName());
deviceChannel.setLongitude(gbStream.getLongitude());
deviceChannel.setLatitude(gbStream.getLatitude());
- deviceChannel.setDeviceId(deviceGBId);
+ deviceChannel.setDeviceId(platform.getDeviceGBId());
deviceChannel.setManufacture("wvp-pro");
- deviceChannel.setStatus(gbStream.isStatus()?1:0);
+// deviceChannel.setStatus(gbStream.isStatus()?1:0);
+ deviceChannel.setStatus(1);
deviceChannel.setParentId(catalogId ==null?gbStream.getCatalogId():catalogId);
deviceChannel.setRegisterWay(1);
- deviceChannel.setCivilCode(sipConfig.getDomain());
+ if (catalogId.length() <= 10) { // 鐖惰妭鐐规槸琛屾斂鍖哄垝,鍒欒缃瓹ivilCode浣跨敤姝よ鏀垮尯鍒�
+ deviceChannel.setCivilCode(catalogId);
+ }else {
+ deviceChannel.setCivilCode(platform.getAdministrativeDivision());
+ }
deviceChannel.setModel("live");
deviceChannel.setOwner("wvp-pro");
deviceChannel.setParental(0);
@@ -118,14 +123,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) {
@@ -159,7 +164,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