package com.njcn.rdms.module.project.service.workreport.autogen;

import jakarta.annotation.Resource;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class WorkReportAutoGenerateScheduler {

    @Resource
    private WorkReportAutoGenerateService workReportAutoGenerateService;

    @Scheduled(cron = "${rdms.work-report.auto-gen.weekly.cron:0 0 12 ? * FRI}", zone = "Asia/Shanghai")
    public void weekly() {
        workReportAutoGenerateService.autoGenerateWeeklyBySchedule();
    }

    @Scheduled(cron = "${rdms.work-report.auto-gen.monthly.cron:0 0 12 1-31 * ?}", zone = "Asia/Shanghai")
    public void monthlyDaily() {
        workReportAutoGenerateService.autoGenerateMonthlyBySchedule();
    }

    @Scheduled(cron = "${rdms.work-report.auto-gen.project.cron:0 0 12 1-31 * ?}", zone = "Asia/Shanghai")
    public void projectDaily() {
        workReportAutoGenerateService.autoGenerateProjectBySchedule();
    }
}
