提交代码

master
胡锐 6 months ago
parent 121c28979c
commit 6d3b06380c
  1. 13
      service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java

@ -217,6 +217,13 @@ public class BsOrderServiceImpl implements BsOrderService {
} else { } else {
childOrder.setSurplusRefundIntegral(0L); 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); orderChildService.editData(childOrder);
} }
@ -285,10 +292,10 @@ public class BsOrderServiceImpl implements BsOrderService {
} }
deduction.setCouponDiscountActualPrice(discount.getPrice()); deduction.setCouponDiscountActualPrice(discount.getPrice());
} else if (3 == discount.getType()) { } else if (3 == discount.getType()) {
deduction.setCouponDiscountPrice(discount.getPercentage());
deduction.setCouponDiscountActualPrice( deduction.setCouponDiscountActualPrice(
order.getTotalPrice() order.getTotalPrice().subtract(
.multiply(discount.getPercentage().divide(new BigDecimal("100"))) order.getTotalPrice() .multiply(discount.getPercentage().divide(new BigDecimal("100"))).setScale(2, BigDecimal.ROUND_DOWN))
.setScale(2, BigDecimal.ROUND_DOWN)
); );
} else { } else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的优惠券优惠类型"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的优惠券优惠类型");

Loading…
Cancel
Save