package com.iailab.module.data.job.task;
|
|
import com.iailab.module.data.common.enums.CommonConstant;
|
import com.iailab.module.data.http.collector.HttpCollectorForSD;
|
import org.slf4j.Logger;
|
import org.slf4j.LoggerFactory;
|
import javax.annotation.Resource;
|
import org.springframework.stereotype.Component;
|
|
import java.time.LocalDateTime;
|
import java.util.HashMap;
|
import java.util.Map;
|
|
/**
|
*山大设备运行状态数据采集
|
*
|
* @author lirm
|
* @Description
|
* @createTime 2024年05月21日
|
*/
|
@Component("httpCollectRunStateTask")
|
public class HttpCollectRunStateTask implements ITask {
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
|
@Resource
|
private HttpCollectorForSD httpCollectorForSD;
|
|
@Override
|
public void run(String params) {
|
logger.info("HttpCollectRunStateTask定时任务正在执行,参数为:{}", params);
|
try {
|
Map<String,String> map = new HashMap<>();
|
map.put("cu_ids", "3");
|
map.put("t", "1716274632482");
|
map.put("code", CommonConstant.HTTP_API_SD_RUN_STATE);
|
map.put("client_id", "sd");
|
map.put("X-Forwarded-OrgSet", "1000000000000003");
|
map.put("X-Forwarded-PrId", "300002001,300002002");
|
map.put("X-Request-Id", "-3cfeef03-9f1f-48bb-98ec-5494012081d1");
|
httpCollectorForSD.getRunStateValue(map);
|
logger.info("HttpCollectRunStateTask定时任务完成时间:" + LocalDateTime.now());
|
} catch (Exception ex) {
|
ex.printStackTrace();
|
logger.info("HttpCollectRunStateTask定时任务失败时间:" + LocalDateTime.now());
|
}
|
}
|
}
|