修改统计单位为分钟

This commit is contained in:
zhonghua.li
2026-02-03 21:42:00 +08:00
parent aca05abd73
commit ec16419f1f
6 changed files with 44 additions and 17 deletions

View File

@@ -1,5 +1,6 @@
package com.rj.scheduler;
import com.rj.config.AppConfig;
import com.rj.service.IAudioManagementStatisticsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -10,7 +11,7 @@ import java.time.LocalDate;
/**
* 门店录音统计定时任务
*
*
* @author 李中华 ,spllzh
* @since 2025-08-07
*/
@@ -21,18 +22,27 @@ public class AudioStatisticsScheduler {
@Autowired
private IAudioManagementStatisticsService audioStatisticsService;
@Autowired
private AppConfig appConfig;
/**
* 每天凌晨2点执行门店录音统计
* 统计昨天的录音数据
*/
// @Scheduled(cron = "0 0 2 * * ?")
@Scheduled(cron = "0 0 2 * * ?")
public void generateDailyAudioStatistics() {
try {
// 检查调度器是否启用
if (!appConfig.getScheduler().isStart()) {
log.info("调度器未启用,跳过门店录音统计任务执行");
return;
}
log.info("开始执行门店录音统计任务...");
LocalDate yesterday = LocalDate.now().minusDays(1);
int count = audioStatisticsService.generateStatisticsByDate(yesterday);
log.info("门店录音统计任务执行完成,统计日期:{},生成记录数:{}", yesterday, count);
} catch (Exception e) {
log.error("门店录音统计任务执行失败", e);