新增宝藏赠送积分不开放

This commit is contained in:
2025-10-16 18:42:29 +08:00
parent 1f3bfbce1c
commit 244b9d8b7a

View File

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