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);