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.RStatOrgFeignClient;
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/07
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class RStatOrgJob {

    private final RStatOrgFeignClient rStatOrgFeignClient;

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

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

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

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

}
