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.RAlarmCountFeignClient;
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/04
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class RAlarmCountJob {

    private final RAlarmCountFeignClient rAlarmCountFeignClient;

    @XxlJob("rAlarmCountWHandler")
    public void  rStartEventDHandler(){
        OrgParam orgParam = new OrgParam();
        orgParam.setType(Integer.valueOf(BizParamConstant.STAT_BIZ_WEEK));
        orgParam.setDataDate(CommonExecutorUtils.prepareTimeDeal(BizParamConstant.STAT_BIZ_WEEK));
        rAlarmCountFeignClient.rAlarmCountHandler(orgParam);
    }

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

}
