From 6904763f0e74d9a9fa4dbc39f635d2aee39416c6 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期二, 30 九月 2025 09:34:22 +0800
Subject: [PATCH] 2025.9.30

---
 src/main/kotlin/cn/flightfeather/supervision/scheduler/ScheduleService.kt |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/main/kotlin/cn/flightfeather/supervision/scheduler/ScheduleService.kt b/src/main/kotlin/cn/flightfeather/supervision/scheduler/ScheduleService.kt
index 9c199ba..5fe3032 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/scheduler/ScheduleService.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/scheduler/ScheduleService.kt
@@ -8,6 +8,7 @@
 import org.springframework.scheduling.annotation.Async
 import org.springframework.scheduling.annotation.Scheduled
 import org.springframework.stereotype.Component
+import java.time.LocalDate
 import java.time.LocalDateTime
 
 /**
@@ -32,7 +33,6 @@
     @Async
     @Scheduled(cron = "0 0 * * * *")
     fun eachHour() {
-        if (mode != "proapp") return
         logger.info("=====>>>>>姣忓皬鏃朵换鍔℃墽琛� {}", System.currentTimeMillis())
         taskJinAnHourlyDustData.doTask(LocalDateTime.now())
         logger.info("=====>>>>>姣忓皬鏃朵换鍔$粨鏉� {}", System.currentTimeMillis())
@@ -49,9 +49,18 @@
     @Async
     @Scheduled(cron = "0 0 0 * * SUN")
     fun eachSunday() {
-        if (mode != "proapp") return
         logger.info("=====>>>>>姣忓懆鏃ラ浂鐐逛换鍔℃墽琛� {}", System.currentTimeMillis())
         mTaskJinAnHourlyDustData.handle()
         logger.info("=====>>>>>姣忓懆鏃ラ浂鐐逛换鍔$粨鏉� {}", System.currentTimeMillis())
     }
+
+    @Async
+    @Scheduled(cron = "0 0 3 1 * *")
+    fun eachMonth() {
+        logger.info("=====>>>>>姣忔湀鍒濅换鍔℃墽琛� {}", System.currentTimeMillis())
+        // 鎵ц涓婁釜鏈堢殑闈欏畨宸ュ湴鎵皹鏁版嵁琛ュ叏浠诲姟
+        val now = LocalDate.now().minusMonths(1)
+        mTaskJinAnHourlyDustData.handle(now.year, now.monthValue)
+        logger.info("=====>>>>>姣忔湀鍒濅换鍔$粨鏉� {}", System.currentTimeMillis())
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3