package com.njcn.executor.handler;

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

/**
 * pqs
 * 暂态指标统计
 * @author zbj
 * @date 2023/07/03
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class RStatEventJob {

    private final RStatEventFeignClient rStatEventFeignClient;

    @XxlJob("rStartEventDHandler")
    public void  rStartEventDHandler(){
        OrgParam orgParam = new OrgParam();
        orgParam.setType(Integer.valueOf(BizParamConstant.STAT_BIZ_DAY));
        orgParam.setDataDate(CommonExecutorUtils.prepareTimeDeal(BizParamConstant.STAT_BIZ_DAY));
        rStatEventFeignClient.rStartEventHandler(orgParam);
    }

    @XxlJob("rStartEventMHandler")
    public void  rStartEventMHandler(){
        OrgParam orgParam = new OrgParam();
        orgParam.setType(Integer.valueOf(BizParamConstant.STAT_BIZ_MONTH));
        orgParam.setDataDate(CommonExecutorUtils.prepareTimeDeal(BizParamConstant.STAT_BIZ_MONTH));
        rStatEventFeignClient.rStartEventHandler(orgParam);
    }

    @XxlJob("rStartEventQHandler")
    public void  rStartEventQHandler(){
        OrgParam orgParam = new OrgParam();
        orgParam.setType(Integer.valueOf(BizParamConstant.STAT_BIZ_QUARTER));
        orgParam.setDataDate(CommonExecutorUtils.prepareTimeDeal(BizParamConstant.STAT_BIZ_QUARTER));
        rStatEventFeignClient.rStartEventHandler(orgParam);
    }

    @XxlJob("rStartEventYHandler")
    public void  rStartEventYHandler(){
        OrgParam orgParam = new OrgParam();
        orgParam.setType(Integer.valueOf(BizParamConstant.STAT_BIZ_YEAR));
        orgParam.setDataDate(CommonExecutorUtils.prepareTimeDeal(BizParamConstant.STAT_BIZ_YEAR));
        rStatEventFeignClient.rStartEventHandler(orgParam);
    }

}
