chenjialing
2022-05-06 cc63a52884ca3c56df66b74aa508803ff91c20e0
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
@@ -13,8 +13,6 @@
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
import com.genersoft.iot.vmp.storager.dao.*;
import com.genersoft.iot.vmp.storager.dao.dto.ChannelSourceInfo;
import com.genersoft.iot.vmp.utils.node.ForestNodeMerger;
import com.genersoft.iot.vmp.vmanager.bean.DeviceChannelTree;
import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@@ -342,10 +340,15 @@
   }
   @Override
   public PageInfo queryChannelsByDeviceId(String deviceId, String query, Boolean hasSubChannel, Boolean online, int page, int count) {
   public PageInfo queryChannelsByDeviceId(String deviceId, String query, Boolean hasSubChannel, Boolean online, Boolean catalogUnderDevice, int page, int count) {
      // 获取到所有正在播放的流
      PageHelper.startPage(page, count);
      List<DeviceChannel> all = deviceChannelMapper.queryChannels(deviceId, null, query, hasSubChannel, online);
      List<DeviceChannel> all;
      if (catalogUnderDevice != null && catalogUnderDevice) {
         all = deviceChannelMapper.queryChannels(deviceId, deviceId, query, hasSubChannel, online);
      }else {
         all = deviceChannelMapper.queryChannels(deviceId, null, query, hasSubChannel, online);
      }
      return new PageInfo<>(all);
   }
@@ -354,10 +357,6 @@
      return deviceChannelMapper.queryChannelsByDeviceIdWithStartAndLimit(deviceId, null, query, hasSubChannel, online, start, limit);
   }
   @Override
   public List<DeviceChannelTree> tree(String deviceId) {
      return ForestNodeMerger.merge(deviceChannelMapper.tree(deviceId));
   }
   @Override
   public List<DeviceChannel> queryChannelsByDeviceId(String deviceId) {
@@ -365,9 +364,9 @@
   }
   @Override
   public PageInfo<DeviceChannel> querySubChannels(String deviceId, String parentChannelId, String query, Boolean hasSubChannel, String online, int page, int count) {
   public PageInfo<DeviceChannel> querySubChannels(String deviceId, String parentChannelId, String query, Boolean hasSubChannel, Boolean online, int page, int count) {
      PageHelper.startPage(page, count);
      List<DeviceChannel> all = deviceChannelMapper.queryChannels(deviceId, parentChannelId, null, null, null);
      List<DeviceChannel> all = deviceChannelMapper.queryChannels(deviceId, parentChannelId, query, hasSubChannel, online);
      return new PageInfo<>(all);
   }
@@ -504,8 +503,8 @@
    * @param endTime
    */
   @Override
   public synchronized List<MobilePosition> queryMobilePositions(String deviceId, String startTime, String endTime) {
      return deviceMobilePositionMapper.queryPositionByDeviceIdAndTime(deviceId, startTime, endTime);
   public synchronized List<MobilePosition> queryMobilePositions(String deviceId, String channelId, String startTime, String endTime) {
      return deviceMobilePositionMapper.queryPositionByDeviceIdAndTime(deviceId, channelId, startTime, endTime);
   }
   @Override
@@ -524,7 +523,7 @@
         parentPlatform.setCatalogGroup(1);
      }
      if (parentPlatform.getAdministrativeDivision() == null) {
         parentPlatform.setAdministrativeDivision(parentPlatform.getDeviceGBId().substring(0,6));
         parentPlatform.setAdministrativeDivision(parentPlatform.getAdministrativeDivision());
      }
      ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // .getDeviceGBId());
      if (parentPlatform.getId() == null ) {
@@ -1081,7 +1080,7 @@
      deviceChannel.setParentId(catalog.getParentId());
      deviceChannel.setRegisterWay(1);
      // 行政区划应该是Domain的前八位
      deviceChannel.setCivilCode(parentPlatByServerGBId.getDeviceGBId().substring(0,6));
      deviceChannel.setCivilCode(parentPlatByServerGBId.getAdministrativeDivision());
      deviceChannel.setModel("live");
      deviceChannel.setOwner("wvp-pro");
      deviceChannel.setSecrecy("0");