Forráskód Böngészése

激光获取场景rtk坐标信息

lyhzzz 1 éve
szülő
commit
10ae550f0a

+ 43 - 0
src/main/java/com/fdkankan/manage/mq/consumer/LaserSceneGpsConsumer.java

@@ -0,0 +1,43 @@
+package com.fdkankan.manage.mq.consumer;
+
+import com.alibaba.fastjson.JSONObject;
+import com.rabbitmq.client.Channel;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.amqp.core.Message;
+import org.springframework.amqp.rabbit.annotation.Queue;
+import org.springframework.amqp.rabbit.annotation.RabbitListener;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.nio.charset.StandardCharsets;
+
+/**
+ * 场景封存解封 mq
+ */
+@Slf4j
+@Component
+public class LaserSceneGpsConsumer {
+
+
+    @RabbitListener(
+            queuesToDeclare = @Queue("${queue.laser.update-scene.location:save-scene-location}")
+    )
+    public void consumerQueue(Channel channel, Message message)  {
+        try {
+            String messageId = message.getMessageProperties().getMessageId();
+            String msg = new String(message.getBody(), StandardCharsets.UTF_8);
+            log.info("laser-update-save-scene-location-mq--messageId:{},msg:{}",messageId,msg);
+
+            channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
+
+
+        }catch (Exception e){
+            log.info("laser-save-scene-location------消费失败",e);
+        }finally {
+
+        }
+
+    }
+
+}

+ 9 - 0
src/main/java/com/fdkankan/manage/mq/param/LaserSceneGpsVo.java

@@ -0,0 +1,9 @@
+package com.fdkankan.manage.mq.param;
+
+import lombok.Data;
+
+@Data
+public class LaserSceneGpsVo {
+    private String num;
+    private Double[] location;
+ }