|
|
@ -2,6 +2,8 @@ package com.yingji.quartz;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
|
|
|
import cn.hutool.http.HttpRequest;
|
|
|
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
import com.yingji.entity.Fire;
|
|
|
|
import com.yingji.entity.Fire;
|
|
|
|
import com.yingji.entity.QuartzLog;
|
|
|
|
import com.yingji.entity.QuartzLog;
|
|
|
|
import com.yingji.service.FireService;
|
|
|
|
import com.yingji.service.FireService;
|
|
|
@ -14,7 +16,9 @@ import org.springframework.scheduling.annotation.Scheduled;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 119数据保存定时任务
|
|
|
|
* 119数据保存定时任务
|
|
|
@ -53,6 +57,9 @@ public class FireQuartz {
|
|
|
|
// 110算法接口
|
|
|
|
// 110算法接口
|
|
|
|
if (CollectionUtil.isNotEmpty(list)) {
|
|
|
|
if (CollectionUtil.isNotEmpty(list)) {
|
|
|
|
fireService.saveAll(list);
|
|
|
|
fireService.saveAll(list);
|
|
|
|
|
|
|
|
for (Fire fire : list) {
|
|
|
|
|
|
|
|
link119Algorithm(fire.getId());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
quartzLog.setStatus(1);
|
|
|
|
quartzLog.setStatus(1);
|
|
|
|
log.info("119接口结束" + LocalDateTime.now());
|
|
|
|
log.info("119接口结束" + LocalDateTime.now());
|
|
|
@ -67,4 +74,16 @@ public class FireQuartz {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 120算法接口
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public void link119Algorithm(String id) {
|
|
|
|
|
|
|
|
log.info("============119和110对比算法接口开始" + LocalDateTime.now() + "=============");
|
|
|
|
|
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
|
|
|
|
|
map.put("id", id);
|
|
|
|
|
|
|
|
String body = JSONUtil.toJsonStr(map);
|
|
|
|
|
|
|
|
String response = HttpRequest.post("http://localhost:9002/link119_algorithm").body(body).execute().body();
|
|
|
|
|
|
|
|
log.info("++++++119和110对比算法响应数据++++++" + response);
|
|
|
|
|
|
|
|
log.info("============119和110对比算法接口结束" + LocalDateTime.now() + "=============");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|