|
@@ -472,7 +472,11 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
newSnCode = newSnCode.toLowerCase();
|
|
|
String fdagePaht = dataSource.replace("/mnt/data","home") +"/data.fdage";
|
|
|
localPathFdage = String.format(OssPath.localFdagePath,fdagePaht);
|
|
|
- fYunFileServiceInterface.downloadFile(fdagePaht,localPathFdage);
|
|
|
+
|
|
|
+ String fileContent = fYunFileServiceInterface.getFileContent(fdagePaht);
|
|
|
+
|
|
|
+ JSONObject jsonObject = updateFdageJson(JSONObject.parseObject(fileContent), newSnCode);
|
|
|
+ FileUtils.writeFile(localPathFdage ,JSONObject.toJSONString(jsonObject));
|
|
|
|
|
|
String oldFdagePaht = dataSource.replace("/mnt/data","home") ;
|
|
|
String[] split = oldFdagePaht.split("/");
|
|
@@ -482,13 +486,8 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
fYunFileServiceInterface.copyFileInBucket(oldFdagePaht,newFdagePath);
|
|
|
fYunFileServiceInterface.deleteFolder(oldFdagePaht);
|
|
|
}
|
|
|
- fYunFileServiceInterface.uploadFile(localPathFdage,newFdagePath+"/"+oldSnCode.toLowerCase()+"-"+newSnCode+"_"+Dateutils.getDate(new Date())+".data.fdage");
|
|
|
-
|
|
|
- String fileContent = FileUtils.readFile(localPathFdage);
|
|
|
- JSONObject jsonObject = updateFdageJson(JSONObject.parseObject(fileContent), newSnCode);
|
|
|
- FileUtils.writeFile(localPathFdage+".new" ,JSONObject.toJSONString(jsonObject));
|
|
|
- fYunFileServiceInterface.uploadFile(localPathFdage+".new",newFdagePath+"/data.fdage");
|
|
|
-
|
|
|
+ fYunFileServiceInterface.copyFileInBucket(newFdagePath+"/data.fdage",newFdagePath+"/"+oldSnCode.toLowerCase()+"-"+newSnCode+"_"+Dateutils.getDate(new Date())+".data.fdage");
|
|
|
+ fYunFileServiceInterface.uploadFile(localPathFdage,newFdagePath+"/data.fdage");
|
|
|
log.info("updateFdage--localPathFdage:{},newFdagePath:{}",localPathFdage,newFdagePath);
|
|
|
String newDataSource = newFdagePath.replace("home","/mnt/data");
|
|
|
this.updateDataSource(scenePro,scenePlus,newDataSource);
|
|
@@ -498,7 +497,6 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
}finally {
|
|
|
if(localPathFdage != null){
|
|
|
FileUtil.del(localPathFdage);
|
|
|
- FileUtil.del(localPathFdage+".new");
|
|
|
}
|
|
|
}
|
|
|
}
|