|
@@ -2816,23 +2816,24 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
}
|
|
|
|
|
|
String key = String.format(RedisKey.SCENE_filter_DATA, param.getNum());
|
|
|
+ redisUtil.del(key);//前端将全量数据传过来,所以这里先清空历史数据,然后保存前端数据即可
|
|
|
JSONArray filterArr = JSON.parseArray(param.getData());
|
|
|
int filters = CommonStatus.YES.code();
|
|
|
- if(param.getReset() == CommonStatus.YES.code().intValue()){
|
|
|
+ //如果页面选择恢复默认,filters字段值为否
|
|
|
+ if(Objects.nonNull(param.getReset()) && param.getReset() == CommonStatus.YES.code().intValue()){
|
|
|
filters = CommonStatus.NO.code();
|
|
|
- redisUtil.del(key);
|
|
|
}else{
|
|
|
- List<String> filterList = filterArr.stream().map(item->JSON.toJSONString(item)).collect(Collectors.toList());
|
|
|
- redisUtil.lRightPushAll(key, filterList);
|
|
|
+ if(CollUtil.isNotEmpty(filterArr)){
|
|
|
+ List<String> filterList = filterArr.stream().map(item->JSON.toJSONString(item)).collect(Collectors.toList());
|
|
|
+ redisUtil.lRightPushAll(key, filterList);
|
|
|
+ }else{
|
|
|
+ filters = CommonStatus.NO.code();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//写本地文件,作为备份
|
|
|
this.writeFilter(param.getNum());
|
|
|
|
|
|
- //如果页面选择恢复默认,filters字段值为否
|
|
|
- if(Objects.nonNull(param.getReset()) && param.getReset() == CommonStatus.YES.code().intValue()){
|
|
|
- filters = CommonStatus.NO.code();
|
|
|
- }
|
|
|
|
|
|
//更新数据库
|
|
|
SceneEditInfoExt sceneEditInfoExt = sceneEditInfoExtService.getByScenePlusId(scenePlus.getId());
|