Просмотр исходного кода

上传全景图,更新版本号

dengsixing 3 лет назад
Родитель
Сommit
8ba88956bf

+ 13 - 7
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/SceneEditInfoServiceImpl.java

@@ -722,15 +722,18 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
             throw new BusinessException(ErrorCode.FAILURE_CODE_7015);
             throw new BusinessException(ErrorCode.FAILURE_CODE_7015);
         }
         }
 
 
-        ScenePro scenePro = sceneProService.findBySceneNum(num);
-        if(scenePro == null){
+//        ScenePro scenePro = sceneProService.findBySceneNum(num);
+        ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
+        if(scenePlus == null){
             throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
             throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
         }
         }
-        SceneProExt sceneProExt = sceneProExtService.findBySceneProId(scenePro.getId());
+//        SceneProExt sceneProExt = sceneProExtService.findBySceneProId(scenePro.getId());
+        ScenePlusExt scenePlusExt = scenePlusExtService
+            .getScenePlusExtByPlusId(scenePlus.getId());
 
 
         //原始计算根目录
         //原始计算根目录
 //      String path = "F:\\test";
 //      String path = "F:\\test";
-        String path = sceneProExt.getDataSource();
+        String path = scenePlusExt.getDataSource();
         //全景图计算根目录
         //全景图计算根目录
         String target = path + "_images";
         String target = path + "_images";
         //解压缩文件存放目录
         //解压缩文件存放目录
@@ -776,7 +779,6 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
             return true;
             return true;
         }).collect(Collectors.toList());
         }).collect(Collectors.toList());
 
 
-        //有文件对不上号,就退出
         if(CollUtil.isNotEmpty(notExistFileList)){
         if(CollUtil.isNotEmpty(notExistFileList)){
             //删除错误文件
             //删除错误文件
             notExistFileList.parallelStream().forEach(filePath->{
             notExistFileList.parallelStream().forEach(filePath->{
@@ -816,12 +818,12 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
             dataJson.put("extras", floorplanJson);
             dataJson.put("extras", floorplanJson);
             //V5表示不需要生成high,low文件
             //V5表示不需要生成high,low文件
             dataJson.put("skybox_type", "SKYBOX_V6");
             dataJson.put("skybox_type", "SKYBOX_V6");
-            if(scenePro.getSceneScheme() == 11){
+            if(scenePlusExt.getSceneScheme() == 11){
                 dataJson.put("skybox_type", "SKYBOX_V7");
                 dataJson.put("skybox_type", "SKYBOX_V7");
             }
             }
             dataJson.put("split_type", "SPLIT_V8");
             dataJson.put("split_type", "SPLIT_V8");
             //sceneScheme为3切成瓦片图
             //sceneScheme为3切成瓦片图
-            if(scenePro.getSceneScheme() == 3){
+            if(scenePlusExt.getSceneScheme() == 3){
                 dataJson.put("skybox_type", "SKYBOX_V4");
                 dataJson.put("skybox_type", "SKYBOX_V4");
             }
             }
             FileUtils.writeFile(target + File.separator+"data.json", new String(dataJson.toString().getBytes(), "UTF-8"));
             FileUtils.writeFile(target + File.separator+"data.json", new String(dataJson.toString().getBytes(), "UTF-8"));
@@ -898,6 +900,10 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
             uploadToOssUtil.uploadMulFiles(map);
             uploadToOssUtil.uploadMulFiles(map);
         }
         }
 
 
+        //更新版本号
+        SceneEditInfo sceneEditInfo = this.getByScenePlusId(scenePlus.getId());
+        this.upgradeVersionById(sceneEditInfo.getId());
+
         if(CollUtil.isNotEmpty(notExistFileList)){
         if(CollUtil.isNotEmpty(notExistFileList)){
             notExistFileList = notExistFileList.stream().map(filePath -> {
             notExistFileList = notExistFileList.stream().map(filePath -> {
                 return filePath.substring(filePath.lastIndexOf(File.separator) + 1);
                 return filePath.substring(filePath.lastIndexOf(File.separator) + 1);