Prechádzať zdrojové kódy

上传深时场景生成obj的必要文件

dsx 2 rokov pred
rodič
commit
21d5822996

+ 22 - 11
src/main/java/com/fdkankan/contro/mq/service/impl/BuildObjServiceImpl.java

@@ -136,17 +136,28 @@ public class BuildObjServiceImpl implements IBuildSceneService {
     @Override
     public void downLoadSource(BuildSceneCallMessage message,String path) throws Exception{
 
-        String prevoisPath = message.getBuildContext().get("previousPath").toString();
-        FileUtils.copyFile(prevoisPath + "/caches/reconstruction/final.bin", path + "/caches/reconstruction/final.bin", true);
-        FileUtils.copyFile(prevoisPath + "/caches/reconstruction/chunk.json", path + "/caches/reconstruction/chunk.json", true);
-        FileUtils.copyFile(prevoisPath + "/caches/floor_group_fix.json", path + "/caches/floor_group_fix.json", true);
-        FileUtils.copyDirectiory(prevoisPath + "/caches/images", path + "/caches/images");
-
-        FileUtils.copyDirectiory(prevoisPath + "/caches/depthmap_csc", path + "/caches/depthmap_csc");
-        FileUtils.copyDirectiory(prevoisPath + "/caches/depthmap_vis", path + "/caches/depthmap_vis");
-        FileUtils.copyDirectiory(prevoisPath + "/caches/depthmap", path + "/caches/depthmap");
-        FileUtils.copyFile(prevoisPath + "/caches/panorama.json", path + "/caches/panorama.json", true);
-        FileUtils.copyFile(prevoisPath + "/results/laserData/laser.ply", path + "/results/laserData/laser.ply", true);
+        String ossResultPath = String.format(UploadFilePath.scene_result_data_path, message.getSceneNum());
+        fYunFileService.downloadFile(ossResultPath + "caches/reconstruction/final.bin", path + "/caches/reconstruction/final.bin");
+        fYunFileService.downloadFile(ossResultPath + "caches/reconstruction/chunk.json", path + "/caches/reconstruction/chunk.json");
+        fYunFileService.downloadFile(ossResultPath + "caches/floor_group_fix.json", path + "/caches/floor_group_fix.json");
+        fYunFileService.downloadFileByCommand(ossResultPath + "caches/images/", path + "/caches/images");
+        fYunFileService.downloadFileByCommand(ossResultPath + "caches/depthmap_csc/", path + "/caches/depthmap_csc");
+        fYunFileService.downloadFileByCommand(ossResultPath + "caches/depthmap_vis/", path + "/caches/depthmap_vis");
+        fYunFileService.downloadFileByCommand(ossResultPath + "caches/depthmap/", path + "/caches/depthmap");
+        fYunFileService.downloadFile(ossResultPath + "caches/panorama.json", path + "/caches/panorama.json");
+        fYunFileService.downloadFile(ossResultPath + "results/laserData/laser.ply", path + "/results/laserData/laser.ply");
+
+//        String prevoisPath = message.getBuildContext().get("previousPath").toString();
+//        FileUtils.copyFile(prevoisPath + "/caches/reconstruction/final.bin", path + "/caches/reconstruction/final.bin", true);
+//        FileUtils.copyFile(prevoisPath + "/caches/reconstruction/chunk.json", path + "/caches/reconstruction/chunk.json", true);
+//        FileUtils.copyFile(prevoisPath + "/caches/floor_group_fix.json", path + "/caches/floor_group_fix.json", true);
+//        FileUtils.copyDirectiory(prevoisPath + "/caches/images", path + "/caches/images");
+//
+//        FileUtils.copyDirectiory(prevoisPath + "/caches/depthmap_csc", path + "/caches/depthmap_csc");
+//        FileUtils.copyDirectiory(prevoisPath + "/caches/depthmap_vis", path + "/caches/depthmap_vis");
+//        FileUtils.copyDirectiory(prevoisPath + "/caches/depthmap", path + "/caches/depthmap");
+//        FileUtils.copyFile(prevoisPath + "/caches/panorama.json", path + "/caches/panorama.json", true);
+//        FileUtils.copyFile(prevoisPath + "/results/laserData/laser.ply", path + "/results/laserData/laser.ply", true);
     }
 
     @Override

+ 54 - 15
src/main/java/com/fdkankan/contro/mq/service/impl/CommonServiceImpl.java

@@ -36,22 +36,23 @@ public class CommonServiceImpl implements ICommonService {
         String localCachesImagePath = dataSource + "/caches/images/";
         String ossCachesImagePath = ossResultPath + "caches/images/";
         //先清除旧的全景图
-        fYunFileServiceInterface.deleteFolder(ossCachesImagePath);
+//        fYunFileServiceInterface.deleteFolder(ossCachesImagePath);
         if(FileUtil.exist(localCachesImagePath)){
-            List<String> imagesList = FileUtil.listFileNames(localCachesImagePath);
-            if(CollUtil.isNotEmpty(imagesList)){
-                String ossVisionPath = String.format(UploadFilePath.IMG_VIEW_PATH, num) + "vision.txt";
-                String visionPath = String.format(ConstantFilePath.SCENE_DATA_PATH_V4, num) + "vision.txt";
-                fYunFileServiceInterface.downloadFile(ossVisionPath, visionPath);
-                List<String> panoramaImageList = SceneUtil.getPanoramaImageList(visionPath);
-                imagesList.stream().forEach(fileName -> {
-                    if (panoramaImageList.contains(fileName)) {
-                        String srcPath = localCachesImagePath + fileName;
-                        String ossPath = ossCachesImagePath + fileName;
-                        uploadMap.put(srcPath, ossPath);
-                    }
-                });
-            }
+            fYunFileServiceInterface.uploadFileByCommand(localCachesImagePath, ossCachesImagePath);
+//            List<String> imagesList = FileUtil.listFileNames(localCachesImagePath);
+//            if(CollUtil.isNotEmpty(imagesList)){
+//                String ossVisionPath = String.format(UploadFilePath.IMG_VIEW_PATH, num) + "vision.txt";
+//                String visionPath = String.format(ConstantFilePath.SCENE_DATA_PATH_V4, num) + "vision.txt";
+//                fYunFileServiceInterface.downloadFile(ossVisionPath, visionPath);
+//                List<String> panoramaImageList = SceneUtil.getPanoramaImageList(visionPath);
+//                imagesList.stream().forEach(fileName -> {
+//                    if (panoramaImageList.contains(fileName)) {
+//                        String srcPath = localCachesImagePath + fileName;
+//                        String ossPath = ossCachesImagePath + fileName;
+//                        uploadMap.put(srcPath, ossPath);
+//                    }
+//                });
+//            }
         }
 
         //上传project.json
@@ -85,6 +86,44 @@ public class CommonServiceImpl implements ICommonService {
             });
         }
 
