fix: 取消券置空相关信息

This commit is contained in:
张松
2024-11-25 15:16:21 +08:00
parent 41b6a18676
commit 18e446083d

View File

@@ -504,7 +504,7 @@ public class PayService {
static void returnCoupon(TbOrderInfo orderInfo, TbShopCouponService shopCouponService, MpCashierCartMapper cashierCartMapper) {
if (StrUtil.isNotBlank(orderInfo.getCouponInfoList())) {
OrderCouponInfoDTO couponInfoDTO = JSONObject.parseObject(orderInfo.getCouponInfoList(), OrderCouponInfoDTO.class);
OrderInfoCouponInfoDTO couponInfoDTO = JSONObject.parseObject(orderInfo.getCouponInfoList(), OrderInfoCouponInfoDTO.class);
// 券返还
if (!couponInfoDTO.getOutRecordList().isEmpty()) {
couponInfoDTO.getOutRecordList().forEach(item -> {
@@ -512,6 +512,8 @@ public class PayService {
});
shopCouponService.refund(couponInfoDTO.getOutRecordList());
couponInfoDTO.setOutRecordList(new ArrayList<>());
couponInfoDTO.setProductCoupon(new ArrayList<>());
couponInfoDTO.setFullReductionCoupon(new ArrayList<>());
orderInfo.setCouponInfoList(JSONObject.toJSONString(couponInfoDTO));
orderInfo.setUserCouponId(null);
orderInfo.setUseCouponInfo(null);