package com.jjt.task;

import com.jjt.calc.service.ITwinCalcHourEnergyService;
import com.jjt.ws.service.ITwinWorkshopCalcService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.time.LocalDate;

/**
 * 能源定时任务
 *
 * @author wukai
 * @date 2025-1-17 23:27:26
 */
@Component("energy")
public class EnergyTask {
    @Resource
    private ITwinCalcHourEnergyService energyService;
    @Resource
    private ITwinWorkshopCalcService wsCalcService;

    public void last() {
        energyService.calcLastEnergy();
    }

    /**
     * 统计昨日数据
     */
    public void calc() {
        LocalDate localDate = LocalDate.now().minusDays(1);
        wsCalcService.calc(localDate);
    }

}
