package com.njcn.executor.handler;

import com.njcn.common.pojo.constant.BizParamConstant;
import com.njcn.executor.utils.CommonExecutorUtils;
import com.njcn.prepare.harmonic.api.newalgorithm.RMpPassrateFeignClient;
import com.njcn.prepare.harmonic.api.newalgorithm.ROperatingMonitorFeignClient;
import com.njcn.prepare.harmonic.pojo.param.LineParam;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * 类的介绍：
 *
 * @author xuyang
 * @version 1.0.0
 * @createTime 2023/7/26 15:55
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class RMpPassrateJob {

    private final RMpPassrateFeignClient rMpPassrateFeignClient;

    @XxlJob("rMpPassrateDay")
    public void rMpPassrateDay(){
        log.info(LocalDateTime.now()+"监测点稳态指标合格率_日统计调度开始------------------------");
        LineParam lineParam = new LineParam();
        lineParam.setType(Integer.valueOf(BizParamConstant.STAT_BIZ_DAY));
        lineParam.setDataDate(CommonExecutorUtils.prepareTimeDeal(BizParamConstant.STAT_BIZ_DAY));
        lineParam.setDataSource(2);
        rMpPassrateFeignClient.passRateHandler(lineParam);
    }

    @XxlJob("rMpPassrateMonth")
    public void rMpPassrateMonth(){
        log.info(LocalDateTime.now()+"监测点稳态指标合格率_月统计调度开始------------------------");
        LineParam lineParam = new LineParam();
        lineParam.setType(Integer.valueOf(BizParamConstant.STAT_BIZ_MONTH));
        lineParam.setDataDate(CommonExecutorUtils.prepareTimeDeal(BizParamConstant.STAT_BIZ_MONTH));
        lineParam.setDataSource(2);
        rMpPassrateFeignClient.passRateHandler(lineParam);
    }

}
