折扣比例

This commit is contained in:
wangw 2025-03-05 09:21:33 +08:00
parent 615f32d32d
commit f4ad2415b0
1 changed files with 1 additions and 1 deletions

View File

@ -695,7 +695,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
orderInfo.setDiscountInfo(buildDiscountInfo(orderInfo));
//最终折扣
if (param.getOrderAmount().compareTo(BigDecimal.ZERO) != 0) {
orderInfo.setDiscountRatio(orderInfo.getOriginAmount().divide(param.getOrderAmount(), 2, RoundingMode.UP));
orderInfo.setDiscountRatio(orderInfo.getOrderAmount().divide(param.getOriginAmount(), 2, RoundingMode.UP));
} else {
orderInfo.setDiscountRatio(BigDecimal.ZERO);
}