部门树状结构调整格式
parent
c00c0c9155
commit
60028814fc
|
|
@ -92,7 +92,7 @@ public class DepartmentController {
|
|||
}
|
||||
@ApiOperation("所有企业下部门树状所有数据")
|
||||
@PostMapping("/listAllTree")
|
||||
public MultiResponse<List<DepartmentTreeInfoCO>> listAllTree() {
|
||||
public MultiResponse<DepartmentTreeInfoCO> listAllTree() {
|
||||
return MultiResponse.of(departmentService.listAllTree());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ public class DepartmentQueryExe {
|
|||
return departmentCoConvertor.converDOsToCOs(list);
|
||||
}
|
||||
|
||||
public Collection<List<DepartmentTreeInfoCO>> listAllTree() {
|
||||
public List<DepartmentTreeInfoCO> listAllTree() {
|
||||
|
||||
List<DepartmentDO> pageResponse = departmentRepository.listAllTree();
|
||||
if (CollUtil.isEmpty(pageResponse)) {
|
||||
|
|
@ -160,16 +160,17 @@ public class DepartmentQueryExe {
|
|||
//GBS部门根节点父部门是tenantId
|
||||
//按照企业分组
|
||||
List<List<DepartmentTreeInfoCO>> result1= new ArrayList<>();
|
||||
List<DepartmentTreeInfoCO> result2= new ArrayList<>();
|
||||
Map<Long, List<DepartmentTreeInfoCO>> corpMap = examCenterCOS.stream().collect(Collectors.groupingBy(DepartmentTreeInfoCO::getCorpinfoId));
|
||||
corpMap.forEach((corpId, list) -> {
|
||||
List<DepartmentTreeInfoCO> departmentTreeInfoCOS = Tools.buildEntityTree(list, "id", "parentId", "childrenList", 0L);
|
||||
if(CollUtil.isNotEmpty(departmentTreeInfoCOS)){
|
||||
result1.add(departmentTreeInfoCOS);
|
||||
result2.addAll(departmentTreeInfoCOS);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return result1;
|
||||
return result2;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ public class DepartmentServiceImpl implements DepartmentServiceI {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<List<DepartmentTreeInfoCO>> listAllTree() {
|
||||
public List<DepartmentTreeInfoCO> listAllTree() {
|
||||
return departmentQueryExe.listAllTree();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,6 @@ public interface DepartmentServiceI {
|
|||
|
||||
List<DepartmentCO> getDeptList();
|
||||
|
||||
Collection<List<DepartmentTreeInfoCO>> listAllTree();
|
||||
List<DepartmentTreeInfoCO> listAllTree();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue