Commit 20fdd996700121c280326c7791713172cd0b803b
1 parent
bc0319b3
修复推流加入国标时未加入开启共享的上级平台
Showing
1 changed file
with
19 additions
and
4 deletions
src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java
| @@ -6,23 +6,23 @@ import com.alibaba.fastjson.TypeReference; | @@ -6,23 +6,23 @@ import com.alibaba.fastjson.TypeReference; | ||
| 6 | import com.genersoft.iot.vmp.common.StreamInfo; | 6 | import com.genersoft.iot.vmp.common.StreamInfo; |
| 7 | import com.genersoft.iot.vmp.conf.UserSetup; | 7 | import com.genersoft.iot.vmp.conf.UserSetup; |
| 8 | import com.genersoft.iot.vmp.gb28181.bean.GbStream; | 8 | import com.genersoft.iot.vmp.gb28181.bean.GbStream; |
| 9 | +import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; | ||
| 9 | import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookSubscribe; | 10 | import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookSubscribe; |
| 10 | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; | 11 | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| 11 | import com.genersoft.iot.vmp.media.zlm.ZLMServerConfig; | 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 | import com.genersoft.iot.vmp.service.IMediaServerService; | 14 | import com.genersoft.iot.vmp.service.IMediaServerService; |
| 17 | import com.genersoft.iot.vmp.service.IStreamPushService; | 15 | import com.genersoft.iot.vmp.service.IStreamPushService; |
| 18 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 16 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 19 | import com.genersoft.iot.vmp.storager.dao.GbStreamMapper; | 17 | import com.genersoft.iot.vmp.storager.dao.GbStreamMapper; |
| 18 | +import com.genersoft.iot.vmp.storager.dao.ParentPlatformMapper; | ||
| 20 | import com.genersoft.iot.vmp.storager.dao.PlatformGbStreamMapper; | 19 | import com.genersoft.iot.vmp.storager.dao.PlatformGbStreamMapper; |
| 21 | import com.genersoft.iot.vmp.storager.dao.StreamPushMapper; | 20 | import com.genersoft.iot.vmp.storager.dao.StreamPushMapper; |
| 22 | import com.github.pagehelper.PageHelper; | 21 | import com.github.pagehelper.PageHelper; |
| 23 | import com.github.pagehelper.PageInfo; | 22 | import com.github.pagehelper.PageInfo; |
| 24 | import org.springframework.beans.factory.annotation.Autowired; | 23 | import org.springframework.beans.factory.annotation.Autowired; |
| 25 | import org.springframework.stereotype.Service; | 24 | import org.springframework.stereotype.Service; |
| 25 | +import org.springframework.util.StringUtils; | ||
| 26 | 26 | ||
| 27 | import java.util.*; | 27 | import java.util.*; |
| 28 | 28 | ||
| @@ -36,6 +36,9 @@ public class StreamPushServiceImpl implements IStreamPushService { | @@ -36,6 +36,9 @@ public class StreamPushServiceImpl implements IStreamPushService { | ||
| 36 | private StreamPushMapper streamPushMapper; | 36 | private StreamPushMapper streamPushMapper; |
| 37 | 37 | ||
| 38 | @Autowired | 38 | @Autowired |
| 39 | + private ParentPlatformMapper parentPlatformMapper; | ||
| 40 | + | ||
| 41 | + @Autowired | ||
| 39 | private PlatformGbStreamMapper platformGbStreamMapper; | 42 | private PlatformGbStreamMapper platformGbStreamMapper; |
| 40 | 43 | ||
| 41 | @Autowired | 44 | @Autowired |
| @@ -113,6 +116,18 @@ public class StreamPushServiceImpl implements IStreamPushService { | @@ -113,6 +116,18 @@ public class StreamPushServiceImpl implements IStreamPushService { | ||
| 113 | stream.setStreamType("push"); | 116 | stream.setStreamType("push"); |
| 114 | stream.setStatus(true); | 117 | stream.setStatus(true); |
| 115 | int add = gbStreamMapper.add(stream); | 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 | return add > 0; | 131 | return add > 0; |
| 117 | } | 132 | } |
| 118 | 133 |