package com.huatek.busi.task;


import com.huatek.busi.service.*;
import com.huatek.busi.task.base.AbstractBusiTaskExecutor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.time.LocalDate;

/**
 * 各个主设备定时器
 * 
 * @author mitchell_ma
 * @date 2021/12/16
 */
@Slf4j
@Component("sumNumberStatisticsTask")
public class SumNumberStatisticsTask extends AbstractBusiTaskExecutor {

    @Autowired
    TransformerNumberService transformerNumberService;

    @Autowired
    GisNumberService gisNumberService;

    @Autowired
    CableNumberService cableNumberService;

    @Autowired
    ArresterNumberService arresterNumberService;

    @Autowired
    CubicleNumberService cubicleNumberService;

    @Autowired
    GeneratorNumberService generatorNumberService;

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


        /**
         * 各个设备总外挂装置查询并将计算值加入Cache表
         */

        transformerNumberService.findSumTransformerNumber();

        gisNumberService.findSumGisNumber();

        cableNumberService.findSumCableNumber();

        arresterNumberService.findSumArresterNumber();

        cubicleNumberService.findSumCubicleNumber();

        // todo 其他

        // todo 发电机  104程序维护缓存设备表
        generatorNumberService.findSumGeneratorNumber();
    }

    @Override
    public void execute(String params) throws Exception {
        LocalDate day = toLocalDate(params);
        execute(day);

    }

    @Override
    public void execute(LocalDate day) throws Exception {






    }


}