提交代码

dev
胡锐 5 months ago
parent c2040cab21
commit 8f3eca8525
  1. 2
      service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java
  2. 9
      service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java

@ -174,7 +174,7 @@ public class OrderPaySuccessService {
orderCoupon.setPayTime(order.getPayTime()); orderCoupon.setPayTime(order.getPayTime());
orderCouponService.editData(orderCoupon); orderCouponService.editData(orderCoupon);
// 增加销量 /// 增加销量
goodsMsgService.editSaleNum(childOrder.getProductId(), childOrder.getProductCount(), 1); goodsMsgService.editSaleNum(childOrder.getProductId(), childOrder.getProductCount(), 1);
// 子订单完成 // 子订单完成

@ -224,15 +224,18 @@ public class BsOrderServiceImpl implements BsOrderService {
childOrder.setSurplusRefundPrice( childOrder.setSurplusRefundPrice(
// 商品总金额 - 积分抵扣金额 // 商品总金额 - 积分抵扣金额
childOrder.getProductTotalPrice().subtract( 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.setIntegralDiscountPrice(childOrder.getSurplusRefundIntegral());
childOrder.setTotalDeductionPrice( childOrder.setTotalDeductionPrice(
childOrder.getCouponDiscountPrice() 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())); childOrder.setProductActualPrice(childOrder.getProductTotalPrice().subtract(childOrder.getTotalDeductionPrice()));
orderChildService.editData(childOrder); orderChildService.editData(childOrder);

Loading…
Cancel
Save