Pārlūkot izejas kodu

场景计算后处理逻辑优化

dengsixing 2 gadi atpakaļ
vecāks
revīzija
82dd1eddf1

+ 17 - 17
src/main/java/com/fdkankan/contro/service/impl/BuildScenePostServiceImpl.java

@@ -160,20 +160,21 @@ public class BuildScenePostServiceImpl implements IBuildScenePostService {
             fYunFileService.uploadFile(outPathZh, String.format(UploadFilePath.DOWNLOADS_QRCODE, sceneCode) + sceneCode + ".png");
             fYunFileService.uploadFile(outPathEn, String.format(UploadFilePath.DOWNLOADS_QRCODE, sceneCode) + sceneCode + "_en.png");
 
-            Map<String, String> newUploadFiles = this.uploadFileMapHandler(sceneCode, cameraType, uploadFiles);
+//            Map<String, String> newUploadFiles = this.uploadFileMapHandler(sceneCode, cameraType, uploadFiles);
 
             //上传全景图俯视图
-            this.uploadFloorCad(path, sceneCode, newUploadFiles);
+            this.uploadFloorCad(path, sceneCode, uploadFiles);
 
             //上传文件
-            fYunFileService.uploadMulFiles(newUploadFiles);
+            log.info("开始上传场景计算结果数据,num:{}", sceneCode);
+            fYunFileService.uploadMulFiles(uploadFiles);
 
             Map<String,String> damFileHeaders = new HashMap<>();
             damFileHeaders.put("Content-Encoding","gzip");
 
             if (!fYunFileService.getFyunType().equals(FYunTypeEnum.LOCAL.code())) {
                 // dam 文件设置请求头
-                newUploadFiles.entrySet().stream().filter(entry -> FileNameUtil.extName(entry.getKey()).equals("dam"))
+                uploadFiles.entrySet().stream().filter(entry -> FileNameUtil.extName(entry.getKey()).equals("dam"))
                         .forEach(entry -> {
                             // gzip压缩
                             FileUtil.writeBytes(ZipUtil.gzip(new File(entry.getKey())), entry.getKey() + ".gzip");
@@ -182,17 +183,16 @@ public class BuildScenePostServiceImpl implements IBuildScenePostService {
                             fYunFileService.uploadFile(entry.getKey(), entry.getValue(), damFileHeaders);
                         });
             }
-            // TODO: 2022/3/11 同时上传一份到旧版本的目录,用于过渡期使用,待重构版本稳定后删除
-            fYunFileService.uploadMulFiles(uploadFiles);
 
             //拷贝部分文件到编辑目录,用于用户编辑
             this.copyToEditDir(sceneCode);
 
             //生成houseTypejson并上传
-            newUploadFiles.entrySet().stream().filter(entry-> FileNameUtil.getName(entry.getKey()).equals("floorplan_cad.json"))
+            uploadFiles.entrySet().stream().filter(entry-> FileNameUtil.getName(entry.getKey()).equals("floorplan_cad.json"))
                     .forEach(entry-> uploadHouseTypeJson(sceneCode,entry.getKey()));
 
             //写scene.json
+            log.info("生成scene.json上传oss并设置缓存,num:{}", sceneCode);
             this.writeSceneJson(sceneCode, videosJson,sceneEditInfo, sceneEditInfoExt, sceneEditControls, scenePlus,
                     scenePlusExt, arrearCap);
 
@@ -370,16 +370,16 @@ public class BuildScenePostServiceImpl implements IBuildScenePostService {
         }
 
         // TODO: 2022/4/21 plus版本稳定后删除------------------------------------------start
-        String localSceneJsonPath = String.format(ConstantFilePath.SCENE_PATH_FORMAT, num);
-        String localSceneJson = FileUtils.readFile(localSceneJsonPath);
-        if(StrUtil.isNotEmpty(localSceneJson)){
-            JSONObject sceneJsonObject = JSON.parseObject(localSceneJson);
-            sceneJsonObject.put("videos", JSON.toJSONString(videosJson));
-            if(arrearCap) {
-                sceneJsonObject.put("payStatus", PayStatus.NO_CAPACITY.code());
-            }
-            FileUtils.writeFile(localSceneJsonPath, sceneJsonObject.toJSONString());
-        }
+//        String localSceneJsonPath = String.format(ConstantFilePath.SCENE_PATH_FORMAT, num);
+//        String localSceneJson = FileUtils.readFile(localSceneJsonPath);
+//        if(StrUtil.isNotEmpty(localSceneJson)){
+//            JSONObject sceneJsonObject = JSON.parseObject(localSceneJson);
+//            sceneJsonObject.put("videos", JSON.toJSONString(videosJson));
+//            if(arrearCap) {
+//                sceneJsonObject.put("payStatus", PayStatus.NO_CAPACITY.code());
+//            }
+//            FileUtils.writeFile(localSceneJsonPath, sceneJsonObject.toJSONString());
+//        }
         // TODO: 2022/4/21 plus版本稳定后删除------------------------------------------end
 
     }