From 4ad1f324ab1fd2b51504afc00b43b4ee40f029c2 Mon Sep 17 00:00:00 2001 From: lsh <lsh@163.com> Date: 星期四, 20 二月 2025 09:40:03 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/task/ReportToDismantleTheStackScheduler.java | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/zy/asrs/task/ReportToDismantleTheStackScheduler.java b/src/main/java/com/zy/asrs/task/ReportToDismantleTheStackScheduler.java index ac41c11..a63f144 100644 --- a/src/main/java/com/zy/asrs/task/ReportToDismantleTheStackScheduler.java +++ b/src/main/java/com/zy/asrs/task/ReportToDismantleTheStackScheduler.java @@ -2,6 +2,7 @@ import com.zy.asrs.task.core.ReturnT; import com.zy.asrs.task.handler.ReportToDismantleTheStackHandler; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; @@ -10,19 +11,24 @@ * Created by Monkey D. Luffy on 2023.07.25 * 寰愬伐姹変簯..............浠ヤ笅.............涓婇ザ姹熼摐.............鎷嗗灈淇℃伅涓婁紶 */ +@Slf4j @Component public class ReportToDismantleTheStackScheduler { @Autowired private ReportToDismantleTheStackHandler reportToDismantleTheStackHandler; - @Scheduled(cron = "0/3 * * * * ? ") +// @Scheduled(cron = "0/3 * * * * ? ") private void execute(){//鎷嗗灈淇℃伅涓婁紶 - int[] staNos =new int[]{118,119,120,121}; + int[] staNos =new int[]{118,120,121}; for (int staNo : staNos){ - ReturnT<String> result = reportToDismantleTheStackHandler.start(staNo); - if (result.getCode()==200){ - break; + try{ + ReturnT<String> result = reportToDismantleTheStackHandler.start(staNo); + if (result.getCode()==200){ + break; + } + }catch (Exception e){ + log.error("绔欑偣"+staNo+"鎷嗗灈淇℃伅涓婁紶澶勭悊澶辫触锛屽紓甯镐俊鎭細"+e); } } } -- Gitblit v1.9.1