|
@@ -464,10 +464,10 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
}
|
|
}
|
|
|
|
|
|
public void updateFdageNewDataSource(String oldSnCode,String newSnCode,String dataSource) {
|
|
public void updateFdageNewDataSource(String oldSnCode,String newSnCode,String dataSource) {
|
|
- String localPath = String.format(OssPath.localFdagePath,dataSource);
|
|
|
|
|
|
+ String localPathFdage = null;
|
|
try {
|
|
try {
|
|
- String localPathFdage = String.format(OssPath.localFdagePath,dataSource)+"/data.fdage";
|
|
|
|
String fdagePaht = dataSource.replace("/mnt/data","home") +"/data.fdage";
|
|
String fdagePaht = dataSource.replace("/mnt/data","home") +"/data.fdage";
|
|
|
|
+ localPathFdage = String.format(OssPath.localFdagePath,fdagePaht)+"/data.fdage";
|
|
String fileContent = fYunFileServiceInterface.getFileContent(fdagePaht);
|
|
String fileContent = fYunFileServiceInterface.getFileContent(fdagePaht);
|
|
|
|
|
|
JSONObject jsonObject = updateFdageJson(JSONObject.parseObject(fileContent), newSnCode);
|
|
JSONObject jsonObject = updateFdageJson(JSONObject.parseObject(fileContent), newSnCode);
|
|
@@ -479,6 +479,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
if(!oldFdagePaht.equals(newFdagePath)){
|
|
if(!oldFdagePaht.equals(newFdagePath)){
|
|
log.info("updateFdageCopy--复制oss资源--oldFdagePaht:{},newFdagePath:{}",oldFdagePaht,newFdagePath);
|
|
log.info("updateFdageCopy--复制oss资源--oldFdagePaht:{},newFdagePath:{}",oldFdagePaht,newFdagePath);
|
|
fYunFileServiceInterface.copyFileInBucket(oldFdagePaht,newFdagePath);
|
|
fYunFileServiceInterface.copyFileInBucket(oldFdagePaht,newFdagePath);
|
|
|
|
+ fYunFileServiceInterface.deleteFolder(oldFdagePaht);
|
|
}
|
|
}
|
|
fYunFileServiceInterface.uploadFile(localPathFdage,newFdagePath);
|
|
fYunFileServiceInterface.uploadFile(localPathFdage,newFdagePath);
|
|
log.info("updateFdage--localPathFdage:{},newFdagePath:{}",localPathFdage,newFdagePath);
|
|
log.info("updateFdage--localPathFdage:{},newFdagePath:{}",localPathFdage,newFdagePath);
|
|
@@ -488,13 +489,17 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
log.error("updateFdage-error:oldSnCode:{},newSnCode:{},dataSource:{}",oldSnCode,newSnCode,dataSource);
|
|
log.error("updateFdage-error:oldSnCode:{},newSnCode:{},dataSource:{}",oldSnCode,newSnCode,dataSource);
|
|
log.error("updateFdage-error:",e);
|
|
log.error("updateFdage-error:",e);
|
|
}finally {
|
|
}finally {
|
|
- FileUtil.del(localPath);
|
|
|
|
|
|
+ if(localPathFdage != null){
|
|
|
|
+ FileUtil.del(localPathFdage);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
private void updateDataSource(String dataSource, String newDataSource) {
|
|
private void updateDataSource(String dataSource, String newDataSource) {
|
|
LambdaUpdateWrapper<ScenePro> wrapper = new LambdaUpdateWrapper<>();
|
|
LambdaUpdateWrapper<ScenePro> wrapper = new LambdaUpdateWrapper<>();
|
|
wrapper.eq(ScenePro::getDataSource,dataSource);
|
|
wrapper.eq(ScenePro::getDataSource,dataSource);
|
|
|
|
+ wrapper.eq(ScenePro::getIsUpgrade,0);
|
|
wrapper.set(ScenePro::getDataSource,newDataSource);
|
|
wrapper.set(ScenePro::getDataSource,newDataSource);
|
|
this.update(wrapper);
|
|
this.update(wrapper);
|
|
|
|
|