panlinlin
2021-04-19 6e67b1902e783b4a13a7d8e83fd894dda2e4f61e
解决更新通道导致的点播丢失
5个文件已修改
20 ■■■■■ 已修改文件
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_src/src/components/UiHeader.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_src/src/components/channelList.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
@@ -16,10 +16,10 @@
    @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>" +
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java
@@ -2,7 +2,9 @@
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 @@
    @Autowired
    private GbStreamMapper gbStreamMapper;
    @Autowired
    private VideoStreamSessionManager streamSession;
    /**
     * 根据设备ID判断设备是否存在
@@ -106,6 +111,7 @@
    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);
src/main/resources/application.yml
@@ -1,3 +1,3 @@
spring:
  profiles:
    active: dev
    active: local
web_src/src/components/UiHeader.vue
@@ -59,8 +59,8 @@
        sseControl() {
            let that = this;
            if (this.alarmNotify) {
                console.log("申请SSE推送API调用,浏览器ID: " + this.$browserId);
                this.sseSource = new EventSource('/api/emit?browserId=' + this.$browserId);
              console.log("申请SSE推送API调用,浏览器ID: " + this.$browserId);
              this.sseSource = new EventSource('/api/emit?browserId=' + this.$browserId);
                this.sseSource.addEventListener('message', function(evt) {
                    that.$notify({
                        title: '收到报警信息',
web_src/src/components/channelList.vue
@@ -1,7 +1,6 @@
<template>
<div id="channelList">
    <el-container>
        <el-header>
            <uiHeader></uiHeader>
        </el-header>
@@ -118,7 +117,7 @@
    },
    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 @@
        },
        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`,