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