Merge branch 'wvp-28181-2.0' into wvp-pro-record
# Conflicts: # src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java # web_src/src/components/control.vue
This commit is contained in:
@@ -99,14 +99,14 @@ public class EventPublisher {
|
||||
applicationEventPublisher.publishEvent(outEvent);
|
||||
}
|
||||
|
||||
@Async
|
||||
|
||||
public void catalogEventPublish(String platformId, DeviceChannel deviceChannel, String type) {
|
||||
List<DeviceChannel> deviceChannelList = new ArrayList<>();
|
||||
deviceChannelList.add(deviceChannel);
|
||||
catalogEventPublish(platformId, deviceChannelList, type);
|
||||
}
|
||||
|
||||
@Async
|
||||
|
||||
public void catalogEventPublish(String platformId, List<DeviceChannel> deviceChannels, String type) {
|
||||
CatalogEvent outEvent = new CatalogEvent(this);
|
||||
List<DeviceChannel> channels = new ArrayList<>();
|
||||
@@ -128,8 +128,8 @@ public class EventPublisher {
|
||||
applicationEventPublisher.publishEvent(outEvent);
|
||||
}
|
||||
|
||||
@Async
|
||||
public void catalogEventPublishForStream(String platformId, GbStream[] gbStreams, String type) {
|
||||
|
||||
public void catalogEventPublishForStream(String platformId, List<GbStream> gbStreams, String type) {
|
||||
CatalogEvent outEvent = new CatalogEvent(this);
|
||||
outEvent.setGbStreams(gbStreams);
|
||||
outEvent.setType(type);
|
||||
@@ -137,10 +137,11 @@ public class EventPublisher {
|
||||
applicationEventPublisher.publishEvent(outEvent);
|
||||
}
|
||||
|
||||
@Async
|
||||
|
||||
public void catalogEventPublishForStream(String platformId, GbStream gbStream, String type) {
|
||||
GbStream[] gbStreams = {gbStream};
|
||||
catalogEventPublishForStream(platformId, gbStreams, type);
|
||||
List<GbStream> gbStreamList = new ArrayList<>();
|
||||
gbStreamList.add(gbStream);
|
||||
catalogEventPublishForStream(platformId, gbStreamList, type);
|
||||
}
|
||||
|
||||
public void recordEndEventPush(RecordInfo recordInfo) {
|
||||
|
||||
@@ -20,7 +20,7 @@ public class CatalogEvent extends ApplicationEvent {
|
||||
public static final String UPDATE = "UPDATE"; // 更新
|
||||
|
||||
private List<DeviceChannel> deviceChannels;
|
||||
private GbStream[] gbStreams;
|
||||
private List<GbStream> gbStreams;
|
||||
private String type;
|
||||
private String platformId;
|
||||
|
||||
@@ -48,11 +48,11 @@ public class CatalogEvent extends ApplicationEvent {
|
||||
this.platformId = platformId;
|
||||
}
|
||||
|
||||
public GbStream[] getGbStreams() {
|
||||
public List<GbStream> getGbStreams() {
|
||||
return gbStreams;
|
||||
}
|
||||
|
||||
public void setGbStreams(GbStream[] gbStreams) {
|
||||
public void setGbStreams(List<GbStream> gbStreams) {
|
||||
this.gbStreams = gbStreams;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,11 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> {
|
||||
if (parentPlatform != null && !parentPlatform.isStatus())return;
|
||||
String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + userSetup.getServerId() + "_Catalog_" + event.getPlatformId();
|
||||
subscribe = redisCatchStorage.getSubscribe(key);
|
||||
if (subscribe == null) return;
|
||||
|
||||
if (subscribe == null) {
|
||||
logger.debug("发送订阅消息时发现订阅信息已经不存在");
|
||||
return;
|
||||
}
|
||||
}else {
|
||||
// 获取所用订阅
|
||||
List<String> platforms = redisCatchStorage.getAllSubscribePlatform();
|
||||
@@ -94,7 +98,7 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> {
|
||||
if (event.getDeviceChannels() != null) {
|
||||
deviceChannelList.addAll(event.getDeviceChannels());
|
||||
}
|
||||
if (event.getGbStreams() != null && event.getGbStreams().length > 0){
|
||||
if (event.getGbStreams() != null && event.getGbStreams().size() > 0){
|
||||
for (GbStream gbStream : event.getGbStreams()) {
|
||||
DeviceChannel deviceChannelByStream = gbStreamService.getDeviceChannelListByStream(gbStream, gbStream.getCatalogId(), parentPlatform.getDeviceGBId());
|
||||
deviceChannelList.add(deviceChannelByStream);
|
||||
@@ -134,7 +138,7 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> {
|
||||
if (event.getDeviceChannels() != null) {
|
||||
deviceChannelList.addAll(event.getDeviceChannels());
|
||||
}
|
||||
if (event.getGbStreams() != null && event.getGbStreams().length > 0){
|
||||
if (event.getGbStreams() != null && event.getGbStreams().size() > 0){
|
||||
for (GbStream gbStream : event.getGbStreams()) {
|
||||
DeviceChannel deviceChannelByStream = gbStreamService.getDeviceChannelListByStream(gbStream, gbStream.getCatalogId(), parentPlatform.getDeviceGBId());
|
||||
deviceChannelList.add(deviceChannelByStream);
|
||||
@@ -142,7 +146,7 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> {
|
||||
}
|
||||
if (deviceChannelList.size() > 0) {
|
||||
logger.info("[Catalog事件: {}]平台:{},影响通道{}个", event.getType(), event.getPlatformId(), deviceChannelList.size());
|
||||
sipCommanderFroPlatform.sendNotifyForCatalogAddOrUpdate(event.getType(), parentPlatform, deviceChannelList, subscribe);
|
||||
sipCommanderFroPlatform.sendNotifyForCatalogAddOrUpdate(event.getType(), parentPlatform, deviceChannelList, subscribe, null);
|
||||
}
|
||||
}else if (parentPlatformMap.keySet().size() > 0) {
|
||||
for (String gbId : parentPlatformMap.keySet()) {
|
||||
|
||||
Reference in New Issue
Block a user