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