|
@@ -1812,58 +1812,24 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
|
|
|
@Override
|
|
|
public ResultData saveLinkPan(SaveLinkPanParamVO param) throws Exception {
|
|
|
- String num = param.getNum();
|
|
|
- String fileName = param.getFileName();
|
|
|
- String fileData = param.getFileData();
|
|
|
- String sid = param.getSid();
|
|
|
|
|
|
+ String num = param.getNum();
|
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(param.getNum());
|
|
|
if(Objects.isNull(scenePlus)){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
}
|
|
|
|
|
|
+ //添加场景关联数据
|
|
|
this.addOrUpdateLinPan(num, param.getLinkPans());
|
|
|
|
|
|
+ //添加场景关联图标
|
|
|
this.addOrUpdateLinkPanStyles(num, param.getStyles());
|
|
|
|
|
|
+ //场景关联数据备份到本地
|
|
|
this.writeLinkScene(num);
|
|
|
|
|
|
-
|
|
|
- StringBuffer dataBuf = new StringBuffer()
|
|
|
- .append("data").append(File.separator)
|
|
|
- .append("data").append(scenePro.getNum())
|
|
|
- .append(File.separator);
|
|
|
-
|
|
|
- StringBuffer imagesBuf = new StringBuffer()
|
|
|
- .append("images").append(File.separator)
|
|
|
- .append("images").append(scenePro.getNum())
|
|
|
- .append(File.separator);
|
|
|
-
|
|
|
- StringBuffer dataBuffer = new StringBuffer(ConstantFilePath.SCENE_PATH).append(dataBuf.toString());
|
|
|
- StringBuffer imagesBuffer = new StringBuffer(ConstantFilePath.SCENE_PATH).append(imagesBuf.toString());
|
|
|
-
|
|
|
- FileUtils.writeFile(dataBuffer.toString() + fileName, fileData);
|
|
|
-
|
|
|
- String strsceneInfos = FileUtils.readFile(dataBuffer.toString() + "scene.json");
|
|
|
- JSONObject scenejson = new JSONObject();
|
|
|
- if(strsceneInfos!=null) {
|
|
|
- scenejson = JSONObject.parseObject(strsceneInfos);
|
|
|
- }
|
|
|
-
|
|
|
- scenejson.put("uploadPanoramaJson", 1);
|
|
|
- scenejson.put("version", scenejson.getIntValue("version") + 1);
|
|
|
- if(StrUtil.isNotEmpty(fileData)){
|
|
|
- scenejson.put("jumpScene", true);
|
|
|
- }else {
|
|
|
- scenejson.put("jumpScene", false);
|
|
|
- }
|
|
|
- FileUtils.writeFile(dataBuffer.toString() + "scene.json", scenejson.toString());
|
|
|
-
|
|
|
- if(StrUtil.isNotEmpty(sid)){
|
|
|
- String target = imagesBuffer.toString() + "panorama/" + sid;
|
|
|
- FileUtils.deleteDirectory(target);
|
|
|
- uploadToOssUtil.deleteFile(imagesBuf.toString() + "panorama_edit/" + sid);
|
|
|
- }
|
|
|
+ //更新场景版本
|
|
|
+ this.upgradeVersionById();
|
|
|
|
|
|
return ResultData.ok();
|
|
|
}
|
|
@@ -1917,6 +1883,10 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
|
|
|
this.syncLinkPanStylesFromFileToRedis(num);
|
|
|
|
|
|
+ if(CollUtil.isEmpty(styles)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
String key = String.format(RedisKey.SCENE_LINKPAN_STYLES, num);
|
|
|
redisUtil.sSet(key, styles.toArray());
|
|
|
|