完成部门管理

This commit is contained in:
none
2023-02-19 17:12:52 +08:00
parent 384d61437f
commit 4ada5e9ff8
11 changed files with 88 additions and 137 deletions

View File

@@ -24,9 +24,18 @@ public class DepartmentBus {
if (parentDepartment == null) {
throw new NotFoundException("父级部门不存在");
}
parentChain = parentDepartment.getParentChain() + "," + parentId;
String pc = parentDepartment.getParentChain();
parentChain = pc == null || pc.length() == 0 ? parentId + "" : pc + "," + parentId;
}
return parentChain;
}
public static String childrenParentChain(Department department) {
String prefix = department.getId() + "";
if (department.getParentChain() != null && department.getParentChain().length() > 0) {
prefix = department.getParentChain() + "," + prefix;
}
return prefix;
}
}