|
@@ -32,6 +32,8 @@ public class SceneCommonService {
|
|
|
FYunFileServiceInterface fYunFileServiceInterface;
|
|
|
@Autowired
|
|
|
IScene3dNumService scene3dNumService;
|
|
|
+ @Autowired
|
|
|
+ com.fdkankan.ucenter.util.FileUtil fileUtil;
|
|
|
|
|
|
public String getNewNum(String oldNum ){
|
|
|
String newNum = scene3dNumService.generateSceneNum(1);
|
|
@@ -141,11 +143,11 @@ public class SceneCommonService {
|
|
|
if(fileName.contains("scene.json")){
|
|
|
JSONObject jsonObject = JSONObject.parseObject(newJson);
|
|
|
jsonObject.put("sceneName",newSceneName);
|
|
|
- com.fdkankan.ucenter.util.FileUtil.writeFile(localPath,jsonObject.toJSONString());
|
|
|
+ fileUtil.writeFile(localPath,jsonObject.toJSONString());
|
|
|
String sceneJsonPath = String.format(SceneResourcePath.dataPath+"/"+fileName, newNum);
|
|
|
fYunFileServiceInterface.uploadFile(localPath, sceneJsonPath);
|
|
|
}else {
|
|
|
- com.fdkankan.ucenter.util.FileUtil.writeFile(localPath,newJson);
|
|
|
+ fileUtil.writeFile(localPath,newJson);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -153,7 +155,7 @@ public class SceneCommonService {
|
|
|
if("v4".equals(sceneVersion)){
|
|
|
JSONObject jsonObject = JSONObject.parseObject(newJson);
|
|
|
jsonObject.put("title",newSceneName);
|
|
|
- com.fdkankan.ucenter.util.FileUtil.writeFile(localPath,jsonObject.toJSONString());
|
|
|
+ fileUtil.writeFile(localPath,jsonObject.toJSONString());
|
|
|
|
|
|
String sceneJsonPath = String.format(SceneResourcePath.DATA_VIEW_PATH+"/" + fileName, newNum);
|
|
|
fYunFileServiceInterface.uploadFile(localPath, sceneJsonPath);
|
|
@@ -194,7 +196,7 @@ public class SceneCommonService {
|
|
|
if(StringUtils.isNotBlank(fileContent)){
|
|
|
String newJson = fileContent.replaceAll(oldNum,newNum);
|
|
|
try {
|
|
|
- com.fdkankan.ucenter.util.FileUtil.writeFile(localPath,newJson);
|
|
|
+ fileUtil.writeFile(localPath,newJson);
|
|
|
fYunFileServiceInterface.uploadFile(localPath,ossStatusJsonPath);
|
|
|
}catch (Exception e){
|
|
|
log.error("writeFile-error:{}",e);
|