每人每个商家, 一日一次
This commit is contained in:
@@ -143,6 +143,17 @@ public class ARCustomerManager {
|
||||
if (redPackId.size() >= promotionIdList.size()) {
|
||||
throw new RuntimeException("此商家红包你已经全部领取");
|
||||
}
|
||||
|
||||
// 每人每个商家, 一日一次
|
||||
Assert.isTrue( arUserRedPackService.count(
|
||||
Wrappers.lambdaQuery(ArUserRedPack.class)
|
||||
.eq(ArUserRedPack::getUserId, request.getUserId())
|
||||
.eq(ArUserRedPack::getMerchantId, merchantInfo.getId())
|
||||
.ge(ArUserRedPack::getReceiveTime, DateUtil.getToday())
|
||||
) == 0, "此商家红包今日已经领取 , 请明天再来探宝" );
|
||||
|
||||
|
||||
|
||||
return Boolean.TRUE;
|
||||
|
||||
|
||||
@@ -251,6 +262,15 @@ public class ARCustomerManager {
|
||||
ArPromotion arPromotion = arPromotionService.getById(request.getPromotionId());
|
||||
Assert.notNull(arPromotion, "无效宝藏");
|
||||
Assert.isTrue(Objects.equals(arPromotion.getPromotionStatus(), 2), "此宝藏未开始或已关闭");
|
||||
|
||||
// 每人每个商家, 一日一次
|
||||
Assert.isTrue( arUserRedPackService.count(
|
||||
Wrappers.lambdaQuery(ArUserRedPack.class)
|
||||
.eq(ArUserRedPack::getUserId, request.getUserId())
|
||||
.eq(ArUserRedPack::getMerchantId, request.getPromotionId())
|
||||
.ge(ArUserRedPack::getReceiveTime, DateUtil.getToday())
|
||||
) == 0, "此商家红包今日已经领取 , 请明天再来探宝" );
|
||||
|
||||
long count = arUserRedPackService.count(
|
||||
Wrappers.lambdaQuery(ArUserRedPack.class)
|
||||
.eq(ArUserRedPack::getUserId, request.getUserId())
|
||||
|
||||
Reference in New Issue
Block a user