package com.njcn.executor.handler;

import cn.hutool.core.util.StrUtil;
import com.njcn.energy.pojo.api.EleAirStrategyFeignClient;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * pqs
 * 空调策略
 * @author cdf
 * @date 2022/4/21
 */

@Slf4j
@Component
@AllArgsConstructor
public class AirStrategyJob {

    private final EleAirStrategyFeignClient eleAirStrategyFeignClient;



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

        try {

            String command = XxlJobHelper.getJobParam();
            //获取所有策略监测点
            String[] arr = command.split(StrUtil.COMMA);
            eleAirStrategyFeignClient.dealAirStrategyId(arr[1], arr[0]);
        }catch (Exception e){
            e.printStackTrace();
        }


    }
}
