#
Junjie
2024-08-01 788b9bfcf3d4935a9e171488fb4e55482480472c
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();
        }
    }
}