pageHelper 不生效问题

空值问题
This commit is contained in:
2025-02-28 10:50:51 +08:00
parent dce2c309e5
commit 26b6a5a5da
10 changed files with 33 additions and 44 deletions

View File

@@ -282,7 +282,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
if (prodCouponAmount.getPrice().compareTo(param.getProductCouponDiscountAmount()) != 0) {
throw new ValidateException("生成支付订单失败,商品优惠券优惠金额不正确");
}
BigDecimal newTotalAmount = BigDecimal.ZERO;
BigDecimal newTotalAmount;
//折扣金额 如 9折 计算 为 订单金额*0.9 向上取整
if (param.getDiscountRatio().compareTo(BigDecimal.ONE) != 0) {
newTotalAmount = totalAmount.getPrice().multiply(param.getDiscountRatio()).setScale(2, RoundingMode.UP);
@@ -648,7 +648,6 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
*/
private void upOrderPayInfo(OrderInfo orderInfo, CheckOrderPay param) {
orderInfo.setPointsNum(param.getPointsNum());
orderInfo.setOriginAmount(param.getOriginAmount());
orderInfo.setRoundAmount(param.getRoundAmount());
orderInfo.setOrderAmount(param.getOrderAmount());
orderInfo.setPointsDiscountAmount(param.getPointsDiscountAmount());
@@ -660,7 +659,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
//折扣信息
orderInfo.setDiscountInfo(buildDiscountInfo(orderInfo));
//最终折扣
orderInfo.setDiscountRatio(param.getOriginAmount().divide(param.getOrderAmount(), 2, RoundingMode.UP));
orderInfo.setDiscountRatio(orderInfo.getOriginAmount().divide(param.getOrderAmount(), 2, RoundingMode.UP));
saveOrUpdate(orderInfo);
}