适配推流列表信息

pull/1642/head
648540858 2024-07-16 17:33:18 +08:00
parent 90d298f7a7
commit d7abe7fb75
22 changed files with 1154 additions and 884 deletions

View File

@ -78,4 +78,11 @@ public class CommonChannelController {
public void reset(Integer id){
channelService.reset(id);
}
@Operation(summary = "增加通道", security = @SecurityRequirement(name = JwtUtils.HEADER))
@ResponseBody
@PostMapping("/add")
public void add(@RequestBody CommonGBChannel channel){
channelService.add(channel);
}
}

View File

@ -67,11 +67,6 @@ public interface CommonGBChannelMapper {
" <if test='streamPushId != null' > stream_push_id,</if>" +
"create_time," +
"update_time," +
"sub_count," +
"stream_id," +
"has_audio," +
"gps_time," +
"stream_identification," +
"gb_name," +
"gb_manufacturer," +
"gb_model," +
@ -111,11 +106,6 @@ public interface CommonGBChannelMapper {
" <if test='streamPushId != null' > #{streamPushId},</if>" +
"#{createTime}, " +
"#{updateTime}, " +
"#{subCount}, " +
"#{streamId}, " +
"#{hasAudio}, " +
"#{gpsTime}, " +
"#{streamIdentification}, " +
"#{gbName}, " +
"#{gbManufacturer}, " +
"#{gbModel}, " +
@ -351,11 +341,6 @@ public interface CommonGBChannelMapper {
"stream_push_id," +
"create_time," +
"update_time," +
"sub_count," +
"stream_id," +
"has_audio," +
"gps_time," +
"stream_identification," +
"gb_name," +
"gb_manufacturer," +
"gb_model," +
@ -391,8 +376,8 @@ public interface CommonGBChannelMapper {
"gb_svc_time_support_mode ) " +
"VALUES" +
"<foreach collection='commonGBChannels' index='index' item='item' separator=','> " +
"(#{item.gbDeviceId}, #{item.streamProxyId}, #{item.streamPushId},#{item.createTime},#{item.updateTime},#{item.subCount}," +
"#{item.streamId},#{item.hasAudio},#{item.gpsTime},#{item.streamIdentification},#{item.gbName},#{item.gbManufacturer}, #{item.gbModel}," +
"(#{item.gbDeviceId}, #{item.streamProxyId}, #{item.streamPushId},#{item.createTime},#{item.updateTime}," +
"#{item.gbName},#{item.gbManufacturer}, #{item.gbModel}," +
"#{item.gbOwner},#{item.gbCivilCode},#{item.gbBlock}, #{item.gbAddress}, #{item.gbParental}, #{item.gbParentId},#{item.gbSafetyWay}, " +
"#{item.gbRegisterWay},#{item.gbCertNum},#{item.gbCertifiable},#{item.gbErrCode},#{item.gbEndTime}, #{item.gbSecrecy},#{item.gbIpAddress}," +
"#{item.gbPort},#{item.gbPassword},#{item.gbStatus},#{item.gbLongitude}, #{item.gbLatitude},#{item.gbPtzType},#{item.gbPositionType},#{item.gbRoomType}," +
@ -473,4 +458,64 @@ public interface CommonGBChannelMapper {
" </script>"})
void reset(@Param("id") int id, @Param("gbDeviceDbId") int gbDeviceDbId, @Param("updateTime") String updateTime);
@Select(value = {" <script>" +
" select\n" +
" id as gb_id,\n" +
" device_db_id,\n" +
" stream_push_id,\n" +
" stream_proxy_id,\n" +
" create_time,\n" +
" update_time,\n" +
" sub_count,\n" +
" stream_id,\n" +
" has_audio,\n" +
" gps_time,\n" +
" stream_identification,\n" +
" coalesce(gb_device_id, device_id) as gb_device_id,\n" +
" coalesce(gb_name, name) as gb_name,\n" +
" coalesce(gb_manufacturer, manufacturer) as gb_manufacturer,\n" +
" coalesce(gb_model, model) as gb_model,\n" +
" coalesce(gb_owner, owner) as gb_owner,\n" +
" coalesce(gb_civil_code, civil_code) as gb_civil_code,\n" +
" coalesce(gb_block, block) as gb_block,\n" +
" coalesce(gb_address, address) as gb_address,\n" +
" coalesce(gb_parental, parental) as gb_parental,\n" +
" coalesce(gb_parent_id, parent_id) as gb_parent_id,\n" +
" coalesce(gb_safety_way, safety_way) as gb_safety_way,\n" +
" coalesce(gb_register_way, register_way) as gb_register_way,\n" +
" coalesce(gb_cert_num, cert_num) as gb_cert_num,\n" +
" coalesce(gb_certifiable, certifiable) as gb_certifiable,\n" +
" coalesce(gb_err_code, err_code) as gb_err_code,\n" +
" coalesce(gb_end_time, end_time) as gb_end_time,\n" +
" coalesce(gb_secrecy, secrecy) as gb_secrecy,\n" +
" coalesce(gb_ip_address, ip_address) as gb_ip_address,\n" +
" coalesce(gb_port, port) as gb_port,\n" +
" coalesce(gb_password, password) as gb_password,\n" +
" coalesce(gb_status, status) as gb_status,\n" +
" coalesce(gb_longitude, longitude) as gb_longitude,\n" +
" coalesce(gb_latitude, latitude) as gb_latitude,\n" +
" coalesce(gb_ptz_type, ptz_type) as gb_ptz_type,\n" +
" coalesce(gb_position_type, position_type) as gb_position_type,\n" +
" coalesce(gb_room_type, room_type) as gb_room_type,\n" +
" coalesce(gb_use_type, use_type) as gb_use_type,\n" +
" coalesce(gb_supply_light_type, supply_light_type) as gb_supply_light_type,\n" +
" coalesce(gb_direction_type, direction_type) as gb_direction_type,\n" +
" coalesce(gb_resolution, resolution) as gb_resolution,\n" +
" coalesce(gb_business_group_id, business_group_id) as gb_business_group_id,\n" +
" coalesce(gb_download_speed, download_speed) as gb_download_speed,\n" +
" coalesce(gb_svc_space_support_mod, svc_space_support_mod) as gb_svc_space_support_mod,\n" +
" coalesce(gb_svc_time_support_mode,svc_time_support_mode) as gb_svc_time_support_mode\n" +
" from wvp_device_channel" +
" where 1 = 1 and id in " +
" <foreach collection='commonGBChannelList' item='item' open='(' separator=',' close=')' > #{item.gbId}</foreach>" +
"</script>"})
List<CommonGBChannel> queryByIds(List<CommonGBChannel> commonGBChannelList);
@Delete(value = {" <script>" +
" delete from wvp_device_channel" +
" where 1 = 1 and id in " +
" <foreach collection='channelListInDb' item='item' open='(' separator=',' close=')' > #{item.gbId}</foreach>" +
"</script>"})
void batchDelete(List<CommonGBChannel> channelListInDb);
}

View File

@ -15,6 +15,8 @@ public interface IGbChannelService {
int delete(int gbId);
void delete(List<CommonGBChannel> commonGBChannelList);
int update(CommonGBChannel commonGBChannel);
int offline(CommonGBChannel commonGBChannel);
@ -40,4 +42,5 @@ public interface IGbChannelService {
List<NetworkIdentificationType> getNetworkIdentificationTypeList();
void reset(int id);
}

View File

@ -52,9 +52,24 @@ public class GbChannelServiceImpl implements IGbChannelService {
return 1;
}
@Override
public void delete(List<CommonGBChannel> commonGBChannelList) {
List<CommonGBChannel> channelListInDb = commonGBChannelMapper.queryByIds(commonGBChannelList);
if (channelListInDb.isEmpty()) {
return;
}
commonGBChannelMapper.batchDelete(channelListInDb);
try {
// 发送通知
eventPublisher.catalogEventPublish(null, channelListInDb, CatalogEvent.DEL);
}catch (Exception e) {
log.warn("[通道移除通知] 发送失败,{}条", channelListInDb.size(), e);
}
}
@Override
public int update(CommonGBChannel commonGBChannel) {
log.warn("[更新通道] 通道ID: {}, ", commonGBChannel.getGbId());
log.info("[更新通道] 通道ID: {}, ", commonGBChannel.getGbId());
if (commonGBChannel.getGbId() <= 0) {
log.warn("[更新通道] 未找到数据库ID更新失败 {}", commonGBChannel.getGbDeviceDbId());
return 0;

View File

@ -71,7 +71,7 @@ public class StreamProxy extends CommonGBChannel {
@Schema(description = "创建时间")
private String createTime;
public CommonGBChannel getCommonGBChannel() {
public CommonGBChannel buildCommonGBChannel() {
if (ObjectUtils.isEmpty(this.getGbDeviceId())) {
return null;
}

View File

@ -169,7 +169,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
streamProxy.setUpdateTime(now);
if (streamProxyMapper.add(streamProxy) > 0 && !ObjectUtils.isEmpty(streamProxy.getGbDeviceId())) {
gbChannelService.add(streamProxy.getCommonGBChannel());
gbChannelService.add(streamProxy.buildCommonGBChannel());
}
return true;
}
@ -183,9 +183,9 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
if (streamProxyMapper.update(streamProxy) > 0 && !ObjectUtils.isEmpty(streamProxy.getGbDeviceId())) {
if (streamProxy.getGbId() > 0) {
gbChannelService.update(streamProxy.getCommonGBChannel());
gbChannelService.update(streamProxy.buildCommonGBChannel());
}else {
gbChannelService.add(streamProxy.getCommonGBChannel());
gbChannelService.add(streamProxy.buildCommonGBChannel());
}
}
return true;
@ -303,7 +303,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
redisCatchStorage.addStream(mediaServer, "pull", streamInfo.getApp(), streamInfo.getStream(), streamInfo.getMediaInfo());
if ("OFF".equalsIgnoreCase(streamProxy.getGbStatus()) && streamProxy.getGbId() > 0) {
streamProxy.setGbStatus("ON");
channelListForOnline.add(streamProxy.getCommonGBChannel());
channelListForOnline.add(streamProxy.buildCommonGBChannel());
}
streamProxyMapForDb.remove(key);
}
@ -319,7 +319,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
for (StreamProxy streamProxy : streamProxyMapForDb.values()) {
if ("ON".equalsIgnoreCase(streamProxy.getGbStatus()) && streamProxy.getGbId() > 0) {
streamProxy.setGbStatus("OFF");
channelListForOffline.add(streamProxy.getCommonGBChannel());
channelListForOffline.add(streamProxy.buildCommonGBChannel());
}
// 移除开启了无人观看自动移除的流
if (streamProxy.getGbDeviceId() == null && streamProxy.isEnableRemoveNoneReader()) {
@ -360,7 +360,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
for (StreamProxy streamProxy : streamProxies) {
if (streamProxy.getGbId() > 0 && "ON".equalsIgnoreCase(streamProxy.getGbStatus())) {
channelListForOffline.add(streamProxy.getCommonGBChannel());
channelListForOffline.add(streamProxy.buildCommonGBChannel());
}
if (streamProxy.getGbId() == 0 && streamProxy.isEnableRemoveNoneReader()) {
streamProxiesForRemove.add(streamProxy);
@ -400,9 +400,9 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
streamProxy.setGbStatus(status?"ON":"OFF");
if (streamProxy.getGbId() > 0) {
if (status) {
gbChannelService.online(streamProxy.getCommonGBChannel());
gbChannelService.online(streamProxy.buildCommonGBChannel());
}else {
gbChannelService.offline(streamProxy.getCommonGBChannel());
gbChannelService.offline(streamProxy.buildCommonGBChannel());
}
}

View File

@ -0,0 +1,10 @@
package com.genersoft.iot.vmp.streamPush.bean;
import lombok.Data;
import java.util.Set;
@Data
public class BatchRemoveParam {
private Set<Integer> ids;
}

View File

@ -83,13 +83,13 @@ public class StreamPush extends CommonGBChannel implements Comparable<StreamPush
}
public StreamPush getInstance(StreamInfo streamInfo) {
StreamPush streamPushItem = new StreamPush();
streamPushItem.setApp(streamInfo.getApp());
streamPushItem.setMediaServerId(streamInfo.getMediaServerId());
streamPushItem.setStream(streamInfo.getStream());
streamPushItem.setCreateTime(DateUtil.getNow());
streamPushItem.setServerId(streamInfo.getMediaServerId());
return streamPushItem;
StreamPush streamPush = new StreamPush();
streamPush.setApp(streamInfo.getApp());
streamPush.setMediaServerId(streamInfo.getMediaServerId());
streamPush.setStream(streamInfo.getStream());
streamPush.setCreateTime(DateUtil.getNow());
streamPush.setServerId(streamInfo.getMediaServerId());
return streamPush;
}
@ -103,7 +103,7 @@ public class StreamPush extends CommonGBChannel implements Comparable<StreamPush
return streamPushItem;
}
public CommonGBChannel getCommonGBChannel() {
public CommonGBChannel buildCommonGBChannel() {
if (ObjectUtils.isEmpty(this.getGbDeviceId())) {
return null;
}

View File

@ -13,6 +13,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
import com.genersoft.iot.vmp.media.service.IMediaServerService;
import com.genersoft.iot.vmp.service.IMediaService;
import com.genersoft.iot.vmp.streamPush.bean.BatchRemoveParam;
import com.genersoft.iot.vmp.streamPush.bean.StreamPush;
import com.genersoft.iot.vmp.streamPush.bean.StreamPushExcelDto;
import com.genersoft.iot.vmp.streamPush.enent.StreamPushUploadFileHandler;
@ -88,13 +89,12 @@ public class StreamPushController {
}
@PostMapping(value = "/stop")
@PostMapping(value = "/remove")
@ResponseBody
@Operation(summary = "中止一个推流", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "app", description = "应用名", required = true)
@Parameter(name = "stream", description = "流id", required = true)
public void stop(String app, String stream){
if (!streamPushService.stopByAppAndStream(app, stream)){
@Operation(summary = "删除", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "id", description = "应用名", required = true)
public void delete(int id){
if (streamPushService.delete(id) > 0){
throw new ControllerException(ErrorCode.ERROR100);
}
}
@ -232,7 +232,7 @@ public class StreamPushController {
@PostMapping(value = "/add")
@ResponseBody
@Operation(summary = "添加推流信息", security = @SecurityRequirement(name = JwtUtils.HEADER))
public void add(@RequestBody StreamPush stream){
public StreamPush add(@RequestBody StreamPush stream){
if (ObjectUtils.isEmpty(stream.getGbId())) {
throw new ControllerException(ErrorCode.ERROR400.getCode(), "国标ID不可为空");
}
@ -244,5 +244,29 @@ public class StreamPushController {
if (!streamPushService.add(stream)) {
throw new ControllerException(ErrorCode.ERROR100);
}
stream.setStreamPushId(stream.getId());
return stream;
}
@PostMapping(value = "/update")
@ResponseBody
@Operation(summary = "更新推流信息", security = @SecurityRequirement(name = JwtUtils.HEADER))
public void update(@RequestBody StreamPush stream){
if (ObjectUtils.isEmpty(stream.getId())) {
throw new ControllerException(ErrorCode.ERROR400.getCode(), "ID不可为空");
}
if (!streamPushService.update(stream)) {
throw new ControllerException(ErrorCode.ERROR100);
}
}
@DeleteMapping(value = "/batchRemove")
@ResponseBody
@Operation(summary = "删除多个推流", security = @SecurityRequirement(name = JwtUtils.HEADER))
public void batchStop(@RequestBody BatchRemoveParam ids){
if(ids.getIds().isEmpty()) {
return;
}
streamPushService.batchRemove(ids.getIds());
}
}

View File

@ -1,6 +1,5 @@
package com.genersoft.iot.vmp.streamPush.dao;
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
import com.genersoft.iot.vmp.streamPush.bean.StreamPush;
import com.genersoft.iot.vmp.service.bean.StreamPushItemFromRedis;
import org.apache.ibatis.annotations.*;
@ -8,207 +7,132 @@ import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
import java.util.Set;
@Mapper
@Repository
public interface StreamPushMapper {
@Insert("INSERT INTO wvp_stream_push (app, stream, total_reader_count, origin_type, origin_type_str, " +
"push_time, alive_second, media_server_id, server_id, update_time, create_time, push_ing, self) VALUES" +
"(#{app}, #{stream}, #{totalReaderCount}, #{originType}, #{originTypeStr}, " +
"#{pushTime}, #{aliveSecond}, #{mediaServerId} , #{serverId} , #{updateTime} , #{createTime}, " +
"#{pushIng}, #{self} )")
@Insert("INSERT INTO wvp_stream_push (app, stream, media_server_id, server_id, push_time, update_time, create_time, push_ing) VALUES" +
"(#{app}, #{stream}, #{mediaServerId} , #{serverId} , #{pushTime} ,#{updateTime}, #{createTime}, #{pushIng})")
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
int add(StreamPush streamPushItem);
@Update(value = {" <script>" +
"UPDATE wvp_stream_push " +
"SET update_time=#{updateTime}" +
"<if test=\"app != null\">, app=#{app}</if>" +
"<if test=\"stream != null\">, stream=#{stream}</if>" +
"<if test=\"mediaServerId != null\">, media_server_id=#{mediaServerId}</if>" +
"<if test=\"serverId != null\">, server_id=#{serverId}</if>" +
"<if test=\"totalReaderCount != null\">, total_reader_count=#{totalReaderCount}</if>" +
"<if test=\"originType != null\">, origin_type=#{originType}</if>" +
"<if test=\"originTypeStr != null\">, origin_type_str=#{originTypeStr}</if>" +
"<if test=\"pushTime != null\">, push_time=#{pushTime}</if>" +
"<if test=\"aliveSecond != null\">, alive_second=#{aliveSecond}</if>" +
"<if test=\"pushIng != null\">, push_ing=#{pushIng}</if>" +
"<if test=\"self != null\">, self=#{self}</if>" +
"WHERE app=#{app} AND stream=#{stream}"+
"WHERE id = #{id}"+
" </script>"})
int update(StreamPush streamPushItem);
@Delete("DELETE FROM wvp_stream_push WHERE app=#{app} AND stream=#{stream}")
int del(String app, String stream);
@Delete("<script> "+
"DELETE sp FROM wvp_stream_push sp left join wvp_gb_stream gs on sp.app = gs.app AND sp.stream = gs.stream where " +
"<foreach collection='streamPushItems' item='item' separator='or'>" +
"(sp.app=#{item.app} and sp.stream=#{item.stream} and gs.gb_id is null) " +
"</foreach>" +
"</script>")
int delAllWithoutGBId(List<StreamPush> streamPushItems);
@Delete("<script> "+
"DELETE FROM wvp_stream_push where " +
"<foreach collection='streamPushItems' item='item' separator='or'>" +
"(app=#{item.app} and stream=#{item.stream}) " +
"</foreach>" +
"</script>")
int delAll(List<StreamPush> streamPushItems);
@Delete("<script> "+
"DELETE FROM wvp_stream_push where " +
"<foreach collection='gbStreams' item='item' separator='or'>" +
"(app=#{item.app} and stream=#{item.stream}) " +
"</foreach>" +
"</script>")
int delAllForGbStream(List<GbStream> gbStreams);
@Delete("DELETE FROM wvp_stream_push WHERE id=#{id}")
int del(@Param("id") int id);
@Select(value = {" <script>" +
"SELECT " +
"st.*, " +
"gs.gb_id, gs.name, gs.longitude, gs.latitude, gs.gb_stream_id " +
"from " +
"wvp_stream_push st " +
"LEFT join wvp_gb_stream gs " +
"on st.app = gs.app AND st.stream = gs.stream " +
"WHERE " +
"1=1 " +
" <if test='query != null'> AND (st.app LIKE concat('%',#{query},'%') OR st.stream LIKE concat('%',#{query},'%') OR gs.gb_id LIKE concat('%',#{query},'%') OR gs.name LIKE concat('%',#{query},'%'))</if> " +
" <if test='pushing == true' > AND (gs.gb_id is null OR st.push_ing=1)</if>" +
" <if test='pushing == false' > AND (st.push_ing is null OR st.push_ing=0) </if>" +
" SELECT " +
" st.*, " +
" st.id as stream_push_id, " +
" wdc.*, " +
" wdc.id as gb_id" +
" from " +
" wvp_stream_push st " +
" LEFT join wvp_device_channel wdc " +
" on st.id = wdc.stream_push_id " +
" WHERE " +
" 1=1 " +
" <if test='query != null'> AND (st.app LIKE concat('%',#{query},'%') OR st.stream LIKE concat('%',#{query},'%') " +
" OR wdc.gb_device_id LIKE concat('%',#{query},'%') OR wdc.gb_name LIKE concat('%',#{query},'%'))</if> " +
" <if test='pushing == true' > AND st.push_ing=1</if>" +
" <if test='pushing == false' > AND st.push_ing=0 </if>" +
" <if test='mediaServerId != null' > AND st.media_server_id=#{mediaServerId} </if>" +
"order by st.create_time desc" +
" order by st.create_time desc" +
" </script>"})
List<StreamPush> selectAllForList(@Param("query") String query, @Param("pushing") Boolean pushing, @Param("mediaServerId") String mediaServerId);
@Select("SELECT st.*, gs.gb_id, gs.name, gs.longitude, gs.latitude FROM wvp_stream_push st LEFT join wvp_gb_stream gs on st.app = gs.app AND st.stream = gs.stream order by st.create_time desc")
List<StreamPush> selectAll();
@Select("SELECT st.*, gs.gb_id, gs.name, gs.longitude, gs.latitude FROM wvp_stream_push st LEFT join wvp_gb_stream gs on st.app = gs.app AND st.stream = gs.stream WHERE st.app=#{app} AND st.stream=#{stream}")
@Select("SELECT st.*, st.id as stream_push_id, wdc.*, wdc.id as gb_id FROM wvp_stream_push st LEFT join wvp_device_channel wdc on st.id = wdc.stream_push_id WHERE st.app=#{app} AND st.stream=#{stream}")
StreamPush selectByAppAndStream(@Param("app") String app, @Param("stream") String stream);
@Insert("<script>" +
"Insert INTO wvp_stream_push (app, stream, total_reader_count, origin_type, origin_type_str, " +
"create_time, alive_second, media_server_id, server_id, status, push_ing) " +
"VALUES <foreach collection='streamPushItems' item='item' index='index' separator=','>" +
"( #{item.app}, #{item.stream}, #{item.totalReaderCount}, #{item.originType}, " +
"#{item.originTypeStr},#{item.createTime}, #{item.aliveSecond}, #{item.mediaServerId},#{item.serverId}, #{item.status} ," +
" #{item.pushIng} )" +
"Insert INTO wvp_stream_push ( " +
" app, stream, media_server_id, server_id, push_time, update_time, create_time, push_ing) " +
" VALUES <foreach collection='streamPushItems' item='item' index='index' separator=','>" +
" ( #{item.app}, #{item.stream}, #{item.mediaServerId},#{item.serverId} ,#{item.pushTime}, #{item.updateTime}, #{item.createTime}, #{item.pushIng} )" +
" </foreach>" +
"</script>")
" </script>")
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
int addAll(List<StreamPush> streamPushItems);
@Delete("DELETE FROM wvp_stream_push")
void clear();
@Delete("delete" +
" from wvp_stream_push " +
" where id in " +
" (select temp.id from " +
" (select wgs.gb_stream_id as id " +
" from wvp_gb_stream wgs" +
" left join wvp_stream_push sp on sp.id = wgs.gb_stream_id" +
" where wgs.gb_id is null and wgs.media_server_id = #{mediaServerId}) temp)"
)
void deleteWithoutGBId(String mediaServerId);
@Select("SELECT * FROM wvp_stream_push WHERE media_server_id=#{mediaServerId}")
@Select("SELECT st.*, st.id as stream_push_id, wdc.*, wdc.id as gb_id FROM wvp_stream_push st LEFT join wvp_device_channel wdc on st.id = wdc.stream_push_id WHERE st.media_server_id=#{mediaServerId}")
List<StreamPush> selectAllByMediaServerId(String mediaServerId);
@Select("SELECT sp.* FROM wvp_stream_push sp left join wvp_gb_stream gs on gs.app = sp.app and gs.stream= sp.stream WHERE sp.media_server_id=#{mediaServerId} and gs.gb_id is null")
@Select("SELECT st.*, st.id as stream_push_id, wdc.*, wdc.id as gb_id FROM wvp_stream_push st LEFT join wvp_device_channel wdc on st.id = wdc.stream_push_id WHERE st.media_server_id=#{mediaServerId} and wdc.gb_device_id is null")
List<StreamPush> selectAllByMediaServerIdWithOutGbID(String mediaServerId);
@Update("UPDATE wvp_stream_push " +
"SET status=#{status} " +
"WHERE app=#{app} AND stream=#{stream}")
int updateStatus(@Param("app") String app, @Param("stream") String stream, @Param("status") boolean status);
@Update("UPDATE wvp_stream_push " +
"SET push_ing=#{pushIng} " +
"WHERE app=#{app} AND stream=#{stream}")
int updatePushStatus(@Param("app") String app, @Param("stream") String stream, @Param("pushIng") boolean pushIng);
@Update("UPDATE wvp_stream_push " +
"SET status=#{status} " +
"WHERE media_server_id=#{mediaServerId}")
void updateStatusByMediaServerId(@Param("mediaServerId") String mediaServerId, @Param("status") boolean status);
"WHERE id=#{id}")
int updatePushStatus(@Param("id") int id, @Param("pushIng") boolean pushIng);
@Select("<script> "+
"SELECT gs.* FROM wvp_stream_push sp left join wvp_gb_stream gs on sp.app = gs.app AND sp.stream = gs.stream " +
"where sp.status = true and (gs.app, gs.stream) in (" +
"SELECT st.*, st.id as stream_push_id, wdc.*, wdc.id as gb_id FROM wvp_stream_push st LEFT join wvp_device_channel wdc on st.id = wdc.stream_push_id " +
"where (st.app, st.stream) in (" +
"<foreach collection='offlineStreams' item='item' separator=','>" +
"(#{item.app}, #{item.stream}) " +
"</foreach>" +
")</script>")
List<StreamPush> getOnlinePusherForGbInList(List<StreamPushItemFromRedis> offlineStreams);
List<StreamPush> getListFromRedis(List<StreamPushItemFromRedis> offlineStreams);
@Update("<script> "+
"UPDATE wvp_stream_push SET status=0 where (app, stream) in (" +
"<foreach collection='offlineStreams' item='item' separator=','>" +
"(#{item.app}, #{item.stream}) " +
"</foreach>" +
")</script>")
void offline(List<StreamPushItemFromRedis> offlineStreams);
@Select("<script> "+
"SELECT * FROM wvp_stream_push sp left join wvp_gb_stream gs on sp.app = gs.app AND sp.stream = gs.stream " +
"where sp.status = 0 and (gs.app, gs.stream) in (" +
"<foreach collection='onlineStreams' item='item' separator=','>" +
"(#{item.app}, #{item.stream}) " +
"</foreach>" +
") </script>")
List<StreamPush> getOfflinePusherForGbInList(List<StreamPushItemFromRedis> onlineStreams);
@Update("<script> "+
"UPDATE wvp_stream_push SET status=1 where (app, stream) in (" +
"<foreach collection='onlineStreams' item='item' separator=','>" +
"(#{item.app}, #{item.stream}) " +
"</foreach>" +
")</script>")
void online(List<StreamPushItemFromRedis> onlineStreams);
@Select("SELECT gs.* FROM wvp_stream_push sp left join wvp_gb_stream gs on sp.app = gs.app AND sp.stream = gs.stream where sp.status = true")
List<StreamPush> getOnlinePusherForGb();
@Update("UPDATE wvp_stream_push SET status=0")
void setAllStreamOffline();
@Select("SELECT CONCAT(app,stream) from wvp_gb_stream")
@Select("SELECT CONCAT(app,stream) from wvp_stream_push")
List<String> getAllAppAndStream();
@Select("select count(1) from wvp_stream_push ")
int getAllCount();
@Select(value = {" <script>" +
" <if test='pushIngAsOnline == true'> select count(1) from wvp_stream_push where push_ing = true </if>" +
" <if test='pushIngAsOnline == false'> select count(1)from wvp_stream_push where status = true </if>" +
" select count(1) from wvp_stream_push where push_ing = true" +
" </script>"})
int getAllOnline(Boolean usePushingAsStatus);
@Select("<script> " +
"select app, stream from wvp_stream_push where (app, stream) in " +
"<foreach collection='streamPushItems' item='item' separator=','>" +
"(#{item.app}, #{item.stream}) " +
"</foreach>" +
"</script>")
List<StreamPush> getListIn(List<StreamPush> streamPushItems);
int getAllPushing(Boolean usePushingAsStatus);
@MapKey("vhost")
@Select("SELECT CONCAT(wsp.app, wsp.stream) as vhost, wsp.app, wsp.stream, wgs.gb_id, wgs.name " +
@Select("SELECT CONCAT(wsp.app, wsp.stream) as vhost, wsp.*, wsp.* , wsp.id as gb_id " +
" from wvp_stream_push wsp " +
" left join wvp_gb_stream wgs on wgs.app = wsp.app and wgs.stream = wsp.stream")
" LEFT join wvp_device_channel wdc on wsp.id = wdc.stream_push_id")
Map<String, StreamPush> getAllAppAndStreamMap();
@MapKey("gb_id")
@Select("SELECT wgs.gb_id, wsp.app, wsp.stream, wgs.gb_id, wgs.name " +
@MapKey("gb_device_id")
@Select("SELECT wdc.gb_device_id, wsp.id as stream_push_id, wsp.*, wsp.* , wsp.id as gb_id " +
" from wvp_stream_push wsp " +
" left join wvp_gb_stream wgs on wgs.app = wsp.app and wgs.stream = wsp.stream")
" LEFT join wvp_device_channel wdc on wsp.id = wdc.stream_push_id")
Map<String, StreamPush> getAllGBId();
StreamPush select(Integer streamPushId);
@Select("SELECT st.*, st.id as stream_push_id, wdc.*, wdc.id as gb_id FROM wvp_stream_push st LEFT join wvp_device_channel wdc on st.id = wdc.stream_push_id WHERE st.id=#{id}")
StreamPush select(@Param("id") int id);
@Select("<script> "+
"SELECT st.*, st.id as stream_push_id, wdc.*, wdc.id as gb_id FROM wvp_stream_push st LEFT join wvp_device_channel wdc on st.id = wdc.stream_push_id " +
" where st.id in (" +
" <foreach collection='ids' item='item' separator=','>" +
" #{item} " +
" </foreach>" +
" )</script>")
List<StreamPush> selectInSet(Set<Integer> ids);
@Delete("<script> "+
"DELETE FROM wvp_stream_push WHERE" +
" id in (" +
"<foreach collection='streamPushList' item='item' separator=','>" +
" #{item.id} " +
"</foreach>" +
")</script>")
void batchDel(List<StreamPush> streamPushList);
}

View File

@ -110,7 +110,7 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener<StreamPus
streamPush.setGbName(streamPushExcelDto.getName());
streamPush.setGbLongitude(streamPushExcelDto.getLongitude());
streamPush.setGbLatitude(streamPushExcelDto.getLatitude());
streamPush.setUpdateTime(DateUtil.getNow());
streamPushItemForSave.put(streamPush.getApp() + streamPush.getStream(), streamPush);
loadedSize ++;

View File

@ -7,6 +7,7 @@ import com.github.pagehelper.PageInfo;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* @author lin
@ -92,4 +93,8 @@ public interface IStreamPushService {
void updatePushStatus(Integer streamPushId, boolean pushIng);
void batchUpdate(List<StreamPush> streamPushItemForUpdate);
int delete(int id);
void batchRemove(Set<Integer> ids);
}

View File

@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.genersoft.iot.vmp.common.StreamInfo;
import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.conf.exception.ControllerException;
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
import com.genersoft.iot.vmp.gb28181.service.IGbChannelService;
import com.genersoft.iot.vmp.media.bean.MediaInfo;
@ -21,6 +22,7 @@ import com.genersoft.iot.vmp.streamPush.bean.StreamPush;
import com.genersoft.iot.vmp.streamPush.dao.StreamPushMapper;
import com.genersoft.iot.vmp.streamPush.service.IStreamPushService;
import com.genersoft.iot.vmp.utils.DateUtil;
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
import com.genersoft.iot.vmp.vmanager.bean.StreamContent;
import com.github.pagehelper.PageHelper;
@ -205,6 +207,10 @@ public class StreamPushServiceImpl implements IStreamPushService {
@Transactional
public boolean add(StreamPush stream) {
log.info("[添加推流] app: {}, stream: {}, 国标编号: {}", stream.getApp(), stream.getStream(), stream.getGbDeviceId());
StreamPush streamPushInDb = streamPushMapper.selectByAppAndStream(stream.getApp(), stream.getStream());
if (streamPushInDb != null) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "应用名+流ID已存在");
}
stream.setUpdateTime(DateUtil.getNow());
stream.setCreateTime(DateUtil.getNow());
int addResult = streamPushMapper.add(stream);
@ -218,7 +224,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
if (channel != null) {
log.info("[添加推流]失败,国标编号已存在: {} app: {}, stream: {}, ", stream.getGbDeviceId(), stream.getApp(), stream.getStream());
}
int addChannelResult = gbChannelService.add(stream.getCommonGBChannel());
int addChannelResult = gbChannelService.add(stream.buildCommonGBChannel());
return addChannelResult > 0;
}
@ -243,10 +249,18 @@ public class StreamPushServiceImpl implements IStreamPushService {
public boolean update(StreamPush streamPush) {
log.info("[更新推流]id: {}, app: {}, stream: {}, ", streamPush.getId(), streamPush.getApp(), streamPush.getStream());
assert streamPush.getId() != null;
StreamPush streamPushInDb = streamPushMapper.select(streamPush.getId());
if (!streamPushInDb.getApp().equals(streamPush.getApp()) || !streamPushInDb.getStream().equals(streamPush.getStream())) {
// app或者stream变化
StreamPush streamPushInDbForAppAndStream = streamPushMapper.selectByAppAndStream(streamPush.getApp(), streamPush.getStream());
if (streamPushInDbForAppAndStream != null && !streamPushInDbForAppAndStream.getId().equals(streamPush.getId())) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "应用名+流ID已存在");
}
}
streamPush.setUpdateTime(DateUtil.getNow());
streamPushMapper.update(streamPush);
if (streamPush.getGbId() > 0) {
gbChannelService.update(streamPush.getCommonGBChannel());
gbChannelService.update(streamPush.buildCommonGBChannel());
}
return true;
}
@ -282,7 +296,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
}
streamPush.setPushIng(false);
if (userSetting.isUsePushingAsStatus()) {
gbChannelService.offline(streamPush.getCommonGBChannel());
gbChannelService.offline(streamPush.buildCommonGBChannel());
}
redisCatchStorage.deleteSendRTPServer(null, streamPush.getGbDeviceId(), null, streamPush.getStream());
mediaServerService.stopSendRtp(mediaServer, streamPush.getApp(), streamPush.getStream(), null);
@ -440,8 +454,8 @@ public class StreamPushServiceImpl implements IStreamPushService {
streamPushMapper.addAll(streamPushItems);
List<CommonGBChannel> commonGBChannels = new ArrayList<>();
for (StreamPush streamPush : streamPushItems) {
if (ObjectUtils.isEmpty(streamPush.getGbDeviceId())) {
commonGBChannels.add(streamPush.getCommonGBChannel());
if (!ObjectUtils.isEmpty(streamPush.getGbDeviceId())) {
commonGBChannels.add(streamPush.buildCommonGBChannel());
}
}
gbChannelService.batchAdd(commonGBChannels);
@ -449,13 +463,13 @@ public class StreamPushServiceImpl implements IStreamPushService {
@Override
public void allOffline() {
List<StreamPush> onlinePushers = streamPushMapper.getOnlinePusherForGb();
if (onlinePushers.isEmpty()) {
List<StreamPush> streamPushList = streamPushMapper.selectAllForList(null, null, null);
if (streamPushList.isEmpty()) {
return;
}
List<CommonGBChannel> commonGBChannelList = new ArrayList<>();
for (StreamPush onlinePusher : onlinePushers) {
commonGBChannelList.add(onlinePusher.getCommonGBChannel());
for (StreamPush streamPush : streamPushList) {
commonGBChannelList.add(streamPush.buildCommonGBChannel());
}
gbChannelService.offline(commonGBChannelList);
}
@ -463,10 +477,10 @@ public class StreamPushServiceImpl implements IStreamPushService {
@Override
public void offline(List<StreamPushItemFromRedis> offlineStreams) {
// 更新部分设备离线
List<StreamPush> onlinePushers = streamPushMapper.getOnlinePusherForGbInList(offlineStreams);
List<StreamPush> streamPushList = streamPushMapper.getListFromRedis(offlineStreams);
List<CommonGBChannel> commonGBChannelList = new ArrayList<>();
for (StreamPush onlinePusher : onlinePushers) {
commonGBChannelList.add(onlinePusher.getCommonGBChannel());
for (StreamPush onlinePusher : streamPushList) {
commonGBChannelList.add(onlinePusher.buildCommonGBChannel());
}
gbChannelService.offline(commonGBChannelList);
}
@ -474,10 +488,10 @@ public class StreamPushServiceImpl implements IStreamPushService {
@Override
public void online(List<StreamPushItemFromRedis> onlineStreams) {
// 更新部分设备上线streamPushService
List<StreamPush> offlinePushers = streamPushMapper.getOfflinePusherForGbInList(onlineStreams);
List<StreamPush> streamPushList = streamPushMapper.getListFromRedis(onlineStreams);
List<CommonGBChannel> commonGBChannelList = new ArrayList<>();
for (StreamPush onlinePusher : offlinePushers) {
commonGBChannelList.add(onlinePusher.getCommonGBChannel());
for (StreamPush onlinePusher : streamPushList) {
commonGBChannelList.add(onlinePusher.buildCommonGBChannel());
}
gbChannelService.online(commonGBChannelList);
}
@ -491,7 +505,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
@Override
public ResourceBaseInfo getOverview() {
int total = streamPushMapper.getAllCount();
int online = streamPushMapper.getAllOnline(userSetting.isUsePushingAsStatus());
int online = streamPushMapper.getAllPushing(userSetting.isUsePushingAsStatus());
return new ResourceBaseInfo(total, online);
}
@ -512,9 +526,9 @@ public class StreamPushServiceImpl implements IStreamPushService {
return;
}
if ("ON".equalsIgnoreCase(push.getGbStatus())) {
gbChannelService.online(push.getCommonGBChannel());
gbChannelService.online(push.buildCommonGBChannel());
}else {
gbChannelService.offline(push.getCommonGBChannel());
gbChannelService.offline(push.buildCommonGBChannel());
}
}
@ -556,4 +570,38 @@ public class StreamPushServiceImpl implements IStreamPushService {
public void batchUpdate(List<StreamPush> streamPushItemForUpdate) {
}
@Override
@Transactional
public int delete(int id) {
StreamPush streamPush = streamPushMapper.select(id);
if (streamPush == null) {
return 0;
}
if(streamPush.isPushIng()) {
MediaServer mediaServer = mediaServerService.getOne(streamPush.getMediaServerId());
mediaServerService.closeStreams(mediaServer, streamPush.getApp(), streamPush.getStream());
}
if (streamPush.getGbDeviceId() != null) {
gbChannelService.delete(streamPush.getGbId());
}
return streamPushMapper.del(id);
}
@Override
@Transactional
public void batchRemove(Set<Integer> ids) {
List<StreamPush> streamPushList = streamPushMapper.selectInSet(ids);
if (streamPushList.isEmpty()) {
return;
}
List<CommonGBChannel> commonGBChannelList = new ArrayList<>();
streamPushList.stream().forEach(streamPush -> {
if (streamPush.getGbDeviceId() != null) {
commonGBChannelList.add(streamPush.buildCommonGBChannel());
}
});
streamPushMapper.batchDel(streamPushList);
gbChannelService.delete(commonGBChannelList);
}
}

View File

@ -1,6 +1,6 @@
<template>
<div id="ChannelEdit" v-loading="locading" style="width: 100%">
<div v-if="form.gbId" class="page-header">
<div class="page-header">
<div class="page-title">
<el-button icon="el-icon-back" size="mini" style="font-size: 20px; color: #000;" type="text" @click="close" ></el-button>
<el-divider direction="vertical"></el-divider>
@ -12,333 +12,26 @@
</div>
</div>
</div>
<el-form ref="passwordForm" status-icon label-width="160px" class="channel-form">
<div class="form-box">
<el-form-item label="名称" >
<el-input v-model="form.gbName" placeholder="请输入通道名称"></el-input>
</el-form-item>
<el-form-item label="编码" >
<el-input v-model="form.gbDeviceId" placeholder="请输入通道编码">
<el-button slot="append" @click="buildDeviceIdCode(form.gbDeviceId)"></el-button>
</el-input>
</el-form-item>
<el-form-item label="设备厂商" >
<el-input v-model="form.gbManufacturer" placeholder="请输入设备厂商"></el-input>
</el-form-item>
<el-form-item label="设备型号" >
<el-input v-model="form.gbModel" placeholder="请输入设备型号"></el-input>
</el-form-item>
<el-form-item label="行政区域" >
<el-input v-model="form.gbCivilCode" placeholder="请输入行政区域"></el-input>
</el-form-item>
<el-form-item label="安装地址" >
<el-input v-model="form.gbAddress" placeholder="请输入安装地址"></el-input>
</el-form-item>
<el-form-item label="子设备" >
<el-select v-model="form.gbParental" style="width: 100%" placeholder="请选择是否有子设备">
<el-option label="有" :value="1"></el-option>
<el-option label="无" :value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item label="父节点编码" >
<el-input v-model="form.gbParentId" placeholder="请输入父节点编码"></el-input>
</el-form-item>
<el-form-item label="设备状态" >
<el-select v-model="form.gbStatus" style="width: 100%" placeholder="请选择设备状态">
<el-option label="在线" value="ON"></el-option>
<el-option label="离线" value="OFF"></el-option>
</el-select>
</el-form-item>
<el-form-item label="经度" >
<el-input v-model="form.gbLongitude" placeholder="请输入经度"></el-input>
</el-form-item>
<el-form-item label="纬度" >
<el-input v-model="form.gbLatitude" placeholder="请输入纬度"></el-input>
</el-form-item>
<el-form-item label="云台类型" >
<el-select v-model="form.gbPtzType" style="width: 100%" placeholder="请选择云台类型">
<el-option label="球机" :value="1"></el-option>
<el-option label="半球" :value="2"></el-option>
<el-option label="固定枪机" :value="3"></el-option>
<el-option label="遥控枪机" :value="4"></el-option>
<el-option label="遥控半球" :value="5"></el-option>
<el-option label="多目设备的全景/拼接通道" :value="6"></el-option>
<el-option label="多目设备的分割通道" :value="7"></el-option>
</el-select>
</el-form-item>
</div>
<div>
<el-form-item label="警区" >
<el-input v-model="form.gbBlock" placeholder="请输入警区"></el-input>
</el-form-item>
<el-form-item label="设备归属" >
<el-input v-model="form.gbOwner" placeholder="请输入设备归属"></el-input>
</el-form-item>
<el-form-item label="信令安全模式" >
<el-select v-model="form.gbSafetyWay" style="width: 100%" placeholder="请选择信令安全模式">
<el-option label="不采用" :value="0"></el-option>
<el-option label="S/MIME签名" :value="2"></el-option>
<el-option label="S/MIME加密签名同时采用" :value="3"></el-option>
<el-option label="数字摘要" :value="4"></el-option>
</el-select>
</el-form-item>
<el-form-item label="注册方式" >
<el-select v-model="form.gbRegisterWay" style="width: 100%" placeholder="请选择注册方式">
<el-option label="IETFRFC3261标准" :value="1"></el-option>
<el-option label="基于口令的双向认证" :value="2"></el-option>
<el-option label="基于数字证书的双向认证注册" :value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item label="证书序列号" >
<el-input type="number" v-model="form.gbCertNum" placeholder="请输入证书序列号"></el-input>
</el-form-item>
<el-form-item label="证书有效标识" >
<el-select v-model="form.gbCertifiable" style="width: 100%" placeholder="请选择证书有效标识">
<el-option label="有效" :value="1"></el-option>
<el-option label="无效" :value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item label="无效原因码" >
<el-input type="errCode" v-model="form.gbCertNum" placeholder="请输入无效原因码"></el-input>
</el-form-item>
<el-form-item label="证书终止有效期" >
<el-date-picker
v-model="form.gbEndTime"
type="datetime"
placeholder="选择日期时间"
style="width: 100%">
</el-date-picker>
</el-form-item>
<el-form-item label="保密属性" >
<el-select v-model="form.gbSecrecy" style="width: 100%" placeholder="请选择保密属性">
<el-option label="不涉密" :value="0"></el-option>
<el-option label="涉密" :value="1"></el-option>
</el-select>
</el-form-item>
<el-form-item label="IP地址" >
<el-input v-model="form.gbIpAddress" placeholder="请输入IP地址"></el-input>
</el-form-item>
<el-form-item label="端口" >
<el-input type="number" v-model="form.gbPort" placeholder="请输入端口"></el-input>
</el-form-item>
<el-form-item label="设备口令" >
<el-input v-model="form.gbPassword" placeholder="请输入设备口令"></el-input>
</el-form-item>
</div>
<div>
<el-form-item label="业务分组编号" >
<el-input v-model="form.gbBusinessGroupId" placeholder="请输入业务分组编号"></el-input>
</el-form-item>
<el-form-item label="位置类型" >
<el-select v-model="form.gbPositionType" style="width: 100%" placeholder="请选择位置类型">
<el-option label="省际检查站" :value="1"></el-option>
<el-option label="党政机关" :value="2"></el-option>
<el-option label="车站码头" :value="3"></el-option>
<el-option label="中心广场" :value="4"></el-option>
<el-option label="体育场馆" :value="5"></el-option>
<el-option label="商业中心" :value="6"></el-option>
<el-option label="宗教场所" :value="7"></el-option>
<el-option label="校园周边" :value="8"></el-option>
<el-option label="治安复杂区域" :value="9"></el-option>
<el-option label="交通干线" :value="10"></el-option>
</el-select>
</el-form-item>
<el-form-item label="室外/室内" >
<el-select v-model="form.gbRoomType" style="width: 100%" placeholder="请选择位置类型">
<el-option label="室外" :value="1"></el-option>
<el-option label="室内" :value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="用途" >
<el-select v-model="form.gbUseType" style="width: 100%" placeholder="请选择位置类型">
<el-option label="治安" :value="1"></el-option>
<el-option label="交通" :value="2"></el-option>
<el-option label="重点" :value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item label="补光" >
<el-select v-model="form.gbUseType" style="width: 100%" placeholder="请选择位置类型">
<el-option label="无补光" :value="1"></el-option>
<el-option label="红外补光" :value="2"></el-option>
<el-option label="白光补光" :value="3"></el-option>
<el-option label="激光补光" :value="4"></el-option>
<el-option label="其他" :value="9"></el-option>
</el-select>
</el-form-item>
<el-form-item label="监视方位" >
<el-select v-model="form.gbUseType" style="width: 100%" placeholder="请选择位置类型">
<el-option label="东(西向东)" :value="1"></el-option>
<el-option label="西(东向西)" :value="2"></el-option>
<el-option label="南(北向南)" :value="3"></el-option>
<el-option label="北(南向北)" :value="4"></el-option>
<el-option label="东南(西北到东南)" :value="5"></el-option>
<el-option label="东北(西南到东北)" :value="6"></el-option>
<el-option label="西南(东北到西南)" :value="7"></el-option>
<el-option label="西北(东南到西北)" :value="8"></el-option>
</el-select>
</el-form-item>
<el-form-item label="分辨率" >
<el-input v-model="form.gbResolution" placeholder="请输入分辨率"></el-input>
</el-form-item>
<el-form-item label="下载倍速" >
<el-select v-model="form.gbDownloadSpeedArray" multiple style="width: 100%" placeholder="请选择位置类型">
<el-option label="1倍速" value="1"></el-option>
<el-option label="2倍速" value="2"></el-option>
<el-option label="4倍速" value="4"></el-option>
<el-option label="8倍速" value="8"></el-option>
<el-option label="16倍速" value="16"></el-option>
</el-select>
</el-form-item>
<el-form-item label="空域编码能力" >
<el-select v-model="form.gbSvcSpaceSupportMod" style="width: 100%" placeholder="请选择空域编码能力">
<el-option label="1级增强" value="1"></el-option>
<el-option label="2级增强" value="2"></el-option>
<el-option label="3级增强" value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item label="时域编码能力" >
<el-select v-model="form.gbSvcTimeSupportMode" style="width: 100%" placeholder="请选择空域编码能力">
<el-option label="1级增强" value="1"></el-option>
<el-option label="2级增强" value="2"></el-option>
<el-option label="3级增强" value="3"></el-option>
</el-select>
</el-form-item>
<div style="float: right;">
<el-button type="primary" @click="onSubmit"></el-button>
<el-button @click="close"></el-button>
<el-button v-if="form.gbDeviceDbId" @click="reset"></el-button>
</div>
</div>
</el-form>
<channelCode ref="channelCode"></channelCode>
<CommonChannelEdit ref="commonChannelEdit" :id="id" :saveSuccess="close" :cancel="close"></CommonChannelEdit>
</div>
</template>
<script>
import channelCode from './dialog/channelCode'
import CommonChannelEdit from './common/CommonChannelEdit'
export default {
name: "channelEdit",
props: [ 'id', 'closeEdit'],
components: {
channelCode,
},
created() {
//
this.getCommonChannel()
CommonChannelEdit,
},
data() {
return {
locading: true,
form: {},
};
return {};
},
methods: {
onSubmit: function () {
this.form.gbDownloadSpeed = this.form.gbDownloadSpeedArray.join("/")
this.$axios({
method: 'post',
url: "/api/common/channel/update",
data: this.form
}).then((res) => {
if (res.data.code === 0) {
this.$message.success("保存成功");
this.close()
}
}).catch((error) => {
console.error(error)
}).finally(()=>[
this.locading = false
])
},
close: function () {
this.closeEdit()
},
reset: function () {
this.$confirm("确定重置为默认内容?", '提示', {
dangerouslyUseHTMLString: true,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$axios({
method: 'post',
url: "/api/common/channel/reset",
params: {
id: this.form.gbId
}
}).then((res) => {
if (res.data.code === 0) {
this.$message.success("重置成功 已保存");
this.getCommonChannel()
}
}).catch((error) => {
console.error(error)
}).finally(()=>[
this.locading = false
])
}).catch(() => {
});
},
test: function () {
console.log(this.form.gbDownloadSpeedArray)
},
getCommonChannel:function () {
this.$axios({
method: 'get',
url: "/api/common/channel/one",
params: {
id: this.id
}
}).then((res) => {
if (res.data.code === 0) {
res.data.data.gbDownloadSpeedArray = res.data.data.gbDownloadSpeed.split("/")
this.form = res.data.data;
}
}).catch((error) => {
console.error(error)
}).finally(()=>[
this.locading = false
])
},
buildDeviceIdCode: function (gbDeviceId){
this.$refs.channelCode.openDialog(code=>{
this.form.gbDeviceId = code;
}, gbDeviceId);
}
// getDeviceChannel:function (callback) {
// this.$axios({
// method: 'get',
// url: "/api/device/query/channel/raw",
// params: {
// id: this.id
// }
// }).then((res) => {
// if (res.data.code === 0) {
// if(callback) {
// callback(res.data.data)
// }
// }
// }).catch((error) => {
// console.error(error)
// }).finally(()=>[
// this.locading = false
// ])
// }
},
};
</script>
<style>
.channel-form {
display: grid;
background-color: #FFFFFF;
padding: 1rem 2rem 0 2rem;
grid-template-columns: 1fr 1fr 1fr;
gap: 1rem;
}
</style>

View File

@ -1,359 +0,0 @@
<template>
<div id="pushVideoList" style="width: 100%">
<div class="page-header">
<div class="page-title">推流列表</div>
<div class="page-header-btn">
搜索:
<el-input @input="getPushList" style="margin-right: 1rem; width: auto;" size="mini" placeholder="关键字"
prefix-icon="el-icon-search" v-model="searchSrt" clearable></el-input>
流媒体:
<el-select size="mini" @change="getPushList" style="margin-right: 1rem;" v-model="mediaServerId"
placeholder="请选择" default-first-option>
<el-option label="全部" value=""></el-option>
<el-option
v-for="item in mediaServerList"
:key="item.id"
:label="item.id"
:value="item.id">
</el-option>
</el-select>
推流状态:
<el-select size="mini" style="margin-right: 1rem;" @change="getPushList" v-model="pushing" placeholder="请选择"
default-first-option>
<el-option label="全部" value=""></el-option>
<el-option label="推流进行中" value="true"></el-option>
<el-option label="推流未进行" value="false"></el-option>
</el-select>
<el-button icon="el-icon-upload2" size="mini" style="margin-right: 1rem;" type="primary" @click="importChannel">
通道导入
</el-button>
<el-button icon="el-icon-download" size="mini" style="margin-right: 1rem;" type="primary">
<a style="color: #FFFFFF; text-align: center; text-decoration: none" href="/static/file/推流通道导入.zip"
download='推流通道导入.zip'>下载模板</a>
</el-button>
<el-button icon="el-icon-delete" size="mini" style="margin-right: 1rem;"
:disabled="multipleSelection.length === 0" type="danger" @click="batchDel">批量移除
</el-button>
<el-button icon="el-icon-plus" size="mini" style="margin-right: 1rem;" type="primary" @click="addStream">
</el-button>
<el-button icon="el-icon-refresh-right" circle size="mini" @click="refresh()"></el-button>
</div>
</div>
<devicePlayer ref="devicePlayer"></devicePlayer>
<addStreamTOGB ref="addStreamTOGB"></addStreamTOGB>
<el-table ref="pushListTable" :data="pushList" style="width: 100%" :height="winHeight"
@selection-change="handleSelectionChange" :row-key="(row)=> row.app + row.stream">
<el-table-column type="selection" :reserve-selection="true" min-width="55">
</el-table-column>
<el-table-column prop="name" label="名称" min-width="200">
</el-table-column>
<el-table-column prop="app" label="APP" min-width="200">
</el-table-column>
<el-table-column prop="stream" label="流ID" min-width="200">
</el-table-column>
<el-table-column prop="gbId" label="国标编码" min-width="200" >
</el-table-column>
<el-table-column prop="mediaServerId" label="流媒体" min-width="200" >
</el-table-column>
<el-table-column label="开始时间" min-width="200">
<template slot-scope="scope">
<el-button-group>
{{ scope.row.pushTime == null? "-":scope.row.pushTime }}
</el-button-group>
</template>
</el-table-column>
<el-table-column label="正在推流" min-width="100">
<template slot-scope="scope">
{{scope.row.pushIng ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column label="本平台推流" min-width="100">
<template slot-scope="scope">
{{scope.row.pushIng && !!scope.row.self ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column label="操作" min-width="360" fixed="right">
<template slot-scope="scope">
<el-button size="medium" icon="el-icon-video-play"
v-if="scope.row.pushIng === true"
@click="playPush(scope.row)" type="text">播放
</el-button>
<el-divider direction="vertical"></el-divider>
<el-button size="medium" icon="el-icon-delete" type="text" @click="stopPush(scope.row)" style="color: #f56c6c" >移除</el-button>
<el-divider direction="vertical"></el-divider>
<el-button size="medium" icon="el-icon-position" type="text" v-if="!!!scope.row.gbId"
@click="addToGB(scope.row)">加入国标
</el-button>
<el-divider v-if="!!!scope.row.gbId" direction="vertical"></el-divider>
<el-button size="medium" icon="el-icon-position" type="text" v-if="!!scope.row.gbId"
@click="removeFromGB(scope.row)">移出国标
</el-button>
<el-button size="medium" icon="el-icon-cloudy" type="text" @click="queryCloudRecords(scope.row)">
</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
style="float: right"
@size-change="handleSizeChange"
@current-change="currentChange"
:current-page="currentPage"
:page-size="count"
:page-sizes="[15, 25, 35, 50]"
layout="total, sizes, prev, pager, next"
:total="total">
</el-pagination>
<streamProxyEdit ref="streamProxyEdit"></streamProxyEdit>
<importChannel ref="importChannel"></importChannel>
</div>
</template>
<script>
import streamProxyEdit from './dialog/StreamProxyEdit.vue'
import devicePlayer from './dialog/devicePlayer.vue'
import addStreamTOGB from './dialog/pushStreamEdit.vue'
import uiHeader from '../layout/UiHeader.vue'
import importChannel from './dialog/importChannel.vue'
import MediaServer from './service/MediaServer'
export default {
name: 'pushVideoList',
components: {
devicePlayer,
addStreamTOGB,
streamProxyEdit,
uiHeader,
importChannel,
},
data() {
return {
pushList: [], //
currentPusher: {}, //
updateLooper: 0, //
currentDeviceChannelsLenth: 0,
winHeight: window.innerHeight - 250,
mediaServerObj: new MediaServer(),
currentPage: 1,
count: 15,
total: 0,
searchSrt: "",
pushing: "",
mediaServerId: "",
mediaServerList: [],
multipleSelection: [],
getDeviceListLoading: false
};
},
computed: {},
mounted() {
this.initData();
this.updateLooper = setInterval(this.getPushList, 2000);
},
destroyed() {
clearTimeout(this.updateLooper);
},
methods: {
initData: function () {
this.mediaServerObj.getOnlineMediaServerList((data) => {
this.mediaServerList = data.data;
})
this.getPushList();
},
currentChange: function (val) {
this.currentPage = val;
this.getPushList();
},
handleSizeChange: function (val) {
this.count = val;
this.getPushList();
},
getPushList: function () {
let that = this;
this.getDeviceListLoading = true;
this.$axios({
method: 'get',
url: `/api/push/list`,
params: {
page: that.currentPage,
count: that.count,
query: that.searchSrt,
pushing: that.pushing,
mediaServerId: that.mediaServerId,
}
}).then(function (res) {
if (res.data.code === 0) {
that.total = res.data.data.total;
that.pushList = res.data.data.list;
}
that.getDeviceListLoading = false;
}).catch(function (error) {
console.error(error);
that.getDeviceListLoading = false;
});
},
playPush: function (row) {
let that = this;
this.getListLoading = true;
this.$axios({
method: 'get',
url: '/api/push/getPlayUrl',
params: {
app: row.app,
stream: row.stream,
mediaServerId: row.mediaServerId
}
}).then(function (res) {
that.getListLoading = false;
if (res.data.code === 0 ) {
that.$refs.devicePlayer.openDialog("streamPlay", null, null, {
streamInfo: res.data.data,
hasAudio: true
});
}else {
that.$message.error(res.data.msg);
}
}).catch(function (error) {
console.error(error);
that.getListLoading = false;
});
},
stopPush: function (row) {
let that = this;
that.$axios({
method: "post",
url: "/api/push/stop",
params: {
app: row.app,
streamId: row.stream
}
}).then((res) => {
if (res.data.code === 0) {
that.initData()
}
}).catch(function (error) {
console.error(error);
});
},
addToGB: function (row) {
this.$refs.addStreamTOGB.openDialog({
app: row.app,
stream: row.stream,
mediaServerId: row.mediaServerId
}, this.initData);
},
removeFromGB: function (row) {
let that = this;
that.$axios({
method: "delete",
url: "/api/push/remove_form_gb",
data: row
}).then((res) => {
if (res.data.code === 0) {
that.initData()
}
}).catch(function (error) {
console.error(error);
});
},
queryCloudRecords: function (row) {
this.$router.push(`/cloudRecordDetail/${row.app}/${row.stream}`)
},
importChannel: function () {
this.$refs.importChannel.openDialog(() => {
})
},
addStream: function (){
this.$refs.addStreamTOGB.openDialog(null, this.initData);
},
batchDel: function () {
this.$confirm(`确定删除选中的${this.multipleSelection.length}个通道?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let that = this;
that.$axios({
method: "delete",
url: "/api/push/batchStop",
data: {
gbStreams: this.multipleSelection
}
}).then((res) => {
this.initData();
this.$refs.pushListTable.clearSelection();
}).catch(function (error) {
console.error(error);
});
}).catch(() => {
});
},
handleSelectionChange: function (val) {
this.multipleSelection = val;
},
refresh: function () {
this.initData();
},
}
};
</script>
<style>
.videoList {
display: flex;
flex-wrap: wrap;
align-content: flex-start;
}
.video-item {
position: relative;
width: 15rem;
height: 10rem;
margin-right: 1rem;
background-color: #000000;
}
.video-item-img {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 100%;
height: 100%;
}
.video-item-img:after {
content: "";
display: inline-block;
position: absolute;
z-index: 2;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 3rem;
height: 3rem;
background-image: url("../assets/loading.png");
background-size: cover;
background-color: #000000;
}
.video-item-title {
position: absolute;
bottom: 0;
color: #000000;
background-color: #ffffff;
line-height: 1.5rem;
padding: 0.3rem;
width: 14.4rem;
}
</style>

View File

@ -0,0 +1,108 @@
<template>
<div id="ChannelEdit" style="width: 100%">
<div class="page-header">
<div class="page-title">
<el-button icon="el-icon-back" size="mini" style="font-size: 20px; color: #000;" type="text" @click="close" ></el-button>
<el-divider direction="vertical"></el-divider>
编辑推流信息
</div>
<div class="page-header-btn">
<div style="display: inline;">
<el-button icon="el-icon-close" size="mini" style="font-size: 20px; color: #000;" type="text" @click="close" ></el-button>
</div>
</div>
</div>
<el-tabs tab-position="left">
<el-tab-pane label="推流信息编辑">
<el-form ref="streamPushForm" status-icon label-width="160px" class="channel-form" v-loading="locading">
<el-form-item label="应用名" >
<el-input v-model="streamPush.app" placeholder="请输入应用名"></el-input>
</el-form-item>
<el-form-item label="流ID" >
<el-input v-model="streamPush.stream" placeholder="请输入流ID"></el-input>
</el-form-item>
<el-form-item >
<el-button type="primary" @click="onSubmit"></el-button>
<el-button @click="close"></el-button>
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane label="国标通道配置" v-if="streamPush.id">
<CommonChannelEdit ref="commonChannelEdit" :dataForm="streamPush" :cancel="close"></CommonChannelEdit>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import CommonChannelEdit from './common/CommonChannelEdit'
export default {
name: "channelEdit",
props: [ 'streamPush', 'closeEdit'],
components: {
CommonChannelEdit,
},
created() {
console.log(this.streamPush)
},
data() {
return {
locading: false,
};
},
methods: {
onSubmit: function () {
console.log(this.streamPush)
this.locading = true
if (this.streamPush.id) {
this.$axios({
method: 'post',
url: "/api/push/update",
data: this.streamPush
}).then((res) => {
if (res.data.code === 0) {
this.$message.success("保存成功");
}else {
this.$message.error(res.data.msg)
}
}).catch((error) => {
this.$message.error(error)
}).finally(()=>[
this.locading = false
])
}else {
this.$axios({
method: 'post',
url: "/api/push/add",
data: this.streamPush
}).then((res) => {
if (res.data.code === 0) {
this.$message.success("保存成功");
this.streamPush = res.data.data
}else {
this.$message.error(res.data.msg)
}
}).catch((error) => {
this.$message.error(error)
}).finally(()=>[
this.locading = false
])
}
},
close: function () {
this.closeEdit()
},
},
};
</script>
<style>
.channel-form {
display: grid;
background-color: #FFFFFF;
padding: 1rem 2rem 0 2rem;
grid-template-columns: 1fr 1fr 1fr;
gap: 1rem;
}
</style>

View File

@ -0,0 +1,374 @@
<template>
<div id="streamPushList" style="width: 100%">
<div v-if="!streamPush">
<div class="page-header">
<div class="page-title">推流列表</div>
<div class="page-header-btn">
搜索:
<el-input @input="getPushList" style="margin-right: 1rem; width: auto;" size="mini" placeholder="关键字"
prefix-icon="el-icon-search" v-model="searchSrt" clearable></el-input>
流媒体:
<el-select size="mini" @change="getPushList" style="margin-right: 1rem;" v-model="mediaServerId"
placeholder="请选择" default-first-option>
<el-option label="全部" value=""></el-option>
<el-option
v-for="item in mediaServerList"
:key="item.id"
:label="item.id"
:value="item.id">
</el-option>
</el-select>
推流状态:
<el-select size="mini" style="margin-right: 1rem;" @change="getPushList" v-model="pushing" placeholder="请选择"
default-first-option>
<el-option label="全部" value=""></el-option>
<el-option label="推流进行中" value="true"></el-option>
<el-option label="推流未进行" value="false"></el-option>
</el-select>
<el-button icon="el-icon-upload2" size="mini" style="margin-right: 1rem;" type="primary" @click="importChannel">
通道导入
</el-button>
<el-button icon="el-icon-download" size="mini" style="margin-right: 1rem;" type="primary">
<a style="color: #FFFFFF; text-align: center; text-decoration: none" href="/static/file/推流通道导入.zip"
download='推流通道导入.zip'>下载模板</a>
</el-button>
<el-button icon="el-icon-delete" size="mini" style="margin-right: 1rem;"
:disabled="multipleSelection.length === 0" type="danger" @click="batchDel">批量移除
</el-button>
<el-button icon="el-icon-plus" size="mini" style="margin-right: 1rem;" type="primary" @click="addStream">
</el-button>
<el-button icon="el-icon-refresh-right" circle size="mini" @click="refresh()"></el-button>
</div>
</div>
<el-table ref="pushListTable" :data="pushList" style="width: 100%" :height="winHeight" :loading="loading"
@selection-change="handleSelectionChange" :row-key="(row)=> row.app + row.stream">
<el-table-column type="selection" :reserve-selection="true" min-width="55">
</el-table-column>
<el-table-column prop="gbName" label="名称" min-width="200">
</el-table-column>
<el-table-column prop="app" label="应用名" min-width="200">
</el-table-column>
<el-table-column prop="stream" label="流ID" min-width="200">
</el-table-column>
<el-table-column prop="gbDeviceId" label="国标编码" min-width="200" >
</el-table-column>
<el-table-column prop="mediaServerId" label="流媒体" min-width="200" >
</el-table-column>
<el-table-column label="开始时间" min-width="200">
<template slot-scope="scope">
<el-button-group>
{{ scope.row.pushTime == null? "-":scope.row.pushTime }}
</el-button-group>
</template>
</el-table-column>
<el-table-column label="正在推流" min-width="100">
<template slot-scope="scope">
{{scope.row.pushIng ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column label="本平台推流" min-width="100">
<template slot-scope="scope">
{{scope.row.pushIng && !!scope.row.self ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column label="操作" min-width="360" fixed="right">
<template slot-scope="scope">
<el-button size="medium" icon="el-icon-video-play"
v-if="scope.row.pushIng === true"
@click="playPush(scope.row)" type="text">播放
</el-button>
<el-divider direction="vertical"></el-divider>
<el-button size="medium" icon="el-icon-delete" type="text" @click="deletePush(scope.row.id)" style="color: #f56c6c" >删除</el-button>
<el-divider direction="vertical"></el-divider>
<el-button size="medium" icon="el-icon-position" type="text" @click="edit(scope.row)">
编辑
</el-button>
<el-button size="medium" icon="el-icon-cloudy" type="text" @click="queryCloudRecords(scope.row)">
</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
style="float: right"
@size-change="handleSizeChange"
@current-change="currentChange"
:current-page="currentPage"
:page-size="count"
:page-sizes="[15, 25, 35, 50]"
layout="total, sizes, prev, pager, next"
:total="total">
</el-pagination>
</div>
<devicePlayer ref="devicePlayer"></devicePlayer>
<addStreamTOGB ref="addStreamTOGB"></addStreamTOGB>
<importChannel ref="importChannel"></importChannel>
<stream-push-edit v-if="streamPush" :streamPush="streamPush" :closeEdit="closeEdit"></stream-push-edit>
</div>
</template>
<script>
import devicePlayer from './dialog/devicePlayer.vue'
import addStreamTOGB from './dialog/pushStreamEdit.vue'
import uiHeader from '../layout/UiHeader.vue'
import importChannel from './dialog/importChannel.vue'
import MediaServer from './service/MediaServer'
import StreamPushEdit from "./StreamPushEdit";
import ChannelEdit from "./ChannelEdit.vue";
export default {
name: 'streamPushList',
components: {
ChannelEdit,
StreamPushEdit,
devicePlayer,
addStreamTOGB,
uiHeader,
importChannel,
},
data() {
return {
pushList: [], //
currentPusher: {}, //
updateLooper: 0, //
currentDeviceChannelsLenth: 0,
winHeight: window.innerHeight - 250,
mediaServerObj: new MediaServer(),
currentPage: 1,
count: 15,
total: 0,
searchSrt: "",
pushing: "",
mediaServerId: "",
mediaServerList: [],
multipleSelection: [],
loading: false,
streamPush: null,
};
},
computed: {},
mounted() {
this.initData();
this.updateLooper = setInterval(this.getPushList, 2000);
},
destroyed() {
clearTimeout(this.updateLooper);
},
methods: {
initData: function () {
this.loading = true;
this.mediaServerObj.getOnlineMediaServerList((data) => {
this.mediaServerList = data.data;
})
this.getPushList();
},
currentChange: function (val) {
this.currentPage = val;
this.getPushList();
},
handleSizeChange: function (val) {
this.count = val;
this.getPushList();
},
getPushList: function () {
let that = this;
this.$axios({
method: 'get',
url: `/api/push/list`,
params: {
page: that.currentPage,
count: that.count,
query: that.searchSrt,
pushing: that.pushing,
mediaServerId: that.mediaServerId,
}
}).then(function (res) {
if (res.data.code === 0) {
that.total = res.data.data.total;
that.pushList = res.data.data.list;
}
}).catch(function (error) {
console.error(error);
}).finally(()=>{
this.loading = false;
})
},
playPush: function (row) {
let that = this;
this.getListLoading = true;
this.$axios({
method: 'get',
url: '/api/push/getPlayUrl',
params: {
app: row.app,
stream: row.stream,
mediaServerId: row.mediaServerId
}
}).then(function (res) {
that.getListLoading = false;
if (res.data.code === 0 ) {
that.$refs.devicePlayer.openDialog("streamPlay", null, null, {
streamInfo: res.data.data,
hasAudio: true
});
}else {
that.$message.error(res.data.msg);
}
}).catch(function (error) {
console.error(error);
that.getListLoading = false;
});
},
deletePush: function (id) {
this.$confirm(`确定删除通道?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.loading = true;
this.$axios({
method: "post",
url: "/api/push/remove",
params: {
id: id,
}
}).then((res) => {
if (res.data.code === 0) {
this.initData()
}
}).catch(function (error) {
console.error(error);
});
}).catch(() => {
});
},
edit: function (row) {
this.streamPush = row
},
//
closeEdit: function (){
this.streamPush = null
this.getPushList()
},
removeFromGB: function (row) {
let that = this;
that.$axios({
method: "delete",
url: "/api/push/remove_form_gb",
data: row
}).then((res) => {
if (res.data.code === 0) {
that.initData()
}
}).catch(function (error) {
console.error(error);
});
},
queryCloudRecords: function (row) {
this.$router.push(`/cloudRecordDetail/${row.app}/${row.stream}`)
},
importChannel: function () {
this.$refs.importChannel.openDialog(() => {
})
},
addStream: function (){
// this.$refs.addStreamTOGB.openDialog(null, this.initData);
this.streamPush = {}
},
batchDel: function () {
this.$confirm(`确定删除选中的${this.multipleSelection.length}个通道?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let ids = []
for (let i = 0; i < this.multipleSelection.length; i++) {
ids.push(this.multipleSelection[i].id)
}
let that = this;
that.$axios({
method: "delete",
url: "/api/push/batchRemove",
data: {
ids: ids
}
}).then((res) => {
this.initData();
this.$refs.pushListTable.clearSelection();
}).catch(function (error) {
console.error(error);
});
}).catch(() => {
});
},
handleSelectionChange: function (val) {
this.multipleSelection = val;
},
refresh: function () {
this.initData();
},
}
};
</script>
<style>
.videoList {
display: flex;
flex-wrap: wrap;
align-content: flex-start;
}
.video-item {
position: relative;
width: 15rem;
height: 10rem;
margin-right: 1rem;
background-color: #000000;
}
.video-item-img {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 100%;
height: 100%;
}
.video-item-img:after {
content: "";
display: inline-block;
position: absolute;
z-index: 2;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 3rem;
height: 3rem;
background-image: url("../assets/loading.png");
background-size: cover;
background-color: #000000;
}
.video-item-title {
position: absolute;
bottom: 0;
color: #000000;
background-color: #ffffff;
line-height: 1.5rem;
padding: 0.3rem;
width: 14.4rem;
}
</style>

View File

@ -0,0 +1,372 @@
<template>
<div id="CommonChannelEdit" v-loading="locading" style="width: 100%">
<el-form ref="passwordForm" status-icon label-width="160px" class="channel-form">
<div class="form-box">
<el-form-item label="名称" >
<el-input v-model="form.gbName" placeholder="请输入通道名称"></el-input>
</el-form-item>
<el-form-item label="编码" >
<el-input v-model="form.gbDeviceId" placeholder="请输入通道编码">
<el-button slot="append" @click="buildDeviceIdCode(form.gbDeviceId)"></el-button>
</el-input>
</el-form-item>
<el-form-item label="设备厂商" >
<el-input v-model="form.gbManufacturer" placeholder="请输入设备厂商"></el-input>
</el-form-item>
<el-form-item label="设备型号" >
<el-input v-model="form.gbModel" placeholder="请输入设备型号"></el-input>
</el-form-item>
<el-form-item label="行政区域" >
<el-input v-model="form.gbCivilCode" placeholder="请输入行政区域"></el-input>
</el-form-item>
<el-form-item label="安装地址" >
<el-input v-model="form.gbAddress" placeholder="请输入安装地址"></el-input>
</el-form-item>
<el-form-item label="子设备" >
<el-select v-model="form.gbParental" style="width: 100%" placeholder="请选择是否有子设备">
<el-option label="有" :value="1"></el-option>
<el-option label="无" :value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item label="父节点编码" >
<el-input v-model="form.gbParentId" placeholder="请输入父节点编码"></el-input>
</el-form-item>
<el-form-item label="设备状态" >
<el-select v-model="form.gbStatus" style="width: 100%" placeholder="请选择设备状态">
<el-option label="在线" value="ON"></el-option>
<el-option label="离线" value="OFF"></el-option>
</el-select>
</el-form-item>
<el-form-item label="经度" >
<el-input v-model="form.gbLongitude" placeholder="请输入经度"></el-input>
</el-form-item>
<el-form-item label="纬度" >
<el-input v-model="form.gbLatitude" placeholder="请输入纬度"></el-input>
</el-form-item>
<el-form-item label="云台类型" >
<el-select v-model="form.gbPtzType" style="width: 100%" placeholder="请选择云台类型">
<el-option label="球机" :value="1"></el-option>
<el-option label="半球" :value="2"></el-option>
<el-option label="固定枪机" :value="3"></el-option>
<el-option label="遥控枪机" :value="4"></el-option>
<el-option label="遥控半球" :value="5"></el-option>
<el-option label="多目设备的全景/拼接通道" :value="6"></el-option>
<el-option label="多目设备的分割通道" :value="7"></el-option>
</el-select>
</el-form-item>
</div>
<div>
<el-form-item label="警区" >
<el-input v-model="form.gbBlock" placeholder="请输入警区"></el-input>
</el-form-item>
<el-form-item label="设备归属" >
<el-input v-model="form.gbOwner" placeholder="请输入设备归属"></el-input>
</el-form-item>
<el-form-item label="信令安全模式" >
<el-select v-model="form.gbSafetyWay" style="width: 100%" placeholder="请选择信令安全模式">
<el-option label="不采用" :value="0"></el-option>
<el-option label="S/MIME签名" :value="2"></el-option>
<el-option label="S/MIME加密签名同时采用" :value="3"></el-option>
<el-option label="数字摘要" :value="4"></el-option>
</el-select>
</el-form-item>
<el-form-item label="注册方式" >
<el-select v-model="form.gbRegisterWay" style="width: 100%" placeholder="请选择注册方式">
<el-option label="IETFRFC3261标准" :value="1"></el-option>
<el-option label="基于口令的双向认证" :value="2"></el-option>
<el-option label="基于数字证书的双向认证注册" :value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item label="证书序列号" >
<el-input type="number" v-model="form.gbCertNum" placeholder="请输入证书序列号"></el-input>
</el-form-item>
<el-form-item label="证书有效标识" >
<el-select v-model="form.gbCertifiable" style="width: 100%" placeholder="请选择证书有效标识">
<el-option label="有效" :value="1"></el-option>
<el-option label="无效" :value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item label="无效原因码" >
<el-input type="errCode" v-model="form.gbCertNum" placeholder="请输入无效原因码"></el-input>
</el-form-item>
<el-form-item label="证书终止有效期" >
<el-date-picker
v-model="form.gbEndTime"
type="datetime"
placeholder="选择日期时间"
style="width: 100%">
</el-date-picker>
</el-form-item>
<el-form-item label="保密属性" >
<el-select v-model="form.gbSecrecy" style="width: 100%" placeholder="请选择保密属性">
<el-option label="不涉密" :value="0"></el-option>
<el-option label="涉密" :value="1"></el-option>
</el-select>
</el-form-item>
<el-form-item label="IP地址" >
<el-input v-model="form.gbIpAddress" placeholder="请输入IP地址"></el-input>
</el-form-item>
<el-form-item label="端口" >
<el-input type="number" v-model="form.gbPort" placeholder="请输入端口"></el-input>
</el-form-item>
<el-form-item label="设备口令" >
<el-input v-model="form.gbPassword" placeholder="请输入设备口令"></el-input>
</el-form-item>
</div>
<div>
<el-form-item label="业务分组编号" >
<el-input v-model="form.gbBusinessGroupId" placeholder="请输入业务分组编号"></el-input>
</el-form-item>
<el-form-item label="位置类型" >
<el-select v-model="form.gbPositionType" style="width: 100%" placeholder="请选择位置类型">
<el-option label="省际检查站" :value="1"></el-option>
<el-option label="党政机关" :value="2"></el-option>
<el-option label="车站码头" :value="3"></el-option>
<el-option label="中心广场" :value="4"></el-option>
<el-option label="体育场馆" :value="5"></el-option>
<el-option label="商业中心" :value="6"></el-option>
<el-option label="宗教场所" :value="7"></el-option>
<el-option label="校园周边" :value="8"></el-option>
<el-option label="治安复杂区域" :value="9"></el-option>
<el-option label="交通干线" :value="10"></el-option>
</el-select>
</el-form-item>
<el-form-item label="室外/室内" >
<el-select v-model="form.gbRoomType" style="width: 100%" placeholder="请选择位置类型">
<el-option label="室外" :value="1"></el-option>
<el-option label="室内" :value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="用途" >
<el-select v-model="form.gbUseType" style="width: 100%" placeholder="请选择位置类型">
<el-option label="治安" :value="1"></el-option>
<el-option label="交通" :value="2"></el-option>
<el-option label="重点" :value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item label="补光" >
<el-select v-model="form.gbUseType" style="width: 100%" placeholder="请选择位置类型">
<el-option label="无补光" :value="1"></el-option>
<el-option label="红外补光" :value="2"></el-option>
<el-option label="白光补光" :value="3"></el-option>
<el-option label="激光补光" :value="4"></el-option>
<el-option label="其他" :value="9"></el-option>
</el-select>
</el-form-item>
<el-form-item label="监视方位" >
<el-select v-model="form.gbUseType" style="width: 100%" placeholder="请选择位置类型">
<el-option label="东(西向东)" :value="1"></el-option>
<el-option label="西(东向西)" :value="2"></el-option>
<el-option label="南(北向南)" :value="3"></el-option>
<el-option label="北(南向北)" :value="4"></el-option>
<el-option label="东南(西北到东南)" :value="5"></el-option>
<el-option label="东北(西南到东北)" :value="6"></el-option>
<el-option label="西南(东北到西南)" :value="7"></el-option>
<el-option label="西北(东南到西北)" :value="8"></el-option>
</el-select>
</el-form-item>
<el-form-item label="分辨率" >
<el-input v-model="form.gbResolution" placeholder="请输入分辨率"></el-input>
</el-form-item>
<el-form-item label="下载倍速" >
<el-select v-model="form.gbDownloadSpeedArray" multiple style="width: 100%" placeholder="请选择位置类型">
<el-option label="1倍速" value="1"></el-option>
<el-option label="2倍速" value="2"></el-option>
<el-option label="4倍速" value="4"></el-option>
<el-option label="8倍速" value="8"></el-option>
<el-option label="16倍速" value="16"></el-option>
</el-select>
</el-form-item>
<el-form-item label="空域编码能力" >
<el-select v-model="form.gbSvcSpaceSupportMod" style="width: 100%" placeholder="请选择空域编码能力">
<el-option label="1级增强" value="1"></el-option>
<el-option label="2级增强" value="2"></el-option>
<el-option label="3级增强" value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item label="时域编码能力" >
<el-select v-model="form.gbSvcTimeSupportMode" style="width: 100%" placeholder="请选择空域编码能力">
<el-option label="1级增强" value="1"></el-option>
<el-option label="2级增强" value="2"></el-option>
<el-option label="3级增强" value="3"></el-option>
</el-select>
</el-form-item>
<div style="float: right;">
<el-button type="primary" @click="onSubmit"></el-button>
<el-button v-if="cancel" @click="cancelSubmit"></el-button>
<el-button v-if="form.gbDeviceDbId" @click="reset"></el-button>
</div>
</div>
</el-form>
<channelCode ref="channelCode"></channelCode>
</div>
</template>
<script>
import channelCode from './../dialog/channelCode'
export default {
name: "CommonChannelEdit",
props: [ 'id', 'dataForm', 'saveSuccess', 'cancel'],
components: {
channelCode,
},
created() {
//
if (this.id) {
this.getCommonChannel()
}else {
if(!this.dataForm.gbDeviceId) {
this.dataForm.gbDeviceId = ""
}
console.log(this.dataForm)
this.form = this.dataForm
}
},
data() {
return {
locading: false,
form: {},
};
},
methods: {
onSubmit: function () {
this.locading = true
if (this.form.gbDownloadSpeedArray) {
this.form.gbDownloadSpeed = this.form.gbDownloadSpeedArray.join("/")
}
if (this.form.gbId) {
this.$axios({
method: 'post',
url: "/api/common/channel/update",
data: this.form
}).then((res) => {
if (res.data.code === 0) {
this.$message.success("保存成功");
if (this.saveSuccess) {
this.saveSuccess()
}
}
}).catch((error) => {
console.error(error)
}).finally(()=>[
this.locading = false
])
}else {
this.$axios({
method: 'post',
url: "/api/common/channel/add",
data: this.form
}).then((res) => {
if (res.data.code === 0) {
this.$message.success("保存成功");
if (this.saveSuccess) {
this.saveSuccess()
}
}
}).catch((error) => {
console.error(error)
}).finally(()=>[
this.locading = false
])
}
},
reset: function () {
this.$confirm("确定重置为默认内容?", '提示', {
dangerouslyUseHTMLString: true,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.locading = true
this.$axios({
method: 'post',
url: "/api/common/channel/reset",
params: {
id: this.form.gbId
}
}).then((res) => {
if (res.data.code === 0) {
this.$message.success("重置成功 已保存");
this.getCommonChannel()
}
}).catch((error) => {
console.error(error)
}).finally(()=>[
this.locading = false
])
}).catch(() => {
});
},
getCommonChannel:function () {
this.locading = true
this.$axios({
method: 'get',
url: "/api/common/channel/one",
params: {
id: this.id
}
}).then((res) => {
if (res.data.code === 0) {
if (res.data.data.gbDownloadSpeed) {
res.data.data.gbDownloadSpeedArray = res.data.data.gbDownloadSpeed.split("/")
}
this.form = res.data.data;
}
}).catch((error) => {
console.error(error)
}).finally(()=>[
this.locading = false
])
},
buildDeviceIdCode: function (deviceId){
this.$refs.channelCode.openDialog(code=>{
console.log(this.form)
console.log("code===> " + code)
this.form.gbDeviceId = code;
console.log("code22===> " + code)
}, deviceId);
},
cancelSubmit: function (){
if(this.cancel) {
this.cancel()
}
}
// getDeviceChannel:function (callback) {
// this.$axios({
// method: 'get',
// url: "/api/device/query/channel/raw",
// params: {
// id: this.id
// }
// }).then((res) => {
// if (res.data.code === 0) {
// if(callback) {
// callback(res.data.data)
// }
// }
// }).catch((error) => {
// console.error(error)
// }).finally(()=>[
// this.locading = false
// ])
// }
},
};
</script>
<style>
.channel-form {
display: grid;
background-color: #FFFFFF;
padding: 1rem 2rem 0 2rem;
grid-template-columns: 1fr 1fr 1fr;
gap: 1rem;
}
</style>

View File

@ -15,7 +15,7 @@
<div style="text-align: center">{{ allVal[0].meaning }}</div>
</div>
<el-radio-group v-model="allVal[0].val" >
<el-radio v-for="item in regionList" :key="item.commonRegionId" :label="item.commonRegionDeviceId" style="line-height: 2rem">
<el-radio v-for="item in regionList" :key="item.commonRegionDeviceId" :label="item.commonRegionDeviceId" style="line-height: 2rem">
{{ item.commonRegionName }} - {{ item.commonRegionDeviceId }}
</el-radio>
</el-radio-group>
@ -26,7 +26,7 @@
<div style="text-align: center">{{ allVal[1].meaning }}</div>
</div>
<el-radio-group v-model="allVal[1].val" :disabled="allVal[1].lock">
<el-radio v-for="item in regionList" :key="item.commonRegionId" :label="item.commonRegionDeviceId.substring(2)" style="line-height: 2rem">
<el-radio v-for="item in regionList" :key="item.commonRegionDeviceId" :label="item.commonRegionDeviceId.substring(2)" style="line-height: 2rem">
{{ item.commonRegionName }} - {{ item.commonRegionDeviceId.substring(2) }}
</el-radio>
</el-radio-group>
@ -37,7 +37,7 @@
<div style="text-align: center">{{ allVal[2].meaning }}</div>
</div>
<el-radio-group v-model="allVal[2].val" :disabled="allVal[2].lock">
<el-radio v-for="item in regionList" :key="item.commonRegionId" :label="item.commonRegionDeviceId.substring(4)" style="line-height: 2rem">
<el-radio v-for="item in regionList" :key="item.commonRegionDeviceId" :label="item.commonRegionDeviceId.substring(4)" style="line-height: 2rem">
{{ item.commonRegionName }} - {{ item.commonRegionDeviceId.substring(4) }}
</el-radio>
</el-radio-group>
@ -75,7 +75,7 @@
<div style="text-align: center">{{ allVal[5].meaning }}</div>
</div>
<el-radio-group v-model="allVal[5].val" :disabled="allVal[5].lock" >
<el-radio v-for="item in deviceTypeList" :label="item.code" style="line-height: 2rem">
<el-radio v-for="item in deviceTypeList" :label="item.code" :key="item.code" style="line-height: 2rem">
{{ item.name }} - {{ item.code }}
</el-radio>
</el-radio-group>
@ -86,7 +86,7 @@
<div style="text-align: center">{{ allVal[6].meaning }}</div>
</div>
<el-radio-group v-model="allVal[6].val" :disabled="allVal[6].lock">
<el-radio v-for="item in networkIdentificationTypeList" :label="item.code" style="line-height: 2rem">
<el-radio v-for="item in networkIdentificationTypeList" :label="item.code" :key="item.code" style="line-height: 2rem">
{{ item.name }} - {{ item.code }}
</el-radio>
</el-radio-group>
@ -195,6 +195,7 @@ export default {
},
methods: {
openDialog: function (endCallBck, code, lockIndex, lockContent) {
console.log(code)
this.showVideoDialog = true
this.activeKey= '0';
this.regionList = []

View File

@ -8,7 +8,7 @@
<el-menu-item index="/live">分屏监控</el-menu-item>
<el-menu-item index="/deviceList">国标设备</el-menu-item>
<el-menu-item index="/map">电子地图</el-menu-item>
<el-menu-item index="/pushVideoList">推流列表</el-menu-item>
<el-menu-item index="/streamPushList">推流列表</el-menu-item>
<el-menu-item index="/streamProxyList">拉流代理</el-menu-item>
<el-menu-item index="/cloudRecord">云端录像</el-menu-item>
<el-menu-item index="/mediaServerManger">节点管理</el-menu-item>

View File

@ -6,7 +6,7 @@ import console from '../components/console.vue'
import deviceList from '../components/DeviceList.vue'
import channelList from '../components/channelList.vue'
import gbRecordDetail from '../components/GBRecordDetail.vue'
import pushVideoList from '../components/PushVideoList.vue'
import streamPushList from '../components/StreamPushList.vue'
import streamProxyList from '../components/StreamProxyList.vue'
import map from '../components/map.vue'
import login from '../components/Login.vue'
@ -54,8 +54,8 @@ export default new VueRouter({
component: deviceList,
},
{
path: '/pushVideoList',
component: pushVideoList,
path: '/streamPushList',
component: streamPushList,
},
{
path: '/streamProxyList',

View File

@ -98,7 +98,7 @@ create table wvp_log (
create table wvp_device_channel (
id serial primary key ,
device_db_id integer,
device_id character varying(50) not null,
device_id character varying(50),
name character varying(255),
manufacturer character varying(50),
model character varying(50),