新客立减修改

This commit is contained in:
张松 2025-09-17 10:26:29 +08:00
parent d620ccf564
commit b4fb2afd68
2 changed files with 8 additions and 1 deletions

View File

@ -53,7 +53,6 @@ public class MkConsumeDiscountDTO implements Serializable {
/**
* 固定减免金额
*/
@DecimalMin(value = "0.01", message = "减免金额不能小于0.01")
private BigDecimal discountAmount;
/**

View File

@ -55,6 +55,14 @@ public class MkConsumeDiscountServiceImpl extends ServiceImpl<MkConsumeDiscountM
if (consumeDiscountDTO.getRandomDiscountList() == null || consumeDiscountDTO.getRandomDiscountList().isEmpty()) {
throw new ApiNotPrintException("随机优惠金额不能为空");
}
}else {
if (consumeDiscountDTO.getDiscountAmount() == null) {
throw new ApiNotPrintException("减免金额不能为空");
}
if (consumeDiscountDTO.getDiscountAmount().compareTo(BigDecimal.ZERO) <= 0) {
throw new ApiNotPrintException("减免金额不能等于0");
}
}
MkConsumeDiscount consumeDiscount = getOne(new QueryWrapper().eq(MkConsumeDiscount::getShopId, shopId));