Browse Source

fixed 购物车接口bug修复

fushengqian 9 tháng trước cách đây
mục cha
commit
b2b41068a0

+ 4 - 3
fuint-application/src/main/java/com/fuint/common/service/impl/OrderServiceImpl.java

@@ -2125,9 +2125,6 @@ public class OrderServiceImpl extends ServiceImpl<MtOrderMapper, MtOrder> implem
 
         // 支付金额 = 商品总额 - 积分抵扣金额
         payPrice = payPrice.subtract(usePointAmount);
-        if (payPrice.compareTo(new BigDecimal("0")) < 0) {
-            payPrice = new BigDecimal("0");
-        }
 
         // 配送费用
         BigDecimal deliveryFee = new BigDecimal("0");
@@ -2139,6 +2136,10 @@ public class OrderServiceImpl extends ServiceImpl<MtOrderMapper, MtOrder> implem
         payPrice = payPrice.add(deliveryFee).subtract(memberDiscount);
         BigDecimal discount = totalPrice.subtract(payPrice).divide(new BigDecimal("10"), BigDecimal.ROUND_CEILING, 2);
 
+        if (payPrice.compareTo(new BigDecimal("0")) < 0) {
+            payPrice = new BigDecimal("0");
+        }
+
         result.put("list", cartDtoList);
         result.put("totalNum", totalNum);
         result.put("totalPrice", totalPrice);