Browse Source

Revert "复制场景 增加复制计算结果目录 生成obj判断本地文件是否存在改为判断oss文件是否存在"

This reverts commit e6d5f3c4
lyhzzz 2 years ago
parent
commit
62f1b46d1d

+ 0 - 5
src/main/java/com/fdkankan/ucenter/common/constants/UploadFilePath.java

@@ -18,11 +18,6 @@ public class UploadFilePath {
 
     public static final String IMG_VIEW_PATH =  "scene_view_data/%s/images/";
 
-    /**
-     * 场景计算结果数据存放路径
-     */
-    public static final String SCENE_RESULT_DATA_PATH = "scene_result_data/%s/";
-
 
 
 }

+ 0 - 6
src/main/java/com/fdkankan/ucenter/service/impl/ScenePlusServiceImpl.java

@@ -185,12 +185,6 @@ public class ScenePlusServiceImpl extends ServiceImpl<IScenePlusMapper, ScenePlu
                 String oldViewPath = String.format(UploadFilePath.VIEW_PATH, num);
                 String newViewPath = String.format(UploadFilePath.VIEW_PATH, newNum);
                 fYunFileServiceInterface.copyFileInBucket(oldViewPath, newViewPath);
-
-                //复制计算结果文件
-                String oldResultPath = String.format(UploadFilePath.SCENE_RESULT_DATA_PATH, num);
-                String newResultPath = String.format(UploadFilePath.SCENE_RESULT_DATA_PATH, newNum);
-                fYunFileServiceInterface.copyFileInBucket(oldResultPath, newResultPath);
-
                 // 拷贝本地资源
                 String oldPath = String.format("/mnt/4Dkankan/scene/%s/caches/images", num);
                 String newPath = String.format("/mnt/4Dkankan/scene/%s/caches/images", newNum);

+ 9 - 21
src/main/java/com/fdkankan/ucenter/service/impl/SceneProServiceImpl.java

@@ -11,7 +11,6 @@ import com.fdkankan.common.constant.SceneConstant;
 import com.fdkankan.common.constant.SceneKind;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.common.util.*;
-import com.fdkankan.model.constants.UploadFilePath;
 import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
 import com.fdkankan.rabbitmq.util.RabbitMqProducer;
 import com.fdkankan.redis.constant.RedisKey;
@@ -1222,28 +1221,17 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         ScenePlusExt scenePlusExt = scenePlusExtService.getByPlusId(scenePlus.getId());
 
         // 拷贝文件
-        String ossResultPath = String.format(UploadFilePath.scene_result_data_path, num);
-        String ossReconstruction = ossResultPath + "caches/reconstruction/";
-        if(!fYunFileService.fileExist(ossReconstruction + "final.bin")
-                || !fYunFileService.fileExist(ossReconstruction + "chunk.json")
-                || !fYunFileService.fileExist(ossResultPath + "caches/images")
-                || !fYunFileService.fileExist(ossResultPath + "caches/depthmap")
-                || !fYunFileService.fileExist(ossResultPath + "caches/depthmap_csc")
-                || !fYunFileService.fileExist(ossResultPath + "caches/panorama.json")
-                || !fYunFileService.fileExist(ossResultPath + "results/laserData/laser.ply")){
+        String path = scenePlusExt.getDataSource();
+        if (!new File(path + "/caches/reconstruction/final.bin").exists()
+                || !new File(path + "/caches/reconstruction/chunk.json").exists()
+                || !new File(path + "/caches/images").exists()
+                || !new File(path + "/caches/depthmap").exists()
+                || !new File(path + "/caches/depthmap_csc").exists()
+                || !new File(path + "/caches/panorama.json").exists()
+                || !new File(path + "/results/laserData/laser.ply").exists()) {
+            log.error("生成obj缺少必要文件,生成失败!");
             throw new BusinessException(SceneConstant.FAILURE_CODE_5038, SceneConstant.FAILURE_MSG_5038);
         }
-//        String path = scenePlusExt.getDataSource();
-//        if (!new File(path + "/caches/reconstruction/final.bin").exists()
-//                || !new File(path + "/caches/reconstruction/chunk.json").exists()
-//                || !new File(path + "/caches/images").exists()
-//                || !new File(path + "/caches/depthmap").exists()
-//                || !new File(path + "/caches/depthmap_csc").exists()
-//                || !new File(path + "/caches/panorama.json").exists()
-//                || !new File(path + "/results/laserData/laser.ply").exists()) {
-//            log.error("生成obj缺少必要文件,生成失败!");
-//            throw new BusinessException(SceneConstant.FAILURE_CODE_5038, SceneConstant.FAILURE_MSG_5038);
-//        }
 
         // 获取最新的场景名称
         JSONObject sceneInfo = fdkkLaserService.getSceneByNum(num);