lin
2022-01-08 abb60593cb77e9e9b6e67e8276fc416c2aede43f
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java
@@ -6,6 +6,7 @@
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
import com.genersoft.iot.vmp.service.IGbStreamService;
import com.genersoft.iot.vmp.service.bean.GPSMsgInfo;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
import com.genersoft.iot.vmp.storager.dao.*;
@@ -486,18 +487,21 @@
      // 更新缓存
      parentPlatformCatch.setParentPlatform(parentPlatform);
      redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
      // 共享所有视频流,需要将现有视频流添加到此平台
      List<GbStream> gbStreams = gbStreamMapper.selectAll();
      if (gbStreams.size() > 0) {
         for (GbStream gbStream : gbStreams) {
            gbStream.setCatalogId(parentPlatform.getCatalogId());
         }
         if (parentPlatform.isShareAllLiveStream()) {
            gbStreamService.addPlatformInfo(gbStreams, parentPlatform.getServerGBId(), parentPlatform.getCatalogId());
         }else {
            gbStreamService.delPlatformInfo(gbStreams);
      if (parentPlatform.isEnable()) {
         // 共享所有视频流,需要将现有视频流添加到此平台
         List<GbStream> gbStreams = gbStreamMapper.queryStreamNotInPlatform();
         if (gbStreams.size() > 0) {
            for (GbStream gbStream : gbStreams) {
               gbStream.setCatalogId(parentPlatform.getCatalogId());
            }
            if (parentPlatform.isShareAllLiveStream()) {
               gbStreamService.addPlatformInfo(gbStreams, parentPlatform.getServerGBId(), parentPlatform.getCatalogId());
            }else {
               gbStreamService.delPlatformInfo(gbStreams);
            }
         }
      }
      return result > 0;
   }
@@ -895,4 +899,9 @@
      }
      return 0;
   }
   @Override
   public int updateStreamGPS(List<GPSMsgInfo> gpsMsgInfos) {
      return gbStreamMapper.updateStreamGPS(gpsMsgInfos);
   }
}