From a47efda7b528e54a06b3a98b3096dedfac251b6a Mon Sep 17 00:00:00 2001 From: Leo Date: Tue, 11 Mar 2025 14:22:11 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E7=AC=AC=E4=B8=80=E7=89=88?= =?UTF-8?q?=EF=BC=8C=E6=B2=A1=E6=9C=89=E6=98=8E=E6=98=BEbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/cn/van/business/util/JDUtil.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/cn/van/business/util/JDUtil.java b/src/main/java/cn/van/business/util/JDUtil.java index 741a727..a40c397 100644 --- a/src/main/java/cn/van/business/util/JDUtil.java +++ b/src/main/java/cn/van/business/util/JDUtil.java @@ -87,9 +87,9 @@ public class JDUtil { private final ObjectMapper objectMapper = new ObjectMapper(); @Value("${isRunning.wx") - private boolean isRunning_wx = false; + private String isRunning_wx = false; @Value("isRunning.jd") - private boolean isRunning_jd = false; + private String isRunning_jd = false; // 构造函数中注入StringRedisTemplate @@ -244,7 +244,7 @@ public class JDUtil { */ @Scheduled(cron = "0 * * * * ?") public void fetchLatestOrder() { - if (isRunning_jd) { + if (isRunning_jd.equals("true")) { LocalDateTime now = LocalDateTime.now(); LocalDateTime startTime = now.minusMinutes(10).withSecond(0).withNano(0); @@ -283,7 +283,7 @@ public class JDUtil { */ @Scheduled(cron = "3 * * * * ?") public void sendOrderToWx() { - if (isRunning_wx) { + if (isRunning_wx.equals("true")) { //long start = System.currentTimeMillis(); int[] validCodes = {-1}; // 只要三个月的,更多的也刷新不出来的 @@ -307,7 +307,7 @@ public class JDUtil { */ @Scheduled(cron = "0 0 */4 * * ?") public void fetchHistoricalOrders3090() { - if (isRunning_jd) { + if (isRunning_jd.equals("true")) { try { OrderFetchStrategy strategy = new Days3090Strategy(); for (WXUtil.SuperAdmin admin : super_admins.values()) { @@ -329,7 +329,7 @@ public class JDUtil { */ @Scheduled(cron = "0 0 * * * ?") public void fetchHistoricalOrders1430() { - if (isRunning_jd) { + if (isRunning_jd.equals("true")) { try { OrderFetchStrategy strategy = new Days1430Strategy(); // 需补充Days1430Strategy实现 @@ -351,7 +351,7 @@ public class JDUtil { */ @Scheduled(cron = "0 0 * * * ?") public void fetchHistoricalOrders0714() { - if (isRunning_jd) { + if (isRunning_jd.equals("true")) { try { OrderFetchStrategy strategy = new Days0714Strategy(); @@ -372,7 +372,7 @@ public class JDUtil { @Scheduled(cron = "0 */5 * * * ?") public void fetchHistoricalOrders0007() { - if (isRunning_jd) { + if (isRunning_jd.equals("true")) { try { OrderFetchStrategy strategy = new Days0007Strategy();