diff --git a/shandan-system/src/main/java/com/keyware/shandan/bianmu/service/DirectoryTreeService.java b/shandan-system/src/main/java/com/keyware/shandan/bianmu/service/DirectoryTreeService.java index bafaef7..0049fa3 100644 --- a/shandan-system/src/main/java/com/keyware/shandan/bianmu/service/DirectoryTreeService.java +++ b/shandan-system/src/main/java/com/keyware/shandan/bianmu/service/DirectoryTreeService.java @@ -63,15 +63,18 @@ public class DirectoryTreeService { Set permisDis = "write".equals(permis) ? dirPermissionService.getByWritePermis(user) : dirPermissionService.getByReadPermis(user); // 判断权限范围 List permisDirectoryList = StreamUtil.as(directoryList).filter(dir -> { - if(dir.getReviewStatus() == status || status == null){ + if (dir.getReviewStatus() == status || status == null) { boolean permisAllow = permisDis.contains(dir.getId()); - if(permisAllow){ + if (permisAllow) { return true; } // 如果权限不允许,则需要判断当前节点的所有子级节点是否有允许的目录,如果有则需要返回到前端的树组件中 - Set childrenIds = getDirectoryList(dir, true, false, busType).stream().map(DirectoryVo::getId).collect(Collectors.toSet()); - for(String id : childrenIds){ - if(permisDis.contains(id)){ + Set childrenIds = getDirectoryList(dir, true, false, busType) + .stream() + .map(DirectoryVo::getId) + .collect(Collectors.toSet()); + for (String id : childrenIds) { + if (permisDis.contains(id)) { return true; } } @@ -103,9 +106,9 @@ public class DirectoryTreeService { */ private List getDirectoryList(DirectoryVo parentDir, boolean allChild, boolean hasResource, int busType) { QueryWrapper wrapper = new QueryWrapper<>(); - if(parentDir == null){ + if (parentDir == null) { wrapper.eq("ID", "ROOT"); - }else { + } else { wrapper.in(!hasResource, "DIRECTORY_TYPE", DirectoryType.DIRECTORY, DirectoryType.LINK_DIR).eq("IS_BASIC_DIR", busType); if (parentDir != null) { if (allChild) {