Commit 98989912e12d763466d4091f5457fc7fdc23bf0f

Authored by puhui999
1 parent 396051b4

【缺陷修复】商城:全局包邮判断

yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/price/calculator/TradeDeliveryPriceCalculator.java
... ... @@ -122,9 +122,13 @@ public class TradeDeliveryPriceCalculator implements TradePriceCalculator {
122 122 */
123 123 private boolean isGlobalExpressFree(TradePriceCalculateRespBO result) {
124 124 TradeConfigDO config = tradeConfigService.getTradeConfig();
125   - return config == null
126   - || Boolean.TRUE.equals(config.getDeliveryExpressFreeEnabled()) // 开启包邮
127   - || result.getPrice().getPayPrice() >= config.getDeliveryExpressFreePrice(); // 满足包邮的价格
  125 + // 情况一:交易中心配置不存在默认不包邮
  126 + if (config == null) {
  127 + return false;
  128 + }
  129 + // 情况二:开启了全局包邮 && 满足包邮金额
  130 + return Boolean.TRUE.equals(config.getDeliveryExpressFreeEnabled()) &&
  131 + result.getPrice().getPayPrice() >= config.getDeliveryExpressFreePrice();
128 132 }
129 133  
130 134 private void calculateDeliveryPrice(List<OrderItem> selectedSkus,
... ...