|
@@ -987,6 +987,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
String downloadName = null;
|
|
String downloadName = null;
|
|
//删除本地文件
|
|
//删除本地文件
|
|
FileUtils.deleteDirectory(localImagesPath);
|
|
FileUtils.deleteDirectory(localImagesPath);
|
|
|
|
+ long start = Calendar.getInstance().getTimeInMillis();
|
|
//如果入参文件名不为空,则是单个文件下载,不需要打包
|
|
//如果入参文件名不为空,则是单个文件下载,不需要打包
|
|
boolean single = true;
|
|
boolean single = true;
|
|
if(StrUtil.isNotEmpty(fileName)){
|
|
if(StrUtil.isNotEmpty(fileName)){
|
|
@@ -1002,13 +1003,15 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
//先下载到本地
|
|
//先下载到本地
|
|
List<String> keyList = uploadToOssUtil.listKeys(imgCachePath);
|
|
List<String> keyList = uploadToOssUtil.listKeys(imgCachePath);
|
|
if (!StorageType.LOCAL.code().equals(this.type)) {// TODO: 2022/2/15 这里有可能有问题,可能还需要考虑本地部署的情况
|
|
if (!StorageType.LOCAL.code().equals(this.type)) {// TODO: 2022/2/15 这里有可能有问题,可能还需要考虑本地部署的情况
|
|
- keyList.stream().forEach(key->{
|
|
|
|
|
|
+ keyList.parallelStream().forEach(key->{
|
|
String file = key.substring(key.lastIndexOf("/") + 1);
|
|
String file = key.substring(key.lastIndexOf("/") + 1);
|
|
String imageUrl = ossUrlPrefix + imgCachePath + file + "?t=" + System.currentTimeMillis();
|
|
String imageUrl = ossUrlPrefix + imgCachePath + file + "?t=" + System.currentTimeMillis();
|
|
FileUtils.downLoadFromUrl(imageUrl, file, localImagesPath);
|
|
FileUtils.downLoadFromUrl(imageUrl, file, localImagesPath);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ long downloadEnd = Calendar.getInstance().getTimeInMillis();
|
|
|
|
+ log.info("全景图下载耗时,num:{}, time:{}", num, downloadEnd - start);
|
|
|
|
|
|
if(!single){
|
|
if(!single){
|
|
downloadName = num + "_images.zip";
|
|
downloadName = num + "_images.zip";
|
|
@@ -1023,6 +1026,8 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
//删除本地目录
|
|
//删除本地目录
|
|
FileUtils.deleteDirectory(localImagesPath);
|
|
FileUtils.deleteDirectory(localImagesPath);
|
|
}
|
|
}
|
|
|
|
+ long end = Calendar.getInstance().getTimeInMillis();
|
|
|
|
+ log.info("全景图压缩包上传耗时,num:{}, time:{}", num, end - downloadEnd);
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
map.put("fileUrl", url + "?t=" + System.currentTimeMillis());
|
|
map.put("fileUrl", url + "?t=" + System.currentTimeMillis());
|