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

Commit a5a113f3 authored by GaoHu's avatar GaoHu

旧版方式保留

parent 19e66f15
...@@ -75,4 +75,11 @@ public class InnerController { ...@@ -75,4 +75,11 @@ public class InnerController {
return ResponseDto.success(map); return ResponseDto.success(map);
} }
@GetMapping("/setNoticeIdsOld")
@ApiOperation("演出预告列表定时任务旧版保留")
public ResponseDto<HashMap<String,Object>> setNoticeIdsOld(){
HashMap<String, Object> map = kylinPerformancesService.setNoticeIdsOld();
return ResponseDto.success(map);
}
} }
...@@ -183,6 +183,10 @@ public class KylinPerformancesServiceImpl implements IKylinPerformancesService { ...@@ -183,6 +183,10 @@ public class KylinPerformancesServiceImpl implements IKylinPerformancesService {
return dataUtils.setNoticeIds(); return dataUtils.setNoticeIds();
} }
public HashMap<String,Object> setNoticeIdsOld() {
return dataUtils.setNoticeIdsOld();
}
private List<KylinPerformanceVo> mergeRoadList(List<KylinPerformanceVo> performanceList) { private List<KylinPerformanceVo> mergeRoadList(List<KylinPerformanceVo> performanceList) {
List<String> roadIdList = new ArrayList<>(); List<String> roadIdList = new ArrayList<>();
List<KylinPerformanceVo> newList = ObjectUtil.getKylinPerformanceVoArrayList(); List<KylinPerformanceVo> newList = ObjectUtil.getKylinPerformanceVoArrayList();
......
...@@ -717,6 +717,65 @@ public class DataUtils { ...@@ -717,6 +717,65 @@ public class DataUtils {
return idsList; return idsList;
} }
public HashMap<String, Object> setNoticeIdsOld() {
// 固定条件
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());
List<String> toDayIds = toDayList.stream().map(KylinPerformanceVo::getPerformancesId).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());
List<String> threeDayIds = threeDaysList.stream().map(KylinPerformanceVo::getPerformancesId).collect(Collectors.toList());
//数字藏品
LocalDateTime nowTimeTime = null;
List<String> toDayNftIds = null;
List<String> threeNftIds = null;
//组合购
List<String> toDayCombinationIds = null;
List<String> threeDayCombinationIds = null;
//缓存ids
HashMap<String, Object> idsList = CollectionUtil.mapStringObject();
idsList.put("toDayIds", toDayIds);
idsList.put("threeDayIds", threeDayIds);
idsList.put("toDayNftIds", toDayNftIds);
idsList.put("threeNftIds", threeNftIds);
idsList.put("toDayCombinationIds", toDayCombinationIds);
idsList.put("threeDayCombinationIds", threeDayCombinationIds);
idsList.put("now", nowTimeTime);
String redisKeyIds = KylinRedisConst.PERFORMANCES_LIST_NOTICE_IDS;
redisUtil.set(redisKeyIds, idsList);
return idsList;
}
// private List<GoblinGoodsSkuInfoVo> getAboutNftByStartAndEndTime(LocalDateTime nowTime, LocalDateTime EndTime,Integer tag) { // private List<GoblinGoodsSkuInfoVo> getAboutNftByStartAndEndTime(LocalDateTime nowTime, LocalDateTime EndTime,Integer tag) {
private List<String> getAboutNftByStartAndEndTime(LocalDateTime nowTime, LocalDateTime EndTime, Integer tag) { private List<String> getAboutNftByStartAndEndTime(LocalDateTime nowTime, LocalDateTime EndTime, Integer tag) {
Query aboutQuery = new Query(); Query aboutQuery = new Query();
......
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