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

Commit 78e47e97 authored by GaoHu's avatar GaoHu

异常拦截

parent 596c4a85
......@@ -396,24 +396,35 @@ public class DataUtils {
}).collect(Collectors.toList());*/
//数字藏品
List<NoticeGoblinGoodsSkuInfoVo> toDayNftVoList = null;
List<NoticeGoblinGoodsSkuInfoVo> threeDayNftVoList = null;
try {
//当天
List<GoblinGoodsSkuInfoVo> toDaysNftList = getGoblinGoodsSkuInfoVos(toDayNftIds);
String anticipateKey = GoblinRedisConst.ANTICIPATE_VALUE_SKUID;
List<NoticeGoblinGoodsSkuInfoVo> toDayNftVoList = aboutDayNftVoList(toDaysNftList, anticipateKey);
toDayNftVoList = aboutDayNftVoList(toDaysNftList);
//三天的
List<GoblinGoodsSkuInfoVo> threeNftList = getGoblinGoodsSkuInfoVos(threeNftIds);
List<NoticeGoblinGoodsSkuInfoVo> threeDayNftVoList = aboutDayNftVoList(threeNftList, anticipateKey);
threeDayNftVoList = aboutDayNftVoList(threeNftList);
} catch (Exception e) {
log.error("return NftVoList error!");
}
//组合购
List<NoticeGoblinMixDetailsVo> toDayCombinationVoList = null;
List<NoticeGoblinMixDetailsVo> threeDayCombinationVoList = null;
try {
//当天
List<GoblinMixDetailsVo> toDayCombinationList = getGoblinMixDetailsVos(toDayCombinationIds);
List<NoticeGoblinMixDetailsVo> toDayCombinationVoList = toDayCombinationList.stream().map(goblinMixDetailsVo -> NoticeGoblinMixDetailsVo.getNew().copy(goblinMixDetailsVo)).collect(Collectors.toList());
toDayCombinationVoList = toDayCombinationList.stream().map(goblinMixDetailsVo -> NoticeGoblinMixDetailsVo.getNew().copy(goblinMixDetailsVo)).collect(Collectors.toList());
//三天
List<GoblinMixDetailsVo> threeDayCombinationList = getGoblinMixDetailsVos(threeDayCombinationIds);
List<NoticeGoblinMixDetailsVo> threeDayCombinationVoList = threeDayCombinationList.stream().map(goblinMixDetailsVo -> NoticeGoblinMixDetailsVo.getNew().copy(goblinMixDetailsVo)).collect(Collectors.toList());
threeDayCombinationVoList = threeDayCombinationList.stream().map(goblinMixDetailsVo -> NoticeGoblinMixDetailsVo.getNew().copy(goblinMixDetailsVo)).collect(Collectors.toList());
} catch (Exception e) {
log.error("return CombinationVoList error!");
}
HashMap<String, Object> info = CollectionUtil.mapStringObject();
info.put("toDayList", toDayList);
......@@ -434,8 +445,9 @@ public class DataUtils {
return (HashMap<String, Object>) obj;
}
private List<NoticeGoblinGoodsSkuInfoVo> aboutDayNftVoList(List<GoblinGoodsSkuInfoVo> toDaysNftList, String anticipateKey) {
private List<NoticeGoblinGoodsSkuInfoVo> aboutDayNftVoList(List<GoblinGoodsSkuInfoVo> toDaysNftList) {
LocalDateTime now = LocalDateTime.now();
String anticipateKey = GoblinRedisConst.ANTICIPATE_VALUE_SKUID;
List<NoticeGoblinGoodsSkuInfoVo> toDayNftVoList = toDaysNftList.stream().map(goblinGoodsSkuInfoVo -> {
NoticeGoblinGoodsSkuInfoVo noticeGoblinGoodsSkuInfoVo = NoticeGoblinGoodsSkuInfoVo.getNew().copy(goblinGoodsSkuInfoVo);
......@@ -571,14 +583,6 @@ public class DataUtils {
}
}
});
//查询mongodb
/*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;
}
......@@ -622,7 +626,11 @@ public class DataUtils {
List<String> threeDayIds = threeDaysList.stream().map(KylinPerformanceVo::getPerformancesId).collect(Collectors.toList());
//数字藏品
LocalDateTime nowTimeTime = DateUtil.asLocalDateTime((Date) toDayTime.get("start"));
LocalDateTime nowTimeTime = null;
List<String> toDayNftIds = null;
List<String> threeNftIds = null;
try {
nowTimeTime = DateUtil.asLocalDateTime((Date) toDayTime.get("start"));
LocalDateTime toDayEndTime = DateUtil.asLocalDateTime((Date) toDayTime.get("end"));
LocalDateTime threeEndTime = DateUtil.asLocalDateTime(beforeDayEnd);
//查询预约(当天)
......@@ -650,7 +658,7 @@ public class DataUtils {
queryToDayNft.with(sortNameToDayNft);
List<GoblinGoodsSkuInfoVo> toDaysNftList = mongoTemplate.find(queryToDayNft, GoblinGoodsSkuInfoVo.class, GoblinGoodsSkuInfoVo.class.getSimpleName());
// toDaysNftList.addAll(toDayAboutNft);
List<String> toDayNftIds = toDaysNftList.stream().map(GoblinGoodsSkuInfoVo::getSkuId).collect(Collectors.toList());
toDayNftIds = toDaysNftList.stream().map(GoblinGoodsSkuInfoVo::getSkuId).collect(Collectors.toList());
/*toDayNftIds.addAll(toDayAboutNft);*/
//三天的
......@@ -664,11 +672,16 @@ public class DataUtils {
queryThreeNft.with(sortThreeNft);
List<GoblinGoodsSkuInfoVo> threeNftList = mongoTemplate.find(queryThreeNft, GoblinGoodsSkuInfoVo.class, GoblinGoodsSkuInfoVo.class.getSimpleName());
// threeNftList.addAll(threeDayAboutNft);
List<String> threeNftIds = threeNftList.stream().map(GoblinGoodsSkuInfoVo::getSkuId).collect(Collectors.toList());
threeNftIds = threeNftList.stream().map(GoblinGoodsSkuInfoVo::getSkuId).collect(Collectors.toList());
/*threeNftIds.addAll(threeDayAboutNft);*/
} catch (Exception e) {
log.error("get NftIds error!");
}
//组合购
List<String> toDayCombinationIds = null;
List<String> threeDayCombinationIds = null;
try {
//当天
Query queryToDayCombination = new Query();
Sort sortToDayCombination = Sort.by(Sort.Direction.ASC, "saleStartTime");
......@@ -676,7 +689,7 @@ public class DataUtils {
queryToDayCombination.addCriteria(Criteria.where("status").ne(7));
queryToDayCombination.with(sortToDayCombination);
List<GoblinMixDetailsVo> toDayCombinationList = mongoTemplate.find(queryToDayCombination, GoblinMixDetailsVo.class, GoblinMixDetailsVo.class.getSimpleName());
List<String> toDayCombinationIds = toDayCombinationList.stream().map(GoblinMixDetailsVo::getMixId).collect(Collectors.toList());
toDayCombinationIds = toDayCombinationList.stream().map(GoblinMixDetailsVo::getMixId).collect(Collectors.toList());
//三天
Query queryThreeDayCombination = new Query();
Sort sortThreeDayCombination = Sort.by(Sort.Direction.ASC, "saleStartTime");
......@@ -684,7 +697,10 @@ public class DataUtils {
queryThreeDayCombination.addCriteria(Criteria.where("status").ne(7));
queryThreeDayCombination.with(sortThreeDayCombination);
List<GoblinMixDetailsVo> threeDayCombinationList = mongoTemplate.find(queryThreeDayCombination, GoblinMixDetailsVo.class, GoblinMixDetailsVo.class.getSimpleName());
List<String> threeDayCombinationIds = threeDayCombinationList.stream().map(GoblinMixDetailsVo::getMixId).collect(Collectors.toList());
threeDayCombinationIds = threeDayCombinationList.stream().map(GoblinMixDetailsVo::getMixId).collect(Collectors.toList());
} catch (Exception e) {
log.error("get CombinationIds error!");
}
//缓存ids
......
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