|
@@ -16,6 +16,7 @@ import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
|
|
|
import com.genersoft.iot.vmp.web.gb28181.dto.DeviceChannelExtend;
|
|
import com.genersoft.iot.vmp.web.gb28181.dto.DeviceChannelExtend;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
+import com.sun.org.apache.xml.internal.resolver.Catalog;
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -72,6 +73,9 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private PlatformChannelMapper platformChannelMapper;
|
|
private PlatformChannelMapper platformChannelMapper;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private PlatformCatalogMapper platformCatalogMapper;
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private StreamProxyMapper streamProxyMapper;
|
|
private StreamProxyMapper streamProxyMapper;
|
|
|
|
|
|
|
@@ -903,9 +907,43 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
|
|
eventPublisher.catalogEventPublish(platformId, deviceChannelList, CatalogEvent.DEL);
|
|
eventPublisher.catalogEventPublish(platformId, deviceChannelList, CatalogEvent.DEL);
|
|
|
}
|
|
}
|
|
|
int delChannelresult = platformChannelMapper.delByCatalogId(platformId, id);
|
|
int delChannelresult = platformChannelMapper.delByCatalogId(platformId, id);
|
|
|
|
|
+ // 查看是否存在子目录,如果存在一并删除
|
|
|
|
|
+ List<String> allChildCatalog = getAllChildCatalog(id, platformId);
|
|
|
|
|
+ if (!allChildCatalog.isEmpty()) {
|
|
|
|
|
+ int limitCount = 50;
|
|
|
|
|
+ if (allChildCatalog.size() > limitCount) {
|
|
|
|
|
+ for (int i = 0; i < allChildCatalog.size(); i += limitCount) {
|
|
|
|
|
+ int toIndex = i + limitCount;
|
|
|
|
|
+ if (i + limitCount > allChildCatalog.size()) {
|
|
|
|
|
+ toIndex = allChildCatalog.size();
|
|
|
|
|
+ }
|
|
|
|
|
+ delChannelresult += platformCatalogMapper.deleteAll(platformId, allChildCatalog.subList(i, toIndex));
|
|
|
|
|
+ }
|
|
|
|
|
+ }else {
|
|
|
|
|
+ delChannelresult += platformCatalogMapper.deleteAll(platformId, allChildCatalog);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
return delresult + delChannelresult + delStreamresult;
|
|
return delresult + delChannelresult + delStreamresult;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private List<String> getAllChildCatalog(String id, String platformId) {
|
|
|
|
|
+ List<String> catalogList = platformCatalogMapper.queryCatalogFromParent(id, platformId);
|
|
|
|
|
+ List<String> catalogListChild = new ArrayList<>();
|
|
|
|
|
+ if (catalogList != null && !catalogList.isEmpty()) {
|
|
|
|
|
+ for (String childId : catalogList) {
|
|
|
|
|
+ List<String> allChildCatalog = getAllChildCatalog(childId, platformId);
|
|
|
|
|
+ if (allChildCatalog != null && !allChildCatalog.isEmpty()) {
|
|
|
|
|
+ catalogListChild.addAll(allChildCatalog);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!catalogListChild.isEmpty()) {
|
|
|
|
|
+ catalogList.addAll(catalogListChild);
|
|
|
|
|
+ }
|
|
|
|
|
+ return catalogList;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public int updateCatalog(PlatformCatalog platformCatalog) {
|
|
public int updateCatalog(PlatformCatalog platformCatalog) {
|