diff --git a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java index 57e7a5f..52b637d 100644 --- a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java @@ -217,6 +217,13 @@ public class BsOrderServiceImpl implements BsOrderService { } else { childOrder.setSurplusRefundIntegral(0L); } + + childOrder.setCouponDiscountPrice(childOrder.getProductPrice().subtract(childOrder.getSurplusRefundPrice())); + childOrder.setIntegralDiscountPrice(childOrder.getSurplusRefundIntegral()); + childOrder.setTotalDeductionPrice( + childOrder.getCouponDiscountPrice().add(new BigDecimal(childOrder.getIntegralDiscountPrice().toString()).multiply(new BigDecimal("100"))) + ); + childOrder.setProductActualPrice(childOrder.getProductPrice().subtract(childOrder.getTotalDeductionPrice())); orderChildService.editData(childOrder); } @@ -285,10 +292,10 @@ public class BsOrderServiceImpl implements BsOrderService { } deduction.setCouponDiscountActualPrice(discount.getPrice()); } else if (3 == discount.getType()) { + deduction.setCouponDiscountPrice(discount.getPercentage()); deduction.setCouponDiscountActualPrice( - order.getTotalPrice() - .multiply(discount.getPercentage().divide(new BigDecimal("100"))) - .setScale(2, BigDecimal.ROUND_DOWN) + order.getTotalPrice().subtract( + order.getTotalPrice() .multiply(discount.getPercentage().divide(new BigDecimal("100"))).setScale(2, BigDecimal.ROUND_DOWN)) ); } else { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的优惠券优惠类型");