feiyu02
2025-09-30 6904763f0e74d9a9fa4dbc39f635d2aee39416c6
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())
    }
}