Przeglądaj źródła

Merge branch 'feature-v4.10.0-20230714-dsx' into test

dsx 2 lat temu
rodzic
commit
b9ee0a983f

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

@@ -286,12 +286,12 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
             bizs.add(UserEditDataType.FLOORPLAN.message());
             commonService.initUserEditData(sceneCode, bizs, null);
 
-            //计算场景消耗磁盘空间
-            long space = this.calUseSpace(uploadFiles);
-
             //上传计算结果文件
-            Long cacheSize = commonService.uploadBuildResultData(sceneCode, path, SceneVersionType.V4.code());
-            space += cacheSize;
+            commonService.uploadBuildResultData(sceneCode, path, SceneVersionType.V4.code());
+
+            Long space = fYunFileService.getSpace(fYunFileConfig.getBucket(), String.format(UploadFilePath.VIEW_PATH, sceneCode));
+            space += fYunFileService.getSpace(fYunFileConfig.getBucket(), String.format(UploadFilePath.scene_result_data_path, sceneCode).concat("caches"));
+
 
             //写入数据库
             this.updateDbPlus(scenePlus.getSceneSource(), space, videosJson.toJSONString(), message.getComputeTime(),isObj,scenePlusExt);

+ 1 - 1
src/main/java/com/fdkankan/contro/service/ICommonService.java

@@ -14,7 +14,7 @@ public interface ICommonService {
      * @param dataSource
      * @param version
      */
-    public Long uploadBuildResultData(String num, String dataSource, String version);
+    public void uploadBuildResultData(String num, String dataSource, String version);
 
     /**
      * 删除用户编辑数据业务方法

+ 1 - 13
src/main/java/com/fdkankan/contro/service/impl/CommonServiceImpl.java

@@ -78,9 +78,7 @@ public class CommonServiceImpl implements ICommonService {
     private ICameraService cameraService;
 
     @Override
-    public Long uploadBuildResultData(String num, String dataSource, String version) {
-
-        Long cacheSize = 0L;
+    public void uploadBuildResultData(String num, String dataSource, String version) {
 
         Map<String, String> uploadMap = new HashMap<>();
 
@@ -94,7 +92,6 @@ public class CommonServiceImpl implements ICommonService {
         String ossCachesImagePath = ossResultPath + "caches/images/";
         //先清除旧的全景图
         if(FileUtil.exist(localCachesImagePath)){
-            cacheSize += FileUtil.size(new File(localCachesImagePath));
             fYunFileServiceInterface.uploadFileByCommand(localCachesImagePath, ossCachesImagePath);
         }
 
@@ -133,25 +130,21 @@ public class CommonServiceImpl implements ICommonService {
         String localReconstruction = dataSource + "/caches/reconstruction/";
         String ossReconstruction = ossResultPath + "caches/reconstruction/";
         if(FileUtil.exist(localReconstruction)){
-            cacheSize += FileUtil.size(new File(localReconstruction));
             fYunFileServiceInterface.uploadFileByCommand(localReconstruction, ossReconstruction);
         }
         String localDepthmap = dataSource + "/caches/depthmap/";
         String ossDepthmap = ossResultPath + "caches/depthmap/";
         if(FileUtil.exist(localDepthmap)){
-            cacheSize += FileUtil.size(new File(localDepthmap));
             fYunFileServiceInterface.uploadFileByCommand(localDepthmap, ossDepthmap);
         }
         String localDepthmapAsc = dataSource + "/caches/depthmap_csc/";
         String ossDepthmapAsc = ossResultPath + "caches/depthmap_csc/";
         if(FileUtil.exist(localDepthmapAsc)){
-            cacheSize += FileUtil.size(new File(localDepthmapAsc));
             fYunFileServiceInterface.uploadFileByCommand(localDepthmapAsc, ossDepthmapAsc);
         }
         String localPanoramaJson =  dataSource + "/caches/panorama.json";
         String ossPanoramaJson =  ossResultPath + "caches/panorama.json";
         if(FileUtil.exist(localPanoramaJson)){
-            cacheSize += FileUtil.size(new File(localPanoramaJson));
             fYunFileServiceInterface.uploadFile(localPanoramaJson, ossPanoramaJson);
         }
 //        String localLaserPly = dataSource + "/results/laserData/laser.ply";
@@ -162,28 +155,23 @@ public class CommonServiceImpl implements ICommonService {
         String localFloorGroupFixJson = dataSource + "/caches/floor_group_fix.json";
         String ossFloorGroupFixJson = ossResultPath + "caches/floor_group_fix.json";
         if(FileUtil.exist(localFloorGroupFixJson)){
-            cacheSize += FileUtil.size(new File(localFloorGroupFixJson));
             fYunFileServiceInterface.uploadFile(localFloorGroupFixJson, ossFloorGroupFixJson);
         }
 
         String localDepthmapVis = dataSource + "/caches/depthmap_vis";
         String ossDepthmapVis = ossResultPath + "caches/depthmap_vis";
         if(FileUtil.exist(localDepthmapVis)){
-            cacheSize += FileUtil.size(new File(localDepthmapVis));
             fYunFileServiceInterface.uploadFileByCommand(localDepthmapVis, ossDepthmapVis);
         }
 
         String localIntensity = dataSource + "/caches/intensity";
         String ossIntensity = ossResultPath + "caches/intensity";
         if(FileUtil.exist(localIntensity)){
-            cacheSize += FileUtil.size(new File(localIntensity));
             fYunFileServiceInterface.uploadFileByCommand(localIntensity, ossIntensity);
         }
 
         //开始上传
         fYunFileServiceInterface.uploadMulFiles(uploadMap);
-
-        return cacheSize;
     }
 
     @Override