优化更新索引促销方式,以更新部分字段的方式更新。不在以刷新索引的方式更新。

This commit is contained in:
paulGao
2021-12-29 17:53:40 +08:00
parent b6db829b04
commit 9f6d33f6e8
4 changed files with 34 additions and 4 deletions

View File

@@ -259,6 +259,7 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
searchParams.setCategoryPath(promotions.getScopeId());
List<GoodsSku> goodsSkuByList = this.goodsSkuService.getGoodsSkuByList(searchParams);
List<String> skuIds = goodsSkuByList.stream().map(GoodsSku::getId).collect(Collectors.toList());
this.goodsIndexService.deleteEsGoodsPromotionByPromotionId(skuIds, promotions.getId());
this.goodsIndexService.updateEsGoodsIndexPromotions(skuIds, promotions, esPromotionKey);
} else if (PromotionsScopeTypeEnum.ALL.name().equals(promotions.getScopeType())) {
this.goodsIndexService.updateEsGoodsIndexAllByList(promotions, esPromotionKey);