|
@@ -108,7 +108,7 @@ public class SceneCommonService {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- public void updateNasSceneJson(String targetPath, String oldNum, String newNum,String oldSceneName,String newSceneName,String sceneVersion) {
|
|
|
|
|
|
+ public void updateNasSceneJson(String targetPath, String oldNum, String newNum,String newSceneName,String sceneVersion) {
|
|
String fileContent = null;
|
|
String fileContent = null;
|
|
if("v3".equals(sceneVersion)){
|
|
if("v3".equals(sceneVersion)){
|
|
String localPath = SceneResourcePath.nasBasePath + targetPath + "/" + "scene.json";
|
|
String localPath = SceneResourcePath.nasBasePath + targetPath + "/" + "scene.json";
|
|
@@ -136,14 +136,19 @@ public class SceneCommonService {
|
|
file.getParentFile().mkdirs();
|
|
file.getParentFile().mkdirs();
|
|
}
|
|
}
|
|
String newJson = fileContent.replaceAll(oldNum,newNum);
|
|
String newJson = fileContent.replaceAll(oldNum,newNum);
|
|
- newJson = newJson.replace(oldSceneName,newSceneName);
|
|
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(newJson);
|
|
try {
|
|
try {
|
|
- com.fdkankan.ucenter.util.FileUtil.writeFile(localPath,newJson);
|
|
|
|
if("v3".equals(sceneVersion)){
|
|
if("v3".equals(sceneVersion)){
|
|
|
|
+ jsonObject.put("sceneName",newSceneName);
|
|
|
|
+ com.fdkankan.ucenter.util.FileUtil.writeFile(localPath,jsonObject.toJSONString());
|
|
|
|
+
|
|
String sceneJsonPath = String.format(SceneResourcePath.dataPath+"/scene.json", newNum);
|
|
String sceneJsonPath = String.format(SceneResourcePath.dataPath+"/scene.json", newNum);
|
|
fYunFileServiceInterface.uploadFile(localPath, sceneJsonPath);
|
|
fYunFileServiceInterface.uploadFile(localPath, sceneJsonPath);
|
|
}
|
|
}
|
|
if("v4".equals(sceneVersion)){
|
|
if("v4".equals(sceneVersion)){
|
|
|
|
+ jsonObject.put("title",newSceneName);
|
|
|
|
+ com.fdkankan.ucenter.util.FileUtil.writeFile(localPath,jsonObject.toJSONString());
|
|
|
|
+
|
|
String sceneJsonPath = String.format(SceneResourcePath.DATA_VIEW_PATH+"/scene.json", newNum);
|
|
String sceneJsonPath = String.format(SceneResourcePath.DATA_VIEW_PATH+"/scene.json", newNum);
|
|
fYunFileServiceInterface.uploadFile(localPath, sceneJsonPath);
|
|
fYunFileServiceInterface.uploadFile(localPath, sceneJsonPath);
|
|
|
|
|