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