From ad351688762accfec69acf5c617376d636d8adb1 Mon Sep 17 00:00:00 2001 From: paulGao Date: Mon, 10 Jan 2022 18:05:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BC=96=E8=BE=91=E5=95=86?= =?UTF-8?q?=E5=93=81=E6=97=B6=E7=9A=84=E7=94=9F=E6=88=90=E7=B4=A2=E5=BC=95?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E4=BA=8B=E5=8A=A1=E7=9B=91=E5=90=AC?= =?UTF-8?q?=E5=9C=A8=E6=8F=90=E4=BA=A4=E5=90=8E=E5=8F=91=E9=80=81mq?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java index 8f458c69..a7e67948 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java @@ -51,6 +51,8 @@ import org.apache.rocketmq.spring.core.RocketMQTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.event.TransactionPhase; +import org.springframework.transaction.event.TransactionalEventListener; import java.util.*; import java.util.stream.Collectors; @@ -564,6 +566,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl i * @param goods 商品信息 */ @Override + @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void generateEs(Goods goods) { // 不生成没有审核通过且没有上架的商品 if (!GoodsStatusEnum.UPPER.name().equals(goods.getMarketEnable()) || !GoodsAuthEnum.PASS.name().equals(goods.getAuthFlag())) {