规格页面,列表

This commit is contained in:
zhenxianyimeng
2019-08-26 23:44:16 +08:00
parent 37d85b37ca
commit 795314ca04
9 changed files with 238 additions and 32 deletions

View File

@@ -91,7 +91,7 @@ public class AdminController {
}
// =========== 管理员管理 API ===========
//TODO 目前需要增加搜索所有子部门的用户
@GetMapping("/page")
@RequiresPermissions("system.admin.page")
@ApiOperation(value = "管理员分页")

View File

@@ -49,7 +49,7 @@ public class DeptmentController {
public CommonResult<List<DeptmentVO>> treeAll(){
List<DeptmentBO> list = deptmentService.getAllDeptments();
List<DeptmentVO> voList = DeptmentConvert.INSTANCE.convert(list);
Map<Integer, DeptmentVO> nodeMap = calaNodeMap(voList);
Map<Integer, DeptmentVO> nodeMap = calcNodeMap(voList);
// 获得到所有的根节点
List<DeptmentVO> rootNodes = nodeMap.values().stream()
.filter(node -> node.getPid().equals(ResourceConstants.PID_ROOT))
@@ -64,7 +64,7 @@ public class DeptmentController {
PageResult<DeptmentVO> voPageResult = DeptmentConvert.INSTANCE.convert(pageResult);
List<DeptmentBO> list = deptmentService.getAllDeptments();
List<DeptmentVO> voList = DeptmentConvert.INSTANCE.convert(list);
Map<Integer, DeptmentVO> nodeMap = calaNodeMap(voList);
Map<Integer, DeptmentVO> nodeMap = calcNodeMap(voList);
voPageResult.getList().forEach(d->{
d.setChildren(nodeMap.get(d.getId()).getChildren());
});
@@ -97,7 +97,7 @@ public class DeptmentController {
));
}
private Map<Integer, DeptmentVO> calaNodeMap(List<DeptmentVO> voList){
private Map<Integer, DeptmentVO> calcNodeMap(List<DeptmentVO> voList){
Map<Integer, DeptmentVO> nodeMap = voList.stream().collect(Collectors.toMap(e->e.getId(), e->e));
nodeMap.values().stream()