dengsixing 4 giorni fa
parent
commit
2beb3835b0

+ 0 - 4
src/main/java/com/fdkankan/contro/mq/service/impl/BuildSceneServiceImpl.java

@@ -162,7 +162,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
     @Autowired
     private IHaixinService haixinService;
 
-
     @Override
     public void buildScenePre(BuildSceneCallMessage message) throws Exception{
         boolean success = false;
@@ -363,7 +362,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
             log.info("计算日志上传完成");
 
             JSONObject fdageData = getFdageData(path + File.separator + "capture" +File.separator+"data.fdage");
-            String uuid = fdageData.getString("creator") + "_" + fdageData.getString("uuidtime");
 
             if (!message.getBuildSuccess()) {
                 log.error("建模失败,修改状态为失败状态");
@@ -593,8 +591,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
         }
     }
 
-
-
     private Integer uploadFreespace(String num, String path, Map<String, String> map){
         String floor0pngPath = "/results/floorplan/floor_0.png";
         String plyPath = path + "/results/laserData/cover/final_freespace.ply";

+ 7 - 0
src/main/java/com/fdkankan/contro/service/IRtkService.java

@@ -0,0 +1,7 @@
+package com.fdkankan.contro.service;
+
+public interface IRtkService {
+
+    Integer getMapStatus(String path);
+
+}

+ 7 - 0
src/main/java/com/fdkankan/contro/service/impl/CommonServiceImpl.java

@@ -116,6 +116,8 @@ public class CommonServiceImpl implements ICommonService {
     private SceneShapeEnumService sceneShapeEnumService;
     @Autowired
     private ISceneFileUploadService sceneFileUploadService;
+    @Autowired
+    private IRtkService rtkService;
 
     public static void main(String[] args) {
         String infoJsonPath = "D:\\test\\info.json";
@@ -390,6 +392,7 @@ public class CommonServiceImpl implements ICommonService {
     }
 
     public Object[] updateEditInfo(ScenePlus scenePlus){
+        ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
         SceneEditInfo sceneEditInfo = sceneEditInfoService.getByScenePlusId(scenePlus.getId());
         SceneEditControls sceneEditControls = null;
         SceneEditInfoExt sceneEditInfoExt = null;
@@ -434,6 +437,10 @@ public class CommonServiceImpl implements ICommonService {
         if(sceneEditControls == null){
             sceneEditControls = new SceneEditControls();
             sceneEditControls.setEditInfoId(sceneEditInfo.getId());
+            Integer mapStatus = rtkService.getMapStatus(scenePlusExt.getDataSource());
+            if(mapStatus == 1){
+                sceneEditControls.setShowMap(3);
+            }
             sceneEditControlsService.save(sceneEditControls);
         }
         if(sceneEditInfoExt == null){

+ 35 - 0
src/main/java/com/fdkankan/contro/service/impl/RtkServiceImpl.java

@@ -0,0 +1,35 @@
+package com.fdkankan.contro.service.impl;
+
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.util.ObjUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.contro.service.IRtkService;
+import org.springframework.stereotype.Service;
+
+import java.io.File;
+
+@Service
+public class RtkServiceImpl implements IRtkService {
+    @Override
+    public Integer getMapStatus(String path) {
+        String visionPath = path + File.separator + "results" + File.separator + "vision.txt";
+        JSONObject visionObj = JSON.parseObject(FileUtil.readUtf8String(visionPath));
+        JSONArray sweepLocations = visionObj.getJSONArray("sweepLocations");
+        long count = sweepLocations.stream().filter(v -> {
+            JSONObject obj = (JSONObject) v;
+            JSONObject ggaLocation = obj.getJSONObject("ggaLocation");
+            if (ObjUtil.isNotNull(ggaLocation)
+                    && ggaLocation.containsKey("StatusIndicator")
+                    && (ggaLocation.getInteger("StatusIndicator") == 4
+                    || ggaLocation.getInteger("StatusIndicator") == 100
+                    || ggaLocation.getInteger("StatusIndicator") == 104)) {
+                return true;
+            } else {
+                return false;
+            }
+        }).count();
+        return count < 2 ? 0 : 1;
+    }
+}