为级联平台增加虚拟目录功能
This commit is contained in:
@@ -30,7 +30,7 @@ public interface IGbStreamService {
|
||||
* 保存国标关联
|
||||
* @param gbStreams
|
||||
*/
|
||||
boolean addPlatformInfo(List<GbStream> gbStreams, String platformId);
|
||||
boolean addPlatformInfo(List<GbStream> gbStreams, String platformId, String catalogId);
|
||||
|
||||
/**
|
||||
* 移除国标关联
|
||||
|
||||
@@ -47,13 +47,15 @@ public class GbStreamServiceImpl implements IGbStreamService {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean addPlatformInfo(List<GbStream> gbStreams, String platformId) {
|
||||
public boolean addPlatformInfo(List<GbStream> gbStreams, String platformId, String catalogId) {
|
||||
// 放在事务内执行
|
||||
boolean result = false;
|
||||
TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition);
|
||||
try {
|
||||
for (GbStream gbStream : gbStreams) {
|
||||
gbStream.setCatalogId(catalogId);
|
||||
gbStream.setPlatformId(platformId);
|
||||
// TODO 修改为批量提交
|
||||
platformGbStreamMapper.add(gbStream);
|
||||
}
|
||||
dataSourceTransactionManager.commit(transactionStatus); //手动提交
|
||||
|
||||
@@ -130,7 +130,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
||||
if ( !StringUtils.isEmpty(param.getPlatformGbId()) && streamLive) {
|
||||
List<GbStream> gbStreams = new ArrayList<>();
|
||||
gbStreams.add(param);
|
||||
if (gbStreamService.addPlatformInfo(gbStreams, param.getPlatformGbId())){
|
||||
if (gbStreamService.addPlatformInfo(gbStreams, param.getPlatformGbId(), param.getCatalogId())){
|
||||
result.append(", 关联国标平台[ " + param.getPlatformGbId() + " ]成功");
|
||||
}else {
|
||||
result.append(", 关联国标平台[ " + param.getPlatformGbId() + " ]失败");
|
||||
@@ -141,6 +141,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
||||
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) {
|
||||
|
||||
@@ -119,6 +119,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||
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 streamProxyItems = platformGbStreamMapper.selectOne(stream.getApp(), streamId, parentPlatform.getServerGBId());
|
||||
|
||||
Reference in New Issue
Block a user