From fe031e01cc1737c2f05a133fde7c36c7a2a7b4b4 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期三, 21 一月 2026 17:38:32 +0800
Subject: [PATCH] 2026.1.21 1. 新增完善台账复制逻辑

---
 src/main/kotlin/cn/flightfeather/supervision/scheduler/ScheduleService.kt |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 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..b28304a 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,15 +33,17 @@
     @Async
     @Scheduled(cron = "0 0 * * * *")
     fun eachHour() {
-        if (mode != "proapp") return
+        if (mode != "pro") return
+
         logger.info("=====>>>>>姣忓皬鏃朵换鍔℃墽琛� {}", System.currentTimeMillis())
         taskJinAnHourlyDustData.doTask(LocalDateTime.now())
         logger.info("=====>>>>>姣忓皬鏃朵换鍔$粨鏉� {}", System.currentTimeMillis())
     }
 
-//    @Async
+    //    @Async
 //    @Scheduled(cron = "0 0 0 * * *")
     fun eachDay() {
+        if (mode != "pro") return
         logger.info("=====>>>>>姣忔棩浠诲姟鎵ц {}", System.currentTimeMillis())
 
         logger.info("=====>>>>>姣忔棩浠诲姟缁撴潫 {}", System.currentTimeMillis())
@@ -49,9 +52,20 @@
     @Async
     @Scheduled(cron = "0 0 0 * * SUN")
     fun eachSunday() {
-        if (mode != "proapp") return
+        if (mode != "pro") return
         logger.info("=====>>>>>姣忓懆鏃ラ浂鐐逛换鍔℃墽琛� {}", System.currentTimeMillis())
         mTaskJinAnHourlyDustData.handle()
         logger.info("=====>>>>>姣忓懆鏃ラ浂鐐逛换鍔$粨鏉� {}", System.currentTimeMillis())
     }
+
+    @Async
+    @Scheduled(cron = "0 0 3 1 * *")
+    fun eachMonth() {
+        if (mode != "pro") return
+        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