diff --git a/src/main/java/com/genersoft/iot/vmp/service/IStreamPushService.java b/src/main/java/com/genersoft/iot/vmp/service/IStreamPushService.java index 8a09de7b..c52c325b 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/IStreamPushService.java +++ b/src/main/java/com/genersoft/iot/vmp/service/IStreamPushService.java @@ -30,11 +30,9 @@ public interface IStreamPushService { /** * 获取 - * @param page - * @param count - * @return */ - PageInfo getPushList(Integer page, Integer count); + PageInfo getPushList(Integer page, Integer count, String query, Boolean pushing, String mediaServerId); + List getPushList(String mediaSererId); StreamPushItem transform(MediaItem item); diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java index 948c61ad..c8a4f46d 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java @@ -110,9 +110,9 @@ public class StreamPushServiceImpl implements IStreamPushService { } @Override - public PageInfo getPushList(Integer page, Integer count) { + public PageInfo getPushList(Integer page, Integer count, String query, Boolean pushing, String mediaServerId) { PageHelper.startPage(page, count); - List all = streamPushMapper.selectAll(); + List all = streamPushMapper.selectAllForList(query, pushing, mediaServerId); return new PageInfo<>(all); } diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java index a9f85104..d8ddabe2 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java @@ -32,8 +32,7 @@ public interface PlatformGbStreamMapper { "LEFT JOIN parent_platform pp ON pp.serverGBId = pgs.platformId " + "WHERE " + "pgs.app =#{app} " + - "AND pgs.stream =#{stream} " + - "GROUP BY pp.serverGBId") + "AND pgs.stream =#{stream} ") List selectByAppAndStream(String app, String stream); @Select("SELECT pgs.*, gs.gbId FROM platform_gb_stream pgs " + diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/StreamPushMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/StreamPushMapper.java index 08b7c827..3c43a9db 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/StreamPushMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/StreamPushMapper.java @@ -48,6 +48,27 @@ public interface StreamPushMapper { "") int delAll(List streamPushItems); + + + + @Select(value = {" "}) + List selectAllForList(String query, Boolean pushing, String mediaServerId); + @Select("SELECT st.*, pgs.gbId, pgs.status, pgs.name, pgs.longitude, pgs.latitude FROM stream_push st LEFT JOIN gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream order by st.createStamp desc") List selectAll(); diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java index 3ea207a3..0c34f74e 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java @@ -24,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import org.springframework.web.context.request.async.DeferredResult; import org.springframework.web.multipart.MultipartFile; @@ -57,16 +58,24 @@ public class StreamPushController { @ApiImplicitParam(name="page", value = "当前页", required = true, dataTypeClass = Integer.class), @ApiImplicitParam(name="count", value = "每页查询数量", required = true, dataTypeClass = Integer.class), @ApiImplicitParam(name="query", value = "查询内容", dataTypeClass = String.class), - @ApiImplicitParam(name="online", value = "是否在线", dataTypeClass = Boolean.class), + @ApiImplicitParam(name="pushing", value = "是否正在推流", dataTypeClass = Boolean.class), + @ApiImplicitParam(name="mediaServerId", value = "流媒体ID", dataTypeClass = String.class), }) @GetMapping(value = "/list") @ResponseBody public PageInfo list(@RequestParam(required = false)Integer page, @RequestParam(required = false)Integer count, @RequestParam(required = false)String query, - @RequestParam(required = false)Boolean online ){ + @RequestParam(required = false)Boolean pushing, + @RequestParam(required = false)String mediaServerId ){ - PageInfo pushList = streamPushService.getPushList(page, count); + if (StringUtils.isEmpty(query)) { + query = null; + } + if (StringUtils.isEmpty(mediaServerId)) { + mediaServerId = null; + } + PageInfo pushList = streamPushService.getPushList(page, count, query, pushing, mediaServerId); return pushList; } diff --git a/web_src/src/components/PushVideoList.vue b/web_src/src/components/PushVideoList.vue index 44372dff..ad07aff5 100644 --- a/web_src/src/components/PushVideoList.vue +++ b/web_src/src/components/PushVideoList.vue @@ -9,15 +9,33 @@ 推流列表
+ + 搜索: + + 流媒体: + + + + + 推流状态: + + + + 通道导入 下载模板 -
+ + @@ -73,6 +91,7 @@ import addStreamTOGB from './dialog/addStreamTOGB.vue' import uiHeader from './UiHeader.vue' import importChannel from './dialog/importChannel.vue' + import MediaServer from './service/MediaServer' export default { name: 'pushVideoList', components: { @@ -89,9 +108,14 @@ updateLooper: 0, //数据刷新轮训标志 currentDeviceChannelsLenth:0, winHeight: window.innerHeight - 200, + mediaServerObj : new MediaServer(), currentPage:1, count:15, total:0, + searchSrt: "", + pushing: "", + mediaServerId: "", + mediaServerList: [], getDeviceListLoading: false }; }, @@ -106,6 +130,10 @@ }, methods: { initData: function() { + this.mediaServerObj.getOnlineMediaServerList((data)=>{ + console.log(data) + this.mediaServerList = data.data; + }) this.getPushList(); }, currentChange: function(val){ @@ -124,7 +152,10 @@ url:`/api/push/list`, params: { page: that.currentPage, - count: that.count + count: that.count, + query: that.searchSrt, + pushing: that.pushing, + mediaServerId: that.mediaServerId, } }).then(function (res) { that.total = res.data.total;