You've already forked FrameTour-BE
feat(pricing): 增加商品和打包配置的优惠券及券码使用限制
- 在 PriceBundleConfig 和 PriceProductConfig 中添加是否可使用优惠券和券码的字段 - 修改 CouponDiscountProvider 和 VoucherDiscountProvider,增加对商品和打包配置的检查 - 更新 PriceCalculationServiceImpl 中的优惠计算逻辑,将一口价改为打包购买 - 调整 DiscountDetail 中的描述和排序顺序,以适应新的优惠方式
This commit is contained in:
@@ -75,15 +75,16 @@ public class DiscountDetail {
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建一口价折扣明细
|
||||
* 创建打包购买折扣明细
|
||||
*/
|
||||
public static DiscountDetail createBundleDiscount(BigDecimal discountAmount) {
|
||||
DiscountDetail detail = new DiscountDetail();
|
||||
detail.setDiscountType("BUNDLE");
|
||||
detail.setDiscountName("一口价优惠");
|
||||
detail.setDiscountName("打包购买优惠");
|
||||
detail.setDiscountAmount(discountAmount);
|
||||
detail.setDescription("一口价购买更优惠");
|
||||
detail.setSortOrder(4); // 一口价排在最后
|
||||
detail.setDescription("多商品打包购买更优惠");
|
||||
detail.setSortOrder(5); // 打包购买排在后面
|
||||
return detail;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -79,4 +79,9 @@ public class DiscountInfo {
|
||||
* 优惠券ID(如果是coupon类型)
|
||||
*/
|
||||
private Long couponId;
|
||||
|
||||
/**
|
||||
* 一口价信息(如果是一口价优惠)
|
||||
*/
|
||||
private OnePriceInfo onePriceInfo;
|
||||
}
|
||||
Reference in New Issue
Block a user