ソースを参照

fix 混合退款 余额为null

zoujiajian 7 ヶ月 前
コミット
1bd756f59d

+ 6 - 4
netflix-service/src/main/java/com/cyksj/service/mange/impl/CmsOrderDonServiceImpl.java

@@ -1104,11 +1104,13 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
                     balance = balance.add(claudeCodeDeductOrderRelate.getDeductMoney());
                 }
             }
-            if (refundBalance.compareTo(balance) > 0) {
-                throw BusinessRuntimeException.getInstance("退款余额大于订单总金额");
+            if (refundBalance != null) {
+                if (refundBalance.compareTo(balance) > 0) {
+                    throw BusinessRuntimeException.getInstance("退款余额大于订单总金额");
+                }
+                refundBalance = refundBalance.add(orderDonRefundBalance);
+                orderDon.setRefundBalance(refundBalance);
             }
-            refundBalance = refundBalance.add(orderDonRefundBalance);
-            orderDon.setRefundBalance(refundBalance);
 
             refundMoney = orderDonRefundMoney.add(refundMoney);
             if (refundMoney.compareTo(money) > 0) {