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/TaskTimer.java |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/timer/TaskTimer.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/timer/TaskTimer.java
index 770ff8c..90bbd5a 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/timer/TaskTimer.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/timer/TaskTimer.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;
@@ -68,7 +69,7 @@
 
                         List<TaskDetl> taskDetls = taskDetlService.getTaskDetlByTaskId(task.getId());
                         if(taskDetls.isEmpty()) {
-                            throw new CoolException("搴撳瓨鏄庣粏涓嶅瓨鍦�");
+                            throw new CoolException("浠诲姟鏄庣粏涓嶅瓨鍦�");
                         }
 
                         //娣诲姞搴撳瓨鏄庣粏
@@ -113,7 +114,8 @@
                 }
             }
         } catch (Exception e) {
-
+            e.printStackTrace();
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
         }finally {
             InterceptorIgnoreHelper.clearIgnoreStrategy();
         }
@@ -122,7 +124,15 @@
     @Scheduled(cron = "0/3 * * * * ? ")
     @Transactional
     public void outExecute() {
+        InterceptorIgnoreHelper.handle(IgnoreStrategy.builder().tenantLine(true).build());
+        try {
 
+        } catch (Exception e) {
+            e.printStackTrace();
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+        }finally {
+            InterceptorIgnoreHelper.clearIgnoreStrategy();
+        }
     }
 
 }

--
Gitblit v1.9.1