updates
This commit is contained in:
parent
259ba3d777
commit
bfe6bc25f9
|
|
@ -77,6 +77,13 @@ public class MiniVipController {
|
|||
//检查card是否有效
|
||||
boolean cardValid = yxVipCardService.cardIsValid(card);
|
||||
AssertUtils.isTrue(cardValid,"当前卡密无效或已被使用");
|
||||
YxVipCard yxVipCard = yxVipCardService.getOne(new LambdaQueryWrapper<YxVipCard>().eq(YxVipCard::getCardNum, card));
|
||||
VipDTO userVip = miniUserService.getUserVip(user.getId());
|
||||
if (userVip!=null) {
|
||||
if (userVip.getSkuCode().equals(yxVipCard.getSkuCode())) {
|
||||
throw new JeecgBootException("该类型激活码您已重复使用");
|
||||
}
|
||||
}
|
||||
//使用卡密
|
||||
boolean exchange = yxVipCardService.exchange(card, user.getId());
|
||||
AssertUtils.isTrue(exchange,"当前卡密已被使用");
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ public class YxVipCardServiceImpl extends ServiceImpl<YxVipCardMapper, YxVipCard
|
|||
}
|
||||
LambdaQueryWrapper<YxVipCard> yxVipCardLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
yxVipCardLambdaQueryWrapper.eq(YxVipCard::getUserId,userId);
|
||||
yxVipCardLambdaQueryWrapper.orderByDesc(YxVipCard::getUsedTime);
|
||||
return this.list(yxVipCardLambdaQueryWrapper);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue