lyhzzz 6 months ago
parent
commit
7c996e48e0

+ 2 - 0
doc/update-fusion-1.8.0.sql

@@ -0,0 +1,2 @@
+ALTER TABLE `4dkankan_v4`.`t_scene_plus_ext`
+    ADD COLUMN `rtk_location` varchar(255) NULL AFTER `icon_size`;

+ 3 - 0
src/main/java/com/fdkankan/manage/entity/ScenePlusExt.java

@@ -164,4 +164,7 @@ public class ScenePlusExt implements Serializable {
     @TableField("location")
     private Integer location;
 
+    @TableField("rtk_location")
+    private String rtkLocation;
+
 }

+ 25 - 2
src/main/java/com/fdkankan/manage/mq/consumer/LaserSceneGpsConsumer.java

@@ -1,6 +1,12 @@
 package com.fdkankan.manage.mq.consumer;
 
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.fdkankan.manage.entity.ScenePlus;
+import com.fdkankan.manage.entity.ScenePlusExt;
+import com.fdkankan.manage.mq.param.LaserSceneGpsVo;
+import com.fdkankan.manage.service.IScenePlusExtService;
+import com.fdkankan.manage.service.IScenePlusService;
 import com.rabbitmq.client.Channel;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -13,12 +19,15 @@ import org.springframework.stereotype.Component;
 import java.nio.charset.StandardCharsets;
 
 /**
- * 场景封存解封 mq
  */
 @Slf4j
 @Component
 public class LaserSceneGpsConsumer {
 
+    @Autowired
+    IScenePlusService scenePlusService;
+    @Autowired
+    IScenePlusExtService scenePlusExtService;
 
     @RabbitListener(
             queuesToDeclare = @Queue("${queue.laser.update-scene.location:save-scene-location}")
@@ -30,7 +39,21 @@ public class LaserSceneGpsConsumer {
             log.info("laser-update-save-scene-location-mq--messageId:{},msg:{}",messageId,msg);
 
             channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
-
+            LaserSceneGpsVo vo = JSONObject.parseObject(msg, LaserSceneGpsVo.class);
+            if(vo != null && vo.getStatus() ==1 && StringUtils.isNotBlank(vo.getNum()) && vo.getLocation() != null && vo.getLocation().length >0){
+                String lat = String.valueOf(vo.getLocation()[0]);
+                String lon = String.valueOf(vo.getLocation()[1]);
+                String hig = String.valueOf(vo.getLocation()[2]);
+                ScenePlus scenePlus = scenePlusService.getByNum(vo.getNum());
+                if(scenePlus != null){
+                    LambdaUpdateWrapper<ScenePlusExt> wrapper = new LambdaUpdateWrapper<>();
+                    wrapper.eq(ScenePlusExt::getPlusId,scenePlus.getId());
+                    wrapper.set(ScenePlusExt::getRtkLocation,lat +","+lon +","+hig);
+                    scenePlusExtService.update(wrapper);
+                }
+            }
+            if(vo != null && vo.getStatus() == 0){
+            }
 
         }catch (Exception e){
             log.info("laser-save-scene-location------消费失败",e);

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

@@ -6,4 +6,5 @@ import lombok.Data;
 public class LaserSceneGpsVo {
     private String num;
     private Double[] location;
+    private Integer status;
  }