From d39ef83b2a6ec80a65ccc3a69ee7cfbeed20a245 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Mon, 27 May 2024 15:44:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hfkj/service/order/OrderPaySuccessService.java | 2 +- .../com/hfkj/service/order/impl/BsOrderServiceImpl.java | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java b/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java index 457c760..5c37325 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java +++ b/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java @@ -174,7 +174,7 @@ public class OrderPaySuccessService { orderCoupon.setPayTime(order.getPayTime()); orderCouponService.editData(orderCoupon); - // 增加销量 + /// 增加销量 goodsMsgService.editSaleNum(childOrder.getProductId(), childOrder.getProductCount(), 1); // 子订单完成 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 a923a04..c63f004 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 @@ -224,15 +224,18 @@ public class BsOrderServiceImpl implements BsOrderService { childOrder.setSurplusRefundPrice( // 商品总金额 - 积分抵扣金额 childOrder.getProductTotalPrice().subtract( - new BigDecimal(childOrder.getSurplusRefundIntegral().toString()).multiply(new BigDecimal("100")) + new BigDecimal(childOrder.getSurplusRefundIntegral().toString()).divide(new BigDecimal("100")) )); } - childOrder.setCouponDiscountPrice(childOrder.getProductTotalPrice().subtract(childOrder.getSurplusRefundPrice())); + childOrder.setCouponDiscountPrice( + childOrder.getSurplusRefundPrice().compareTo(BigDecimal.ZERO) == 1 + ? childOrder.getProductTotalPrice().subtract(childOrder.getSurplusRefundPrice()) + : childOrder.getSurplusRefundPrice()); childOrder.setIntegralDiscountPrice(childOrder.getSurplusRefundIntegral()); childOrder.setTotalDeductionPrice( childOrder.getCouponDiscountPrice() - .add(new BigDecimal(childOrder.getIntegralDiscountPrice().toString()).multiply(new BigDecimal("100"))) + .add(new BigDecimal(childOrder.getIntegralDiscountPrice().toString()).divide(new BigDecimal("100"))) ); childOrder.setProductActualPrice(childOrder.getProductTotalPrice().subtract(childOrder.getTotalDeductionPrice())); orderChildService.editData(childOrder);