package com.miyzh.config;

import com.miyzh.service.UploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import java.time.LocalDateTime;

/**
 * description: SheduledConfig
 * date: 2020/6/18 17:18
 * author: SZQ
 */

@Configuration
public class SheduledConfig {

    @Autowired
    private UploadService uploadService;

    @Scheduled(cron = "0 0 0 * * ?")
    private void uploadHosYesterday() {
        System.out.println("开始执行定时上传住院记录===");
        uploadService.updateHosYesterday();
    }

    @Scheduled(cron = "0 0 0 * * ?")
    private void updateCliYesterday() {
        System.out.println("开始执行定时上传门诊记录===");
        uploadService.updateCliYesterday();
    }

//    @Scheduled(cron = "0 30 0 * * ?")
//    private void uploadDocStatus() {
//        System.out.println("开始执行定时上传结算状态===");
//        uploadService.uploadDocStatusYesterday();
//    }

//    @Scheduled(cron = "0 0 1 * * ?")
//    private void rertyUpload() {
//        System.out.println("开始执行定时上传异常记录===");
//        uploadService.retryUpload();
//    }

}
