From e82bfc4ba30d1f84c6c61c7eb8b93b75e67dc560 Mon Sep 17 00:00:00 2001 From: liuzixi Date: Sat, 13 Dec 2025 15:52:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E3=80=90FCJDFDXTXS-88=E3=80=91=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E6=89=B9=E9=87=8F=E7=BD=AE=E9=A1=B6=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../course/service/impl/CoursePageServiceImpl.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/module/course/service/impl/CoursePageServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/module/course/service/impl/CoursePageServiceImpl.java index 99d5b14c..5940305e 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/module/course/service/impl/CoursePageServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/module/course/service/impl/CoursePageServiceImpl.java @@ -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); }