新客立减 校验 和 使用

This commit is contained in:
wangw 2025-09-25 18:10:21 +08:00
parent 23f3a197ad
commit c3d1524c40
1 changed files with 5 additions and 1 deletions

View File

@ -943,6 +943,10 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
log.error("订单积分使用或优惠券扣除失败订单id{}", orderInfo.getId());
}
} else {
//新客立减
if (orderInfo.getNewCustomerDiscountAmount() != null) {
newConsumerDiscountRecordService.useDiscount(shopUser.getId(), orderInfo.getId(), orderInfo.getNewCustomerDiscountAmount());
}
//积分使用
if (orderInfo.getPointsNum() != null && orderInfo.getPointsNum() > 0) {
pointsService.deductPoints(shopUser.getId(), orderInfo.getPointsNum(), "积分抵扣账单", orderInfo);
@ -1139,7 +1143,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
} else {
//新客立减
if (param.getNewCustomerDiscountId() != null) {
newConsumerDiscountRecordService.useDiscount(param.getNewCustomerDiscountId(), shopUser.getId(), param.getOrderId(), param.getNewCustomerDiscountAmount());
newConsumerDiscountRecordService.checkDiscount(param.getNewCustomerDiscountId(), shopUser.getId(), param.getOrderId(), param.getNewCustomerDiscountAmount());
}
//积分使用
if (orderInfo.getPointsNum() != null && orderInfo.getPointsNum() > 0) {