package com.huatek.busi.task.generator;

import com.huatek.busi.task.base.AbstractBusiTaskExecutor;
import com.huatek.busi.task.generator.part.GeneratorAmplTask;
import com.huatek.busi.task.generator.part.GeneratorPdTask;
import com.huatek.busi.task.generator.part.GeneratorPressureTask;
import com.huatek.busi.task.transformer.part.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.time.LocalDate;

/**
 * 发电机每日定时任务统计
 */
@Slf4j
@Component("generatorDailyTask")
public class GeneratorDailyTask extends AbstractBusiTaskExecutor {
    @Autowired
    private GeneratorAmplTask generatorAmplTask;

    @Autowired
    private GeneratorPressureTask generatorPressureTask;

    @Autowired
    private GeneratorPdTask generatorPdTask;

    @Override
    public void execute() throws Exception {
        super.execute();
    }

    @Override
    public void execute(LocalDate day) {
        log.info("{} start...", day);
        // 20230424 新增振动、压力装置
        generatorAmplTask.execute(day);
        generatorPressureTask.execute(day);
        // 20230508 新增局放
        generatorPdTask.execute(day);
        log.info("{} end!", day);
    }
}