diff --git a/src/com/api/browser/service/impl/JobBrowserService.java b/src/com/api/browser/service/impl/JobBrowserService.java index feca2a7b..5e60fd17 100644 --- a/src/com/api/browser/service/impl/JobBrowserService.java +++ b/src/com/api/browser/service/impl/JobBrowserService.java @@ -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(); diff --git a/src/com/engine/organization/entity/company/bo/CompBO.java b/src/com/engine/organization/entity/company/bo/CompBO.java index 91cc94b7..1e7f7d25 100644 --- a/src/com/engine/organization/entity/company/bo/CompBO.java +++ b/src/com/engine/organization/entity/company/bo/CompBO.java @@ -25,8 +25,8 @@ public class CompBO { public static List buildSetToSearchTree(Set 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); diff --git a/src/com/engine/organization/entity/company/dto/CompListDTO.java b/src/com/engine/organization/entity/company/dto/CompListDTO.java index 36e3b484..a49ff720 100644 --- a/src/com/engine/organization/entity/company/dto/CompListDTO.java +++ b/src/com/engine/organization/entity/company/dto/CompListDTO.java @@ -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()); } } } diff --git a/src/com/engine/organization/entity/department/dto/DepartmentListDTO.java b/src/com/engine/organization/entity/department/dto/DepartmentListDTO.java index 45361dc8..b16a3186 100644 --- a/src/com/engine/organization/entity/department/dto/DepartmentListDTO.java +++ b/src/com/engine/organization/entity/department/dto/DepartmentListDTO.java @@ -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()); } } } diff --git a/src/com/engine/organization/service/impl/CompServiceImpl.java b/src/com/engine/organization/service/impl/CompServiceImpl.java index 3a9680d7..4e6b0596 100644 --- a/src/com/engine/organization/service/impl/CompServiceImpl.java +++ b/src/com/engine/organization/service/impl/CompServiceImpl.java @@ -85,10 +85,10 @@ public class CompServiceImpl extends Service implements CompService { // 添加父级元素 List 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 subList = PageUtil.subList(params.getCurrent(), params.getPageSize(), compListDTOS); pageInfos = new PageInfo<>(user, subList, CompListDTO.class); diff --git a/src/com/engine/organization/service/impl/DepartmentServiceImpl.java b/src/com/engine/organization/service/impl/DepartmentServiceImpl.java index 897d407a..7e167447 100644 --- a/src/com/engine/organization/service/impl/DepartmentServiceImpl.java +++ b/src/com/engine/organization/service/impl/DepartmentServiceImpl.java @@ -134,10 +134,10 @@ public class DepartmentServiceImpl extends Service implements DepartmentService // 添加父级元素 List 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 subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), compListDTOS); pageInfos = new PageInfo<>(user, DepartmentBO.buildDeptDTOShowNames(subList), DepartmentListDTO.class); diff --git a/src/com/engine/organization/service/impl/JobServiceImpl.java b/src/com/engine/organization/service/impl/JobServiceImpl.java index 3735116a..b4a23232 100644 --- a/src/com/engine/organization/service/impl/JobServiceImpl.java +++ b/src/com/engine/organization/service/impl/JobServiceImpl.java @@ -164,10 +164,10 @@ public class JobServiceImpl extends Service implements JobService { // 添加父级元素 List 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 subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), jobListDTOS); pageInfos = new PageInfo<>(user, subList, JobListDTO.class);