|
@@ -3,11 +3,13 @@ package com.ym.mec.biz.service.impl;
|
|
|
import com.ym.mec.biz.dal.dao.LiveGoodsDao;
|
|
|
import com.ym.mec.biz.dal.dto.RedisKeyConstant;
|
|
|
import com.ym.mec.biz.dal.entity.LiveGoods;
|
|
|
+import com.ym.mec.biz.dal.page.LiveGoodsQueryInfo;
|
|
|
import com.ym.mec.biz.service.LiveGoodsMapperService;
|
|
|
import com.ym.mec.biz.service.LiveGoodsService;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.redisson.api.RBucket;
|
|
|
import org.redisson.api.RLock;
|
|
|
import org.redisson.api.RedissonClient;
|
|
@@ -15,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.util.List;
|
|
|
import java.util.Optional;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.function.BiConsumer;
|
|
@@ -140,6 +143,16 @@ public class LiveGoodsServiceImpl extends BaseServiceImpl<Integer, LiveGoods> i
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Object queryGoodsPage(LiveGoodsQueryInfo queryInfo) {
|
|
|
+ if(StringUtils.isNotEmpty(queryInfo.getLiveId())){
|
|
|
+ //获取直播间关联的商品列表
|
|
|
+ List<Integer> goodsIds = liveGoodsMapperService.queryGoodsIdsByLiveId(queryInfo.getLiveId());
|
|
|
+ queryInfo.setIgnoreGoodsIds(goodsIds);
|
|
|
+ }
|
|
|
+ return queryPage(queryInfo);
|
|
|
+ }
|
|
|
+
|
|
|
public void stockLock(String lockKey, BiConsumer<Integer,String> consumer, Integer liveGoodsId, String liveId) {
|
|
|
RLock lock = redissonClient.getLock(lockKey);
|
|
|
try{
|