Merge remote-tracking branch 'origin/wvp-28181-2.0' into wvp-28181-2.0
This commit is contained in:
@@ -156,24 +156,6 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
||||
result.append(", 关联国标平台[ " + param.getPlatformGbId() + " ]失败");
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -134,29 +134,6 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||
stream.setStatus(true);
|
||||
stream.setCreateTime(DateUtil.getNow());
|
||||
int add = gbStreamMapper.add(stream);
|
||||
|
||||
// 查找开启了全部直播流共享的上级平台
|
||||
List<ParentPlatform> parentPlatforms = parentPlatformMapper.selectAllAhareAllLiveStream();
|
||||
if (parentPlatforms.size() > 0) {
|
||||
for (ParentPlatform parentPlatform : parentPlatforms) {
|
||||
stream.setCatalogId(parentPlatform.getCatalogId());
|
||||
stream.setPlatformId(parentPlatform.getServerGBId());
|
||||
String streamId = stream.getStream();
|
||||
StreamProxyItem streamProxyItem = platformGbStreamMapper.selectOne(stream.getApp(), streamId, parentPlatform.getServerGBId());
|
||||
if (streamProxyItem == null) {
|
||||
platformGbStreamMapper.add(stream);
|
||||
eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), stream, CatalogEvent.ADD);
|
||||
}else {
|
||||
if (!streamProxyItem.getGbId().equals(stream.getGbId())) {
|
||||
// 此流使用另一个国标Id已经与该平台关联,移除此记录
|
||||
platformGbStreamMapper.delByAppAndStreamAndPlatform(stream.getApp(), streamId, parentPlatform.getServerGBId());
|
||||
platformGbStreamMapper.add(stream);
|
||||
eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), stream, CatalogEvent.ADD);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return add > 0;
|
||||
}
|
||||
|
||||
@@ -345,31 +322,6 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||
public void batchAdd(List<StreamPushItem> streamPushItems) {
|
||||
streamPushMapper.addAll(streamPushItems);
|
||||
gbStreamMapper.batchAdd(streamPushItems);
|
||||
// 查找开启了全部直播流共享的上级平台
|
||||
List<ParentPlatform> parentPlatforms = parentPlatformMapper.selectAllAhareAllLiveStream();
|
||||
if (parentPlatforms.size() > 0) {
|
||||
for (StreamPushItem stream : streamPushItems) {
|
||||
for (ParentPlatform parentPlatform : parentPlatforms) {
|
||||
stream.setCatalogId(parentPlatform.getCatalogId());
|
||||
stream.setPlatformId(parentPlatform.getServerGBId());
|
||||
String streamId = stream.getStream();
|
||||
StreamProxyItem streamProxyItem = platformGbStreamMapper.selectOne(stream.getApp(), streamId, parentPlatform.getServerGBId());
|
||||
if (streamProxyItem == null) {
|
||||
platformGbStreamMapper.add(stream);
|
||||
eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), stream, CatalogEvent.ADD);
|
||||
}else {
|
||||
if (!streamProxyItem.getGbId().equals(stream.getGbId())) {
|
||||
// 此流使用另一个国标Id已经与该平台关联,移除此记录
|
||||
platformGbStreamMapper.delByAppAndStreamAndPlatform(stream.getApp(), streamId, parentPlatform.getServerGBId());
|
||||
platformGbStreamMapper.add(stream);
|
||||
eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), stream, CatalogEvent.ADD);
|
||||
stream.setGbId(streamProxyItem.getGbId());
|
||||
eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), stream, CatalogEvent.DEL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user