0元付款 积分抵扣问题

This commit is contained in:
2025-03-24 11:24:17 +08:00
parent 78df4662ed
commit 9e6a3f96fa

View File

@@ -108,28 +108,6 @@ public class PayServiceImpl implements PayService {
private OrderInfo checkPay(CheckOrderPay checkOrderPay) {
OrderInfo orderInfo = orderInfoService.checkOrderPay(checkOrderPay);
if (orderInfo.getOrderAmount().compareTo(BigDecimal.ZERO) == 0) {
//积分使用
if (orderInfo.getPointsNum() != null && orderInfo.getPointsNum() > 0) {
pointsService.deductPoints(orderInfo.getUserId(), orderInfo.getPointsNum(), "积分抵扣账单", orderInfo);
}
//更新优惠券信息
if (StrUtil.isNotBlank(orderInfo.getCouponInfoList()) && !"null".equals(orderInfo.getCouponInfoList())) {
//券消耗
List<Long> coupons = JSON.parseArray(orderInfo.getCouponInfoList(), Long.class);
if (CollUtil.isNotEmpty(coupons)) {
if (orderInfo.getUserId() == null) {
log.info("订单:{}优惠券使用失败用户Id为空", orderInfo.getId());
} else {
ShopUser shopUser = shopUserService.getShopUserInfo(orderInfo.getShopId(), orderInfo.getUserId());
if (shopUser == null) {
log.info("订单:{}优惠券使用失败,店铺用户不存在", orderInfo.getId());
} else {
couponService.use(coupons, shopUser.getId(), orderInfo.getId());
}
}
}
}
orderDetailService.updateChain().set(OrderDetail::getStatus, OrderStatusEnums.DONE.getCode()).eq(OrderDetail::getOrderId, orderInfo.getId()).update();
//发送打票信息
rabbitPublisher.sendOrderPrintMsg(orderInfo.getId().toString(), orderInfo.getIsPrint() == 1);
redisService.del(RedisCst.classKeyExpired.EXPIRED_ORDER + orderInfo.getId());