mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-25 02:32:57 +08:00
fix:【FCJDFDXTXS-174】资源展示列表改为完成时间降序
This commit is contained in:
@@ -1236,6 +1236,24 @@ public class StudyCourseApi extends ApiBaseController{
|
||||
// userIdList = new ArrayList<>();
|
||||
// }
|
||||
// PageList<StudyCourseItem> rs = studyService.itemPage(pager.getPageIndex(), pager.getPageSize(), contentId, courseId, status, userIdList);
|
||||
// 25.12.17按照finishTime字段降序排列
|
||||
List<StudyCourseItem> studyCourseItems = rs.getList();
|
||||
if (studyCourseItems != null && !studyCourseItems.isEmpty()) {
|
||||
studyCourseItems.sort((item1, item2) -> {
|
||||
LocalDateTime time1 = item1.getFinishTime();
|
||||
LocalDateTime time2 = item2.getFinishTime();
|
||||
// 处理null值情况,将null值排在最后
|
||||
if (time1 == null && time2 == null) {
|
||||
return 0;
|
||||
} else if (time1 == null) {
|
||||
return 1;
|
||||
} else if (time2 == null) {
|
||||
return -1;
|
||||
}
|
||||
// 降序排列
|
||||
return time2.compareTo(time1);
|
||||
});
|
||||
}
|
||||
return success(rs);
|
||||
}catch(Exception e) {
|
||||
log.error("【资源学习情况分页查询】错误", e);
|
||||
|
||||
Reference in New Issue
Block a user