Browse Source

取消协作移除项目场景

lyhzzz 11 months ago
parent
commit
fd855f9825

+ 4 - 1
src/main/java/com/fdkankan/manage_jp/mq/consumer/LaserSceneGpsConsumer.java

@@ -36,11 +36,14 @@ public class LaserSceneGpsConsumer {
 
             channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
             LaserSceneGpsVo vo = JSONObject.parseObject(msg, LaserSceneGpsVo.class);
-            if(vo != null && StringUtils.isNotBlank(vo.getNum()) && vo.getLocation() != null && vo.getLocation().length >0){
+            if(vo != null && vo.getStatus() ==1 && StringUtils.isNotBlank(vo.getNum()) && vo.getLocation() != null && vo.getLocation().length >0){
                 String lat = String.valueOf(vo.getLocation()[1]);
                 String lon = String.valueOf(vo.getLocation()[0]);
                 projectSceneGpsService.updateGps(vo.getNum(),lat,lon,2);
             }
+            if(vo != null && vo.getStatus() == 0){
+                projectSceneGpsService.updateGps(vo.getNum(),0);
+            }
 
         }catch (Exception e){
             log.info("laser-save-scene-location------消费失败",e);

+ 1 - 0
src/main/java/com/fdkankan/manage_jp/mq/vo/LaserSceneGpsVo.java

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

+ 1 - 0
src/main/java/com/fdkankan/manage_jp/service/IProjectSceneGpsService.java

@@ -23,6 +23,7 @@ public interface IProjectSceneGpsService extends IService<ProjectSceneGps> {
     ProjectSceneGps addGps(SceneGpsDb sceneGpsDb);
 
     void updateGps(String num,String lat,String lon,Integer type);
+    void updateGps(String num,Integer type);
 
 
     Object allSceneGps(SceneGpsParam param);

+ 8 - 0
src/main/java/com/fdkankan/manage_jp/service/impl/ProjectSceneGpsServiceImpl.java

@@ -150,6 +150,14 @@ public class ProjectSceneGpsServiceImpl extends ServiceImpl<IProjectSceneGpsMapp
         this.update(wrapper);
     }
 
+    @Override
+    public void updateGps(String num,Integer type) {
+        LambdaUpdateWrapper<ProjectSceneGps> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(ProjectSceneGps::getNum,num);
+        wrapper.set(ProjectSceneGps::getGpsSource,type);
+        this.update(wrapper);
+    }
+
     @Autowired
     ISceneProMapper sceneProMapper;
     @Autowired