提交代码

master
胡锐 6 months ago committed by yuanye
parent b6ebbb3427
commit f842d0ef23
  1. 13
      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, "未知的优惠券优惠类型");

Loading…
Cancel
Save