解决更新通道导致的点播丢失
parent
57bbbc9f7a
commit
6e67b1902e
|
@ -16,10 +16,10 @@ public interface DeviceChannelMapper {
|
||||||
|
|
||||||
@Insert("INSERT INTO device_channel (channelId, deviceId, name, manufacture, model, owner, civilCode, block, " +
|
@Insert("INSERT INTO device_channel (channelId, deviceId, name, manufacture, model, owner, civilCode, block, " +
|
||||||
"address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " +
|
"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}'," +
|
"VALUES ('${channelId}', '${deviceId}', '${name}', '${manufacture}', '${model}', '${owner}', '${civilCode}', '${block}'," +
|
||||||
"'${address}', ${parental}, '${parentId}', ${safetyWay}, ${registerWay}, '${certNum}', ${certifiable}, ${errCode}, '${secrecy}', " +
|
"'${address}', ${parental}, '${parentId}', ${safetyWay}, ${registerWay}, '${certNum}', ${certifiable}, ${errCode}, '${secrecy}', " +
|
||||||
"'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status})")
|
"'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status}, '${streamId}')")
|
||||||
int add(DeviceChannel channel);
|
int add(DeviceChannel channel);
|
||||||
|
|
||||||
@Update(value = {" <script>" +
|
@Update(value = {" <script>" +
|
||||||
|
|
|
@ -2,7 +2,9 @@ package com.genersoft.iot.vmp.storager.impl;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.genersoft.iot.vmp.common.StreamInfo;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.*;
|
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.StreamProxyItem;
|
||||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||||
|
@ -60,6 +62,9 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
|
||||||
@Autowired
|
@Autowired
|
||||||
private GbStreamMapper gbStreamMapper;
|
private GbStreamMapper gbStreamMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private VideoStreamSessionManager streamSession;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据设备ID判断设备是否存在
|
* 根据设备ID判断设备是否存在
|
||||||
|
@ -106,6 +111,7 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
|
||||||
public synchronized void updateChannel(String deviceId, DeviceChannel channel) {
|
public synchronized void updateChannel(String deviceId, DeviceChannel channel) {
|
||||||
String channelId = channel.getChannelId();
|
String channelId = channel.getChannelId();
|
||||||
channel.setDeviceId(deviceId);
|
channel.setDeviceId(deviceId);
|
||||||
|
channel.setStreamId(streamSession.getStreamId(deviceId, channel.getChannelId()));
|
||||||
DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(deviceId, channelId);
|
DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(deviceId, channelId);
|
||||||
if (deviceChannel == null) {
|
if (deviceChannel == null) {
|
||||||
deviceChannelMapper.add(channel);
|
deviceChannelMapper.add(channel);
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: local
|
|
@ -59,8 +59,8 @@ export default {
|
||||||
sseControl() {
|
sseControl() {
|
||||||
let that = this;
|
let that = this;
|
||||||
if (this.alarmNotify) {
|
if (this.alarmNotify) {
|
||||||
console.log("申请SSE推送API调用,浏览器ID: " + this.$browserId);
|
console.log("申请SSE推送API调用,浏览器ID: " + this.$browserId);
|
||||||
this.sseSource = new EventSource('/api/emit?browserId=' + this.$browserId);
|
this.sseSource = new EventSource('/api/emit?browserId=' + this.$browserId);
|
||||||
this.sseSource.addEventListener('message', function(evt) {
|
this.sseSource.addEventListener('message', function(evt) {
|
||||||
that.$notify({
|
that.$notify({
|
||||||
title: '收到报警信息',
|
title: '收到报警信息',
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div id="channelList">
|
<div id="channelList">
|
||||||
<el-container>
|
<el-container>
|
||||||
|
|
||||||
<el-header>
|
<el-header>
|
||||||
<uiHeader></uiHeader>
|
<uiHeader></uiHeader>
|
||||||
</el-header>
|
</el-header>
|
||||||
|
@ -118,7 +117,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initData: function () {
|
initData: function () {
|
||||||
if (this.parentChannelId == "" || this.parentChannelId == 0) {
|
if (typeof (this.parentChannelId) == "undefined" || this.parentChannelId == 0) {
|
||||||
this.getDeviceChannelList();
|
this.getDeviceChannelList();
|
||||||
} else {
|
} else {
|
||||||
this.showSubchannels();
|
this.showSubchannels();
|
||||||
|
@ -153,6 +152,7 @@ export default {
|
||||||
},
|
},
|
||||||
getDeviceChannelList: function () {
|
getDeviceChannelList: function () {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
if (typeof (this.$route.params.deviceId) == "undefined") return;
|
||||||
this.$axios({
|
this.$axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: `/api/device/query/devices/${this.$route.params.deviceId}/channels`,
|
url: `/api/device/query/devices/${this.$route.params.deviceId}/channels`,
|
||||||
|
|
Loading…
Reference in New Issue