From 62f81c034c65bd7f02ac5ec8afc8e0d789a078b4 Mon Sep 17 00:00:00 2001 From: 陶杰 <1378534974@qq.com> Date: 星期三, 04 九月 2024 10:16:46 +0800 Subject: [PATCH] 1.优惠券-新增创建时间字段返回 --- src/main/java/com/mzl/flower/service/payment/UserPaymentV3Service.java | 24 +++++++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/mzl/flower/service/payment/UserPaymentV3Service.java b/src/main/java/com/mzl/flower/service/payment/UserPaymentV3Service.java index f9ae5d7..8b75506 100644 --- a/src/main/java/com/mzl/flower/service/payment/UserPaymentV3Service.java +++ b/src/main/java/com/mzl/flower/service/payment/UserPaymentV3Service.java @@ -16,6 +16,7 @@ import com.mzl.flower.mapper.system.UserWechatMapper; import com.mzl.flower.service.BaseService; import com.mzl.flower.service.flower.FlowerService; +import com.mzl.flower.service.point.PointGoodsService; import com.mzl.flower.utils.UUIDGenerator; import com.wechat.pay.java.core.notification.NotificationParser; import com.wechat.pay.java.core.notification.RequestParam; @@ -103,6 +104,12 @@ @Autowired private OrderRefundMapper orderRefundMapper; + + @Autowired + private OrderPointGoodsMapper orderPointGoodsMapper; + + @Autowired + private PointGoodsService pointGoodsService; /** * 微信预支付 @@ -439,8 +446,23 @@ } private void releasePrepayLock(Order order){ - log.info("恢复库存: " + order); + log.info("恢复库存 积分商品兑换券 优惠券: " + order); revertFlowerStock(order.getId()); + + //恢复积分商品兑换券 + revertPointGoodsRecord(order.getId()); + + //TODO 恢复优惠券 + } + + private void revertPointGoodsRecord(String orderId){ + List<OrderPointGoods> ls = orderPointGoodsMapper.selectList(new QueryWrapper<OrderPointGoods>() + .eq("order_id", orderId)); + if(ls != null && ls.size() > 0){ + for(OrderPointGoods pg : ls){ + pointGoodsService.revertExchangeGoods(pg.getGoodsRecordId()); + } + } } public Map payAgain(String orderId){ -- Gitblit v1.9.3