SaltFish
2022-02-10 0209dc89c9d5a65aaa1c6e3ae8140dfdb5020dcb
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java
@@ -639,7 +639,7 @@
   @Override
   public List<PlatformCatalog> queryStreamInParentPlatformAndCatalog(String platformId, String catalogId) {
      List<PlatformCatalog> catalogs = platformGbStreamMapper.queryChannelInParentPlatformAndCatalogForCatlog(platformId, catalogId);
      List<PlatformCatalog> catalogs = platformGbStreamMapper.queryChannelInParentPlatformAndCatalogForCatalog(platformId, catalogId);
      return catalogs;
   }
@@ -679,6 +679,7 @@
      streamProxyItem.setStatus(true);
      String now = this.format.format(System.currentTimeMillis());
      streamProxyItem.setCreateTime(now);
      streamProxyItem.setCreateStamp(System.currentTimeMillis());
      try {
         if (gbStreamMapper.add(streamProxyItem)<0 || streamProxyMapper.add(streamProxyItem) < 0) {
            //事务回滚
@@ -814,9 +815,11 @@
               streamPushItem.setCatalogId(parentPlatform.getCatalogId());
               streamPushItem.setPlatformId(parentPlatform.getServerGBId());
               String stream = streamPushItem.getStream();
               StreamProxyItem streamProxyItems = platformGbStreamMapper.selectOne(streamPushItem.getApp(), stream, parentPlatform.getServerGBId());
               StreamProxyItem streamProxyItems = platformGbStreamMapper.selectOne(streamPushItem.getApp(), stream,
                     parentPlatform.getServerGBId());
               if (streamProxyItems == null) {
                  platformGbStreamMapper.add(streamPushItem);
                  eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), streamPushItem, CatalogEvent.ADD);
               }
            }
         }
@@ -857,8 +860,8 @@
   }
   @Override
   public List<StreamProxyItem> getStreamProxyListForEnableInMediaServer(String id, boolean enable) {
      return streamProxyMapper.selectForEnableInMediaServer(id, enable);
   public List<StreamProxyItem> getStreamProxyListForEnableInMediaServer(String id, boolean enable, boolean status) {
      return streamProxyMapper.selectForEnableInMediaServer(id, enable, status);
   }
@@ -1018,7 +1021,8 @@
      deviceChannel.setParental(1);
      deviceChannel.setParentId(catalog.getParentId());
      deviceChannel.setRegisterWay(1);
      deviceChannel.setCivilCode(sipConfig.getDomain());
      // 行政区划应该是Domain的前八位
      deviceChannel.setCivilCode(sipConfig.getDomain().substring(0, sipConfig.getDomain().length() - 2));
      deviceChannel.setModel("live");
      deviceChannel.setOwner("wvp-pro");
      deviceChannel.setSecrecy("0");
@@ -1044,4 +1048,20 @@
   public GbStream getGbStream(String app, String streamId) {
      return gbStreamMapper.selectOne(app, streamId);
   }
   @Override
   public void delCatalogByPlatformId(String serverGBId) {
      catalogMapper.delByPlatformId(serverGBId);
   }
   @Override
   public void delRelationByPlatformId(String serverGBId) {
      platformGbStreamMapper.delByPlatformId(serverGBId);
      platformChannelMapper.delByPlatformId(serverGBId);
   }
   @Override
   public PlatformCatalog queryDefaultCatalogInPlatform(String platformId) {
      return catalogMapper.selectDefaultByPlatFormId(platformId);
   }
}