Merge remote-tracking branch 'origin/master'

master
GuoXin 1 year ago
commit 3e6c019881
  1. 4
      shandan-system/src/main/java/com/keyware/shandan/bianmu/service/impl/DirectoryServiceImpl.java

@ -82,12 +82,12 @@ public class DirectoryServiceImpl extends BaseServiceImpl<DirectoryMapper, Direc
QueryWrapper<DirectoryVo> deleteByResourceIdsQuery = new QueryWrapper<DirectoryVo>(); QueryWrapper<DirectoryVo> deleteByResourceIdsQuery = new QueryWrapper<DirectoryVo>();
removeList.forEach(dir -> { removeList.forEach(dir -> {
if (dir.getDirectoryType() == DirectoryType.FILE) { if (dir.getDirectoryType() == DirectoryType.FILE) {
if (countByDirTypeAndResource(DirectoryType.FILE, dir.getResourceId()) == 0) { if (countByDirTypeAndResource(DirectoryType.FILE, dir.getResourceId()) <= 1) {
deleteByDirectoryIdAndResourceId(null, dir.getResourceId()); deleteByDirectoryIdAndResourceId(null, dir.getResourceId());
sysFileService.deleteById(dir.getResourceId()); sysFileService.deleteById(dir.getResourceId());
} }
} else if (dir.getDirectoryType() == DirectoryType.METADATA) { } else if (dir.getDirectoryType() == DirectoryType.METADATA) {
if (countByDirTypeAndResource(DirectoryType.METADATA, dir.getResourceId()) == 0) { if (countByDirTypeAndResource(DirectoryType.METADATA, dir.getResourceId()) <= 1) {
deleteByDirectoryIdAndResourceId(null, dir.getResourceId()); deleteByDirectoryIdAndResourceId(null, dir.getResourceId());
} }
} }