浏览代码

更新调用平面图脚本名称

wuweihao 3 年之前
父节点
当前提交
74cc15536e

+ 1 - 1
laser/src/main/java/com/fdkankan/indoor/base/constant/CmdConstant.java

@@ -77,5 +77,5 @@ public class CmdConstant {
      *              xxx.png
      * bash /home/ubuntu/bin/Launcher.sh ${工作路径}
      */
-    public final static String TILED_MAP = "bash /home/ubuntu/bin/Launcher.sh @inPath";
+    public final static String TILED_MAP = "bash /home/ubuntu/bin/Laser-Launcher.sh @inPath";
 }

+ 8 - 4
laser/src/main/java/com/fdkankan/indoor/core/service/impl/TiledMapServiceImpl.java

@@ -231,7 +231,7 @@ public class TiledMapServiceImpl extends IBaseServiceImpl implements TiledMapSer
             cmdTiledMap(tiledBasePath);
 
             // 上传平面图到download目录
-            uplodaOss(tiledBasePath, sceneCode);
+            uploadOss(tiledBasePath, sceneCode);
             return Result.success();
         } catch (IOException e) {
             e.printStackTrace();
@@ -263,9 +263,14 @@ public class TiledMapServiceImpl extends IBaseServiceImpl implements TiledMapSer
      * @param tiledBasePath
      * @param sceneCode
      */
-    private void uplodaOss(String tiledBasePath, String sceneCode){
+    private void uploadOss(String tiledBasePath, String sceneCode){
         String tiledMapPath = tiledBasePath + "/results/laserData/cover/final_freespace.png";
-//        String tiledMaptInfoPath = tiledBasePath + "/results/laserData/cover/info.json";
+
+        if (!FileUtil.exist(tiledMapPath)){
+            String msg = "没有生成平面图文件,请检查平面图算法是否调用成功";
+            log.error(msg);
+            throw new BaseRuntimeException(msg);
+        }
 
         // 提供前端下载使用
         String ossTiledMap = "data/" + sceneCode + "/download/final_freespace.png";
@@ -389,7 +394,6 @@ public class TiledMapServiceImpl extends IBaseServiceImpl implements TiledMapSer
      * @return
      */
     private List<TiledMapDto> initData(String sceneCode, String from){
-//        String path = redisPath(sceneCode) + "/laserData";
         String path = redisPath(sceneCode);
         if ("dev".equals(configConstant.active)) {
             path = "F:\\test\\ngin\\age_laser_data\\" + sceneCode + "\\results\\laserData";