解决更新通道导致的点播丢失

pull/93/head
panlinlin 2021-04-19 14:24:08 +08:00
parent 57bbbc9f7a
commit 6e67b1902e
5 changed files with 13 additions and 7 deletions

View File

@ -16,10 +16,10 @@ public interface DeviceChannelMapper {
@Insert("INSERT INTO device_channel (channelId, deviceId, name, manufacture, model, owner, civilCode, block, " +
"address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " +
"ipAddress, port, password, PTZType, status) " +
"ipAddress, port, password, PTZType, status, streamId) " +
"VALUES ('${channelId}', '${deviceId}', '${name}', '${manufacture}', '${model}', '${owner}', '${civilCode}', '${block}'," +
"'${address}', ${parental}, '${parentId}', ${safetyWay}, ${registerWay}, '${certNum}', ${certifiable}, ${errCode}, '${secrecy}', " +
"'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status})")
"'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status}, '${streamId}')")
int add(DeviceChannel channel);
@Update(value = {" <script>" +

View File

@ -2,7 +2,9 @@ package com.genersoft.iot.vmp.storager.impl;
import java.util.*;
import com.genersoft.iot.vmp.common.StreamInfo;
import com.genersoft.iot.vmp.gb28181.bean.*;
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
@ -60,6 +62,9 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
@Autowired
private GbStreamMapper gbStreamMapper;
@Autowired
private VideoStreamSessionManager streamSession;
/**
* ID
@ -106,6 +111,7 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
public synchronized void updateChannel(String deviceId, DeviceChannel channel) {
String channelId = channel.getChannelId();
channel.setDeviceId(deviceId);
channel.setStreamId(streamSession.getStreamId(deviceId, channel.getChannelId()));
DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(deviceId, channelId);
if (deviceChannel == null) {
deviceChannelMapper.add(channel);

View File

@ -1,3 +1,3 @@
spring:
profiles:
active: dev
active: local

View File

@ -1,7 +1,6 @@
<template>
<div id="channelList">
<el-container>
<el-header>
<uiHeader></uiHeader>
</el-header>
@ -118,7 +117,7 @@ export default {
},
methods: {
initData: function () {
if (this.parentChannelId == "" || this.parentChannelId == 0) {
if (typeof (this.parentChannelId) == "undefined" || this.parentChannelId == 0) {
this.getDeviceChannelList();
} else {
this.showSubchannels();
@ -153,6 +152,7 @@ export default {
},
getDeviceChannelList: function () {
let that = this;
if (typeof (this.$route.params.deviceId) == "undefined") return;
this.$axios({
method: 'get',
url: `/api/device/query/devices/${this.$route.params.deviceId}/channels`,