|
@@ -762,6 +762,8 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
this.save(scenePro);
|
|
|
|
|
|
ExecutorService executor = ThreadUtil.newSingleExecutor();
|
|
|
+ try {
|
|
|
+
|
|
|
|
|
|
CompletableFuture.runAsync(() -> {
|
|
|
|
|
@@ -798,7 +800,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
|
|
|
String sourceData = String.format(SceneResourcePath.dataPath, oldNum);
|
|
|
String targetData = String.format(SceneResourcePath.dataPath, scenePro.getNum());
|
|
|
- this.copyOssAndNas(oldNum,scenePro.getNum(),sourceData,targetData,sceneCommonService);
|
|
|
+ this.copyOssAndNas(oldNum,scenePro.getNum(),sourceData,targetData);
|
|
|
//修改 oss status.json ,nas scene.json
|
|
|
sceneCommonService.updateOssJson(targetData,oldNum,newNum,"status.json");
|
|
|
sceneCommonService.updateOssJson(targetData,oldNum,newNum,"hot.json");
|
|
@@ -807,15 +809,15 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
|
|
|
String sourceImages = String.format(SceneResourcePath.imagesPath, oldNum);
|
|
|
String targetImages = String.format(SceneResourcePath.imagesPath, scenePro.getNum());
|
|
|
- this.copyOssAndNas(oldNum,scenePro.getNum(),sourceImages,targetImages,sceneCommonService);
|
|
|
+ this.copyOssAndNas(oldNum,scenePro.getNum(),sourceImages,targetImages);
|
|
|
|
|
|
String sourceVideo = String.format(SceneResourcePath.videoPath, oldNum);
|
|
|
String targetVideo = String.format(SceneResourcePath.videoPath, scenePro.getNum());
|
|
|
- this.copyOssAndNas(oldNum,scenePro.getNum(),sourceVideo,targetVideo,sceneCommonService);
|
|
|
+ this.copyOssAndNas(oldNum,scenePro.getNum(),sourceVideo,targetVideo);
|
|
|
|
|
|
String sourceVoice = String.format(SceneResourcePath.voicePath, oldNum);
|
|
|
String targetVoice = String.format(SceneResourcePath.voicePath, scenePro.getNum());
|
|
|
- this.copyOssAndNas(oldNum,scenePro.getNum(),sourceVoice,targetVoice,sceneCommonService);
|
|
|
+ this.copyOssAndNas(oldNum,scenePro.getNum(),sourceVoice,targetVoice);
|
|
|
|
|
|
if(scenePro.getSceneSource() == 4){ //深时复制
|
|
|
String laserPath = laserService.copyDataSource(oldDataSource,scenePro.getDataSource());
|
|
@@ -837,15 +839,37 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
}, executor).whenComplete((reslut, e) -> {
|
|
|
log.info("copy-success-");
|
|
|
});
|
|
|
+ }catch ( Exception e){
|
|
|
+ log.error("copyError",e);
|
|
|
+ }
|
|
|
return scenePro.getId();
|
|
|
}
|
|
|
- private void copyOssAndNas(String oldNum ,String newNum ,String sourcePath,String targetPath,SceneCommonService sceneCommonService){
|
|
|
+ private void copyOssAndNas(String oldNum ,String newNum ,String sourcePath,String targetPath){
|
|
|
log.info("sceneCopy-ossSource-oldNum:{},newNum:{},sourcePath:{},targetPath:{}",oldNum,newNum,sourcePath,targetPath);
|
|
|
fYunFileServiceInterface.copyFileInBucket(sourcePath,targetPath);
|
|
|
File fileData = new File(SceneResourcePath.nasBasePath + sourcePath);
|
|
|
if(fileData.exists()){
|
|
|
if(targetPath.contains("images")){
|
|
|
- sceneCommonService.delLink(SceneResourcePath.nasBasePath + sourcePath);
|
|
|
+ log.info("------------------------------------delLink");
|
|
|
+ String panPath = fileData.getPath() +"/panorama";
|
|
|
+ File file = new File(panPath);
|
|
|
+ log.info("delLink--filePath:{}",fileData.getPath());
|
|
|
+ log.info("delLink--filePath:{}",file.exists());
|
|
|
+ if(file.exists()){
|
|
|
+ File[] files = file.listFiles();
|
|
|
+ log.info("delLink--filePath:{}",files);
|
|
|
+ log.info("delLink--filePath:{}",files.length);
|
|
|
+ if(files == null || files.length == 0){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ for (File file1 : files) {
|
|
|
+ log.info("delLink--filePath:{}",file1.getPath());
|
|
|
+ String linkPath =file1.getPath() + "/capture";
|
|
|
+ if(new File(linkPath).exists()){
|
|
|
+ FileUtil.del(file1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
cn.hutool.core.io.FileUtil.copyContent(fileData,new File(SceneResourcePath.nasBasePath + targetPath),true);
|
|
|
}
|