From 840447f80ecb50e15305967984058f740e835d81 Mon Sep 17 00:00:00 2001 From: hupeng Date: Wed, 29 Aug 2018 11:20:16 +0800 Subject: [PATCH] =?UTF-8?q?[=E7=B3=BB=E7=BB=9F][=E4=BF=AE=E5=A4=8D]:?= =?UTF-8?q?=E6=AF=8F=E5=A4=A9=E6=80=BB=E9=A2=9D=E7=BB=9F=E8=AE=A1=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BA=8B=E5=8A=A1=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/simple/schedule/DaliyAmountSchedule.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mallinkAdmin/src/main/java/com/simple/schedule/DaliyAmountSchedule.java b/mallinkAdmin/src/main/java/com/simple/schedule/DaliyAmountSchedule.java index d3b6b641c..4756c78a5 100644 --- a/mallinkAdmin/src/main/java/com/simple/schedule/DaliyAmountSchedule.java +++ b/mallinkAdmin/src/main/java/com/simple/schedule/DaliyAmountSchedule.java @@ -12,6 +12,8 @@ import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -42,6 +44,7 @@ public class DaliyAmountSchedule { @Scheduled(cron = "0 0 23 * * ?") // 每天晚上11点盘点 //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 + @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) public void daliyAmountSchedule() {