|
@@ -3,14 +3,15 @@ package com.lutao.uav.mqtt;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
-import com.lutao.uav.domain.entity.GasMessage;
|
|
|
import com.lutao.uav.domain.entity.NorthSeaGasPoint;
|
|
|
-import com.lutao.uav.service.GasMessageService;
|
|
|
import com.lutao.uav.service.NorthSeaGasPointService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.eclipse.paho.client.mqttv3.*;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.data.geo.*;
|
|
|
+import org.springframework.data.geo.Circle;
|
|
|
+import org.springframework.data.geo.Distance;
|
|
|
+import org.springframework.data.geo.GeoResults;
|
|
|
+import org.springframework.data.geo.Point;
|
|
|
import org.springframework.data.redis.connection.RedisGeoCommands;
|
|
|
import org.springframework.data.redis.core.BoundGeoOperations;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
@@ -55,9 +56,6 @@ public class MqttConfig {
|
|
|
@Resource
|
|
|
private KafkaTemplate kafkaTemplate;
|
|
|
|
|
|
- @Resource
|
|
|
- private GasMessageService gasMessageService;
|
|
|
-
|
|
|
private MqttClient client;
|
|
|
private ExecutorService executorService;
|
|
|
|
|
@@ -125,8 +123,8 @@ public class MqttConfig {
|
|
|
* "collectTime":"2024-04-12 18:21:11"
|
|
|
* }
|
|
|
*/
|
|
|
- List<GasMessage> gasMessages = gasMessageService.list();
|
|
|
- for (GasMessage gasMessage : gasMessages) {
|
|
|
+ List<NorthSeaGasPoint> gasMessages = northSeaGasPointService.list();
|
|
|
+ for (NorthSeaGasPoint gasMessage : gasMessages) {
|
|
|
JSONObject kafkaSendMessage = new JSONObject();
|
|
|
kafkaSendMessage.put("enterpriseId", gasMessage.getCompanyName());
|
|
|
kafkaSendMessage.put("equipCode", gasMessage.getPointCode());
|