档案管理树结构修改
This commit is contained in:
parent
357063ea1e
commit
f64f7559db
|
|
@ -89,13 +89,17 @@ public class FileManagementController extends BaseController {
|
||||||
@SysLog(title = "第四级档案信息", module = "档案管理->档案右侧列表", businessType = OperaType.QUERY, details = "第四级档案信息", logType = 1)
|
@SysLog(title = "第四级档案信息", module = "档案管理->档案右侧列表", businessType = OperaType.QUERY, details = "第四级档案信息", logType = 1)
|
||||||
@RequiresPermissions("file:manage:query")
|
@RequiresPermissions("file:manage:query")
|
||||||
public TableDataInfo getFileManage(DaKyProFilesContentsDto dto) {
|
public TableDataInfo getFileManage(DaKyProFilesContentsDto dto) {
|
||||||
Integer level = fileManageMapper.getLevelById(dto.getParentId().toString());
|
if (dto.getParentId() == 0) {
|
||||||
if (level == 4) {
|
|
||||||
startPage();
|
|
||||||
List<DaKyProFilesContentsDto> list = fileManageService.FileManage(dto);
|
|
||||||
return getDataTable(list);
|
|
||||||
} else {
|
|
||||||
return getDataTable(new ArrayList<>());
|
return getDataTable(new ArrayList<>());
|
||||||
|
} else {
|
||||||
|
Integer level = fileManageMapper.getLevelById(dto.getParentId().toString());
|
||||||
|
if (level == 4) {
|
||||||
|
startPage();
|
||||||
|
List<DaKyProFilesContentsDto> list = fileManageService.FileManage(dto);
|
||||||
|
return getDataTable(list);
|
||||||
|
} else {
|
||||||
|
return getDataTable(new ArrayList<>());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ public class TreeBuilder {
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
// 使用 Map 提升查找效率
|
// 使用 Map 提升查找效率
|
||||||
Map<Integer, DaKyProFilesContentsDto> map = new HashMap<>();
|
Map<String, DaKyProFilesContentsDto> map = new HashMap<>();
|
||||||
List<DaKyProFilesContentsDto> roots = new ArrayList<>();
|
List<DaKyProFilesContentsDto> roots = new ArrayList<>();
|
||||||
|
|
||||||
// 第一步:将所有节点放入 map
|
// 第一步:将所有节点放入 map
|
||||||
|
|
@ -70,7 +70,7 @@ public class TreeBuilder {
|
||||||
if (parentId == null) {
|
if (parentId == null) {
|
||||||
roots.add(item);
|
roots.add(item);
|
||||||
} else {
|
} else {
|
||||||
DaKyProFilesContentsDto parent = map.get(parentId);
|
DaKyProFilesContentsDto parent = map.get(parentId.toString());
|
||||||
if (parent != null) {
|
if (parent != null) {
|
||||||
parent.getChildren().add(item);
|
parent.getChildren().add(item);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue