package com.njcn.executor.handler;


import com.njcn.executor.utils.CommonExecutorUtils;
import com.njcn.prepare.harmonic.api.line.CoustmReportFeignClient;
import com.njcn.prepare.harmonic.pojo.param.LineParam;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;

/**
 * pqs
 * 稳态自定义监测点报告定时调度任务
 * @author cdf
 * @date 2022/10/24
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class HarmCustomReportJob {

    private final CoustmReportFeignClient coustmReportFeignClient;


    @XxlJob("harmCustomReportHandler")
    public void harmCustomReportHandler(){

        String command = XxlJobHelper.getJobParam();
        LineParam lineParam = new LineParam();
        lineParam.setType(Integer.valueOf(command));

        String date = CommonExecutorUtils.prepareTimeDeal(command);
        //date = "2022-10-26";
        lineParam.setDataDate(date);
        lineParam.setDataSource(1);
        coustmReportFeignClient.batchReport(lineParam);
    }






}
