Commit 20fdd996700121c280326c7791713172cd0b803b

Authored by 648540858
1 parent bc0319b3

修复推流加入国标时未加入开启共享的上级平台

src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java
... ... @@ -6,23 +6,23 @@ import com.alibaba.fastjson.TypeReference;
6 6 import com.genersoft.iot.vmp.common.StreamInfo;
7 7 import com.genersoft.iot.vmp.conf.UserSetup;
8 8 import com.genersoft.iot.vmp.gb28181.bean.GbStream;
  9 +import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
9 10 import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookSubscribe;
10 11 import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils;
11 12 import com.genersoft.iot.vmp.media.zlm.ZLMServerConfig;
12   -import com.genersoft.iot.vmp.media.zlm.dto.MediaItem;
13   -import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
14   -import com.genersoft.iot.vmp.media.zlm.dto.OriginType;
15   -import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
  13 +import com.genersoft.iot.vmp.media.zlm.dto.*;
16 14 import com.genersoft.iot.vmp.service.IMediaServerService;
17 15 import com.genersoft.iot.vmp.service.IStreamPushService;
18 16 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
19 17 import com.genersoft.iot.vmp.storager.dao.GbStreamMapper;
  18 +import com.genersoft.iot.vmp.storager.dao.ParentPlatformMapper;
20 19 import com.genersoft.iot.vmp.storager.dao.PlatformGbStreamMapper;
21 20 import com.genersoft.iot.vmp.storager.dao.StreamPushMapper;
22 21 import com.github.pagehelper.PageHelper;
23 22 import com.github.pagehelper.PageInfo;
24 23 import org.springframework.beans.factory.annotation.Autowired;
25 24 import org.springframework.stereotype.Service;
  25 +import org.springframework.util.StringUtils;
26 26  
27 27 import java.util.*;
28 28  
... ... @@ -36,6 +36,9 @@ public class StreamPushServiceImpl implements IStreamPushService {
36 36 private StreamPushMapper streamPushMapper;
37 37  
38 38 @Autowired
  39 + private ParentPlatformMapper parentPlatformMapper;
  40 +
  41 + @Autowired
39 42 private PlatformGbStreamMapper platformGbStreamMapper;
40 43  
41 44 @Autowired
... ... @@ -113,6 +116,18 @@ public class StreamPushServiceImpl implements IStreamPushService {
113 116 stream.setStreamType("push");
114 117 stream.setStatus(true);
115 118 int add = gbStreamMapper.add(stream);
  119 + // 查找开启了全部直播流共享的上级平台
  120 + List<ParentPlatform> parentPlatforms = parentPlatformMapper.selectAllAhareAllLiveStream();
  121 + if (parentPlatforms.size() > 0) {
  122 + for (ParentPlatform parentPlatform : parentPlatforms) {
  123 + stream.setPlatformId(parentPlatform.getServerGBId());
  124 + String streamId = stream.getStream();
  125 + StreamProxyItem streamProxyItems = platformGbStreamMapper.selectOne(stream.getApp(), streamId, parentPlatform.getServerGBId());
  126 + if (streamProxyItems == null) {
  127 + platformGbStreamMapper.add(stream);
  128 + }
  129 + }
  130 + }
116 131 return add > 0;
117 132 }
118 133  
... ...