package com.hxhq.util;

/**
 * @author zhangjing
 * @date 2025/07/08 19:29
 * @description 元数据定时
 */
import com.hxhq.service.ReagentStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class DailyTask {

    @Autowired
    ReagentStockService reagentStockService;


//     北京时间
//    @Scheduled(cron = "0 0 1 * * ?", zone = "Asia/Shanghai")
//    public void executeAtOneAMInShanghai() {
//        reagentStockService.dataSync();
//        System.out.println("【北京时间】每天凌晨1点执行：" + new Date());
//    }
//    @Scheduled(cron = "0 0/5 * * * ?")
//    public void executeEveryFiveMinutes() {
//        metadataRecordService.uploadRecord();
//        System.out.println("【每5分钟执行】当前时间：" + new Date());
//    }

    @Scheduled(cron = "0 * * * * ?")
    public void executeEveryMinute() {
        reagentStockService.dataSync();
        System.out.println("【每分钟执行】当前时间：" + new Date());
    }

//    @Scheduled(cron = "0 */3 * * * ?")
//    public void executeEveryThreeMinutes() {
//        metadataRecordService.uploadRecord();
//        System.out.println("【每3分钟执行】当前时间：" + new Date());
//    }
}
