|
@@ -921,11 +921,11 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
|
|
|
}
|
|
}
|
|
|
//默认补差价余额
|
|
//默认补差价余额
|
|
|
String refundType = Optional.ofNullable(orderRefundReq.getRefundType()).orElse("balance");
|
|
String refundType = Optional.ofNullable(orderRefundReq.getRefundType()).orElse("balance");
|
|
|
|
|
+ BigDecimal refundMoney = orderRefundReq.getRefundMoney();
|
|
|
if ("money".equals(refundType)) {
|
|
if ("money".equals(refundType)) {
|
|
|
if (orderDon.getMoney().compareTo(BigDecimal.ZERO) == 0) {
|
|
if (orderDon.getMoney().compareTo(BigDecimal.ZERO) == 0) {
|
|
|
throw BusinessRuntimeException.getInstance("该订单为0元订单,无法补差价至用户账户");
|
|
throw BusinessRuntimeException.getInstance("该订单为0元订单,无法补差价至用户账户");
|
|
|
}
|
|
}
|
|
|
- BigDecimal refundMoney = orderRefundReq.getRefundMoney();
|
|
|
|
|
if (refundMoney == null || refundMoney.compareTo(BigDecimal.ZERO) <= 0) {
|
|
if (refundMoney == null || refundMoney.compareTo(BigDecimal.ZERO) <= 0) {
|
|
|
throw BusinessRuntimeException.getInstance("请输入正确的差价金额");
|
|
throw BusinessRuntimeException.getInstance("请输入正确的差价金额");
|
|
|
}
|
|
}
|
|
@@ -947,7 +947,7 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
|
|
|
refundRecord(orderDon, goodsDon, sku, outNo, refundType);
|
|
refundRecord(orderDon, goodsDon, sku, outNo, refundType);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- BigDecimal refundBalance = orderRefundReq.getRefundBalance();
|
|
|
|
|
|
|
+ BigDecimal refundBalance = refundMoney;
|
|
|
if (refundBalance == null || refundBalance.compareTo(BigDecimal.ZERO) <= 0 || refundBalance.compareTo(orderDon.getMoney()) > 0) {
|
|
if (refundBalance == null || refundBalance.compareTo(BigDecimal.ZERO) <= 0 || refundBalance.compareTo(orderDon.getMoney()) > 0) {
|
|
|
throw BusinessRuntimeException.getInstance("请输入正确的差价金额");
|
|
throw BusinessRuntimeException.getInstance("请输入正确的差价金额");
|
|
|
}
|
|
}
|