123
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user