+        //上传深时场景生成obj需要的文件
+        String localReconstruction = dataSource + "/caches/reconstruction/";
+        String ossReconstruction = ossResultPath + "caches/reconstruction/";
+        if(FileUtil.exist(localReconstruction)){
+            fYunFileServiceInterface.uploadFileByCommand(localReconstruction, ossReconstruction);
+        }
+        String localDepthmap = dataSource + "/caches/depthmap/";
+        String ossDepthmap = ossResultPath + "caches/depthmap/";
+        if(FileUtil.exist(localDepthmap)){
+            fYunFileServiceInterface.uploadFileByCommand(localDepthmap, ossDepthmap);
+        }
+        String localDepthmapAsc = dataSource + "/caches/depthmap_csc/";
+        String ossDepthmapAsc = ossResultPath + "caches/depthmap_csc/";
+        if(FileUtil.exist(localDepthmap)){
+            fYunFileServiceInterface.uploadFileByCommand(localDepthmapAsc, ossDepthmapAsc);
+        }
+        String localPanoramaJson =  dataSource + "/caches/panorama.json";
+        String ossPanoramaJson =  ossResultPath + "caches/panorama.json";
+        if(FileUtil.exist(localPanoramaJson)){
+            fYunFileServiceInterface.uploadFile(localPanoramaJson, ossPanoramaJson);
+        }
+        String localLaserPly = dataSource + "/results/laserData/laser.ply";
+        String ossLaserPly =  ossResultPath + "results/laserData/laser.ply";
+        if(FileUtil.exist(localLaserPly)){
+            fYunFileServiceInterface.uploadFile(localLaserPly, ossLaserPly);
+        }
+        String localFloorGroupFixJson = dataSource + "/caches/floor_group_fix.json";
+        String ossFloorGroupFixJson = ossResultPath + "caches/floor_group_fix.json";
+        if(FileUtil.exist(localFloorGroupFixJson)){
+            fYunFileServiceInterface.uploadFile(localFloorGroupFixJson, ossFloorGroupFixJson);
+        }
+        String localDepthmapVis = dataSource + "/caches/depthmap_vis";
+        String ossDepthmapVis = ossResultPath + "caches/depthmap_vis";
+        if(FileUtil.exist(localDepthmapVis)){
+            fYunFileServiceInterface.uploadFile(localDepthmapVis, ossDepthmapVis);
+        }
+
+
         //开始上传
         fYunFileServiceInterface.uploadMulFiles(uploadMap);
     }