|
@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
import com.gis.common.proto.util.ConvertUtils;
|
|
import com.gis.common.proto.util.ConvertUtils;
|
|
|
|
+import com.gis.common.util.DateUtils;
|
|
import com.gis.common.util.FileUtils;
|
|
import com.gis.common.util.FileUtils;
|
|
import com.gis.common.util.QiniuOssUtil;
|
|
import com.gis.common.util.QiniuOssUtil;
|
|
import com.gis.common.util.Result;
|
|
import com.gis.common.util.Result;
|
|
@@ -267,7 +268,6 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
|
|
|
|
model.put("summary", infoJson.get("summary"));
|
|
model.put("summary", infoJson.get("summary"));
|
|
|
|
|
|
-// model.put("camera_start", infoJson.getJSONObject("camera_start"));
|
|
|
|
|
|
|
|
if (guidesArray != null) {
|
|
if (guidesArray != null) {
|
|
model.put("images", guidesArray);
|
|
model.put("images", guidesArray);
|
|
@@ -275,8 +275,6 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
model.put("images", new JSONArray());
|
|
model.put("images", new JSONArray());
|
|
}
|
|
}
|
|
|
|
|
|
- // camera_start放到最外层
|
|
|
|
-// someDataJson.put("camera_start", infoJson.getJSONObject("camera_start"));
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// 更新someDataJson
|
|
// 更新someDataJson
|
|
@@ -295,7 +293,8 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
// 写入新someDataJson
|
|
// 写入新someDataJson
|
|
FileUtil.writeUtf8String(someDataJson.toJSONString(), someDataPath);
|
|
FileUtil.writeUtf8String(someDataJson.toJSONString(), someDataPath);
|
|
// 2021-9-23 备份someData.json
|
|
// 2021-9-23 备份someData.json
|
|
- FileUtil.writeUtf8String(someDataJson.toJSONString(), entity.getPath() + "/someData_"+ System.currentTimeMillis() +".json");
|
|
|
|
|
|
+ String dateTime = DateUtils.getDateTime();
|
|
|
|
+ FileUtil.writeUtf8String(someDataJson.toJSONString(), entity.getPath() + "/someData_"+ dateTime +".json");
|
|
|
|
|
|
log.info("someData.json写入完成");
|
|
log.info("someData.json写入完成");
|
|
|
|
|
|
@@ -324,8 +323,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
|
|
|
|
String data2 = FileUtil.readUtf8String(data2Path);
|
|
String data2 = FileUtil.readUtf8String(data2Path);
|
|
JSONObject data2Json = JSONObject.parseObject(data2);
|
|
JSONObject data2Json = JSONObject.parseObject(data2);
|
|
-
|
|
|
|
-// log.info("old data2Json: " + data2Json.toJSONString());
|
|
|
|
|
|
+
|
|
|
|
|
|
String tourAudio = param.getTourAudio();
|
|
String tourAudio = param.getTourAudio();
|
|
if (tourAudio != null) {
|
|
if (tourAudio != null) {
|
|
@@ -361,19 +359,15 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
return Result.failure("guides.metadata.scan_id为空: " + i);
|
|
return Result.failure("guides.metadata.scan_id为空: " + i);
|
|
}
|
|
}
|
|
// Fastjson-fastjson中$ref对象重复引用问题,拿不到想要的效果
|
|
// Fastjson-fastjson中$ref对象重复引用问题,拿不到想要的效果
|
|
-// JSONObject timeJson = new JSONObject();
|
|
|
|
-// timeJson.put("time", 40000);
|
|
|
|
audioJson.put(scanId, JSON.toJSONString(timeJson, SerializerFeature.DisableCircularReferenceDetect));
|
|
audioJson.put(scanId, JSON.toJSONString(timeJson, SerializerFeature.DisableCircularReferenceDetect));
|
|
|
|
|
|
}
|
|
}
|
|
-// log.info("audioJson: " + i + ":" + audioJson.toJSONString());
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// 新增audio
|
|
// 新增audio
|
|
data2Json.put("audio", audioJson);
|
|
data2Json.put("audio", audioJson);
|
|
}
|
|
}
|
|
|
|
|
|
-// log.info("new datajs: " + data2Json.toJSONString());
|
|
|
|
|
|
|
|
// host在data2.js、data.js都需要处理
|
|
// host在data2.js、data.js都需要处理
|
|
String hots = param.getHots();
|
|
String hots = param.getHots();
|
|
@@ -400,7 +394,8 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
FileUtil.writeUtf8String(data2Json.toJSONString(), data2Path);
|
|
FileUtil.writeUtf8String(data2Json.toJSONString(), data2Path);
|
|
|
|
|
|
// 2021-09-23 备份data2.js
|
|
// 2021-09-23 备份data2.js
|
|
- FileUtil.writeUtf8String(data2Json.toJSONString(), entity.getPath() + File.separator + "data2_" + System.currentTimeMillis() + ".js");
|
|
|
|
|
|
+ String dateTime = DateUtils.getDateTime();
|
|
|
|
+ FileUtil.writeUtf8String(data2Json.toJSONString(), entity.getPath() + File.separator + "data2_" + dateTime + ".js");
|
|
|
|
|
|
|
|
|
|
log.info("新data2.js写入完成");
|
|
log.info("新data2.js写入完成");
|
|
@@ -515,7 +510,8 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
// log.info("data.js {}", dataJsJson);
|
|
// log.info("data.js {}", dataJsJson);
|
|
|
|
|
|
// 2021-09-23 备份数据用
|
|
// 2021-09-23 备份数据用
|
|
- FileUtil.writeUtf8String(dataJsJson.toJSONString(), entity.getPath() + "/data_"+ System.currentTimeMillis() + ".js");
|
|
|
|
|
|
+ String dateTime = DateUtils.getDateTime();
|
|
|
|
+ FileUtil.writeUtf8String(dataJsJson.toJSONString(), entity.getPath() + "/data_"+ dateTime + ".js");
|
|
|
|
|
|
|
|
|
|
//上传oss
|
|
//上传oss
|