From 788b9bfcf3d4935a9e171488fb4e55482480472c Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期四, 01 八月 2024 13:27:29 +0800
Subject: [PATCH] #

---
 zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/timer/TaskLogTimer.java |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/timer/TaskLogTimer.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/timer/TaskLogTimer.java
index 86a640f..2ede7d5 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/timer/TaskLogTimer.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/timer/TaskLogTimer.java
@@ -11,6 +11,7 @@
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
 
 import java.util.Date;
 import java.util.List;
@@ -122,7 +123,7 @@
 
                         order.setOrderSettle(OrderSettleType.COMPLETE.val());
                         order.setUpdateTime(new Date());
-                        if (!orderService.save(order)) {
+                        if (!orderService.updateById(order)) {
                             throw new CoolException("璁㈠崟鏇存柊澶辫触");
                         }
                     }
@@ -133,6 +134,7 @@
 
         } catch (Exception e) {
             e.printStackTrace();
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
         }finally {
             InterceptorIgnoreHelper.clearIgnoreStrategy();
         }
@@ -146,6 +148,7 @@
 
         } catch (Exception e) {
             e.printStackTrace();
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
         }finally {
             InterceptorIgnoreHelper.clearIgnoreStrategy();
         }

--
Gitblit v1.9.1