订单 金额问题

This commit is contained in:
wangw 2025-10-11 17:18:52 +08:00
parent 47d4690f03
commit 5290229609
1 changed files with 8 additions and 8 deletions

View File

@ -477,6 +477,11 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
fullReductionAmount.getPrice(), rateAmount.getPrice(), oneGiftAmount.getPrice(), twoHalfAmount.getPrice(), param.getOtherCouponDiscountAmount());
throw new ValidateException("生成支付订单失败,其它优惠券金额不正确");
}
if (newTotalAmount.compareTo(BigDecimal.ZERO) <= 0) {
newTotalAmount = BigDecimal.ZERO;
}
//优惠券金额结束 商品金额+打包费+餐位费
newTotalAmount = newTotalAmount.add(packAmount.getPrice()).add(orderInfo.getSeatAmount());
//新客立减
if (shopUser != null) {
newTotalAmount = newTotalAmount.subtract(param.getNewCustomerDiscountAmount());
@ -506,16 +511,11 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
if (newTotalAmount.compareTo(BigDecimal.ZERO) <= 0) {
newTotalAmount = BigDecimal.ZERO;
}
//校验最终金额订单金额 (扣除各类折扣)+打包费 餐位费
newTotalAmount = newTotalAmount.add(packAmount.getPrice()).add(orderInfo.getSeatAmount());
if (newTotalAmount.compareTo(BigDecimal.ZERO) <= 0) {
newTotalAmount = BigDecimal.ZERO;
}
if (newTotalAmount.compareTo(param.getOrderAmount()) != 0) {
log.info("支付计算金额不正确订单Id:{},最终计算金额为:{},打包费:{},餐位费:{},积分抵扣金额:{},抹零金额:{}",
log.info("支付计算金额不正确订单Id:{},支付计算金额为:{},打包费:{},餐位费:{},折扣金额:{},积分抵扣金额:{},抹零金额:{}",
orderInfo.getId(), newTotalAmount, packAmount.getPrice(), orderInfo.getSeatAmount(),
param.getPointsDiscountAmount(), param.getRoundAmount());
throw new ValidateException("生成支付订单失败,订单金额不正确");
param.getDiscountAmount(), param.getPointsDiscountAmount(), param.getRoundAmount());
throw new ValidateException("生成支付订单失败,支付金额不正确");
}
orderInfo.setPackFee(packAmount.getPrice());
//生成订单 //discount_info 所有折扣 几折 折扣金额 满减金额 优惠券金额 积分抵扣金额 抹零