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() {