|
@@ -275,8 +275,10 @@ public class MemberRankSettingServiceImpl extends BaseServiceImpl<Integer, Membe
|
|
|
amount = vipGroupActivity.getMarketPrice();
|
|
|
//扣减库存
|
|
|
liveGoodsService.reduceGoodsStock(memberPayParamDto.getLiveGoodsId(),memberPayParamDto.getLiveId());
|
|
|
- } else if (memberPayParamDto.getLiveGoodsId() == 2){
|
|
|
- RBucket<List<Integer>> bucket = redissonClient.getBucket(RedisKeyConstant.LIVE_GOODS_ZERO_CACHE_KEY + memberPayParamDto.getLiveId());
|
|
|
+ } else if (memberPayParamDto.getLiveGoodsId() == 2 || memberPayParamDto.getLiveGoodsId() == 3 || memberPayParamDto.getLiveGoodsId() == 4){
|
|
|
+ StringBuffer sb = new StringBuffer(RedisKeyConstant.LIVE_GOODS_ZERO_CACHE_KEY).append(memberPayParamDto.getLiveId()).
|
|
|
+ append("_").append(memberPayParamDto.getLiveGoodsId());
|
|
|
+ RBucket<List<Integer>> bucket = redissonClient.getBucket(sb.toString());
|
|
|
List<Integer> list = bucket.get();
|
|
|
if(CollectionUtils.isEmpty(list)){
|
|
|
list = new ArrayList<>();
|
|
@@ -286,10 +288,10 @@ public class MemberRankSettingServiceImpl extends BaseServiceImpl<Integer, Membe
|
|
|
throw new BizException("您已领取过本轮免费直播课");
|
|
|
}
|
|
|
//购买次数是否超过2次
|
|
|
- int count = tempBuyFreeLiveTheoryCourseDao.countByUserId(sysUser.getId());
|
|
|
- if(count >= 2){
|
|
|
- throw new BizException("免费直播课已达到领取次数上限");
|
|
|
- }
|
|
|
+// int count = tempBuyFreeLiveTheoryCourseDao.countByUserId(sysUser.getId());
|
|
|
+// if(count >= 2){
|
|
|
+// throw new BizException("免费直播课已达到领取次数上限");
|
|
|
+// }
|
|
|
//保存购买记录
|
|
|
tempBuyFreeLiveTheoryCourseDao.insert(new TempBuyFreeLiveTheoryCourse(sysUser.getId()));
|
|
|
//扣减库存
|
|
@@ -342,8 +344,10 @@ public class MemberRankSettingServiceImpl extends BaseServiceImpl<Integer, Membe
|
|
|
return succeed;
|
|
|
}
|
|
|
}
|
|
|
- } else if (memberPayParamDto.getLiveGoodsId() == 2){
|
|
|
- RBucket<List<Integer>> bucket = redissonClient.getBucket(RedisKeyConstant.LIVE_GOODS_ZERO_CACHE_KEY + memberPayParamDto.getLiveId());
|
|
|
+ } else if (memberPayParamDto.getLiveGoodsId() == 2 || memberPayParamDto.getLiveGoodsId() == 3 || memberPayParamDto.getLiveGoodsId() == 4){
|
|
|
+ StringBuffer sb = new StringBuffer(RedisKeyConstant.LIVE_GOODS_ZERO_CACHE_KEY).append(memberPayParamDto.getLiveId()).
|
|
|
+ append("_").append(memberPayParamDto.getLiveGoodsId());
|
|
|
+ RBucket<List<Integer>> bucket = redissonClient.getBucket(sb.toString());
|
|
|
List<Integer> list = bucket.get();
|
|
|
if(CollectionUtils.isEmpty(list)){
|
|
|
list = new ArrayList<>();
|
|
@@ -354,11 +358,11 @@ public class MemberRankSettingServiceImpl extends BaseServiceImpl<Integer, Membe
|
|
|
return succeed;
|
|
|
}
|
|
|
//购买次数是否超过2次
|
|
|
- int count = tempBuyFreeLiveTheoryCourseDao.countByUserId(sysUser.getId());
|
|
|
- if(count >= 2){
|
|
|
- succeed.setMsg("免费直播课已达到领取次数上限");
|
|
|
- return succeed;
|
|
|
- }
|
|
|
+// int count = tempBuyFreeLiveTheoryCourseDao.countByUserId(sysUser.getId());
|
|
|
+// if(count >= 2){
|
|
|
+// succeed.setMsg("免费直播课已达到领取次数上限");
|
|
|
+// return succeed;
|
|
|
+// }
|
|
|
}else {
|
|
|
succeed.setMsg("当前商品不可购买");
|
|
|
return succeed;
|