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

Commit 895fd5ce authored by GaoHu's avatar GaoHu

修改:演出预告列表

parent cd5fc4fb
......@@ -38,12 +38,6 @@
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-goblin-api</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
......
......@@ -155,6 +155,8 @@ public class KylinPerformancesServiceImpl implements IKylinPerformancesService {
List<KylinPerformanceVo> threeDaysList = (List<KylinPerformanceVo>) performancesListNotice.get("threeDaysList");
List<GoblinGoodsSkuInfoVo> toDaysNftList = (List<GoblinGoodsSkuInfoVo>) performancesListNotice.get("toDaysNftList");
List<GoblinGoodsSkuInfoVo> threeNftList = (List<GoblinGoodsSkuInfoVo>) performancesListNotice.get("threeNftList");
List<GoblinGoodsSkuInfoVo> toDayCombinationList = (List<GoblinGoodsSkuInfoVo>) performancesListNotice.get("toDayCombinationList");
List<GoblinGoodsSkuInfoVo> threeDayCombinationList = (List<GoblinGoodsSkuInfoVo>) performancesListNotice.get("threeDayCombinationList");
toDayList = checkAppStatus(toDayList);
threeDaysList = checkAppStatus(threeDaysList);
......@@ -168,6 +170,8 @@ public class KylinPerformancesServiceImpl implements IKylinPerformancesService {
newList.put("threeDaysList", threeDaysList);
newList.put("toDaysNftList",toDaysNftList);
newList.put("threeNftList",threeNftList);
newList.put("toDayCombinationList",toDayCombinationList);
newList.put("threeDayCombinationList",threeDayCombinationList);
return newList;
}
......
package com.liquidnet.service.kylin.utils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinGoodsAnticipateValueVo;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinMixDetailsItemVo;
import com.liquidnet.service.goblin.dto.vo.GoblinMixDetailsVo;
import com.liquidnet.service.goblin.entity.GoblinGoodsSku;
import com.liquidnet.service.goblin.mapper.GoblinGoodsSkuMapper;
import com.liquidnet.service.kylin.constant.KylinRedisConst;
import com.liquidnet.service.kylin.constant.KylinTableStatusConst;
import com.liquidnet.service.kylin.dto.vo.KylinApiCameraDevicesVo;
......@@ -356,9 +364,6 @@ public class DataUtils {
* 获取演出预告列表redis
*/
public HashMap<String, Object> getPerformancesListNotice() {
mongoTemplate.find(new Query().addCriteria(Criteria.where("skuId").is("0")), KylinPerformanceVo.class, KylinPerformanceVo.class.getSimpleName());
String redisKeyIds = KylinRedisConst.PERFORMANCES_LIST_NOTICE_IDS;
Object obj = redisUtil.get(redisKeyIds);
if (obj != null) {
......@@ -369,25 +374,37 @@ public class DataUtils {
List<Integer> threeDayIds = (List<Integer>) map.get("threeDayIds");
List<String> toDayNftIds = (List<String>) map.get("toDayNftIds");
List<String> threeNftIds = (List<String>) map.get("threeNftIds");
List<String> toDayCombinationIds = (List<String>) map.get("toDayCombinationIds");
List<String> threeDayCombinationIds = (List<String>) map.get("threeDayCombinationIds");
// 固定条件
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));
List<KylinPerformanceVo> toDayList = mongoTemplate.find(query, KylinPerformanceVo.class, KylinPerformanceVo.class.getSimpleName());
// 固定条件
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));
List<KylinPerformanceVo> threeDaysList = mongoTemplate.find(queryT, KylinPerformanceVo.class, KylinPerformanceVo.class.getSimpleName());
//数字藏品
//当天
Query queryToDayNft = new Query();
queryToDayNft.fields().exclude("extagVoList");
queryToDayNft.addCriteria(Criteria.where("skuId").in(toDayNftIds));
List<GoblinGoodsSkuInfoVo> toDaysNftList = mongoTemplate.find(queryToDayNft, GoblinGoodsSkuInfoVo.class, GoblinGoodsSkuInfoVo.class.getSimpleName());
//三天的
Query queryThreeNft = new Query();
queryToDayNft.fields().exclude("extagVoList");
queryThreeNft.addCriteria(Criteria.where("skuId").in(threeNftIds));
List<GoblinGoodsSkuInfoVo> threeNftList = mongoTemplate.find(queryThreeNft, GoblinGoodsSkuInfoVo.class, GoblinGoodsSkuInfoVo.class.getSimpleName());
......@@ -396,14 +413,16 @@ public class DataUtils {
//当天
Query queryToDayCombination = new Query();
Sort sortToDayCombination = Sort.by(Sort.Direction.ASC, "saleStartTime");
queryThreeNft.with(sortToDayCombination);
List<Object> toDayCombinationList = new ArrayList<>();
queryToDayCombination.with(sortToDayCombination);
queryToDayCombination.addCriteria(Criteria.where("mixId").in(toDayCombinationIds));
List<GoblinMixDetailsVo> toDayCombinationList = mongoTemplate.find(queryToDayCombination, GoblinMixDetailsVo.class, GoblinMixDetailsVo.class.getSimpleName());
//三天
Query queryThreeDayCombination = new Query();
Sort sortThreeDayCombination = Sort.by(Sort.Direction.ASC, "saleStartTime");
queryThreeNft.with(sortThreeDayCombination);
List<Object> threeDayCombinationList = new ArrayList<>();
queryThreeDayCombination.with(sortThreeDayCombination);
queryThreeDayCombination.addCriteria(Criteria.where("mixId").in(toDayCombinationIds));
List<GoblinMixDetailsVo> threeDayCombinationList = mongoTemplate.find(queryThreeDayCombination, GoblinMixDetailsVo.class, GoblinMixDetailsVo.class.getSimpleName());
HashMap<String, Object> info = CollectionUtil.mapStringObject();
......@@ -418,14 +437,13 @@ public class DataUtils {
return (HashMap<String, Object>) obj;
}
//执行脚本
public Boolean setRedisIds() {
String redisKeyIds = KylinRedisConst.PERFORMANCES_LIST_NOTICE_IDS;
// 固定条件
Query query = getCommonWhere();
// 排序
Sort sortName = Sort.by(Sort.Direction.ASC, "sellTime");
query.with(sortName);
// 今天的
HashMap toDayTime = DateUtil.oneDayStartEnd();
String nowTimeTStr = (String) toDayTime.get("startStr");
......@@ -438,19 +456,16 @@ public class DataUtils {
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<Integer> toDayIds = toDayList.stream().map(KylinPerformanceVo::getMid).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");
......@@ -459,50 +474,75 @@ public class DataUtils {
queryT.addCriteria(Criteria.where("roadShowId").nin(roadShowId));
List<KylinPerformanceVo> threeDaysList = mongoTemplate.find(queryT, KylinPerformanceVo.class, KylinPerformanceVo.class.getSimpleName());
List<Integer> threeDayIds = threeDaysList.stream().map(KylinPerformanceVo::getMid).collect(Collectors.toList());
//数字藏品
//当天
Query queryToDayNft = new Query();
LocalDateTime nowTimeTime = DateUtil.asLocalDateTime((Date) toDayTime.get("start"));
LocalDateTime toDayEndTime = DateUtil.asLocalDateTime((Date) toDayTime.get("end"));
LocalDateTime threeEndTime = DateUtil.asLocalDateTime(beforeDayEnd);
//查询预约(当天)
// List<GoblinGoodsSkuInfoVo> toDayAboutNft = getAboutNftByStartAndEndTime(nowTimeTime, toDayEndTime,0);
// List<String> toDayAboutNftSkuIds = toDayAboutNft.stream().map(GoblinGoodsSkuInfoVo::getSkuId).collect(Collectors.toList());
List<String> toDayAboutNft = getAboutNftByStartAndEndTime(nowTimeTime, toDayEndTime,0);
//查询预约(三天)
// List<GoblinGoodsSkuInfoVo> threeDayAboutNft = getAboutNftByStartAndEndTime(toDayEndTime, threeEndTime,1);
// List<String> threeDayAboutNftSkuIds = threeDayAboutNft.stream().map(GoblinGoodsSkuInfoVo::getSkuId).collect(Collectors.toList());
// toDayAboutNftSkuIds.addAll(threeDayAboutNftSkuIds);
List<String> threeDayAboutNft = getAboutNftByStartAndEndTime(toDayEndTime, threeEndTime,1);
ArrayList<String> allListSkuIds = new ArrayList<>();
allListSkuIds.addAll(toDayAboutNft);
allListSkuIds.addAll(threeDayAboutNft);
//当天
Query queryToDayNft = new Query();
queryToDayNft.addCriteria(Criteria.where("skuType").is(1));
queryToDayNft.addCriteria(Criteria.where("delFlg").is("0"));
queryToDayNft.addCriteria(Criteria.where("saleStartTime").gte(nowTimeTime).lt(toDayEndTime));
// queryToDayNft.addCriteria(Criteria.where("skuId").nin(toDayAboutNftSkuIds));
queryToDayNft.addCriteria(Criteria.where("skuId").nin(allListSkuIds));
queryToDayNft.addCriteria(Criteria.where("shelvesHandle").ne("3"));
Sort sortNameToDayNft = Sort.by(Sort.Direction.ASC, "saleStartTime");
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.addAll(toDayAboutNft);
//三天的
Query queryThreeNft = new Query();
LocalDateTime threeEndTime = DateUtil.asLocalDateTime(beforeDayEnd);
queryThreeNft.addCriteria(Criteria.where("skuType").is(1));
queryThreeNft.addCriteria(Criteria.where("delFlg").is("0"));
queryThreeNft.addCriteria(Criteria.where("saleStartTime").gte(toDayEndTime).lt(threeEndTime));
queryThreeNft.addCriteria(Criteria.where("skuId").nin(toDayNftIds));
queryThreeNft.addCriteria(Criteria.where("skuId").nin(allListSkuIds));
queryThreeNft.addCriteria(Criteria.where("shelvesHandle").ne("3"));
Sort sortThreeNft = Sort.by(Sort.Direction.ASC, "saleStartTime");
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.addAll(threeDayAboutNft);
//组合购
//当天
Query queryToDayCombination = new Query();
Sort sortToDayCombination = Sort.by(Sort.Direction.ASC, "saleStartTime");
queryToDayCombination.addCriteria(Criteria.where("saleStartTime").gte(toDayEndTime).lt(threeEndTime));
queryThreeNft.with(sortToDayCombination);
List<Object> toDayCombinationList = new ArrayList<>();
List<String> toDayCombinationIds = new ArrayList<>();
queryToDayCombination.addCriteria(Criteria.where("timeStart").gte(nowTimeTStr).lt(toDayEndTimeStr));
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());
//三天
Query queryThreeDayCombination = new Query();
Sort sortThreeDayCombination = Sort.by(Sort.Direction.ASC, "saleStartTime");
queryThreeDayCombination.addCriteria(Criteria.where("saleStartTime").gte(toDayEndTime).lt(threeEndTime));
queryThreeNft.with(sortThreeDayCombination);
List<Object> threeDayCombinationList = new ArrayList<>();
List<String> threeDayCombinationIds = new ArrayList<>();
queryThreeDayCombination.addCriteria(Criteria.where("timeStart").gte(toDayEndTimeStr).lt(threeDaysLaterStr));
queryToDayCombination.addCriteria(Criteria.where("status").ne(7));
queryThreeDayCombination.with(sortThreeDayCombination);
List<GoblinMixDetailsVo> threeDayCombinationList = mongoTemplate.find(queryToDayCombination, GoblinMixDetailsVo.class, GoblinMixDetailsVo.class.getSimpleName());
List<String> threeDayCombinationIds = threeDayCombinationList.stream().map(GoblinMixDetailsVo::getMixId).collect(Collectors.toList());
//缓存ids
HashMap<String, Object> idsList = CollectionUtil.mapStringObject();
idsList.put("toDayIds", toDayIds);
idsList.put("threeDayIds", threeDayIds);
......@@ -510,11 +550,35 @@ public class DataUtils {
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 true;
}
// private List<GoblinGoodsSkuInfoVo> getAboutNftByStartAndEndTime(LocalDateTime nowTime, LocalDateTime EndTime,Integer tag) {
private List<String> getAboutNftByStartAndEndTime(LocalDateTime nowTime, LocalDateTime EndTime,Integer tag) {
Query aboutQuery = new Query();
if (tag.equals(0)){
//当天 查询当天可预约的nft 预约结束时间>当前时间>预约开始
aboutQuery.addCriteria(Criteria.where("aboutStartDate").lt(nowTime));
aboutQuery.addCriteria(Criteria.where("aboutEndDate").gte(EndTime));
}else {
//三天 预约开始时间 范围在三天以内
aboutQuery.addCriteria(Criteria.where("aboutStartDate").gte(nowTime).lt(EndTime));
}
aboutQuery.addCriteria(Criteria.where("delTag").is(0));
List<GoblinGoodsAnticipateValueVo> aboutQueryList = mongoTemplate.find(aboutQuery, GoblinGoodsAnticipateValueVo.class, GoblinGoodsAnticipateValueVo.class.getSimpleName());
List<String> aboutIds = aboutQueryList.stream().map(GoblinGoodsAnticipateValueVo::getSkuId).collect(Collectors.toList());
if (aboutIds.size()>0){
/* Query queryAbout = new Query();
queryAbout.addCriteria(Criteria.where("skuId").in(aboutIds));
return mongoTemplate.find(queryAbout, GoblinGoodsSkuInfoVo.class, GoblinGoodsSkuInfoVo.class.getSimpleName());*/
return aboutIds;
}
return new ArrayList<>();
}
/**
* 获取推荐演出列表redis
*/
......
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