From 93a45319ac1c9196ef4e290adfafb0ea125f41b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BE=9A=E7=BE=8A=E8=B7=B3?= Date: Thu, 11 Sep 2025 08:49:49 +0000 Subject: [PATCH] =?UTF-8?q?update=20framework/src/main/java/cn/lili/module?= =?UTF-8?q?s/search/serviceimpl/EsGoodsIndexServiceImpl.java.=20fix:=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=95=86=E5=93=81=E7=B4=A2=E5=BC=95=E6=97=A0?= =?UTF-8?q?=E6=95=88=E4=BF=83=E9=94=80=E6=B4=BB=E5=8A=A8=E6=B8=85=E7=90=86?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E6=96=B9=E6=B3=95(executeCleanInval?= =?UTF-8?q?idPromotions)=20-=20=E4=BF=AE=E5=A4=8D=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E8=B5=B7=E5=A7=8B=E7=B4=A2=E5=BC=95=E9=94=99?= =?UTF-8?q?=E8=AF=AF=EF=BC=8C=E4=BB=8E1=E6=94=B9=E4=B8=BA0=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E8=B7=B3=E8=BF=87=E7=AC=AC=E4=B8=80=E9=A1=B5?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=20-=20=E4=BF=AE=E5=A4=8D=E4=BF=83=E9=94=80?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E6=B8=85=E6=B4=97=E5=90=8E=E6=9C=AA=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E6=9B=B4=E6=96=B0=E5=88=B0=E7=B4=A2=E5=BC=95=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E6=B8=85=E6=B4=97=E5=90=8E=E7=9A=84?= =?UTF-8?q?promotionMap=E9=9C=80=E9=87=8D=E6=96=B0=E5=BA=8F=E5=88=97?= =?UTF-8?q?=E5=8C=96=E5=B9=B6=E8=AE=BE=E7=BD=AE=E5=9B=9EgoodsIndex?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 羚羊跳 --- .../modules/search/serviceimpl/EsGoodsIndexServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java index 89e258d37..01165b29b 100644 --- a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java @@ -743,7 +743,7 @@ public class EsGoodsIndexServiceImpl extends BaseElasticsearchService implements } private void executeCleanInvalidPromotions() { - for (int i = 1; ; i++) { + for (int i = 0; ; i++) { org.springframework.data.domain.Page all = goodsIndexRepository.findAll(PageRequest.of(i, 1000)); if (all.isEmpty()) { break; @@ -758,6 +758,9 @@ public class EsGoodsIndexServiceImpl extends BaseElasticsearchService implements BasePromotions promotion = promotionJson.toBean(BasePromotions.class); return promotion.getEndTime() != null && promotion.getEndTime().getTime() < DateUtil.date().getTime(); }); + + // 更新回 goodsIndex 对象 + goodsIndex.setPromotionMapJson(JSONUtil.toJsonStr(promotionMap)); } } goodsIndexRepository.saveAll(all);