package com.njcn.executor.handler;

import com.njcn.executor.utils.CommonExecutorUtils;
import com.njcn.prepare.harmonic.api.line.NormalLimitFeignClient;
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;

/**
 * pqs
 * 告警异常
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class HarmAlarmDetailJob {

    private final NormalLimitFeignClient normalLimitFeignClient;

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

        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);
        normalLimitFeignClient.getNormLimitData(lineParam);
    }

}
