|
@@ -295,6 +295,9 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
//发布摄像头数据
|
|
|
this.publicSurveillance(num, sceneEditInfoExt.getSurveillances());
|
|
|
|
|
|
+ //发布空间模型
|
|
|
+ this.publicBoxModel(num, sceneEditInfo);
|
|
|
+
|
|
|
//本地写sceneJson文件
|
|
|
String localSceneJsonPath = String.format(ConstantFilePath.SCENE_DATA_PATH_V4, num) + "scene.json";
|
|
|
FileUtils.writeFile(localSceneJsonPath, JSON.toJSONString(sceneJson));
|
|
@@ -343,6 +346,29 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|
|
|
+ private void publicBoxModel(String num, SceneEditInfo sceneEditInfo){
|
|
|
+ String boxModels = sceneEditInfo.getBoxModels();
|
|
|
+ if(StrUtil.isEmpty(boxModels)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ JSONArray jsonArray = JSON.parseArray(boxModels);
|
|
|
+ if(CollUtil.isEmpty(jsonArray)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ jsonArray.stream().forEach(o->{
|
|
|
+ JSONObject item = (JSONObject)o;
|
|
|
+ String sid = item.getString("sid");
|
|
|
+ if(StrUtil.isNotEmpty(sid)){
|
|
|
+ String ossKey = String.format(UploadFilePath.USER_EDIT_PATH, num) + sid + ".glb";
|
|
|
+ try {
|
|
|
+ uploadToOssUtil.delete(ossKey);
|
|
|
+ } catch (IOException e) {
|
|
|
+ log.warn("删除oss文件出错, key:{}", ossKey);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
private void publicSurveillance(String num, Integer surveillances) throws IOException {
|
|
|
String surveillanceJsonPath = String.format(UploadFilePath.USER_EDIT_PATH, num) + "surveillance.json";
|
|
|
if(surveillances == CommonStatus.NO.code().intValue()){
|