ソースを参照

生成obj改造,生成obj不需要依赖ply文件,所以这里不上传了

dsx 2 年 前
コミット
d9355bf73e

+ 2 - 0
src/main/java/com/fdkankan/contro/mq/service/ICommonService.java

@@ -26,4 +26,6 @@ public interface ICommonService {
     public void uploadFloorplanJson(String num, String dataSource) throws Exception;
 
     public void sendEmail(String num);
+
+    String getOssOrignPath(String path);
 }

+ 6 - 28
src/main/java/com/fdkankan/contro/mq/service/impl/BuildObjServiceImpl.java

@@ -158,35 +158,13 @@ public class BuildObjServiceImpl implements IBuildSceneService {
     @Override
     public void downLoadSource(BuildSceneCallMessage message,String path) throws Exception{
 
-        ScenePro scenePro = sceneProService.getByNum(message.getSceneNum());
-        String version = "V4";
-        if(Objects.nonNull(scenePro) && scenePro.getIsUpgrade() != CommonStatus.YES.code().intValue()){
-            version = "V3";
-        }
+        //下载原始资源文件
+        String ossPath = commonService.getOssOrignPath(path);
+        fYunFileService.downloadFileByCommand(path + File.separator + "capture", ossPath);
 
-        if(SceneVersionType.V4.code().equals(version)){
-            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(path + "/caches/images/", ossResultPath + "caches/images/");
-            fYunFileService.downloadFileByCommand( path + "/caches/depthmap_csc/" , ossResultPath + "caches/depthmap_csc/");
-            fYunFileService.downloadFileByCommand( path + "/caches/depthmap_vis/", ossResultPath + "caches/depthmap_vis/");
-            fYunFileService.downloadFileByCommand( path + "/caches/depthmap/", ossResultPath + "caches/depthmap/");
-            fYunFileService.downloadFile(ossResultPath + "caches/panorama.json", path + "/caches/panorama.json");
-            fYunFileService.downloadFile(ossResultPath + "results/laserData/laser.ply", path + "/results/laserData/laser.ply");
-        }else{
-            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);
-        }
+        //下载caches/image,算法会执行快一些
+        String ossResultPath = String.format(UploadFilePath.scene_result_data_path, message.getSceneNum());
+        fYunFileService.downloadFileByCommand(path + "/caches/images/", ossResultPath + "caches/images/");
     }
 
     @Override

+ 16 - 5
src/main/java/com/fdkankan/contro/mq/service/impl/CommonServiceImpl.java

@@ -12,6 +12,7 @@ import com.fdkankan.contro.factory.UserEditData.UserEditDataHandlerFactory;
 import com.fdkankan.contro.mq.service.ICommonService;
 import com.fdkankan.contro.service.*;
 import com.fdkankan.fyun.face.FYunFileServiceInterface;
+import com.fdkankan.model.constants.ConstantFilePath;
 import com.fdkankan.model.constants.UploadFilePath;
 import com.fdkankan.model.utils.FloorPlanUserUtil;
 import com.fdkankan.sms.SendMailAcceUtils;
@@ -126,11 +127,11 @@ public class CommonServiceImpl implements ICommonService {
         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 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)){
@@ -225,4 +226,14 @@ public class CommonServiceImpl implements ICommonService {
             log.error("发送邮件失败,num:" + num, e);
         }
     }
+
+    public String getOssOrignPath(String path) {
+        String ossPath = ConstantFilePath.OSS_PREFIX
+                + path.replace(ConstantFilePath.BUILD_MODEL_PATH, "")
+                .replace(ConstantFilePath.BUILD_MODEL_LASER_PATH, "");
+        if (!ossPath.endsWith("/")) {
+            ossPath = ossPath.concat("/");
+        }
+        return ossPath;
+    }
 }