|
@@ -175,7 +175,8 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
|
return Result.failure("场景不存在");
|
|
|
}
|
|
|
|
|
|
- String basePath = entity.getPath() + "/edit/";
|
|
|
+// String basePath = entity.getPath() + "/edit/";
|
|
|
+ String basePath = FILE_PATH + sceneCode+ "/edit/";
|
|
|
// 时间戳重新命名
|
|
|
HashMap<String, String> map = null;
|
|
|
try {
|
|
@@ -256,7 +257,8 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
|
log.info("网络下载文件地址: {}", someDataUrl);
|
|
|
String localBasePath = FILE_PATH + sceneCode;
|
|
|
FileUtils.downLoadFromUrl(someDataUrl, someDataName, localBasePath);
|
|
|
- String someDataPath = entity.getPath() + "/someData.json";
|
|
|
+// String someDataPath = entity.getPath() + "/someData.json";
|
|
|
+ String someDataPath = localBasePath + "/someData.json";
|
|
|
|
|
|
BaseRuntimeException.isTrue(!FileUtil.isFile(someDataPath), null, "服务器someData.json文件不存在");
|
|
|
|
|
@@ -318,7 +320,8 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
|
FileUtil.writeUtf8String(someDataJson.toJSONString(), someDataPath);
|
|
|
// 2021-9-23 备份someData.json
|
|
|
String dateTime = DateUtils.getDateTime();
|
|
|
- FileUtil.writeUtf8String(someDataJson.toJSONString(), entity.getPath() + "/someData_" + dateTime + ".json");
|
|
|
+// FileUtil.writeUtf8String(someDataJson.toJSONString(), entity.getPath() + "/someData_" + dateTime + ".json");
|
|
|
+ FileUtil.writeUtf8String(someDataJson.toJSONString(), FILE_PATH + sceneCode + "/someData_" + dateTime + ".json");
|
|
|
|
|
|
BaseRuntimeException.isTrue(!FileUtil.isFile(someDataPath), null, "上传七牛云的someData文件不存在");
|
|
|
long someDataSize = FileUtil.size(new File(someDataPath));
|