648540858
2022-03-29 1553b39b4547418774ab2bd6da72f75bfd14b972
修复级联的国标通道无经纬度问题
5个文件已修改
1个文件已添加
73 ■■■■■ 已修改文件
src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannelInPlatform.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/CatalogNotifyMessageHandler.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/CatalogQueryMessageHandler.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorager.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannelInPlatform.java
New file
@@ -0,0 +1,23 @@
package com.genersoft.iot.vmp.gb28181.bean;
public class DeviceChannelInPlatform extends DeviceChannel{
    private String platFormId;
    private String catalogId;
    public String getPlatFormId() {
        return platFormId;
    }
    public void setPlatFormId(String platFormId) {
        this.platFormId = platFormId;
    }
    public String getCatalogId() {
        return catalogId;
    }
    public void setCatalogId(String catalogId) {
        this.catalogId = catalogId;
    }
}
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/CatalogNotifyMessageHandler.java
@@ -64,10 +64,10 @@
            Element snElement = rootElement.element("SN");
            String sn = snElement.getText();
            // 准备回复通道信息
            List<ChannelReduce> channelReduces = storager.queryChannelListInParentPlatform(parentPlatform.getServerGBId());
            List<DeviceChannelInPlatform> deviceChannels = storager.queryChannelListInParentPlatform(parentPlatform.getServerGBId());
            // 查询关联的直播通道
            List<GbStream> gbStreams = storager.queryGbStreamListInPlatform(parentPlatform.getServerGBId());
            int size = channelReduces.size() + gbStreams.size();
            int size = deviceChannels.size() + gbStreams.size();
            // 回复目录信息
            List<PlatformCatalog> catalogs =  storager.queryCatalogInPlatform(parentPlatform.getServerGBId());
            if (catalogs.size() > 0) {
@@ -96,14 +96,14 @@
                }
            }
            // 回复级联的通道
            if (channelReduces.size() > 0) {
                for (ChannelReduce channelReduce : channelReduces) {
                    if (channelReduce.getCatalogId().equals(parentPlatform.getServerGBId())) {
                        channelReduce.setCatalogId(parentPlatform.getDeviceGBId());
            if (deviceChannels.size() > 0) {
                for (DeviceChannelInPlatform channel : deviceChannels) {
                    if (channel.getCatalogId().equals(parentPlatform.getServerGBId())) {
                        channel.setCatalogId(parentPlatform.getDeviceGBId());
                    }
                    DeviceChannel deviceChannel = storager.queryChannel(channelReduce.getDeviceId(), channelReduce.getChannelId());
                    DeviceChannel deviceChannel = storager.queryChannel(channel.getDeviceId(), channel.getChannelId());
                    deviceChannel.setParental(0);
                    deviceChannel.setParentId(channelReduce.getCatalogId());
                    deviceChannel.setParentId(channel.getCatalogId());
                    deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0, 6));
                    cmderFroPlatform.catalogQuery(deviceChannel, parentPlatform, sn, fromHeader.getTag(), size);
                    // 防止发送过快
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/CatalogQueryMessageHandler.java
@@ -67,12 +67,12 @@
            Element snElement = rootElement.element("SN");
            String sn = snElement.getText();
            // 准备回复通道信息
            List<ChannelReduce> channelReduces = storager.queryChannelListInParentPlatform(parentPlatform.getServerGBId());
            List<DeviceChannelInPlatform> deviceChannelInPlatforms = storager.queryChannelListInParentPlatform(parentPlatform.getServerGBId());
            // 查询关联的直播通道
            List<GbStream> gbStreams = storager.queryGbStreamListInPlatform(parentPlatform.getServerGBId());
            // 回复目录信息
            List<PlatformCatalog> catalogs =  storager.queryCatalogInPlatform(parentPlatform.getServerGBId());
            int size = catalogs.size() + channelReduces.size() + gbStreams.size();
            int size = catalogs.size() + deviceChannelInPlatforms.size() + gbStreams.size();
            if (catalogs.size() > 0) {
                for (PlatformCatalog catalog : catalogs) {
                    if (catalog.getParentId().equals(parentPlatform.getServerGBId())) {
@@ -99,14 +99,14 @@
                }
            }
            // 回复级联的通道
            if (channelReduces.size() > 0) {
                for (ChannelReduce channelReduce : channelReduces) {
                    if (channelReduce.getCatalogId().equals(parentPlatform.getServerGBId())) {
                        channelReduce.setCatalogId(parentPlatform.getDeviceGBId());
            if (deviceChannelInPlatforms.size() > 0) {
                for (DeviceChannelInPlatform channel : deviceChannelInPlatforms) {
                    if (channel.getCatalogId().equals(parentPlatform.getServerGBId())) {
                        channel.setCatalogId(parentPlatform.getDeviceGBId());
                    }
                    DeviceChannel deviceChannel = storager.queryChannel(channelReduce.getDeviceId(), channelReduce.getChannelId());
                    DeviceChannel deviceChannel = storager.queryChannel(channel.getDeviceId(), channel.getChannelId());
                    deviceChannel.setParental(0);
                    deviceChannel.setParentId(channelReduce.getCatalogId());
                    deviceChannel.setParentId(channel.getCatalogId());
                    deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0, 6));
                    cmderFroPlatform.catalogQuery(deviceChannel, parentPlatform, sn, fromHeader.getTag(), size);
                    // 防止发送过快
src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorager.java
@@ -245,7 +245,7 @@
    /**
     * 查询设备的通道信息
     */
    List<ChannelReduce> queryChannelListInParentPlatform(String platformId);
    List<DeviceChannelInPlatform> queryChannelListInParentPlatform(String platformId);
    /**
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
@@ -1,6 +1,7 @@
package com.genersoft.iot.vmp.storager.dao;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannelInPlatform;
import com.genersoft.iot.vmp.vmanager.bean.DeviceChannelTree;
import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
import org.apache.ibatis.annotations.*;
@@ -114,22 +115,15 @@
    @Select(value = {" <script>" +
            "SELECT " +
            "    dc.id,\n" +
            "    dc.channelId,\n" +
            "    dc.deviceId,\n" +
            "    dc.name,\n" +
            "    de.manufacturer,\n" +
            "    de.hostAddress,\n" +
            "    dc.subCount,\n" +
            "    dc.*,\n" +
            "    pgc.platformId as platformId,\n" +
            "    pgc.catalogId as catalogId " +
            " FROM device_channel dc " +
            " LEFT JOIN device de ON dc.deviceId = de.deviceId " +
            " LEFT JOIN platform_gb_channel pgc on pgc.deviceChannelId = dc.id " +
            " WHERE pgc.platformId = #{platformId} " +
            " ORDER BY dc.deviceId, dc.channelId ASC" +
            " </script>"})
    List<ChannelReduce> queryChannelByPlatformId(String platformId);
    List<DeviceChannelInPlatform> queryChannelByPlatformId(String platformId);
    @Select("SELECT * FROM device_channel WHERE channelId=#{channelId}")
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java
@@ -612,9 +612,9 @@
    }
    @Override
    public List<ChannelReduce> queryChannelListInParentPlatform(String platformId) {
    public List<DeviceChannelInPlatform> queryChannelListInParentPlatform(String platformId) {
        return deviceChannelMapper.queryChannelByPlatformId( platformId);
        return deviceChannelMapper.queryChannelByPlatformId(platformId);
    }
    @Override