组织架构 排序字段调整为Double

pull/284/head
dxfeng 6 months ago
parent 8a843480b6
commit 918f2e2a6e

@ -234,7 +234,7 @@ public class JobBrowserService extends BrowserService {
compList = MapperProxyFactory.getProxy(CompMapper.class).listParent();
}
// 获取顶层分部
compList.stream().sorted(Comparator.comparing(item -> null == item.getShowOrder() ? 0 : item.getShowOrder())).forEach(item -> buildCompNodes(treeNodes, compHasSubs, item));
compList.stream().sorted(Comparator.comparingDouble(item -> null == item.getShowOrder() ? 0 : item.getShowOrder())).forEach(item -> buildCompNodes(treeNodes, compHasSubs, item));
} else if ("1".equals(params.getType())) {
// 当前节点下的元素
CompPO compBuild = CompPO.builder().supSubComId(Integer.parseInt(params.getId())).canceled(0).build();

@ -25,8 +25,8 @@ public class CompBO {
public static List<SearchTree> buildSetToSearchTree(Set<CompPO> comps) {
return comps.stream().sorted(Comparator
.comparing(CompPO::getShowOrder)
.thenComparing(CompPO::getShowOrderOfTree)
.comparingDouble(CompPO::getShowOrder)
.thenComparingDouble(CompPO::getShowOrderOfTree)
).map(item -> {
SearchTree tree = new SearchTree();
tree.setCanClick(true);

@ -89,9 +89,9 @@ public class CompListDTO {
return children;
}
if ("asc".equalsIgnoreCase(orderType)) {
return children.stream().sorted(Comparator.comparing(CompListDTO::getShowOrder)).collect(Collectors.toList());
return children.stream().sorted(Comparator.comparingDouble(CompListDTO::getShowOrder)).collect(Collectors.toList());
} else {
return children.stream().sorted(Comparator.comparing(CompListDTO::getShowOrder).reversed()).collect(Collectors.toList());
return children.stream().sorted(Comparator.comparingDouble(CompListDTO::getShowOrder).reversed()).collect(Collectors.toList());
}
}
}

@ -105,9 +105,9 @@ public class DepartmentListDTO {
return children;
}
if ("asc".equalsIgnoreCase(orderType)) {
return children.stream().sorted(Comparator.comparing(DepartmentListDTO::getShowOrder)).collect(Collectors.toList());
return children.stream().sorted(Comparator.comparingDouble(DepartmentListDTO::getShowOrder)).collect(Collectors.toList());
} else {
return children.stream().sorted(Comparator.comparing(DepartmentListDTO::getShowOrder).reversed()).collect(Collectors.toList());
return children.stream().sorted(Comparator.comparingDouble(DepartmentListDTO::getShowOrder).reversed()).collect(Collectors.toList());
}
}
}

@ -85,10 +85,10 @@ public class CompServiceImpl extends Service implements CompService {
// 添加父级元素
List<CompListDTO> compListDTOS = CompBO.buildCompDTOList(allList, filterCompPOs, orderType.toString());
if ("asc".equalsIgnoreCase(orderType.toString())) {
compListDTOS = compListDTOS.stream().sorted(Comparator.comparing(CompListDTO::getShowOrder)).collect(Collectors.toList());
compListDTOS = compListDTOS.stream().sorted(Comparator.comparingDouble(CompListDTO::getShowOrder)).collect(Collectors.toList());
} else {
compListDTOS = compListDTOS.stream().sorted(Comparator.comparing(CompListDTO::getShowOrder).reversed()).collect(Collectors.toList());
compListDTOS = compListDTOS.stream().sorted(Comparator.comparingDouble(CompListDTO::getShowOrder).reversed()).collect(Collectors.toList());
}
List<CompListDTO> subList = PageUtil.subList(params.getCurrent(), params.getPageSize(), compListDTOS);
pageInfos = new PageInfo<>(user, subList, CompListDTO.class);

@ -134,10 +134,10 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
// 添加父级元素
List<DepartmentListDTO> compListDTOS = DepartmentBO.buildDeptDTOList(allList, filterDeptPOs, orderType.toString());
if ("asc".equalsIgnoreCase(orderType.toString())) {
compListDTOS = compListDTOS.stream().sorted(Comparator.comparing(DepartmentListDTO::getShowOrder)).collect(Collectors.toList());
compListDTOS = compListDTOS.stream().sorted(Comparator.comparingDouble(DepartmentListDTO::getShowOrder)).collect(Collectors.toList());
} else {
compListDTOS = compListDTOS.stream().sorted(Comparator.comparing(DepartmentListDTO::getShowOrder).reversed()).collect(Collectors.toList());
compListDTOS = compListDTOS.stream().sorted(Comparator.comparingDouble(DepartmentListDTO::getShowOrder).reversed()).collect(Collectors.toList());
}
List<DepartmentListDTO> subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), compListDTOS);
pageInfos = new PageInfo<>(user, DepartmentBO.buildDeptDTOShowNames(subList), DepartmentListDTO.class);

@ -164,10 +164,10 @@ public class JobServiceImpl extends Service implements JobService {
// 添加父级元素
List<JobListDTO> jobListDTOS = JobBO.buildJobDTOList(allList, filterJobPOs);
if ("asc".equalsIgnoreCase(orderType.toString())) {
jobListDTOS = jobListDTOS.stream().sorted(Comparator.comparing(JobListDTO::getShowOrder)).collect(Collectors.toList());
jobListDTOS = jobListDTOS.stream().sorted(Comparator.comparingDouble(JobListDTO::getShowOrder)).collect(Collectors.toList());
} else {
jobListDTOS = jobListDTOS.stream().sorted(Comparator.comparing(JobListDTO::getShowOrder).reversed()).collect(Collectors.toList());
jobListDTOS = jobListDTOS.stream().sorted(Comparator.comparingDouble(JobListDTO::getShowOrder).reversed()).collect(Collectors.toList());
}
List<JobListDTO> subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), jobListDTOS);
pageInfos = new PageInfo<>(user, subList, JobListDTO.class);

Loading…
Cancel
Save