Commit 1a78057e authored by 邓吉芬's avatar 邓吉芬

十足限抽奖品逻辑修改

parent ee970b90
......@@ -329,12 +329,14 @@ public class DrawManagerImpl implements IDrawManager {
//不可以抽奖的奖品Id
List<Long> prizeIdList = Lists.newArrayList();
if(!CollectionUtils.isEmpty(accountPrizeList)){
for(AccountPrize account:accountPrizeList){
for (Prize prize:restrictPrizeList){
//判断是否已经达到抽奖限制次数
if(account.getPrizeId().equals(prize.getId()) && account.getCount()>= prize.getAstrict()){
prizeIdList.add(prize.getId());
}
Map<Long,List<AccountPrize> > accPrizeMap = accountPrizeList.stream().collect(Collectors.groupingBy(AccountPrize::getPrizeId));
for (Prize prize:restrictPrizeList){
//判断是否已经达到抽奖限制次数
if(!CollectionUtils.isEmpty(accPrizeMap.get(prize.getId()))
&& accPrizeMap.get(prize.getId()).get(0).getCount()>= prize.getAstrict()
){
prizeIdList.addAll(restrictPrizeId);
break;
}
}
}
......
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