Selaa lähdekoodia

Merge branch 'project-jmga-2.2.0-2.0.1' into project-jmga-dev

dengsixing 4 päivää sitten
vanhempi
commit
74f088bea3

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

@@ -166,7 +166,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
     @Autowired
     private IHaixinService haixinService;
 
-
     @Override
     public void buildScenePre(BuildSceneCallMessage message) throws Exception{
         boolean success = false;
@@ -367,7 +366,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("建模失败,修改状态为失败状态");
@@ -597,8 +595,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){

+ 7 - 5
src/main/java/com/fdkankan/contro/service/impl/JmgaServiceImpl.java

@@ -30,6 +30,7 @@ import com.fdkankan.rabbitmq.util.RabbitMqProducer;
 import com.fdkankan.web.util.RSAEncrypt;
 import lombok.extern.slf4j.Slf4j;
 import net.lingala.zip4j.core.ZipFile;
+import net.lingala.zip4j.exception.ZipException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -242,11 +243,8 @@ public class JmgaServiceImpl implements IJmgaService {
         String zipName = uuid + ".zip";
         String zipDir = "/oss/4dkankan/bd_server/";
         fYunFileService.downloadFileByCommand(zipDir + zipName, param.getFilePath());
-//        fYunFileService.deleteFile(param.getFilePath());
 
         //解压缩
-//        String unzipCmd = "unzip -P " + ZipConstant.zipPassword + " " + zipDir +  zipName + " -d " + zipDir + uuid;
-//        CmdUtils.callLineSh(unzipCmd);
         ZipFile zipFile = new ZipFile(new File(zipDir +  zipName));
         if (zipFile.isEncrypted()) {
             zipFile.setPassword(ZipConstant.zipPassword);
@@ -254,7 +252,6 @@ public class JmgaServiceImpl implements IJmgaService {
         } else {
             ZipUtil.unzip(zipDir +  zipName, zipDir + uuid);
         }
-//        FileUtil.del(zipDir +  zipName);
 
         //去读data.fdage
         File dataFdageFile = FileUtil.loopFiles(zipDir + uuid).stream().filter(v -> v.getName().equals("data.fdage")).findFirst().get();
@@ -271,7 +268,6 @@ public class JmgaServiceImpl implements IJmgaService {
         FileUtil.mkdir(homePath);
         String cpCmd = "cp -p -r " + zipDir + uuid + "/*/* " + homePath;
         CmdUtils.callLineSh(cpCmd);
-//        FileUtil.del(zipDir + uuid);
 
         String params = snCode + "#" + fileId + "#" + uniCode;
         String encode = Base64.encode(RSAEncrypt.encrypt(RSAEncrypt.loadPublicKeyByStr(RSAEncrypt.loadPublicKeyByFile()), params.getBytes(StandardCharsets.UTF_8)));
@@ -386,4 +382,10 @@ public class JmgaServiceImpl implements IJmgaService {
             }
         }
     }
+
+    public static void main(String[] args) throws ZipException {
+        ZipFile zipFile = new ZipFile(new File("D:\\test\\b01ych281_202503110946199710\\b01ych281_202503110946199710.zip"));
+        zipFile.setPassword(ZipConstant.zipPassword);
+        zipFile.extractFile("data.fdage", "D:\\test\\b01ych281_202503110946199710");
+    }
 }

+ 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;
+    }
+}