From dc3256566b86ad5897fe58dae2ae18e7fa003289 Mon Sep 17 00:00:00 2001 From: "itheinjury@163.com" Date: Fri, 18 Feb 2022 00:09:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/cn/lili/event/impl/StockUpdateExecute.java | 2 ++ consumer/src/main/resources/application.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/consumer/src/main/java/cn/lili/event/impl/StockUpdateExecute.java b/consumer/src/main/java/cn/lili/event/impl/StockUpdateExecute.java index eb8ed3d7..ab9f5d63 100644 --- a/consumer/src/main/java/cn/lili/event/impl/StockUpdateExecute.java +++ b/consumer/src/main/java/cn/lili/event/impl/StockUpdateExecute.java @@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.script.DefaultRedisScript; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; @@ -79,6 +80,7 @@ public class StockUpdateExecute implements OrderStatusChangeEvent { private PointsGoodsService pointsGoodsService; @Override + @Transactional(rollbackFor = Exception.class) public void orderChange(OrderMessage orderMessage) { switch (orderMessage.getNewStatus()) { diff --git a/consumer/src/main/resources/application.yml b/consumer/src/main/resources/application.yml index e2c26b08..ac5c6e78 100644 --- a/consumer/src/main/resources/application.yml +++ b/consumer/src/main/resources/application.yml @@ -198,7 +198,7 @@ jasypt: lili: system: - isDemoSite: true + isDemoSite: false statistics: # 在线人数统计 X 小时。这里设置48,即统计过去48小时每小时在线人数 onlineMember: 48