|
@@ -125,7 +125,7 @@ public class SceneProServiceImpl implements ISceneProService {
|
|
|
|
|
|
this.addOrUpdateHotData(param.getNum(), param.getSubgroup(), param.getHotDataList());
|
|
this.addOrUpdateHotData(param.getNum(), param.getSubgroup(), param.getHotDataList());
|
|
|
|
|
|
- this.addOrUpdateIcons(param.getNum(), param.getIcons());
|
|
|
|
|
|
+ this.addOrUpdateIcons(param.getNum(), param.getSubgroup(), param.getIcons());
|
|
|
|
|
|
// //写入本地文件,作为备份
|
|
// //写入本地文件,作为备份
|
|
// this.writeHotJson(param.getNum());
|
|
// this.writeHotJson(param.getNum());
|
|
@@ -140,7 +140,7 @@ public class SceneProServiceImpl implements ISceneProService {
|
|
return ResultData.ok();
|
|
return ResultData.ok();
|
|
}
|
|
}
|
|
|
|
|
|
- private void addOrUpdateHotData(String num, List<HotParamVO> hotDataList) throws Exception{
|
|
|
|
|
|
+ private void addOrUpdateHotData(String num, Integer subgroup, List<HotParamVO> hotDataList) throws Exception{
|
|
Map<String, String> addOrUpdateMap = new HashMap<>();
|
|
Map<String, String> addOrUpdateMap = new HashMap<>();
|
|
int i = 0;
|
|
int i = 0;
|
|
for (HotParamVO hotParamVO : hotDataList) {
|
|
for (HotParamVO hotParamVO : hotDataList) {
|
|
@@ -152,15 +152,15 @@ public class SceneProServiceImpl implements ISceneProService {
|
|
// this.syncHotFromFileToRedis(num);
|
|
// this.syncHotFromFileToRedis(num);
|
|
|
|
|
|
//处理新增和修改数据
|
|
//处理新增和修改数据
|
|
- this.addOrUpdateHotDataHandler(num, addOrUpdateMap);
|
|
|
|
|
|
+ this.addOrUpdateHotDataHandler(num, subgroup, addOrUpdateMap);
|
|
}
|
|
}
|
|
|
|
|
|
- private void addOrUpdateIcons(String num, Set<String> icons) throws Exception{
|
|
|
|
|
|
+ private void addOrUpdateIcons(String num, Integer subgroup, Set<String> icons) throws Exception{
|
|
if(CollUtil.isEmpty(icons)){
|
|
if(CollUtil.isEmpty(icons)){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
// this.syncIconsFromFileToRedis(num);
|
|
// this.syncIconsFromFileToRedis(num);
|
|
- String key = String.format(RedisKey.SCENE_HOT_ICONS, num);
|
|
|
|
|
|
+ String key = String.format(RedisKey.SCENE_HOT_ICONS, RedisKey.getNumStr(num, subgroup));
|
|
redisClient.sSet(key, icons);
|
|
redisClient.sSet(key, icons);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -309,8 +309,8 @@ public class SceneProServiceImpl implements ISceneProService {
|
|
return iconList;
|
|
return iconList;
|
|
}
|
|
}
|
|
|
|
|
|
- private void publicHotData(String sceneNum) {
|
|
|
|
- String hotDataKey = String.format(RedisKey.SCENE_HOT_DATA, sceneNum);
|
|
|
|
|
|
+ private void publicHotData(String sceneNum, Integer subgroup) {
|
|
|
|
+ String hotDataKey = String.format(RedisKey.SCENE_HOT_DATA, RedisKey.getNumStr(sceneNum, subgroup));
|
|
Map<String, String> hotMap = redisClient.hmget(hotDataKey);
|
|
Map<String, String> hotMap = redisClient.hmget(hotDataKey);
|
|
|
|
|
|
JSONArray tags = new JSONArray();
|
|
JSONArray tags = new JSONArray();
|
|
@@ -468,7 +468,7 @@ public class SceneProServiceImpl implements ISceneProService {
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
|
|
- private void addOrUpdateHotDataHandler(String num, Map<String, String> addOrUpdateMap){
|
|
|
|
|
|
+ private void addOrUpdateHotDataHandler(String num, Integer subgroup, Map<String, String> addOrUpdateMap){
|
|
if(CollUtil.isEmpty(addOrUpdateMap))
|
|
if(CollUtil.isEmpty(addOrUpdateMap))
|
|
return;
|
|
return;
|
|
|
|
|
|
@@ -481,7 +481,7 @@ public class SceneProServiceImpl implements ISceneProService {
|
|
}
|
|
}
|
|
|
|
|
|
//批量写入缓存
|
|
//批量写入缓存
|
|
- String key = String.format(RedisKey.SCENE_HOT_DATA, num);
|
|
|
|
|
|
+ String key = String.format(RedisKey.SCENE_HOT_DATA, RedisKey.getNumStr(num, subgroup));
|
|
redisClient.hmset(key, addOrUpdateMap);
|
|
redisClient.hmset(key, addOrUpdateMap);
|
|
}
|
|
}
|
|
|
|
|