|
@@ -1293,6 +1293,15 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
//判断全景图缓存是否存在,如果不存在,从计算目录中拷贝到缓存目录
|
|
|
// this.cachePanorama(scenePlusExt.getDataSource(), num);
|
|
|
|
|
|
+ //根据vision.txt获取到有效的全景图名称
|
|
|
+ String ossVisionPath = String.format(UploadFilePath.IMG_VIEW_PATH, num) + "vision.txt";
|
|
|
+ String visionPath = String.format(ConstantFilePath.SCENE_DATA_PATH_V4, num) + "vision.txt";
|
|
|
+ fYunFileService.downloadFile(ossVisionPath, visionPath);
|
|
|
+ List<String> panoramaImageList = SceneUtil.getPanoramaImageList(visionPath);
|
|
|
+ if(CollUtil.isEmpty(panoramaImageList)){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5063);
|
|
|
+ }
|
|
|
+
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
|
//标记是否是异步操作,默认是同步操作
|
|
@@ -1300,7 +1309,10 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
String ossResultPath = String.format(UploadFilePath.scene_result_data_path, num) + "caches/images/";
|
|
|
if(StrUtil.isNotEmpty(fileName)){
|
|
|
//如果是单张图片,直接提供oss url
|
|
|
- if(!fYunFileService.fileExist(bucket, ossResultPath + fileName)){
|
|
|
+// if(!fYunFileService.fileExist(bucket, ossResultPath + fileName)){
|
|
|
+// throw new BusinessException(ErrorCode.FAILURE_CODE_5063);
|
|
|
+// }
|
|
|
+ if(!panoramaImageList.contains(fileName)){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5063);
|
|
|
}
|
|
|
String url = ossUrlPrefix + ossResultPath + fileName;
|
|
@@ -1338,6 +1350,13 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
//下载到本地目录
|
|
|
FileUtil.del(localImagesPath);
|
|
|
fYunFileService.downloadFileByCommand(bucket, localImagesPath, ossResultPath);
|
|
|
+ //移除非必须文件
|
|
|
+ List<String> fileNames = FileUtil.listFileNames(localImagesPath);
|
|
|
+ fileNames.stream().forEach(name->{
|
|
|
+ if(!panoramaImageList.contains(name)){
|
|
|
+ FileUtil.del(localImagesPath + name);
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
String downloadName = num + "_images.zip";
|
|
|
long start = Calendar.getInstance().getTimeInMillis();
|