新增宝藏赠送积分不开放
This commit is contained in:
@@ -51,6 +51,11 @@ public class ARPromotionManager {
|
||||
|
||||
@Transactional(rollbackFor = RuntimeException.class)
|
||||
public Boolean addPromotion(ARPromotionRequest request) {
|
||||
|
||||
if (request.getBenefitsType() == 3){
|
||||
throw new RuntimeException("该宝藏类型还未开启, 敬请期待");
|
||||
}
|
||||
|
||||
ArMerchantInfo merchantInfo = arMerchantInfoService.getById(request.getMerchantId());
|
||||
Assert.notNull(merchantInfo, "未申请商家");
|
||||
Assert.isTrue(Objects.equals(merchantInfo.getUserId(), request.getUserId()), "此商家不属于当前用户");
|
||||
@@ -63,11 +68,15 @@ public class ARPromotionManager {
|
||||
Assert.notNull(request.getDiscountContent(), "折扣内容不能为空");
|
||||
break;
|
||||
case 3:
|
||||
|
||||
Assert.notNull(request.getGivenAmount(), "赠送积分不能为空");
|
||||
Assert.isTrue(request.getGivenAmount().compareTo(BigDecimal.ZERO) > 0, "赠送积分必须大于等于0");
|
||||
Assert.isTrue(request.getLimitAmount().compareTo(BigDecimal.ZERO) > 0 , "限制金额不能小于0");
|
||||
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException("无效宝藏类型");
|
||||
|
||||
}
|
||||
|
||||
//比较开始时间和结束时间
|
||||
|
||||
Reference in New Issue
Block a user