mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-14 05:16:49 +08:00
fix: 【FCJDFDXTXS-88】修正批量置顶排序功能
This commit is contained in:
@@ -212,9 +212,17 @@ public class CoursePageServiceImpl implements ICoursePageService {
|
||||
// 1. 按sortWeight升序排序
|
||||
topList.sort(Comparator.comparingInt(CoursePageVo::getSortWeight));
|
||||
// 2. 更新
|
||||
for (CoursePageVo vo : topList) {
|
||||
courseDao.updateMultiFieldById(vo.getId(),
|
||||
UpdateBuilder.create("sortWeight", vo.getSortWeight()));
|
||||
for (int i = 0, len = topList.size(); i < len; i++) {
|
||||
CoursePageVo vo = topList.get(i);
|
||||
String id = vo.getId();
|
||||
courseDao.updateMultiFieldById(id,
|
||||
UpdateBuilder.create("sortWeight", i));
|
||||
if (this.fullTextSearch != null) {
|
||||
Object fullId = courseDao.findField("fullTextId", FieldFilters.eq("id", id));
|
||||
if (fullId != null) {
|
||||
publishUtil.updateFieldByDocId((String) fullId, "sortWeight", i);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ServiceResponse.success(topList);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user