| | |
| | | import com.mzl.flower.mapper.payment.*; |
| | | import com.mzl.flower.mapper.system.UserWechatMapper; |
| | | import com.mzl.flower.service.BaseService; |
| | | import com.mzl.flower.service.coupon.CouponRecordService; |
| | | 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; |
| | |
| | | |
| | | @Autowired |
| | | private OrderRefundMapper orderRefundMapper; |
| | | |
| | | @Autowired |
| | | private OrderPointGoodsMapper orderPointGoodsMapper; |
| | | |
| | | @Autowired |
| | | private PointGoodsService pointGoodsService; |
| | | |
| | | @Autowired |
| | | private CouponRecordService couponRecordService; |
| | | |
| | | /** |
| | | * 微信预支付 |
| | |
| | | } |
| | | |
| | | private void releasePrepayLock(Order order){ |
| | | log.info("恢复库存: " + order); |
| | | log.info("恢复库存 积分商品兑换券 优惠券: " + order); |
| | | revertFlowerStock(order.getId()); |
| | | |
| | | //恢复积分商品兑换券 |
| | | revertPointGoodsRecord(order.getId()); |
| | | |
| | | //恢复优惠券 |
| | | String memberCouponId = order.getMemberCouponId(); |
| | | if(StringUtils.isNotEmpty(memberCouponId)) { |
| | | couponRecordService.cancelCouponUsage(order.getId()); |
| | | } |
| | | } |
| | | |
| | | 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){ |