mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-01-18 19:20:05 +08:00
【功能】添加满送包邮功能
This commit is contained in:
parent
7231042df4
commit
7ef329f57a
@ -68,6 +68,7 @@ public class TradePriceCalculateRespBO {
|
||||
*/
|
||||
private Long bargainActivityId;
|
||||
|
||||
|
||||
/**
|
||||
* 是否包邮
|
||||
*/
|
||||
|
@ -121,10 +121,12 @@ public class TradeDeliveryPriceCalculator implements TradePriceCalculator {
|
||||
* @return 是否包邮
|
||||
*/
|
||||
private boolean isGlobalExpressFree(TradePriceCalculateRespBO result) {
|
||||
|
||||
TradeConfigDO config = tradeConfigService.getTradeConfig();
|
||||
return config != null
|
||||
&& Boolean.TRUE.equals(config.getDeliveryExpressFreeEnabled()) // 开启包邮
|
||||
&& result.getPrice().getPayPrice() >= config.getDeliveryExpressFreePrice(); // 满足包邮的价格
|
||||
return config == null
|
||||
|| Boolean.TRUE.equals(config.getDeliveryExpressFreeEnabled()) // 开启包邮
|
||||
|| result.getFreeDelivery() //满减包邮
|
||||
|| result.getPrice().getPayPrice() >= config.getDeliveryExpressFreePrice(); // 满足包邮的价格
|
||||
}
|
||||
|
||||
private void calculateDeliveryPrice(List<OrderItem> selectedSkus,
|
||||
|
@ -81,6 +81,8 @@ public class TradeRewardActivityPriceCalculator implements TradePriceCalculator
|
||||
Integer newDiscountPrice = rule.getDiscountPrice();
|
||||
// 2.2 计算分摊的优惠金额
|
||||
List<Integer> divideDiscountPrices = TradePriceCalculatorHelper.dividePrice(orderItems, newDiscountPrice);
|
||||
//计算是否包邮
|
||||
result.setFreeDelivery(rule.getFreeDelivery());
|
||||
|
||||
// 3.1 记录使用的优惠劵
|
||||
result.setCouponId(param.getCouponId());
|
||||
|
Loading…
Reference in New Issue
Block a user