|
|
@ -391,18 +391,24 @@ public class OrderServiceImpl implements OrderService { |
|
|
|
childOrder.setSurplusRefundNum(childOrder.getSaleCount()); |
|
|
|
childOrder.setSurplusRefundNum(childOrder.getSaleCount()); |
|
|
|
// 计算子订单退款金额。
|
|
|
|
// 计算子订单退款金额。
|
|
|
|
if (order.getPayPrice().compareTo(new BigDecimal("0")) == 1) { |
|
|
|
if (order.getPayPrice().compareTo(new BigDecimal("0")) == 1) { |
|
|
|
childOrder.setSurplusRefundPrice(childOrder.getTotalActualPrice() |
|
|
|
BigDecimal ratio = childOrder.getTotalActualPrice() |
|
|
|
.divide(order.getPayPrice(), 4, BigDecimal.ROUND_DOWN) |
|
|
|
.divide(order.getPayPrice(), 2, BigDecimal.ROUND_DOWN).setScale(2); |
|
|
|
.multiply(new BigDecimal("100")).setScale(2)); |
|
|
|
childOrder.setSurplusRefundPrice(order.getPayPrice().multiply(ratio).setScale(2)); |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
childOrder.setSurplusRefundPrice(new BigDecimal("0")); |
|
|
|
childOrder.setSurplusRefundPrice(new BigDecimal("0")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 计算子订单退款积分
|
|
|
|
// 计算子订单退款积分
|
|
|
|
if (order.getPayGold() > 0) { |
|
|
|
if (order.getPayGold() > 0) { |
|
|
|
childOrder.setSurplusRefundIntegral(childOrder.getTotalActualPrice() |
|
|
|
BigDecimal ratio = childOrder.getTotalActualPrice() |
|
|
|
.divide(new BigDecimal(order.getPayGold().toString()), 4, BigDecimal.ROUND_DOWN) |
|
|
|
.divide(new BigDecimal(order.getPayGold().toString()), 2, BigDecimal.ROUND_DOWN).setScale(2); |
|
|
|
.multiply(new BigDecimal("100")).setScale(2).multiply(new BigDecimal("10000")).intValue()); |
|
|
|
|
|
|
|
|
|
|
|
childOrder.setSurplusRefundIntegral( |
|
|
|
|
|
|
|
new BigDecimal(order.getPayGold().toString()) |
|
|
|
|
|
|
|
.multiply(ratio).setScale(2). |
|
|
|
|
|
|
|
multiply(new BigDecimal("100")).intValue() |
|
|
|
|
|
|
|
); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
childOrder.setSurplusRefundIntegral(0); |
|
|
|
childOrder.setSurplusRefundIntegral(0); |
|
|
|
} |
|
|
|
} |
|
|
|