增加日志

This commit is contained in:
wangw 2025-02-25 16:13:56 +08:00
parent 58f357a054
commit 99f9f8b4e3
1 changed files with 5 additions and 0 deletions

View File

@ -208,6 +208,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
@Override @Override
public OrderInfo checkOrderPay(CheckOrderPay param) { public OrderInfo checkOrderPay(CheckOrderPay param) {
OrderInfo orderInfo = getById(param.getOrderId()); OrderInfo orderInfo = getById(param.getOrderId());
log.info("订单信息:{},优惠信息:{}", JSONObject.toJSONString(orderInfo), JSONObject.toJSONString(param));
if (!orderInfo.getStatus().equals(OrderStatusEnums.UNPAID.getCode())) { if (!orderInfo.getStatus().equals(OrderStatusEnums.UNPAID.getCode())) {
throw new ValidateException("生成支付订单失败,订单不可支付"); throw new ValidateException("生成支付订单失败,订单不可支付");
} }
@ -280,11 +281,15 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
throw new ValidateException("生成支付订单失败,积分抵扣金额不正确"); throw new ValidateException("生成支付订单失败,积分抵扣金额不正确");
} }
} }
log.info("支付前置2订单金额{} ", newTotalAmount);
newTotalAmount = newTotalAmount.subtract(param.getPointsDiscountAmount()); newTotalAmount = newTotalAmount.subtract(param.getPointsDiscountAmount());
log.info("支付前置3订单金额{} ", newTotalAmount);
//抹零 //抹零
newTotalAmount = newTotalAmount.subtract(param.getRoundAmount()); newTotalAmount = newTotalAmount.subtract(param.getRoundAmount());
log.info("支付前置4订单金额{} ", newTotalAmount);
//校验最终金额订单金额 (扣除各类折扣)+打包费 餐位费 //校验最终金额订单金额 (扣除各类折扣)+打包费 餐位费
newTotalAmount = newTotalAmount.add(orderInfo.getPackFee()).add(orderInfo.getSeatAmount()); newTotalAmount = newTotalAmount.add(orderInfo.getPackFee()).add(orderInfo.getSeatAmount());
log.info("支付前置5订单金额{} ", newTotalAmount);
if (newTotalAmount.compareTo(param.getOrderAmount()) != 0) { if (newTotalAmount.compareTo(param.getOrderAmount()) != 0) {
throw new ValidateException("生成支付订单失败,订单金额不正确"); throw new ValidateException("生成支付订单失败,订单金额不正确");
} }