|
@@ -71,8 +71,8 @@ public class SceneEditInfoExtServiceImpl extends ServiceImpl<SceneEditInfoExtMap
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void updateToursByNum(String num, Integer tours) {
|
|
|
|
- Scene scenePlus = scenePlusService.getByNum(num);
|
|
|
|
|
|
+ public void updateToursByNum(String num, Integer subgroup, Integer tours) {
|
|
|
|
+ Scene scenePlus = scenePlusService.getByNum(num, subgroup);
|
|
if(Objects.isNull(scenePlus)){
|
|
if(Objects.isNull(scenePlus)){
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
}
|
|
}
|
|
@@ -85,18 +85,18 @@ public class SceneEditInfoExtServiceImpl extends ServiceImpl<SceneEditInfoExtMap
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public ResultData saveBillboards(BaseJsonArrayParamVO param) throws Exception {
|
|
public ResultData saveBillboards(BaseJsonArrayParamVO param) throws Exception {
|
|
- Scene scenePlus = scenePlusService.getByNum(param.getNum());
|
|
|
|
|
|
+ Scene scenePlus = scenePlusService.getByNum(param.getNum(), param.getSubgroup());
|
|
|
|
|
|
- this.addOrUpdateBillboards(param.getNum(), param.getData());
|
|
|
|
|
|
+ this.addOrUpdateBillboards(param.getNum(), param.getSubgroup(), param.getData());
|
|
|
|
|
|
- this.addOrUpdateBillboardsStyles(param.getNum(), param.getStyles());
|
|
|
|
|
|
+ this.addOrUpdateBillboardsStyles(param.getNum(), param.getSubgroup(), param.getStyles());
|
|
|
|
|
|
//保存数据库
|
|
//保存数据库
|
|
SceneEditInfoExt sceneEditInfoExt = this.getByScenePlusId(scenePlus.getId());
|
|
SceneEditInfoExt sceneEditInfoExt = this.getByScenePlusId(scenePlus.getId());
|
|
- this.updateBillboards(param.getNum(), sceneEditInfoExt);
|
|
|
|
|
|
+ this.updateBillboards(param.getNum(), param.getSubgroup(), sceneEditInfoExt);
|
|
// this.updateById(sceneEditInfoExt);
|
|
// this.updateById(sceneEditInfoExt);
|
|
|
|
|
|
- this.publicBillboardData(param.getNum());
|
|
|
|
|
|
+ this.publicBillboardData(param.getNum(), param.getSubgroup());
|
|
|
|
|
|
sceneEditInfoService.upgradeVersionById(sceneEditInfoExt.getEditInfoId());
|
|
sceneEditInfoService.upgradeVersionById(sceneEditInfoExt.getEditInfoId());
|
|
|
|
|
|
@@ -104,7 +104,7 @@ public class SceneEditInfoExtServiceImpl extends ServiceImpl<SceneEditInfoExtMap
|
|
return ResultData.ok();
|
|
return ResultData.ok();
|
|
}
|
|
}
|
|
|
|
|
|
- private void addOrUpdateBillboardsStyles(String num, List<JSONObject> styles) throws Exception{
|
|
|
|
|
|
+ private void addOrUpdateBillboardsStyles(String num, Integer subgroup, List<JSONObject> styles) throws Exception{
|
|
|
|
|
|
// this.syncBillboardsStylesFromFileToRedis(num);
|
|
// this.syncBillboardsStylesFromFileToRedis(num);
|
|
|
|
|
|
@@ -121,7 +121,7 @@ public class SceneEditInfoExtServiceImpl extends ServiceImpl<SceneEditInfoExtMap
|
|
styleMap.put(id, style.toJSONString());
|
|
styleMap.put(id, style.toJSONString());
|
|
});
|
|
});
|
|
|
|
|
|
- String key = String.format(RedisKey.SCENE_BILLBOARDS_STYLES, num);
|
|
|
|
|
|
+ String key = String.format(RedisKey.SCENE_BILLBOARDS_STYLES, RedisKey.getNumStr(num, subgroup));
|
|
redisClient.hmset(key, styleMap);
|
|
redisClient.hmset(key, styleMap);
|
|
|
|
|
|
//写入本地文件,作为备份
|
|
//写入本地文件,作为备份
|
|
@@ -170,23 +170,23 @@ public class SceneEditInfoExtServiceImpl extends ServiceImpl<SceneEditInfoExtMap
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public ResultData deleteBillboards(DeleteSidListParamVO param) throws Exception {
|
|
public ResultData deleteBillboards(DeleteSidListParamVO param) throws Exception {
|
|
- Scene scenePlus = scenePlusService.getByNum(param.getNum());
|
|
|
|
|
|
+ Scene scenePlus = scenePlusService.getByNum(param.getNum(), param.getSubgroup());
|
|
|
|
|
|
List<String> deleteSidList = param.getSidList();
|
|
List<String> deleteSidList = param.getSidList();
|
|
|
|
|
|
// this.syncBillboardsFromFileToRedis(param.getNum());
|
|
// this.syncBillboardsFromFileToRedis(param.getNum());
|
|
|
|
|
|
//处理删除状态数据
|
|
//处理删除状态数据
|
|
- this.deleteBillboardsHandler(param.getNum(), deleteSidList);
|
|
|
|
|
|
+ this.deleteBillboardsHandler(param.getNum(), param.getSubgroup(), deleteSidList);
|
|
|
|
|
|
//写入本地文件,作为备份
|
|
//写入本地文件,作为备份
|
|
// this.writeBillboardJson(param.getNum());
|
|
// this.writeBillboardJson(param.getNum());
|
|
|
|
|
|
- this.publicBillboardData(param.getNum());
|
|
|
|
|
|
+ this.publicBillboardData(param.getNum(), param.getSubgroup());
|
|
|
|
|
|
//保存数据库
|
|
//保存数据库
|
|
SceneEditInfoExt sceneEditInfoExt = this.getByScenePlusId(scenePlus.getId());
|
|
SceneEditInfoExt sceneEditInfoExt = this.getByScenePlusId(scenePlus.getId());
|
|
- this.updateBillboards(param.getNum(), sceneEditInfoExt);
|
|
|
|
|
|
+ this.updateBillboards(param.getNum(), param.getSubgroup(), sceneEditInfoExt);
|
|
sceneEditInfoService.upgradeVersionById(sceneEditInfoExt.getEditInfoId());
|
|
sceneEditInfoService.upgradeVersionById(sceneEditInfoExt.getEditInfoId());
|
|
|
|
|
|
return ResultData.ok();
|
|
return ResultData.ok();
|
|
@@ -198,12 +198,12 @@ public class SceneEditInfoExtServiceImpl extends ServiceImpl<SceneEditInfoExtMap
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
List<JSONObject> tags = new ArrayList<>();
|
|
List<JSONObject> tags = new ArrayList<>();
|
|
List<JSONObject> styles = new ArrayList<>();
|
|
List<JSONObject> styles = new ArrayList<>();
|
|
- Scene scenePlus = scenePlusService.getByNum(param.getNum());
|
|
|
|
|
|
+ Scene scenePlus = scenePlusService.getByNum(param.getNum(), param.getSubgroup());
|
|
|
|
|
|
// this.syncBillboardsFromFileToRedis(param.getNum());
|
|
// this.syncBillboardsFromFileToRedis(param.getNum());
|
|
|
|
|
|
//获取指示牌数据
|
|
//获取指示牌数据
|
|
- String key = String.format(RedisKey.SCENE_BILLBOARDS, param.getNum());
|
|
|
|
|
|
+ String key = String.format(RedisKey.SCENE_BILLBOARDS, RedisKey.getNumStr(param.getNum(), param.getSubgroup()));
|
|
List<String> list = redisClient.hgetValues(key);
|
|
List<String> list = redisClient.hgetValues(key);
|
|
if(CollUtil.isNotEmpty(list)){
|
|
if(CollUtil.isNotEmpty(list)){
|
|
List<TagBean> sortList = list.stream().map(str -> {
|
|
List<TagBean> sortList = list.stream().map(str -> {
|
|
@@ -221,7 +221,7 @@ public class SceneEditInfoExtServiceImpl extends ServiceImpl<SceneEditInfoExtMap
|
|
|
|
|
|
//获取图标数据
|
|
//获取图标数据
|
|
// this.syncBillboardsStylesFromFileToRedis(param.getNum());
|
|
// this.syncBillboardsStylesFromFileToRedis(param.getNum());
|
|
- key = String.format(RedisKey.SCENE_BILLBOARDS_STYLES, param.getNum());
|
|
|
|
|
|
+ key = String.format(RedisKey.SCENE_BILLBOARDS_STYLES, RedisKey.getNumStr(param.getNum(), param.getSubgroup()));
|
|
List<String> sytlelist = redisClient.hgetValues(key);
|
|
List<String> sytlelist = redisClient.hgetValues(key);
|
|
if(CollUtil.isNotEmpty(sytlelist)){
|
|
if(CollUtil.isNotEmpty(sytlelist)){
|
|
List<TagBean> stileSortList = sytlelist.stream().map(str -> {
|
|
List<TagBean> stileSortList = sytlelist.stream().map(str -> {
|
|
@@ -240,13 +240,13 @@ public class SceneEditInfoExtServiceImpl extends ServiceImpl<SceneEditInfoExtMap
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
- private void deleteBillboardsHandler(String num, List<String> deleteSidList) throws Exception {
|
|
|
|
|
|
+ private void deleteBillboardsHandler(String num, Integer subgroup, List<String> deleteSidList) throws Exception {
|
|
if(CollUtil.isEmpty(deleteSidList)){
|
|
if(CollUtil.isEmpty(deleteSidList)){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
//从redis中加载热点数据
|
|
//从redis中加载热点数据
|
|
- String key = String.format(RedisKey.SCENE_BILLBOARDS, num);
|
|
|
|
|
|
+ String key = String.format(RedisKey.SCENE_BILLBOARDS, RedisKey.getNumStr(num, subgroup));
|
|
List<String> deletDataList = redisClient.hMultiGet(key, deleteSidList);
|
|
List<String> deletDataList = redisClient.hMultiGet(key, deleteSidList);
|
|
if(CollUtil.isEmpty(deletDataList))
|
|
if(CollUtil.isEmpty(deletDataList))
|
|
return;
|
|
return;
|
|
@@ -254,7 +254,7 @@ public class SceneEditInfoExtServiceImpl extends ServiceImpl<SceneEditInfoExtMap
|
|
redisClient.hdel(key, deleteSidList);
|
|
redisClient.hdel(key, deleteSidList);
|
|
}
|
|
}
|
|
|
|
|
|
- private void addOrUpdateBillboards(String num, List<JSONObject> data) throws Exception{
|
|
|
|
|
|
+ private void addOrUpdateBillboards(String num, Integer subgroup, List<JSONObject> data) throws Exception{
|
|
Map<String, String> addOrUpdateMap = new HashMap<>();
|
|
Map<String, String> addOrUpdateMap = new HashMap<>();
|
|
int i = 0;
|
|
int i = 0;
|
|
for (JSONObject jsonObject : data) {
|
|
for (JSONObject jsonObject : data) {
|
|
@@ -265,7 +265,7 @@ public class SceneEditInfoExtServiceImpl extends ServiceImpl<SceneEditInfoExtMap
|
|
// this.syncBillboardsFromFileToRedis(num);
|
|
// this.syncBillboardsFromFileToRedis(num);
|
|
|
|
|
|
//处理新增和修改数据
|
|
//处理新增和修改数据
|
|
- this.addOrUpdateBillboardsHandler(num, addOrUpdateMap);
|
|
|
|
|
|
+ this.addOrUpdateBillboardsHandler(num, subgroup, addOrUpdateMap);
|
|
}
|
|
}
|
|
//
|
|
//
|
|
// /**
|
|
// /**
|
|
@@ -313,12 +313,12 @@ public class SceneEditInfoExtServiceImpl extends ServiceImpl<SceneEditInfoExtMap
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
//
|
|
//
|
|
- private void addOrUpdateBillboardsHandler(String num, Map<String, String> addOrUpdateMap){
|
|
|
|
|
|
+ private void addOrUpdateBillboardsHandler(String num, Integer subgroup, Map<String, String> addOrUpdateMap){
|
|
if(CollUtil.isEmpty(addOrUpdateMap))
|
|
if(CollUtil.isEmpty(addOrUpdateMap))
|
|
return;
|
|
return;
|
|
|
|
|
|
//批量写入缓存
|
|
//批量写入缓存
|
|
- String key = String.format(RedisKey.SCENE_BILLBOARDS, num);
|
|
|
|
|
|
+ String key = String.format(RedisKey.SCENE_BILLBOARDS, RedisKey.getNumStr(num, subgroup));
|
|
redisClient.hmset(key, addOrUpdateMap);
|
|
redisClient.hmset(key, addOrUpdateMap);
|
|
|
|
|
|
//写入本地文件,作为备份
|
|
//写入本地文件,作为备份
|
|
@@ -378,9 +378,9 @@ public class SceneEditInfoExtServiceImpl extends ServiceImpl<SceneEditInfoExtMap
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
|
|
- private void updateBillboards(String num, SceneEditInfoExt sceneEditInfoExt){
|
|
|
|
|
|
+ private void updateBillboards(String num, Integer subgroup, SceneEditInfoExt sceneEditInfoExt){
|
|
//查询缓存是否包含热点数据
|
|
//查询缓存是否包含热点数据
|
|
- String key = String.format(RedisKey.SCENE_BILLBOARDS, num);
|
|
|
|
|
|
+ String key = String.format(RedisKey.SCENE_BILLBOARDS, RedisKey.getNumStr(num, subgroup));
|
|
Map<String, String> billboardsMap = redisClient.hmget(key);
|
|
Map<String, String> billboardsMap = redisClient.hmget(key);
|
|
boolean hashBillboards= false;
|
|
boolean hashBillboards= false;
|
|
for (Map.Entry<String, String> tagMap : billboardsMap.entrySet()) {
|
|
for (Map.Entry<String, String> tagMap : billboardsMap.entrySet()) {
|
|
@@ -396,22 +396,22 @@ public class SceneEditInfoExtServiceImpl extends ServiceImpl<SceneEditInfoExtMap
|
|
this.updateById(sceneEditInfoExt);
|
|
this.updateById(sceneEditInfoExt);
|
|
}
|
|
}
|
|
|
|
|
|
- private void publicBillboardData(String sceneNum) throws IOException {
|
|
|
|
- String Key = String.format(RedisKey.SCENE_BILLBOARDS, sceneNum);
|
|
|
|
|
|
+ private void publicBillboardData(String sceneNum, Integer subgroup) throws IOException {
|
|
|
|
+ String Key = String.format(RedisKey.SCENE_BILLBOARDS, RedisKey.getNumStr(sceneNum, subgroup));
|
|
String userEditPath = String.format(UploadFilePath.USER_VIEW_PATH, sceneNum) + "billboards.json";
|
|
String userEditPath = String.format(UploadFilePath.USER_VIEW_PATH, sceneNum) + "billboards.json";
|
|
List<String> list = redisClient.hgetValues(Key);
|
|
List<String> list = redisClient.hgetValues(Key);
|
|
if(CollUtil.isEmpty(list)){
|
|
if(CollUtil.isEmpty(list)){
|
|
- sceneFileMappingService.delByNumAndKey(sceneNum, userEditPath);
|
|
|
|
|
|
+ fYunFileService.deleteFile(sceneNum, subgroup, userEditPath);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
List<JSONObject> collect = list.stream().map(str -> JSON.parseObject(str)).collect(Collectors.toList());
|
|
List<JSONObject> collect = list.stream().map(str -> JSON.parseObject(str)).collect(Collectors.toList());
|
|
- fYunFileService.uploadFile(sceneNum, JSON.toJSONString(collect).getBytes(), userEditPath);
|
|
|
|
|
|
+ fYunFileService.uploadFile(sceneNum, subgroup, JSON.toJSONString(collect).getBytes(), userEditPath);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public ResultData deleteBillboardsStyles(DeleteStylesParamVO param) throws Exception {
|
|
public ResultData deleteBillboardsStyles(DeleteStylesParamVO param) throws Exception {
|
|
- Scene scenePlus = scenePlusService.getByNum(param.getNum());
|
|
|
|
|
|
+ Scene scenePlus = scenePlusService.getByNum(param.getNum(), param.getSubgroup());
|
|
if (scenePlus == null)
|
|
if (scenePlus == null)
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
|
|
|
@@ -419,7 +419,7 @@ public class SceneEditInfoExtServiceImpl extends ServiceImpl<SceneEditInfoExtMap
|
|
|
|
|
|
// this.syncBillboardsStylesFromFileToRedis(param.getNum());
|
|
// this.syncBillboardsStylesFromFileToRedis(param.getNum());
|
|
|
|
|
|
- String key = String.format(RedisKey.SCENE_BILLBOARDS_STYLES, param.getNum());
|
|
|
|
|
|
+ String key = String.format(RedisKey.SCENE_BILLBOARDS_STYLES, RedisKey.getNumStr(param.getNum(), param.getSubgroup()));
|
|
List<String> deleteList = redisClient.hMultiGet(key, sidList);
|
|
List<String> deleteList = redisClient.hMultiGet(key, sidList);
|
|
redisClient.hdel(key, sidList);
|
|
redisClient.hdel(key, sidList);
|
|
|
|
|
|
@@ -434,7 +434,7 @@ public class SceneEditInfoExtServiceImpl extends ServiceImpl<SceneEditInfoExtMap
|
|
|
|
|
|
deleteFileList.stream().forEach(v->{
|
|
deleteFileList.stream().forEach(v->{
|
|
String fileKey = String.format(UploadFilePath.USER_VIEW_PATH, param.getNum()) + v;
|
|
String fileKey = String.format(UploadFilePath.USER_VIEW_PATH, param.getNum()) + v;
|
|
- sceneFileMappingService.delByNumAndKey(param.getNum(), fileKey);
|
|
|
|
|
|
+ fYunFileService.deleteFile(param.getNum(), param.getSubgroup(), fileKey);
|
|
});
|
|
});
|
|
|
|
|
|
return ResultData.ok();
|
|
return ResultData.ok();
|