部门调整父部门是0

main
zhaokai 2025-11-20 11:21:16 +08:00
parent 38a8775824
commit 4bfbcdb7ab
2 changed files with 9 additions and 3 deletions

View File

@ -81,7 +81,13 @@ public class DepartmentQueryExe {
} }
List<DepartmentTreeInfoCO> examCenterCOS = departmentCoConvertor.converDOsToInfoCOs(pageResponse); List<DepartmentTreeInfoCO> examCenterCOS = departmentCoConvertor.converDOsToInfoCOs(pageResponse);
//GBS部门根节点父部门是tenantId //GBS部门根节点父部门是tenantId
return Tools.buildEntityTree(examCenterCOS, "id", "parentId", "childrenList", departmentQry.getEqCorpinfoId()); if(departmentQry.getEqParentId()!=null){
return Tools.buildEntityTree(examCenterCOS, "id", "parentId", "childrenList",departmentQry.getEqParentId());
}else{
return Tools.buildEntityTree(examCenterCOS, "id", "parentId", "childrenList",0L);
}
} }
@ -140,7 +146,7 @@ public class DepartmentQueryExe {
List<List<DepartmentTreeInfoCO>> result1= new ArrayList<>(); List<List<DepartmentTreeInfoCO>> result1= new ArrayList<>();
Map<Long, List<DepartmentTreeInfoCO>> corpMap = examCenterCOS.stream().collect(Collectors.groupingBy(DepartmentTreeInfoCO::getCorpinfoId)); Map<Long, List<DepartmentTreeInfoCO>> corpMap = examCenterCOS.stream().collect(Collectors.groupingBy(DepartmentTreeInfoCO::getCorpinfoId));
corpMap.forEach((corpId, list) -> { corpMap.forEach((corpId, list) -> {
List<DepartmentTreeInfoCO> departmentTreeInfoCOS = Tools.buildEntityTree(list, "id", "parentId", "childrenList", corpId); List<DepartmentTreeInfoCO> departmentTreeInfoCOS = Tools.buildEntityTree(list, "id", "parentId", "childrenList", 0L);
result1.add(departmentTreeInfoCOS); result1.add(departmentTreeInfoCOS);
}); });

View File

@ -62,7 +62,7 @@ public class DepartmentE extends BaseE {
public void initCorpInfo(Long corpInfoId, String corpName) { public void initCorpInfo(Long corpInfoId, String corpName) {
this.setId(corpInfoId); this.setId(corpInfoId);
this.setCorpinfoId(corpInfoId); this.setCorpinfoId(corpInfoId);
this.setParentId(corpInfoId); this.setParentId(0L);
this.setTenantId(corpInfoId); this.setTenantId(corpInfoId);
this.setOrgId(corpInfoId); this.setOrgId(corpInfoId);
this.setName(corpName); this.setName(corpName);