From 4d2cb2d1dc77b7d5e39778ef3bb8cbb0112c35a7 Mon Sep 17 00:00:00 2001 From: paulGao Date: Tue, 18 Oct 2022 17:46:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=95=86=E5=93=81=E7=B4=A2=E5=BC=95=EF=BC=8C=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E5=BA=93=E5=AD=98=E4=B8=8D=E4=B8=BA0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/cn/lili/listener/GoodsMessageListener.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/consumer/src/main/java/cn/lili/listener/GoodsMessageListener.java b/consumer/src/main/java/cn/lili/listener/GoodsMessageListener.java index fac6d784..1ed1c737 100644 --- a/consumer/src/main/java/cn/lili/listener/GoodsMessageListener.java +++ b/consumer/src/main/java/cn/lili/listener/GoodsMessageListener.java @@ -356,11 +356,8 @@ public class GoodsMessageListener implements RocketMQListener { EsGoodsIndex goodsIndex = this.settingUpGoodsIndexData(goods, goodsSku); goodsIndex.setSkuSource(skuSource--); log.info("goodsSku:{}", goodsSku); - //如果商品库存不为0,并且es中有数据 - if (goodsSku.getQuantity() > 0) { - log.info("生成商品索引 {}", goodsIndex); - esGoodsIndices.add(goodsIndex); - } + log.info("生成商品索引 {}", goodsIndex); + esGoodsIndices.add(goodsIndex); } this.goodsIndexService.deleteIndex(MapUtil.builder(new HashMap()).put("goodsId", goods.getId()).build()); this.goodsIndexService.addIndex(esGoodsIndices);