From 1cc692a3c98d44004e8e0209f3fc1fa1108b031c Mon Sep 17 00:00:00 2001 From: misworga831 Date: Thu, 3 Aug 2023 16:13:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E6=B6=88=E8=B4=B9?= =?UTF-8?q?=E8=80=85=E9=83=A8=E5=88=86=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/cn/lili/event/impl/NoticeMessageExecute.java | 2 +- .../modules/search/serviceimpl/EsGoodsIndexServiceImpl.java | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/consumer/src/main/java/cn/lili/event/impl/NoticeMessageExecute.java b/consumer/src/main/java/cn/lili/event/impl/NoticeMessageExecute.java index 3dfc8b1e..f166cd25 100644 --- a/consumer/src/main/java/cn/lili/event/impl/NoticeMessageExecute.java +++ b/consumer/src/main/java/cn/lili/event/impl/NoticeMessageExecute.java @@ -58,7 +58,7 @@ public class NoticeMessageExecute implements TradeEvent, OrderStatusChangeEvent, OrderDetailVO orderDetailVO = orderService.queryDetail(orderMessage.getOrderSn()); NoticeMessageDTO noticeMessageDTO = new NoticeMessageDTO(); //如果订单状态不为空 - if (orderDetailVO != null) { + if (orderDetailVO != null && orderDetailVO.getOrderItems() != null && !orderDetailVO.getOrderItems().isEmpty()) { Map params = new HashMap<>(2); switch (orderMessage.getNewStatus()) { //如果订单新的状态为已取消 则发送取消订单站内信 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 a6af95c8..0e44fd14 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 @@ -455,10 +455,8 @@ public class EsGoodsIndexServiceImpl extends BaseElasticsearchService implements this.client.bulkAsync(request, RequestOptions.DEFAULT, new ActionListener() { @Override public void onResponse(BulkResponse bulkItemResponses) { + // 判断索引如果不存在的处理 log.info("批量更新商品索引结果:{}", bulkItemResponses.buildFailureMessage()); - if (bulkItemResponses.hasFailures() && bulkItemResponses.getItems().length > 0) { - throw new RetryException("批量更新商品索引失败," + bulkItemResponses.buildFailureMessage()); - } } @Override