src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
@@ -14,6 +14,7 @@
import com.genersoft.iot.vmp.storager.dao.dto.ChannelSourceInfo;
import com.genersoft.iot.vmp.utils.DateUtil;
import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
import com.genersoft.iot.vmp.web.gb28181.dto.DeviceChannelExtend;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.slf4j.Logger;
@@ -133,6 +134,15 @@
               if (allChannelMap.containsKey(deviceChannel.getChannelId())) {
                  deviceChannel.setStreamId(allChannelMap.get(deviceChannel.getChannelId()).getStreamId());
                  deviceChannel.setHasAudio(allChannelMap.get(deviceChannel.getChannelId()).isHasAudio());
                  if (allChannelMap.get(deviceChannel.getChannelId()).getStatus() !=deviceChannel.getStatus()){
                     List<String> strings = platformChannelMapper.queryParentPlatformByChannelId(deviceChannel.getChannelId());
                     if (!CollectionUtils.isEmpty(strings)){
                        strings.forEach(platformId->{
                           eventPublisher.catalogEventPublish(platformId, deviceChannel, deviceChannel.getStatus()==1?CatalogEvent.ON:CatalogEvent.OFF);
                        });
                     }
                  }
               }
               channels.add(deviceChannel);
               if (!ObjectUtils.isEmpty(deviceChannel.getParentId())) {
@@ -187,7 +197,7 @@
         dataSourceTransactionManager.commit(transactionStatus);     //手动提交
         return true;
      }catch (Exception e) {
         e.printStackTrace();
         logger.error("未处理的异常 ", e);
         dataSourceTransactionManager.rollback(transactionStatus);
         return false;
      }
@@ -224,8 +234,10 @@
               if (allChannelMap.containsKey(deviceChannel.getChannelId())) {
                  deviceChannel.setStreamId(allChannelMap.get(deviceChannel.getChannelId()).getStreamId());
                  deviceChannel.setHasAudio(allChannelMap.get(deviceChannel.getChannelId()).isHasAudio());
                  deviceChannel.setUpdateTime(DateUtil.getNow());
                  updateChannels.add(deviceChannel);
               }else {
                  deviceChannel.setCreateTime(DateUtil.getNow());
                  addChannels.add(deviceChannel);
               }
               if (!ObjectUtils.isEmpty(deviceChannel.getParentId())) {
@@ -301,7 +313,7 @@
         }
         return true;
      }catch (Exception e) {
         e.printStackTrace();
         logger.error("未处理的异常 ", e);
         dataSourceTransactionManager.rollback(transactionStatus);
         return false;
      }
@@ -355,14 +367,19 @@
   }
   @Override
   public List<DeviceChannel> queryChannelsByDeviceIdWithStartAndLimit(String deviceId, String query, Boolean hasSubChannel, Boolean online, int start, int limit,List<String> channelIds) {
      return deviceChannelMapper.queryChannelsByDeviceIdWithStartAndLimit(deviceId, null, query, hasSubChannel, online, start, limit,channelIds);
   public List<DeviceChannelExtend> queryChannelsByDeviceIdWithStartAndLimit(String deviceId, List<String> channelIds, String query, Boolean hasSubChannel, Boolean online, int start, int limit) {
      return deviceChannelMapper.queryChannelsByDeviceIdWithStartAndLimit(deviceId, channelIds, null, query, hasSubChannel, online, start, limit);
   }
   @Override
   public List<DeviceChannel> queryChannelsByDeviceId(String deviceId,Boolean online,List<String> channelIds) {
      return deviceChannelMapper.queryChannels(deviceId, null,null, null, online,channelIds);
   }
   @Override
   public List<DeviceChannelExtend> queryChannelsByDeviceId(String deviceId, List<String> channelIds, Boolean online) {
      return deviceChannelMapper.queryChannelsWithDeviceInfo(deviceId, null,null, null, online,channelIds);
   }
   @Override
@@ -508,6 +525,16 @@
   }
   @Override
   public List<ParentPlatform> queryEnablePlatformListWithAsMessageChannel() {
      return platformMapper.queryEnablePlatformListWithAsMessageChannel();
   }
   @Override
   public List<Device> queryDeviceWithAsMessageChannel() {
      return deviceMapper.queryDeviceWithAsMessageChannel();
   }
   @Override
   public void outlineForAllParentPlatform() {
      platformMapper.outlineForAllParentPlatform();
   }
@@ -584,6 +611,20 @@
   }
   @Override
   public Device queryDeviceInfoByPlatformIdAndChannelId(String platformId, String channelId) {
      List<Device> devices = platformChannelMapper.queryDeviceInfoByPlatformIdAndChannelId(platformId, channelId);
      if (devices.size() > 1) {
         // 出现长度大于0的时候肯定是国标通道的ID重复了
         logger.warn("国标ID存在重复:{}", channelId);
      }
      if (devices.size() == 0) {
         return null;
      }else {
         return devices.get(0);
      }
   }
   /**
    * 查询最新移动位置
    * @param deviceId