|
|
|
@ -32,16 +32,20 @@ public class DepartmentBO {
|
|
|
|
|
* @param list
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static List<DepartmentListDTO> buildDeptDTOShowNames(Collection<DepartmentListDTO> list) {
|
|
|
|
|
return list.stream().peek(e -> {
|
|
|
|
|
List<DepartmentListDTO> children = e.getChildren();
|
|
|
|
|
if (CollectionUtils.isNotEmpty(children)){
|
|
|
|
|
List<DepartmentListDTO> collect = children.stream().peek(item -> item.setBmfzr(getEmployeeNameById(item.getId()))).collect(Collectors.toList());
|
|
|
|
|
e.setChildren(collect);
|
|
|
|
|
}
|
|
|
|
|
e.setBmfzr(getEmployeeNameById(e.getId()));
|
|
|
|
|
}
|
|
|
|
|
).collect(Collectors.toList());
|
|
|
|
|
public static List<DepartmentListDTO> buildDeptDTOShowNames(List<DepartmentListDTO> list) {
|
|
|
|
|
setDeptLeader(list);
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void setDeptLeader(List<DepartmentListDTO> departments) {
|
|
|
|
|
for (DepartmentListDTO dept : departments) {
|
|
|
|
|
dept.setBmfzr(getEmployeeNameById(dept.getId()));
|
|
|
|
|
List<DepartmentListDTO> children = dept.getChildren();
|
|
|
|
|
if (CollectionUtils.isNotEmpty(children)){
|
|
|
|
|
setDeptLeader(children);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static List<DepartmentListDTO> buildDeptDTOList(Collection<DepartmentPO> list, String orderType) {
|
|
|
|
|