|
@@ -2063,7 +2063,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
}
|
|
|
|
|
|
|
|
|
- private void addOrUpdateLinkPanStyles(String num, List<String> styles) throws Exception{
|
|
|
+ private void addOrUpdateLinkPanStyles(String num, List<JSONObject> styles) throws Exception{
|
|
|
|
|
|
this.syncLinkPanStylesFromFileToRedis(num);
|
|
|
|
|
@@ -2073,9 +2073,8 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
|
|
|
Map<String, String> styleMap = new HashMap<>();
|
|
|
styles.stream().forEach(style->{
|
|
|
- JSONObject jsonObject = JSON.parseObject(style);
|
|
|
- String id = jsonObject.getString("id");
|
|
|
- styleMap.put(id, style);
|
|
|
+ String id = style.getString("id");
|
|
|
+ styleMap.put(id, style.toJSONString());
|
|
|
});
|
|
|
|
|
|
String key = String.format(RedisKey.SCENE_LINKPAN_STYLES, num);
|
|
@@ -2107,7 +2106,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
return;
|
|
|
}
|
|
|
String linkSceneFilePath = String.format(ConstantFilePath.SCENE_USER_PATH_V4, num);
|
|
|
- String linkSceneData = cn.hutool.core.io.FileUtil.readUtf8String(linkSceneFilePath + "link-scene.json");
|
|
|
+ String linkSceneData = FileUtils.readFile(linkSceneFilePath + "link-scene.json");
|
|
|
if(StrUtil.isEmpty(linkSceneData)){
|
|
|
return;
|
|
|
}
|
|
@@ -2129,13 +2128,12 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
|
|
|
}
|
|
|
|
|
|
- private void addOrUpdateLinPan(String num, List<LinkPanParamVO> linkPanList) throws Exception{
|
|
|
+ private void addOrUpdateLinPan(String num, List<JSONObject> linkPanList) throws Exception{
|
|
|
Map<String, String> addOrUpdateMap = new HashMap<>();
|
|
|
int i = 0;
|
|
|
- for (LinkPanParamVO linkPan : linkPanList) {
|
|
|
- JSONObject jsonObject = JSON.parseObject(linkPan.getLinkPanData());
|
|
|
+ for (JSONObject jsonObject : linkPanList) {
|
|
|
jsonObject.put("createTime", Calendar.getInstance().getTimeInMillis() + i++);
|
|
|
- addOrUpdateMap.put(linkPan.getSid(), jsonObject.toJSONString());
|
|
|
+ addOrUpdateMap.put(jsonObject.getString("sid"), jsonObject.toJSONString());
|
|
|
}
|
|
|
|
|
|
this.syncLinPanFromFileToRedis(num);
|
|
@@ -2169,7 +2167,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
return;
|
|
|
}
|
|
|
String linkSceneFilePath = String.format(ConstantFilePath.SCENE_USER_PATH_V4, num);
|
|
|
- String linkSceneData = cn.hutool.core.io.FileUtil.readUtf8String(linkSceneFilePath + "link-scene.json");
|
|
|
+ String linkSceneData = FileUtils.readFile(linkSceneFilePath + "link-scene.json");
|
|
|
if(StrUtil.isEmpty(linkSceneData)){
|
|
|
return;
|
|
|
}
|