初始化项目
This commit is contained in:
1 parent
45a1702948
commit
934b8aad40
155 files changed
+2649
-68
No files matched your search
@@ -0,0 +1,34 @@
|
||||
package com.bycrm.task;
|
||||
|
||||
import com.bycrm.service.ReportService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 报备过期处理定时任务
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ReportExpireTask {
|
||||
|
||||
private final ReportService reportService;
|
||||
|
||||
public ReportExpireTask(ReportService reportService) {
|
||||
this.reportService = reportService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 每天凌晨1点执行,处理过期的报备
|
||||
*/
|
||||
@Scheduled(cron = "0 0 1 * * ?")
|
||||
public void handleExpiredReports() {
|
||||
log.info("开始处理过期报备...");
|
||||
try {
|
||||
reportService.handleExpiredReports();
|
||||
log.info("过期报备处理完成");
|
||||
} catch (Exception e) {
|
||||
log.error("处理过期报备失败", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user