|
@@ -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);
|