|
|
@ -149,7 +149,9 @@ public class JobServiceImpl extends Service implements JobService {
|
|
|
|
JobPO jobPO = JobBO.convertParamsToPO(param, user.getUID());
|
|
|
|
JobPO jobPO = JobBO.convertParamsToPO(param, user.getUID());
|
|
|
|
boolean filter = isFilter(jobPO);
|
|
|
|
boolean filter = isFilter(jobPO);
|
|
|
|
PageInfo<JobListDTO> pageInfos;
|
|
|
|
PageInfo<JobListDTO> pageInfos;
|
|
|
|
String orderSql = PageInfoSortUtil.getSortSql(param.getSortParams(), " show_order ");
|
|
|
|
StringBuilder orderType = new StringBuilder("asc");
|
|
|
|
|
|
|
|
String orderSql = PageInfoSortUtil.getSortSql(orderType, param.getSortParams(), " show_order ");
|
|
|
|
|
|
|
|
orderSql = orderSql.replace("showOrder", "show_order");
|
|
|
|
List<JobListDTO> allList = getJobMapper().listNoFilter(orderSql);
|
|
|
|
List<JobListDTO> allList = getJobMapper().listNoFilter(orderSql);
|
|
|
|
new DetachUtil(user).filterJobDTOList(allList);
|
|
|
|
new DetachUtil(user).filterJobDTOList(allList);
|
|
|
|
// 通过子级遍历父级元素
|
|
|
|
// 通过子级遍历父级元素
|
|
|
@ -159,6 +161,12 @@ public class JobServiceImpl extends Service implements JobService {
|
|
|
|
new DetachUtil(user).filterJobDTOList(allList);
|
|
|
|
new DetachUtil(user).filterJobDTOList(allList);
|
|
|
|
// 添加父级元素
|
|
|
|
// 添加父级元素
|
|
|
|
List<JobListDTO> jobListDTOS = JobBO.buildJobDTOList(allList, filterJobPOs);
|
|
|
|
List<JobListDTO> jobListDTOS = JobBO.buildJobDTOList(allList, filterJobPOs);
|
|
|
|
|
|
|
|
if ("asc".equalsIgnoreCase(orderType.toString())) {
|
|
|
|
|
|
|
|
jobListDTOS = jobListDTOS.stream().sorted(Comparator.comparing(JobListDTO::getShowOrder)).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
jobListDTOS = jobListDTOS.stream().sorted(Comparator.comparing(JobListDTO::getShowOrder).reversed()).collect(Collectors.toList());
|
|
|
|
|
|
|
|
}
|
|
|
|
List<JobListDTO> subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), jobListDTOS);
|
|
|
|
List<JobListDTO> subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), jobListDTOS);
|
|
|
|
pageInfos = new PageInfo<>(subList, JobListDTO.class);
|
|
|
|
pageInfos = new PageInfo<>(subList, JobListDTO.class);
|
|
|
|
pageInfos.setTotal(jobListDTOS.size());
|
|
|
|
pageInfos.setTotal(jobListDTOS.size());
|
|
|
|