记得上下班打卡 | git大法好,push需谨慎

Commit 15c14b79 authored by GaoHu's avatar GaoHu

修改

parent 22851157
......@@ -46,7 +46,6 @@ public class DataUtils {
private MongoTemplate mongoTemplate;
@Autowired
private RedisUtil redisUtil;
@Autowired
GoblinRedisUtils goblinRedisUtils;
......@@ -357,15 +356,24 @@ public class DataUtils {
return (List<KylinPerformanceVo>) obj;
}
/**
* 获取演出预告列表redis
*/
public HashMap<String, Object> getPerformancesListNotice() {
String redisKeyIds = KylinRedisConst.PERFORMANCES_LIST_NOTICE_IDS;
Object obj = redisUtil.get(redisKeyIds);
if (obj != null) {
HashMap<String, Object> info = CollectionUtil.mapStringObject();
//演出
List<KylinPerformanceVo> toDayList = ObjectUtil.getKylinPerformanceVoArrayList();
List<KylinPerformanceVo> threeDaysList = ObjectUtil.getKylinPerformanceVoArrayList();
//数字藏品
List<NoticeGoblinGoodsSkuInfoVo> toDayNftVoList = ObjectUtil.getNoticeGoblinGoodsSkuInfoVoList();
List<NoticeGoblinGoodsSkuInfoVo> threeDayNftVoList = ObjectUtil.getNoticeGoblinGoodsSkuInfoVoList();
//组合购
List<NoticeGoblinMixDetailsVo> toDayCombinationVoList = ObjectUtil.getNoticeGoblinMixDetailsVoList();
List<NoticeGoblinMixDetailsVo> threeDayCombinationVoList = ObjectUtil.getNoticeGoblinMixDetailsVoList();
Map<String, Object> map = getRedisNoticeIsd();
if (map != null) {
//获取ids
HashMap<String, Object> map = (HashMap<String, Object>) obj;
List<String> toDayIds = (List<String>) map.get("toDayIds");
List<String> threeDayIds = (List<String>) map.get("threeDayIds");
List<String> toDayNftIds = (List<String>) map.get("toDayNftIds");
......@@ -374,7 +382,7 @@ public class DataUtils {
List<String> threeDayCombinationIds = (List<String>) map.get("threeDayCombinationIds");
// 固定条件
List<KylinPerformanceVo> toDayList = getKylinPerformanceVos(toDayIds);
toDayList = getKylinPerformanceVos(toDayIds);
toDayList.forEach(kylinPerformanceVo -> {
kylinPerformanceVo.setNoticeImage(null);
kylinPerformanceVo.setTicketTimeList(null);
......@@ -385,7 +393,7 @@ public class DataUtils {
}).collect(Collectors.toList());*/
// 固定条件
List<KylinPerformanceVo> threeDaysList = getKylinPerformanceVos(threeDayIds);
threeDaysList = getKylinPerformanceVos(threeDayIds);
threeDaysList.forEach(kylinPerformanceVo -> {
kylinPerformanceVo.setNoticeImage(null);
kylinPerformanceVo.setTicketTimeList(null);
......@@ -395,9 +403,6 @@ public class DataUtils {
return NoticeKylinPerformanceVo.getNew().copy(kylinPerformanceVo);
}).collect(Collectors.toList());*/
//数字藏品
List<NoticeGoblinGoodsSkuInfoVo> toDayNftVoList = null;
List<NoticeGoblinGoodsSkuInfoVo> threeDayNftVoList = null;
try {
//当天
List<GoblinGoodsSkuInfoVo> toDaysNftList = getGoblinGoodsSkuInfoVos(toDayNftIds);
......@@ -411,9 +416,6 @@ public class DataUtils {
log.error("return NftVoList error!");
}
//组合购
List<NoticeGoblinMixDetailsVo> toDayCombinationVoList = null;
List<NoticeGoblinMixDetailsVo> threeDayCombinationVoList = null;
try {
//当天
List<GoblinMixDetailsVo> toDayCombinationList = getGoblinMixDetailsVos(toDayCombinationIds);
......@@ -426,23 +428,15 @@ public class DataUtils {
log.error("return CombinationVoList error!");
}
HashMap<String, Object> info = CollectionUtil.mapStringObject();
info.put("toDayList", toDayList);
info.put("threeDaysList", threeDaysList);
//过滤数据
info.put("toDaysNftList", toDayNftVoList);
info.put("threeDayNftList", threeDayNftVoList);
info.put("toDayCombinationList", toDayCombinationVoList);
info.put("threeDayCombinationList", threeDayCombinationVoList);
//原始数据
// info.put("toDaysNftList", toDaysNftList);
// info.put("threeNftList", threeNftList);
// info.put("toDayCombinationList", toDayCombinationList);
// info.put("threeDayCombinationList", threeDayCombinationList);
return info;
}
return (HashMap<String, Object>) obj;
info.put("toDayList", toDayList);
info.put("threeDaysList", threeDaysList);
//过滤数据
info.put("toDaysNftList", toDayNftVoList);
info.put("threeDayNftList", threeDayNftVoList);
info.put("toDayCombinationList", toDayCombinationVoList);
info.put("threeDayCombinationList", threeDayCombinationVoList);
return info;
}
/**
......@@ -543,7 +537,7 @@ public class DataUtils {
}
private List<GoblinMixDetailsVo> getGoblinMixDetailsVos(List<String> toDayCombinationIds) {
List<GoblinMixDetailsVo> toDayCombinationList = new ArrayList<>();
List<GoblinMixDetailsVo> toDayCombinationList = ObjectUtil.getGoblinMixDetailsVoList();
//redis key
String rdk = GoblinRedisConst.GOBLIN_MIX_DETAILS;
String rk = GoblinRedisConst.BASIC_GOODS_SKU;
......@@ -591,17 +585,14 @@ public class DataUtils {
return toDayCombinationList;
}
private List<GoblinGoodsSkuInfoVo> getGoblinGoodsSkuInfoVos(List<String> toDayNftIds) {
List<GoblinGoodsSkuInfoVo> toDaysNftList = new ArrayList<>();
//redis key
String rk = GoblinRedisConst.BASIC_GOODS_SKU;
List<GoblinGoodsSkuInfoVo> toDaysNftList = ObjectUtil.getGoblinGoodsSkuInfoVoList();
if (toDayNftIds != null && toDayNftIds.size() > 0) {
//查询redis
toDayNftIds.forEach(id -> {
Object obj = redisUtil.get(rk.concat(id));
if (obj != null) {
toDaysNftList.add((GoblinGoodsSkuInfoVo) obj);
}
GoblinGoodsSkuInfoVo goodsSkuInfoVo = goblinRedisUtils.getGoodsSkuInfoVo(id);
toDaysNftList.add(goodsSkuInfoVo);
});
//查询mongodb
/*Query queryToDayNft = new Query();
......@@ -613,29 +604,12 @@ public class DataUtils {
}
private List<KylinPerformanceVo> getKylinPerformanceVos(List<String> toDayIds) {
List<KylinPerformanceVo> toDayList = new ArrayList<>();
//redis key
String key = KylinRedisConst.PERFORMANCES;
List<KylinPerformanceVo> toDayList = ObjectUtil.getKylinPerformanceVoArrayList();
if (toDayIds != null && toDayIds.size() > 0) {
//查询redis
toDayIds.forEach(id -> {
Object obj = redisUtil.get(key + id);
if (obj != null) {
toDayList.add((KylinPerformanceVo) obj);
} else {
Query query = new Query();
query.fields().exclude("details");
query.fields().exclude("noticeImage");
query.fields().exclude("ticketTimeList");
query.fields().exclude("describeElectronic");
query.addCriteria(Criteria.where("performancesId").is(id));
KylinPerformanceVo one = mongoTemplate.findOne(query, KylinPerformanceVo.class, KylinPerformanceVo.class.getSimpleName());
if (one != null) {
//增加redis缓存
redisUtil.set(key + id, one);
toDayList.add(one);
}
}
KylinPerformanceVo one = getPerformanceVo(id);
toDayList.add(one);
});
}
return toDayList;
......@@ -766,8 +740,7 @@ public class DataUtils {
idsList.put("toDayCombinationIds", toDayCombinationIds);
idsList.put("threeDayCombinationIds", threeDayCombinationIds);
idsList.put("now", nowTimeTime);
String redisKeyIds = KylinRedisConst.PERFORMANCES_LIST_NOTICE_IDS;
redisUtil.set(redisKeyIds, idsList);
setRedisNoticeIsd(idsList);
return idsList;
}
......@@ -1061,6 +1034,20 @@ public class DataUtils {
}
}
public void setRedisNoticeIsd(HashMap<String, Object> idsList) {
String redisKeyIds = KylinRedisConst.PERFORMANCES_LIST_NOTICE_IDS;
redisUtil.set(redisKeyIds, idsList);
}
public Map<String, Object> getRedisNoticeIsd() {
String redisKeyIds = KylinRedisConst.PERFORMANCES_LIST_NOTICE_IDS;
Object obj = redisUtil.get(redisKeyIds);
if (obj != null) {
return (HashMap<String, Object>) obj;
}
return null;
}
/**
* 获取我的演出列表
*/
......
......@@ -2,7 +2,7 @@ package com.liquidnet.service.kylin.utils;
import com.liquidnet.service.adam.dto.vo.AdamEntersVo;
import com.liquidnet.service.base.PagedResult;
import com.liquidnet.service.goblin.dto.vo.GoblinListCollectVo;
import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.kylin.dto.vo.KylinApiCameraDevicesVo;
import com.liquidnet.service.kylin.dto.vo.admin.OrderRefundPoundage;
import com.liquidnet.service.kylin.dto.vo.middle.KylinTicketTimesVo;
......@@ -36,12 +36,32 @@ public class ObjectUtil {
/*正在热卖*/
private static final ArrayList<GoblinListCollectVo> goblinListCollectVo = new ArrayList<>();
private static final ArrayList<NoticeGoblinGoodsSkuInfoVo> noticeGoblinGoodsSkuInfoVoArrayList = new ArrayList<>();
private static final ArrayList<NoticeGoblinMixDetailsVo> noticeGoblinMixDetailsVoArrayList = new ArrayList<>();
private static final ArrayList<GoblinMixDetailsVo> goblinMixDetailsVoArrayList = new ArrayList<>();
private static final ArrayList<GoblinGoodsSkuInfoVo> goblinGoodsSkuInfoVoArrayList = new ArrayList<>();
public static ArrayList<KylinStationPerformanceVo> getKylinStationPerformanceVoArrayList() {
return (ArrayList<KylinStationPerformanceVo>) kylinStationPerformanceVoArrayList.clone();
}
public static ArrayList<NoticeGoblinGoodsSkuInfoVo> getNoticeGoblinGoodsSkuInfoVoList() {
return (ArrayList<NoticeGoblinGoodsSkuInfoVo>) noticeGoblinGoodsSkuInfoVoArrayList.clone();
}
public static ArrayList<GoblinGoodsSkuInfoVo> getGoblinGoodsSkuInfoVoList() {
return (ArrayList<GoblinGoodsSkuInfoVo>) goblinGoodsSkuInfoVoArrayList.clone();
}
public static ArrayList<NoticeGoblinMixDetailsVo> getNoticeGoblinMixDetailsVoList() {
return (ArrayList<NoticeGoblinMixDetailsVo>) noticeGoblinMixDetailsVoArrayList.clone();
}
public static ArrayList<GoblinMixDetailsVo> getGoblinMixDetailsVoList() {
return (ArrayList<GoblinMixDetailsVo>) goblinMixDetailsVoArrayList.clone();
}
public static ArrayList<KylinTicketVo> getKylinTicketVoArrayList() {
return (ArrayList<KylinTicketVo>) kylinTicketVoArrayList.clone();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment