档案管理树结构修改
This commit is contained in:
parent
357063ea1e
commit
f64f7559db
|
|
@ -89,6 +89,9 @@ 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) {
|
||||||
|
if (dto.getParentId() == 0) {
|
||||||
|
return getDataTable(new ArrayList<>());
|
||||||
|
} else {
|
||||||
Integer level = fileManageMapper.getLevelById(dto.getParentId().toString());
|
Integer level = fileManageMapper.getLevelById(dto.getParentId().toString());
|
||||||
if (level == 4) {
|
if (level == 4) {
|
||||||
startPage();
|
startPage();
|
||||||
|
|
@ -98,6 +101,7 @@ public class FileManagementController extends BaseController {
|
||||||
return getDataTable(new ArrayList<>());
|
return getDataTable(new ArrayList<>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "新增右侧档案树")
|
@ApiOperation(value = "新增右侧档案树")
|
||||||
@PostMapping("addFileManageRight")
|
@PostMapping("addFileManageRight")
|
||||||
|
|
|
||||||
|
|
@ -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