|
@@ -93,6 +93,8 @@ public class SceneUpgradeToV4Service implements ISceneUpgradeToV4Service {
|
|
|
private String fkankanMiniHost;
|
|
|
@Value("${http.api-v4.upgradeToV4ResultSync}")
|
|
|
private String URL_UPGRADE_TO_V4_RESULT_SYNC;
|
|
|
+ @Value("${repair.caches-images:yes}")
|
|
|
+ private String copyCachesImages;
|
|
|
|
|
|
|
|
|
@Autowired
|
|
@@ -289,21 +291,27 @@ public class SceneUpgradeToV4Service implements ISceneUpgradeToV4Service {
|
|
|
|
|
|
|
|
|
//将全景图缓存到缓存目录
|
|
|
- List<String> imagesList = cn.hutool.core.io.FileUtil.listFileNames(path + "/caches/images");
|
|
|
- String cachedImagesPath = String.format(ConstantFilePath.SCENE_CACHE_IMAGES, num);
|
|
|
- //先清除旧的全景图
|
|
|
- cn.hutool.core.io.FileUtil.del(cachedImagesPath);
|
|
|
- String visionPath = path + "/results/vision.txt";
|
|
|
- List<String> panoramaImageList = SceneUtil.getPanoramaImageList(visionPath);
|
|
|
- imagesList.stream().forEach(fileName -> {
|
|
|
- if(panoramaImageList.contains(fileName)){
|
|
|
- String srcPath = path + "/caches/images/" + fileName;
|
|
|
- String targetPath = cachedImagesPath + fileName;
|
|
|
- log.info("源文件:{}, 目标文件:{}", srcPath, targetPath);
|
|
|
- cn.hutool.core.io.FileUtil.copy(srcPath, targetPath, true);
|
|
|
+ try {
|
|
|
+ List<String> imagesList = cn.hutool.core.io.FileUtil.listFileNames(path + "/caches/images");
|
|
|
+ String cachedImagesPath = String.format(ConstantFilePath.SCENE_CACHE_IMAGES, num);
|
|
|
+ //先清除旧的全景图
|
|
|
+ cn.hutool.core.io.FileUtil.del(cachedImagesPath);
|
|
|
+ String visionPath = path + "/results/vision.txt";
|
|
|
+ List<String> panoramaImageList = SceneUtil.getPanoramaImageList(visionPath);
|
|
|
+ imagesList.stream().forEach(fileName -> {
|
|
|
+ if(panoramaImageList.contains(fileName)){
|
|
|
+ String srcPath = path + "/caches/images/" + fileName;
|
|
|
+ String targetPath = cachedImagesPath + fileName;
|
|
|
+ log.info("源文件:{}, 目标文件:{}", srcPath, targetPath);
|
|
|
+ cn.hutool.core.io.FileUtil.copy(srcPath, targetPath, true);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error("拷贝全景图失败,num="+num, e);
|
|
|
+ if("yes".equals(copyCachesImages)){
|
|
|
+ throw e;
|
|
|
}
|
|
|
- });
|
|
|
-
|
|
|
+ }
|
|
|
// if(CollUtil.isNotEmpty(imagesList)){
|
|
|
// imagesList.stream().forEach(str -> {
|
|
|
// String filePath = str.substring(str.lastIndexOf(File.separator) + 1);
|