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.RStatEventFeignClient;
import com.njcn.prepare.harmonic.api.line.RStatEventOrgFeignClient;
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 RStatEventOrgJob {

    private final RStatEventOrgFeignClient rStatEventOrgFeignClient;

    @XxlJob("rStartEventOrgDHandler")
    public void  rStartEventOrgDHandler(){
        OrgParam orgParam = new OrgParam();
        orgParam.setType(Integer.valueOf(BizParamConstant.STAT_BIZ_DAY));
        orgParam.setDataDate(CommonExecutorUtils.prepareTimeDeal(BizParamConstant.STAT_BIZ_DAY));
        rStatEventOrgFeignClient.rStartEventOrgHandler(orgParam);
    }

    @XxlJob("rStartEventOrgMHandler")
    public void  rStartEventOrgMHandler(){
        OrgParam orgParam = new OrgParam();
        orgParam.setType(Integer.valueOf(BizParamConstant.STAT_BIZ_MONTH));
        orgParam.setDataDate(CommonExecutorUtils.prepareTimeDeal(BizParamConstant.STAT_BIZ_MONTH));
        rStatEventOrgFeignClient.rStartEventOrgHandler(orgParam);
    }

    @XxlJob("rStartEventOrgQHandler")
    public void  rStartEventOrgQHandler(){
        OrgParam orgParam = new OrgParam();
        orgParam.setType(Integer.valueOf(BizParamConstant.STAT_BIZ_QUARTER));
        orgParam.setDataDate(CommonExecutorUtils.prepareTimeDeal(BizParamConstant.STAT_BIZ_QUARTER));
        rStatEventOrgFeignClient.rStartEventOrgHandler(orgParam);
    }

    @XxlJob("rStartEventOrgYHandler")
    public void  rStartEventOrgYHandler(){
        OrgParam orgParam = new OrgParam();
        orgParam.setType(Integer.valueOf(BizParamConstant.STAT_BIZ_YEAR));
        orgParam.setDataDate(CommonExecutorUtils.prepareTimeDeal(BizParamConstant.STAT_BIZ_YEAR));
        rStatEventOrgFeignClient.rStartEventOrgHandler(orgParam);
    }

}
