|
|
@ -27,6 +27,7 @@ public class DepartmentBO {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 台账数据、值显示转换
|
|
|
|
* 台账数据、值显示转换
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param list
|
|
|
|
* @param list
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -41,7 +42,7 @@ public class DepartmentBO {
|
|
|
|
).collect(Collectors.toList());
|
|
|
|
).collect(Collectors.toList());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static List<DepartmentListDTO> buildDeptDTOList(Collection<DepartmentPO> list) {
|
|
|
|
public static List<DepartmentListDTO> buildDeptDTOList(Collection<DepartmentPO> list, String orderType) {
|
|
|
|
// 递归添加父级数据
|
|
|
|
// 递归添加父级数据
|
|
|
|
List<DepartmentListDTO> dtoList = list.stream().map(e ->
|
|
|
|
List<DepartmentListDTO> dtoList = list.stream().map(e ->
|
|
|
|
DepartmentListDTO
|
|
|
|
DepartmentListDTO
|
|
|
@ -54,6 +55,7 @@ public class DepartmentBO {
|
|
|
|
.supDepId(e.getSupDepId())
|
|
|
|
.supDepId(e.getSupDepId())
|
|
|
|
.showOrder(null == e.getShowOrder() ? 0 : e.getShowOrder())
|
|
|
|
.showOrder(null == e.getShowOrder() ? 0 : e.getShowOrder())
|
|
|
|
.canceled(null == e.getCanceled() ? 0 : e.getCanceled())
|
|
|
|
.canceled(null == e.getCanceled() ? 0 : e.getCanceled())
|
|
|
|
|
|
|
|
.orderType(orderType)
|
|
|
|
.build()).collect(Collectors.toList());
|
|
|
|
.build()).collect(Collectors.toList());
|
|
|
|
Map<Integer, List<DepartmentListDTO>> collects = dtoList.stream().filter(item -> null != item.getSupDepId() && 0 != item.getSupDepId()).collect(Collectors.groupingBy(DepartmentListDTO::getSupDepId));
|
|
|
|
Map<Integer, List<DepartmentListDTO>> collects = dtoList.stream().filter(item -> null != item.getSupDepId() && 0 != item.getSupDepId()).collect(Collectors.groupingBy(DepartmentListDTO::getSupDepId));
|
|
|
|
// 处理被引用数据
|
|
|
|
// 处理被引用数据
|
|
|
@ -74,7 +76,7 @@ public class DepartmentBO {
|
|
|
|
}).filter(item -> null == item.getSupDepId() || 0 == item.getSupDepId()).collect(Collectors.toList());
|
|
|
|
}).filter(item -> null == item.getSupDepId() || 0 == item.getSupDepId()).collect(Collectors.toList());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static List<DepartmentListDTO> buildDeptDTOList(Collection<DepartmentPO> list, List<DepartmentPO> filterList) {
|
|
|
|
public static List<DepartmentListDTO> buildDeptDTOList(Collection<DepartmentPO> list, List<DepartmentPO> filterList, String orderType) {
|
|
|
|
// 搜索结果为空,直接返回空
|
|
|
|
// 搜索结果为空,直接返回空
|
|
|
|
if (CollectionUtils.isEmpty(filterList)) {
|
|
|
|
if (CollectionUtils.isEmpty(filterList)) {
|
|
|
|
return Collections.emptyList();
|
|
|
|
return Collections.emptyList();
|
|
|
@ -85,7 +87,7 @@ public class DepartmentBO {
|
|
|
|
for (DepartmentPO po : filterList) {
|
|
|
|
for (DepartmentPO po : filterList) {
|
|
|
|
dealParentData(addedList, po, poMaps);
|
|
|
|
dealParentData(addedList, po, poMaps);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return buildDeptDTOList(addedList);
|
|
|
|
return buildDeptDTOList(addedList, orderType);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static DepartmentPO convertParamsToPO(DeptSearchParam param, Integer employeeId) {
|
|
|
|
public static DepartmentPO convertParamsToPO(DeptSearchParam param, Integer employeeId) {
|
|
|
|