This commit is contained in:
张良(004796)
2024-01-30 21:11:28 +08:00
parent 5cbed4c929
commit d4c0f477bd
10 changed files with 34 additions and 10 deletions

View File

@@ -0,0 +1,25 @@
package com.ruoyi.job;
import com.ruoyi.cai.service.DayIncomeStatisticsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.time.LocalDate;
@Component
@Slf4j
public class IncomeStatisticsJob {
@Autowired
private DayIncomeStatisticsService dayIncomeStatisticsService;
@Scheduled(cron = "0 0/6 * * * ?")
public void persistentDb() {
try {
dayIncomeStatisticsService.refreshByDate(LocalDate.now());
}catch (Exception e){
log.error("更新每日收益统计失败!",e);
}
}
}