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.HarmonicGeneralFeignClient;
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;

/**
 * pqs
 * 稳态综合评估
 * @author cdf
 * @date 2022/11/11
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class HarmComprehensiveAssessJob {

    private final HarmonicGeneralFeignClient harmonicGeneralFeignClient;

    @Deprecated
    @XxlJob("comprehensiveAssessHandler")
    public void  comprehensiveAssessHandler(){

        LineParam lineParam = new LineParam();
        lineParam.setType(Integer.valueOf(BizParamConstant.STAT_BIZ_DAY));
        lineParam.setDataDate(CommonExecutorUtils.prepareTimeDeal(BizParamConstant.STAT_BIZ_DAY));

        //下面测试数据部署需删除
        //lineParam.setDataDate("2022-10-27");
        lineParam.setDataSource(1);
        harmonicGeneralFeignClient.generalData(lineParam);
    }

    @XxlJob("comprehensiveAssessHandlerToMysql")
    public void  comprehensiveAssessHandlerToMysql(){
        LineParam lineParam = new LineParam();
        lineParam.setType(Integer.valueOf(BizParamConstant.STAT_BIZ_DAY));
        lineParam.setDataDate(CommonExecutorUtils.prepareTimeDeal(BizParamConstant.STAT_BIZ_DAY));
        lineParam.setDataSource(2);
        harmonicGeneralFeignClient.generalDataToMysql(lineParam);
    }
}
