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

Commit aa51134d authored by 胡佳晨's avatar 胡佳晨

Merge branch 'dev_notice_0708' into dev_bd_rm_consumer_od

parents 4e592bb9 22851157
......@@ -86,6 +86,7 @@ public class KylinPerformancesController {
})
public ResponseDto<HashMap<String, Object>> noticeList(@RequestParam(defaultValue = "") Integer type) {
HashMap<String, Object> result = kylinPerformancesService.noticeList(type);
// HashMap<String, Object> result = kylinPerformancesService.noticeListOld(type);
return ResponseDto.success(result);
}
......
......@@ -179,6 +179,35 @@ public class KylinPerformancesServiceImpl implements IKylinPerformancesService {
return newList;
}
public HashMap<String, Object> noticeListOld(Integer type) {
/*if (-1 != DateUtil.compareStrDay(timeStart, toDayEndTimeStr) && -1 == DateUtil.compareStrDay(timeStart, threeDaysLaterStr)) {
threeDaysList.add(info);
}*/
HashMap<String, Object> performancesListNotice = dataUtils.getPerformancesListNoticeOld();
List<KylinPerformanceVo> toDayList = (List<KylinPerformanceVo>) performancesListNotice.get("toDayList");
List<KylinPerformanceVo> threeDaysList = (List<KylinPerformanceVo>) performancesListNotice.get("threeDaysList");
List<GoblinGoodsSkuInfoVo> toDaysNftList = new ArrayList<>();
List<GoblinGoodsSkuInfoVo> threeDayNftList = new ArrayList<>();
List<GoblinGoodsSkuInfoVo> toDayCombinationList = new ArrayList<>();
List<GoblinGoodsSkuInfoVo> threeDayCombinationList = new ArrayList<>();
toDayList = checkAppStatus(toDayList);
threeDaysList = checkAppStatus(threeDaysList);
if (null != type && type > 0) {
toDayList = mergeRoadList(toDayList);
threeDaysList = mergeRoadList(threeDaysList);
}
HashMap<String, Object> newList = CollectionUtil.mapStringObject();
newList.put("toDayList", toDayList);
newList.put("threeDaysList", threeDaysList);
newList.put("toDaysNftList",toDaysNftList);
newList.put("threeDayNftList",threeDayNftList);
newList.put("toDayCombinationList",toDayCombinationList);
newList.put("threeDayCombinationList",threeDayCombinationList);
return newList;
}
public HashMap<String,Object> setNoticeIds() {
return dataUtils.setNoticeIds();
}
......
......@@ -445,6 +445,60 @@ public class DataUtils {
return (HashMap<String, Object>) obj;
}
/**
* 获取演出预告列表redis
*/
public HashMap<String, Object> getPerformancesListNoticeOld() {
String redisKey = KylinRedisConst.PERFORMANCES_LIST_NOTICE;
Object obj = redisUtil.get(redisKey);
if (obj == null) {
// 固定条件
Query query = getCommonWhere();
// 排序
Sort sortName = Sort.by(Sort.Direction.ASC, "sellTime");
query.with(sortName);
// 今天的
HashMap toDayTime = DateUtil.oneDayStartEnd();
String nowTimeTStr = (String) toDayTime.get("startStr");
String toDayEndTimeStr = (String) toDayTime.get("endStr");
query.addCriteria(Criteria.where("sellTime").gte(nowTimeTStr).lt(toDayEndTimeStr));
query.fields().exclude("details");
query.fields().exclude("noticeImage");
query.fields().exclude("ticketTimeList");
query.fields().exclude("describeElectronic");
List<KylinPerformanceVo> toDayList = mongoTemplate.find(query, KylinPerformanceVo.class, KylinPerformanceVo.class.getSimpleName());
List<String> roadShowId = toDayList.stream().filter(r -> !r.getRoadShowId().equals("0")).map(KylinPerformanceVo -> KylinPerformanceVo.getRoadShowId()).collect(Collectors.toList());
// 固定条件
Query queryT = getCommonWhere();
// 排序
Sort sortNameT = Sort.by(Sort.Direction.ASC, "sellTime");
queryT.with(sortNameT);
// 三天的
Calendar cal = Calendar.getInstance();
cal.setTime((Date) toDayTime.get("end"));
Date beforeDayEnd = DateUtil.getBeforeDayEnd(cal, 2);
String threeDaysLaterStr = DateUtil.SDF_YMD_HMS.format(beforeDayEnd);
queryT.addCriteria(Criteria.where("sellTime").gte(toDayEndTimeStr).lt(threeDaysLaterStr));
queryT.fields().exclude("details");
queryT.fields().exclude("noticeImage");
queryT.fields().exclude("ticketTimeList");
queryT.fields().exclude("describeElectronic");
queryT.addCriteria(Criteria.where("roadShowId").nin(roadShowId));
List<KylinPerformanceVo> threeDaysList = mongoTemplate.find(queryT, KylinPerformanceVo.class, KylinPerformanceVo.class.getSimpleName());
HashMap<String, Object> info = CollectionUtil.mapStringObject();
info.put("toDayList", toDayList);
info.put("threeDaysList", threeDaysList);
redisUtil.set(redisKey, info);
return info;
}
return (HashMap<String, Object>) obj;
}
private List<NoticeGoblinGoodsSkuInfoVo> aboutDayNftVoList(List<GoblinGoodsSkuInfoVo> toDaysNftList) {
LocalDateTime now = LocalDateTime.now();
String anticipateKey = GoblinRedisConst.ANTICIPATE_VALUE_SKUID;
......
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