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

Commit e4fab6bd authored by GaoHu's avatar GaoHu

修改:演出预告列表

parent a28b26ed
...@@ -368,7 +368,6 @@ public class DataUtils { ...@@ -368,7 +368,6 @@ public class DataUtils {
String redisKeyIds = KylinRedisConst.PERFORMANCES_LIST_NOTICE_IDS; String redisKeyIds = KylinRedisConst.PERFORMANCES_LIST_NOTICE_IDS;
Object obj = redisUtil.get(redisKeyIds); Object obj = redisUtil.get(redisKeyIds);
if (obj != null) { if (obj != null) {
//获取ids //获取ids
HashMap<String, Object> map = (HashMap<String, Object>) obj; HashMap<String, Object> map = (HashMap<String, Object>) obj;
List<Integer> toDayIds = (List<Integer>) map.get("toDayIds"); List<Integer> toDayIds = (List<Integer>) map.get("toDayIds");
...@@ -384,90 +383,25 @@ public class DataUtils { ...@@ -384,90 +383,25 @@ public class DataUtils {
List<GoblinGoodsSkuInfoVo> threeNftList = new ArrayList<>(); List<GoblinGoodsSkuInfoVo> threeNftList = new ArrayList<>();
List<GoblinMixDetailsVo> toDayCombinationList = new ArrayList<>(); List<GoblinMixDetailsVo> toDayCombinationList = new ArrayList<>();
List<GoblinMixDetailsVo> threeDayCombinationList = new ArrayList<>(); List<GoblinMixDetailsVo> threeDayCombinationList = new ArrayList<>();
// 固定条件 // 固定条件
if (toDayIds != null && toDayIds.size() > 0) { toDayList = getKylinPerformanceVos(toDayIds, toDayList);
Query query = new Query();
query.fields().exclude("details");
query.fields().exclude("noticeImage");
query.fields().exclude("ticketTimeList");
query.fields().exclude("describeElectronic");
query.addCriteria(Criteria.where("mid").in(toDayIds));
toDayList = mongoTemplate.find(query, KylinPerformanceVo.class, KylinPerformanceVo.class.getSimpleName());
}
// 固定条件 // 固定条件
if (threeDayIds != null && threeDayIds.size() > 0) { threeDaysList = getKylinPerformanceVos(threeDayIds, threeDaysList);
Query queryT = new Query();
queryT.fields().exclude("details");
queryT.fields().exclude("noticeImage");
queryT.fields().exclude("ticketTimeList");
queryT.fields().exclude("describeElectronic");
queryT.addCriteria(Criteria.where("mid").in(threeDayIds));
threeDaysList = mongoTemplate.find(queryT, KylinPerformanceVo.class, KylinPerformanceVo.class.getSimpleName());
}
//数字藏品 //数字藏品
//当天 //当天
if (toDayNftIds != null && toDayNftIds.size() > 0) { toDaysNftList = getGoblinGoodsSkuInfoVos(toDayNftIds, toDaysNftList);
Query queryToDayNft = new Query();
queryToDayNft.fields().exclude("extagVoList");
queryToDayNft.addCriteria(Criteria.where("skuId").in(toDayNftIds));
toDaysNftList = mongoTemplate.find(queryToDayNft, GoblinGoodsSkuInfoVo.class, GoblinGoodsSkuInfoVo.class.getSimpleName());
}
//三天的 //三天的
if (threeNftIds != null && threeNftIds.size() > 0) { threeNftList = getGoblinGoodsSkuInfoVos(threeNftIds, threeNftList);
Query queryThreeNft = new Query();
queryThreeNft.fields().exclude("extagVoList");
queryThreeNft.addCriteria(Criteria.where("skuId").in(threeNftIds));
threeNftList = mongoTemplate.find(queryThreeNft, GoblinGoodsSkuInfoVo.class, GoblinGoodsSkuInfoVo.class.getSimpleName());
}
//组合购 //组合购
//当天 //当天
if (toDayCombinationIds != null && toDayCombinationIds.size() > 0) { toDayCombinationList = getGoblinMixDetailsVos(toDayCombinationIds, toDayCombinationList);
Query queryToDayCombination = new Query();
Sort sortToDayCombination = Sort.by(Sort.Direction.ASC, "saleStartTime");
queryToDayCombination.with(sortToDayCombination);
queryToDayCombination.fields().exclude("details");
queryToDayCombination.addCriteria(Criteria.where("mixId").in(toDayCombinationIds));
toDayCombinationList = mongoTemplate.find(queryToDayCombination, GoblinMixDetailsVo.class, GoblinMixDetailsVo.class.getSimpleName());
toDayCombinationList.forEach(goblinMixDetailsVo -> {
List<GoblinMixDetailsItemVo> item = goblinMixDetailsVo.getItem();
item.forEach(goblinMixDetailsItemVo ->{
Query query = new Query();
query.addCriteria(Criteria.where("skuId").is(goblinMixDetailsItemVo.getSkuId()));
GoblinGoodsSkuInfoVo one = mongoTemplate.findOne(query, GoblinGoodsSkuInfoVo.class, GoblinGoodsSkuInfoVo.class.getSimpleName());
if (one!=null){
goblinMixDetailsItemVo.setSkuName(one.getName());
}
});
});
}
//三天 //三天
if (threeDayCombinationIds != null && threeDayCombinationIds.size() > 0) { threeDayCombinationList = getGoblinMixDetailsVos(threeDayCombinationIds, threeDayCombinationList);
Query queryThreeDayCombination = new Query();
Sort sortThreeDayCombination = Sort.by(Sort.Direction.ASC, "saleStartTime");
queryThreeDayCombination.with(sortThreeDayCombination);
queryThreeDayCombination.fields().exclude("details");
queryThreeDayCombination.addCriteria(Criteria.where("mixId").in(threeDayCombinationIds));
threeDayCombinationList = mongoTemplate.find(queryThreeDayCombination, GoblinMixDetailsVo.class, GoblinMixDetailsVo.class.getSimpleName());
threeDayCombinationList.forEach(goblinMixDetailsVo -> {
List<GoblinMixDetailsItemVo> item = goblinMixDetailsVo.getItem();
item.forEach(goblinMixDetailsItemVo ->{
Query query = new Query();
query.addCriteria(Criteria.where("skuId").is(goblinMixDetailsItemVo.getSkuId()));
GoblinGoodsSkuInfoVo one = mongoTemplate.findOne(query, GoblinGoodsSkuInfoVo.class, GoblinGoodsSkuInfoVo.class.getSimpleName());
if (one!=null){
goblinMixDetailsItemVo.setSkuName(one.getName());
}
});
});
}
HashMap<String, Object> info = CollectionUtil.mapStringObject(); HashMap<String, Object> info = CollectionUtil.mapStringObject();
info.put("toDayList", toDayList); info.put("toDayList", toDayList);
...@@ -481,6 +415,52 @@ public class DataUtils { ...@@ -481,6 +415,52 @@ public class DataUtils {
return (HashMap<String, Object>) obj; return (HashMap<String, Object>) obj;
} }
private List<GoblinMixDetailsVo> getGoblinMixDetailsVos(List<String> toDayCombinationIds, List<GoblinMixDetailsVo> toDayCombinationList) {
if (toDayCombinationIds != null && toDayCombinationIds.size() > 0) {
Query queryToDayCombination = new Query();
Sort sortToDayCombination = Sort.by(Sort.Direction.ASC, "saleStartTime");
queryToDayCombination.with(sortToDayCombination);
queryToDayCombination.fields().exclude("details");
queryToDayCombination.addCriteria(Criteria.where("mixId").in(toDayCombinationIds));
toDayCombinationList = mongoTemplate.find(queryToDayCombination, GoblinMixDetailsVo.class, GoblinMixDetailsVo.class.getSimpleName());
toDayCombinationList.forEach(goblinMixDetailsVo -> {
List<GoblinMixDetailsItemVo> item = goblinMixDetailsVo.getItem();
item.forEach(goblinMixDetailsItemVo ->{
Query query = new Query();
query.addCriteria(Criteria.where("skuId").is(goblinMixDetailsItemVo.getSkuId()));
GoblinGoodsSkuInfoVo one = mongoTemplate.findOne(query, GoblinGoodsSkuInfoVo.class, GoblinGoodsSkuInfoVo.class.getSimpleName());
if (one!=null){
goblinMixDetailsItemVo.setSkuName(one.getName());
}
});
});
}
return toDayCombinationList;
}
private List<GoblinGoodsSkuInfoVo> getGoblinGoodsSkuInfoVos(List<String> toDayNftIds, List<GoblinGoodsSkuInfoVo> toDaysNftList) {
if (toDayNftIds != null && toDayNftIds.size() > 0) {
Query queryToDayNft = new Query();
queryToDayNft.fields().exclude("extagVoList");
queryToDayNft.addCriteria(Criteria.where("skuId").in(toDayNftIds));
toDaysNftList = mongoTemplate.find(queryToDayNft, GoblinGoodsSkuInfoVo.class, GoblinGoodsSkuInfoVo.class.getSimpleName());
}
return toDaysNftList;
}
private List<KylinPerformanceVo> getKylinPerformanceVos(List<Integer> toDayIds, List<KylinPerformanceVo> toDayList) {
if (toDayIds != null && toDayIds.size() > 0) {
Query query = new Query();
query.fields().exclude("details");
query.fields().exclude("noticeImage");
query.fields().exclude("ticketTimeList");
query.fields().exclude("describeElectronic");
query.addCriteria(Criteria.where("mid").in(toDayIds));
toDayList = mongoTemplate.find(query, KylinPerformanceVo.class, KylinPerformanceVo.class.getSimpleName());
}
return toDayList;
}
//执行脚本 //执行脚本
public HashMap<String,Object> setRedisIds() { public HashMap<String,Object> setRedisIds() {
// 固定条件 // 固定条件
......
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