|
@@ -1,11 +1,14 @@
|
|
|
package com.miaxis.wx.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
|
import com.miaxis.common.config.WxpayConfig;
|
|
|
+import com.miaxis.common.core.domain.entity.UserInfo;
|
|
|
import com.miaxis.common.exception.CustomException;
|
|
|
+import com.miaxis.user.service.IUserInfoService;
|
|
|
import com.miaxis.wx.domain.RefundRecord;
|
|
|
import com.miaxis.wx.domain.WxOrder;
|
|
|
import com.miaxis.wx.dto.WxNotifyReturnDTO;
|
|
@@ -41,6 +44,9 @@ public class RefundRecordServiceImpl extends ServiceImpl<RefundRecordMapper, Ref
|
|
|
|
|
|
@Autowired
|
|
|
private WxpayConfig wxpayConfig;
|
|
|
+
|
|
|
+
|
|
|
+ private IUserInfoService userInfoService;
|
|
|
/**
|
|
|
* 查询微信退款记录列表
|
|
|
*
|
|
@@ -104,6 +110,10 @@ public class RefundRecordServiceImpl extends ServiceImpl<RefundRecordMapper, Ref
|
|
|
refundRecord.setCurrency(amount.getString("currency"));
|
|
|
this.save(refundRecord);
|
|
|
|
|
|
+ //退款完成 解除会员vip身份
|
|
|
+ UserInfo userInfo = userInfoService.getOne(new QueryWrapper<UserInfo>().eq("openid", wxOrder.getOpenid()));
|
|
|
+ userInfo.setIsVip(0);
|
|
|
+ userInfoService.updateById(userInfo);
|
|
|
WxNotifyReturnDTO wxNotifyReturnDTO = new WxNotifyReturnDTO();
|
|
|
wxNotifyReturnDTO.setCode("SUCCESS");
|
|
|
wxNotifyReturnDTO.setMessage("成功");
|