灵兰币支付使用优惠券

This commit is contained in:
wuchunlei
2024-11-01 17:36:37 +08:00
parent b5467bb011
commit 87de5a9660

View File

@@ -329,6 +329,12 @@ public class BuyOrderController {
//消费用户积分并记录用户积分消费记录
addEbookToUser(buyOrderProductList, buyOrder, 0);
addCourseToUser(buyOrder);
//使用优惠券
if (buyOrder.getCouponId()!=null&&buyOrder.getCouponId()!=0){
CouponHistory couponHistory = couponHistoryService.getById(buyOrder.getCouponId());
couponHistory.setOrderId(buyOrder.getOrderId());
couponService.useCouponAmount(couponHistory);
}
//发放优惠卷
List<Integer> collect = buyOrderProductService.list(new LambdaQueryWrapper<BuyOrderProduct>()
.eq(BuyOrderProduct::getOrderId, buyOrder.getOrderId()))