记得上下班打卡 | git大法好,push需谨慎

Commit f347a304 authored by 胡佳晨's avatar 胡佳晨

修改 smile排序

parent db2e61d1
......@@ -49,7 +49,29 @@ public class SmileVolunteerServerImpl implements SmileVolunteersService {
voList.add(vo);
// }
}
voList = voList.stream().sorted(Comparator.comparing(SmileVProjectListVo::getTimeStart)).collect(Collectors.toList());
List<Integer> sortList = Arrays.asList(1,0,2);
voList = voList.stream().sorted(Comparator.comparing(SmileVProjectListVo::getProjectStatus,(x,y)-> {
if(x == null && y != null){
return 1;
}else if(x !=null && y == null){
return -1;
}else if(x == null && y == null){
return -1;
} else {
for(Integer sort : sortList){
if(sort.equals(x) || sort.equals(y)){
if(x.equals(y)){
return 0;
}else if(sort.equals(x)){
return -1;
}else{
return 1;
}
}
}
return 0;
}
}).thenComparing(SmileVProjectListVo::getTimeStart)).collect(Collectors.toList());
return ResponseDto.success(voList);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment