xiewj 5 月之前
父节点
当前提交
fd6b7d678d

+ 4 - 0
src/main/java/com/fdkankan/scene/constant/CmdConstant.java

@@ -1,6 +1,8 @@
 package com.fdkankan.scene.constant;
 
 
+import jdk.nashorn.internal.ir.LexicalContext;
+
 /**
  * Created by owen on 2020/12/31 0031 14:22
  */
@@ -149,4 +151,6 @@ public class CmdConstant {
 
     public final static String CHECK_LASER_WIN = "PotreeConverter.bat check @inPath @outPath";
 
+    public final static String OBJ2_TILES ="bash /home/ubuntu/bin/Obj2Tiles.sh @inPath";
+    public final static String OBJ2_TILES_WIN ="Obj2Tiles.bat @inPath";
 }

+ 1 - 2
src/main/java/com/fdkankan/scene/service/impl/SceneProServiceImpl.java

@@ -950,9 +950,8 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         CompletableFuture.runAsync(() -> {
             try {
                 //调用算法
-                String command = "bash /home/ubuntu/bin/Obj2Tiles.sh " + path;
                 log.info("上传3dtiles模型开始, num:{}, targetPath:{}", num, path);
-                CreateObjUtil.callshell(command);
+                CmdBuildUtil.Obj2Tiles(path);
                 log.info("上传3dtiles模型结束, num:{}, targetPath:{}", num, path);
 
                 //检测计算结果

+ 14 - 0
src/main/java/com/fdkankan/scene/util/CmdBuildUtil.java

@@ -259,4 +259,18 @@ public class CmdBuildUtil {
         }
 
     }
+    public static void Obj2Tiles(String inPath) {
+        String checkLaserCmd = "";
+        if (CmdBuildUtil.OS.isLinux()) {
+            checkLaserCmd = CmdConstant.OBJ2_TILES
+                    .replace("@inPath", inPath);
+            CmdUtils.callLineSh(checkLaserCmd);
+        } else {
+            checkLaserCmd = CmdConstant.OBJ2_TILES_WIN
+                    .replace("@inPath", inPath);
+            CmdUtils.callLineWin(checkLaserCmd);
+
+        }
+
+    }
 }