package com.njcn.executor.handler;

import com.njcn.common.pojo.constant.BizParamConstant;
import com.njcn.common.utils.PubUtils;
import com.njcn.executor.utils.CommonExecutorUtils;
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/25 11:05
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class ROperatingMonitorJob {

    private final ROperatingMonitorFeignClient rOperatingMonitorFeignClient;

    @XxlJob("rOperatingMonitorDay")
    public void rOperatingMonitorDay(){
        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);
        rOperatingMonitorFeignClient.handlerMonitorOperatingD(lineParam);
    }

    @XxlJob("rOperatingMonitorMonth")
    public void rOperatingMonitorMonth(){
        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);
        rOperatingMonitorFeignClient.handlerMonitorOperatingM(lineParam);
    }

}
