|
@@ -115,6 +115,9 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
private IInnerService innerService;
|
|
|
@Autowired
|
|
|
LaserService laserService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ShellUtil shellUtil;
|
|
|
|
|
|
@Value("${scene.pro.url}")
|
|
|
private String sceneProUrl;
|
|
@@ -840,10 +843,10 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
private void downloadFromOldNumFromOss(String sceneNum, String newNum) {
|
|
|
- ShellUtil.yunDownload("images/images" + sceneNum + "/", ConstantFilePath.SCENE_PATH + "images/images" + newNum);
|
|
|
- ShellUtil.yunDownload("data/data" + sceneNum + "/", ConstantFilePath.SCENE_PATH + "data/data" + newNum);
|
|
|
- ShellUtil.yunDownload("voice/voice" + sceneNum + "/", ConstantFilePath.SCENE_PATH + "voice/voice" + newNum);
|
|
|
- ShellUtil.yunDownload("video/video" + sceneNum + "/", ConstantFilePath.SCENE_PATH + "video/video" + newNum);
|
|
|
+ shellUtil.yunDownload("images/images" + sceneNum + "/", ConstantFilePath.SCENE_PATH + "images/images" + newNum);
|
|
|
+ shellUtil.yunDownload("data/data" + sceneNum + "/", ConstantFilePath.SCENE_PATH + "data/data" + newNum);
|
|
|
+ shellUtil.yunDownload("voice/voice" + sceneNum + "/", ConstantFilePath.SCENE_PATH + "voice/voice" + newNum);
|
|
|
+ shellUtil.yunDownload("video/video" + sceneNum + "/", ConstantFilePath.SCENE_PATH + "video/video" + newNum);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -861,7 +864,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
|
|
|
public void copyFdage(String oldDataSource,String newDataSource,String buildModelPath,String time) throws Exception {
|
|
|
|
|
|
- ShellUtil.yunDownload(ConstantFilePath.OSS_PREFIX + oldDataSource.replace(buildModelPath, "")+"/", newDataSource);
|
|
|
+ shellUtil.yunDownload(ConstantFilePath.OSS_PREFIX + oldDataSource.replace(buildModelPath, "")+"/", newDataSource);
|
|
|
// 修改data.fdage
|
|
|
String data = FileUtils.readFile(newDataSource + "/data.fdage");
|
|
|
JSONObject jsonObject = JSONObject.parseObject(data);
|
|
@@ -871,22 +874,27 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
}
|
|
|
jsonObject.put("uuidtime",time);
|
|
|
FileUtils.writeFile(newDataSource + "/data.fdage", jsonObject.toJSONString());
|
|
|
- ShellUtil.yunUpload(newDataSource, ConstantFilePath.OSS_PREFIX + newDataSource.replace(buildModelPath, ""));
|
|
|
+ shellUtil.yunUpload(newDataSource, ConstantFilePath.OSS_PREFIX + newDataSource.replace(buildModelPath, ""));
|
|
|
|
|
|
// 复制计算结果
|
|
|
- ShellUtil.yunDownload(ConstantFilePath.OSS_PREFIX + oldDataSource.concat("_results/").replace(buildModelPath, ""), newDataSource.concat("_results"));
|
|
|
+ log.info("开始复制计算结果");
|
|
|
+ shellUtil.yunDownload(ConstantFilePath.OSS_PREFIX + oldDataSource.concat("_results/").replace(buildModelPath, ""), newDataSource.concat("_results"));
|
|
|
if(new File(newDataSource.concat("_results")).exists()){
|
|
|
- ShellUtil.yunUpload(newDataSource.concat("_results"), ConstantFilePath.OSS_PREFIX + newDataSource.concat("_results").replace(buildModelPath, ""));
|
|
|
+ shellUtil.yunUpload(newDataSource.concat("_results"), ConstantFilePath.OSS_PREFIX + newDataSource.concat("_results").replace(buildModelPath, ""));
|
|
|
FileUtils.delAllFile(newDataSource.concat("_results"));
|
|
|
}
|
|
|
+ log.info("开始删除本地资源");
|
|
|
FileUtils.delAllFile(newDataSource);
|
|
|
|
|
|
try {
|
|
|
+ log.info("开始复制本地资源");
|
|
|
FileUtils.copyFolderAllFiles(oldDataSource+"/",newDataSource+"/", true);
|
|
|
}catch (Exception e){
|
|
|
log.error("dataSource复制失败,{}不存在",oldDataSource);
|
|
|
}
|
|
|
|
|
|
+ log.info("copy Fdage finished");
|
|
|
+
|
|
|
}
|
|
|
@Override
|
|
|
public String setDataSource(String preDataSource,String time) throws Exception {
|
|
@@ -927,10 +935,10 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
* @param newNum
|
|
|
*/
|
|
|
private void uploadNewSceneToOss(String newNum) {
|
|
|
- ShellUtil.yunUpload("/mnt/4Dkankan/scene/images/images" + newNum, "images/images" + newNum);
|
|
|
- ShellUtil.yunUpload("/mnt/4Dkankan/scene/data/data" + newNum, "data/data" + newNum);
|
|
|
- ShellUtil.yunUpload("/mnt/4Dkankan/scene/voice/voice" + newNum, "voice/voice" + newNum);
|
|
|
- ShellUtil.yunUpload("/mnt/4Dkankan/scene/video/video" + newNum, "video/video" + newNum);
|
|
|
+ shellUtil.yunUpload("/mnt/4Dkankan/scene/images/images" + newNum, "images/images" + newNum);
|
|
|
+ shellUtil.yunUpload("/mnt/4Dkankan/scene/data/data" + newNum, "data/data" + newNum);
|
|
|
+ shellUtil.yunUpload("/mnt/4Dkankan/scene/voice/voice" + newNum, "voice/voice" + newNum);
|
|
|
+ shellUtil.yunUpload("/mnt/4Dkankan/scene/video/video" + newNum, "video/video" + newNum);
|
|
|
}
|
|
|
|
|
|
@Override
|