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

Commit 84605c46 authored by zhengfuxin's avatar zhengfuxin

开发前端获取活动详情

parent 1b25182b
...@@ -38,6 +38,11 @@ ...@@ -38,6 +38,11 @@
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-goblin-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -6,6 +6,7 @@ import com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo; ...@@ -6,6 +6,7 @@ import com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo;
import com.liquidnet.service.kylin.entity.KylinRecommendActive; import com.liquidnet.service.kylin.entity.KylinRecommendActive;
import com.liquidnet.service.kylin.service.IKylinRecommendActiveService; import com.liquidnet.service.kylin.service.IKylinRecommendActiveService;
import com.liquidnet.service.kylin.utils.DataUtils; import com.liquidnet.service.kylin.utils.DataUtils;
import com.liquidnet.service.kylin.utils.KylinRedisUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -22,6 +23,8 @@ import java.util.List; ...@@ -22,6 +23,8 @@ import java.util.List;
public class KylinRecommendActiveServiceImpl implements IKylinRecommendActiveService { public class KylinRecommendActiveServiceImpl implements IKylinRecommendActiveService {
@Autowired @Autowired
private DataUtils dataUtils; private DataUtils dataUtils;
@Autowired
private KylinRedisUtils kylinRedisUtils;
@Override @Override
public List<KylinRecommendActiveVo> getRecommendById(List<KylinRecommendActive> list) { public List<KylinRecommendActiveVo> getRecommendById(List<KylinRecommendActive> list) {
...@@ -34,8 +37,12 @@ public class KylinRecommendActiveServiceImpl implements IKylinRecommendActiveSer ...@@ -34,8 +37,12 @@ public class KylinRecommendActiveServiceImpl implements IKylinRecommendActiveSer
if(kylinRecommendActiveVo.getActiveType()==3){ if(kylinRecommendActiveVo.getActiveType()==3){
//演出 //演出
KylinPerformanceVo performancesInfo = dataUtils.getPerformanceVo(kylinRecommendActiveVo.getActiveBindId()); KylinPerformanceVo performancesInfo = dataUtils.getPerformanceVo(kylinRecommendActiveVo.getActiveBindId());
}else if(kylinRecommendActiveVo.getActiveType()==1||kylinRecommendActiveVo.getActiveType()==4){ }else if(kylinRecommendActiveVo.getActiveType()==1){
//NFT
}else if(kylinRecommendActiveVo.getActiveType()==4){
//商品
kylinRedisUtils.getGoodsInfoVo(kylinRecommendActiveVo.getActiveBindId());
}else if(kylinRecommendActiveVo.getActiveType()==2){ }else if(kylinRecommendActiveVo.getActiveType()==2){
} }
...@@ -45,4 +52,55 @@ public class KylinRecommendActiveServiceImpl implements IKylinRecommendActiveSer ...@@ -45,4 +52,55 @@ public class KylinRecommendActiveServiceImpl implements IKylinRecommendActiveSer
} }
return null; return null;
} }
/*public GoblinNftGoodsSkuInfoVo getNft(String skuId){
LocalDateTime now = LocalDateTime.now();
HashMap<String, Object> map = kylinRedisUtils.getGoodsSkuInfoVo(now, skuId);
if (null == map) {
return null;
}
GoblinGoodsSkuInfoVo skuInfoVo = (GoblinGoodsSkuInfoVo) map.get("vo");
Integer tagType = (Integer) map.get("tagType");
String listId = (String) map.get("listId");
LocalDateTime baseSaleStartTime = (LocalDateTime) map.get("baseSaleStartTime");
LocalDateTime nextSaleStartTime = (LocalDateTime) map.get("nextSaleStartTime");
if (goblinRedisUtils.getSkuAllStatusShow(skuInfoVo)) {
//获取预约相关
AnticipateValueVo anticipateValueVo = goblinGoodsAnticipateMgService.getAnticipateValueBySkuId(skuId, 1);
GoblinNftGoodsSkuInfoVo nftGoodsSkuInfoVo = GoblinNftGoodsSkuInfoVo.getNew().copy(skuInfoVo, anticipateValueVo);
// 限购数量
Integer buyCount = 0;
String userId = CurrentUtil.getCurrentUid();
if (StringUtils.isNotBlank(userId)) {
buyCount = goblinRedisUtils.getSkuCountByUid(userId, skuId);
}
if (null != skuInfoVo.getBuyLimit() && 0 != skuInfoVo.getBuyLimit()) {
nftGoodsSkuInfoVo.setCanBuyNum(skuInfoVo.getBuyLimit() - buyCount);
}
// spu信息
GoblinGoodsInfoVo goodsInfoVo = goblinRedisUtils.getGoodsInfoVo(skuInfoVo.getSpuId());
GoblinNftGoodsDetailSpuInfoVo nftGoodsDetailSpuInfoVo = GoblinNftGoodsDetailSpuInfoVo.getNew().copy(goodsInfoVo);
nftGoodsSkuInfoVo.setGoblinNftGoodsDetailSpuInfoVo(nftGoodsDetailSpuInfoVo);
// 库存
HashMap<String, Integer> stockHashMap = goblinOrderUtils.getIsStock(listId, skuId, skuInfoVo.getUnbox(), skuInfoVo.getSoldoutStatus(), goodsInfoVo.getSkuIdList());
nftGoodsSkuInfoVo.setIsStock(stockHashMap.get("isStock"));
// 总库存
if (skuInfoVo.getUnbox().equals("1")) {
nftGoodsSkuInfoVo.setSkuStock(stockHashMap.get("totalStock"));
}
// 系统时间
nftGoodsSkuInfoVo.setSystime(LocalDateTime.now());
nftGoodsSkuInfoVo.setTagType(tagType);
nftGoodsSkuInfoVo.setListId(listId);
nftGoodsSkuInfoVo.setBaseSaleStartTime(baseSaleStartTime);
nftGoodsSkuInfoVo.setNextSaleStartTime(nextSaleStartTime);
// 是否开启兑换
nftGoodsSkuInfoVo.setIsExchange(goblinRedisUtils.getIsExchange(skuId));
// 待支付订单数量
nftGoodsSkuInfoVo.setNotPayNum(goblinRedisUtils.getNotPayNum(skuId, listId));
return nftGoodsSkuInfoVo;
} else {
return null;
}
}*/
} }
package com.liquidnet.service.kylin.utils;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.constant.GoblinStatusConst;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
@Slf4j
@Component
public class KylinRedisUtils {
@Autowired
RedisUtil redisUtil;
private int randomMax = 10;
public void del(String... keys) {
redisUtil.del(keys);
}
/**
* 商品基础信息
*
* @param spuId 商品ID
* @return GoblinGoodsInfoVo
*/
public GoblinGoodsInfoVo getGoodsInfoVo(String spuId) {
String pre = GoblinStatusConst.MarketPreStatus.getPre(spuId);
if (pre != null && pre.equals(GoblinStatusConst.MarketPreStatus.MARKET_PRE_ZHENGZAI.getValue())) {
String[] spuSplitArr = spuId.split(GoblinStatusConst.MarketPreStatus.MARKET_PRE_ZHENGZAI.getValue());
String rk = GoblinRedisConst.BASIC_GOODS.concat(spuSplitArr[0]);
GoblinGoodsInfoVo vo = (GoblinGoodsInfoVo) redisUtil.get(rk);
if (vo == null) {
return vo;
}
String marketrk = GoblinRedisConst.BASIC_GOODS.concat(spuId);
GoblinGoodsInfoVo marketVo = (GoblinGoodsInfoVo) redisUtil.get(marketrk);
if (marketVo == null) {
return marketVo;
}
vo.setSpuId(marketVo.getSpuId());
List<String> skuIdList = CollectionUtil.linkedListString();
for (String skuIds : vo.getSkuIdList()) {
skuIdList.add(skuIds.concat(pre).concat(spuSplitArr[1]));
}
vo.setSkuIdList(skuIdList);
vo.setPriceGe(marketVo.getPriceGe());
vo.setPriceLe(marketVo.getPriceLe());
vo.setMarketId(marketVo.getMarketId());
vo.setDelFlg(marketVo.getDelFlg().equals("1") ? marketVo.getDelFlg() : vo.getDelFlg());
return vo;
} else {
String rk = GoblinRedisConst.BASIC_GOODS.concat(spuId);
GoblinGoodsInfoVo vo = (GoblinGoodsInfoVo) redisUtil.get(rk);
return vo;
}
}
}
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