Browse Source

修复通道共享的类型选择

648540858 1 year ago
parent
commit
dc12bcf8f1

+ 3 - 2
src/main/java/com/genersoft/iot/vmp/gb28181/controller/PlatformController.java

@@ -189,6 +189,7 @@ public class PlatformController {
     @Parameter(name = "page", description = "当前页", required = true)
     @Parameter(name = "count", description = "每页条数", required = true)
     @Parameter(name = "platformId", description = "上级平台的数据ID")
+    @Parameter(name = "channelType", description = "通道类型, 0:国标设备,1:推流设备,2:拉流代理")
     @Parameter(name = "query", description = "查询内容")
     @Parameter(name = "online", description = "是否在线")
     @Parameter(name = "hasShare", description = "是否已经共享")
@@ -197,7 +198,7 @@ public class PlatformController {
     public PageInfo<PlatformChannel> queryChannelList(int page, int count,
                                                       @RequestParam(required = false) Integer platformId,
                                                       @RequestParam(required = false) String query,
-                                                      @RequestParam(required = false) Boolean channelType,
+                                                      @RequestParam(required = false) Integer channelType,
                                                       @RequestParam(required = false) Boolean online,
                                                       @RequestParam(required = false) Boolean hasShare) {
 
@@ -206,7 +207,7 @@ public class PlatformController {
             query = null;
         }
 
-        return platformChannelService.queryChannelList(page, count, query, online, platformId, hasShare);
+        return platformChannelService.queryChannelList(page, count, query, channelType,  online, platformId, hasShare);
     }
 
     @Operation(summary = "向上级平台添加国标通道", security = @SecurityRequirement(name = JwtUtils.HEADER))

+ 5 - 1
src/main/java/com/genersoft/iot/vmp/gb28181/dao/PlatformChannelMapper.java

@@ -149,9 +149,13 @@ public interface PlatformChannelMapper {
             " <if test='online == false'> AND coalesce(wpgc.status, wdc.gb_status, wdc.status) = 'OFF'</if> " +
             " <if test='hasShare == true'> AND wpgc.platform_id = #{platformId}</if> " +
             " <if test='hasShare == false'> AND wpgc.platform_id is null</if> " +
+            " <if test='channelType == 0'> AND wdc.device_db_id is not null</if> " +
+            " <if test='channelType == 1'> AND wdc.stream_push_id is not null</if> " +
+            " <if test='channelType == 2'> AND wdc.stream_proxy_id is not null</if> " +
             "</script>")
     List<PlatformChannel> queryForPlatformForWebList(@Param("platformId") Integer platformId, @Param("query") String query,
-                                                 @Param("online") Boolean online, @Param("hasShare") Boolean hasShare);
+                                                     @Param("channelType") Integer channelType, @Param("online") Boolean online,
+                                                     @Param("hasShare") Boolean hasShare);
 
     @Select("select\n" +
             "    wdc.id as gb_id,\n" +

+ 1 - 1
src/main/java/com/genersoft/iot/vmp/gb28181/service/IPlatformChannelService.java

@@ -14,7 +14,7 @@ import java.util.List;
  */
 public interface IPlatformChannelService {
 
-    PageInfo<PlatformChannel> queryChannelList(int page, int count, String query, Boolean online, Integer platformId, Boolean hasShare);
+    PageInfo<PlatformChannel> queryChannelList(int page, int count, String query, Integer channelType, Boolean online, Integer platformId, Boolean hasShare);
 
     int addAllChannel(Integer platformId);
 

+ 2 - 2
src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlatformChannelServiceImpl.java

@@ -54,9 +54,9 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
 
 
     @Override
-    public PageInfo<PlatformChannel> queryChannelList(int page, int count, String query, Boolean online, Integer platformId, Boolean hasShare) {
+    public PageInfo<PlatformChannel> queryChannelList(int page, int count, String query, Integer channelType, Boolean online, Integer platformId, Boolean hasShare) {
         PageHelper.startPage(page, count);
-        List<PlatformChannel> all = platformChannelMapper.queryForPlatformForWebList(platformId, query, online, hasShare);
+        List<PlatformChannel> all = platformChannelMapper.queryForPlatformForWebList(platformId, query, channelType, online, hasShare);
         return new PageInfo<>(all);
     }
 

+ 3 - 3
web_src/src/components/dialog/shareChannelAdd.vue

@@ -18,9 +18,9 @@
           <el-select size="mini" style="width: 8rem; margin-right: 1rem;" @change="search" v-model="channelType" placeholder="请选择"
                      default-first-option>
             <el-option label="全部" value=""></el-option>
-            <el-option label="国标设备" value="gb"></el-option>
-            <el-option label="推流设备" value="push"></el-option>
-            <el-option label="拉流代理" value="proxy"></el-option>
+            <el-option label="国标设备" :value="0"></el-option>
+            <el-option label="推流设备" :value="1"></el-option>
+            <el-option label="拉流代理" :value="2"></el-option>
           </el-select>
           添加状态:
           <el-select size="mini" style="width: 8rem; margin-right: 1rem;" @change="search" v-model="hasShare" placeholder="请选择"