package com.fjhx.controller.task;

import com.fjhx.service.check.CheckInfoService;
import com.fjhx.service.v3.V3PlanService;
import org.springblade.core.launch.BladeApplication;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

@Configuration
@EnableScheduling
public class ScheduleTaskController {

    @Autowired
    private V3PlanService v3PlanService;

    @Autowired
    private CheckInfoService checkInfoService;

    /**
     * 获取排班面积
     */
    @Scheduled(cron = "0 0/5 * * * ?")
//    @PostConstruct
    private void statisticsOfFabricUtilizationRate() {
        if (BladeApplication.isLocalDev()) {
            return;
        }
        v3PlanService.statisticsOfFabricUtilizationRate(30);
    }

    /**
     * 盘点
     */
    // @Scheduled(cron = "0 0 1 * * ?")
    @Scheduled(cron = "0 10 19 * * ?")
    // @PostConstruct
    private void automaticCheck() {
        // if (BladeApplication.isLocalDev()) {
        //     return;
        // }
        checkInfoService.automaticCheck();
    }


}
