|
@@ -11,6 +11,7 @@ import com.miaxis.common.utils.AesUtil;
|
|
|
import com.miaxis.tt.domain.TtOrder;
|
|
|
import com.miaxis.tt.dto.TtNotifyReturnDTO;
|
|
|
import com.miaxis.tt.dto.TtpayNotifyDTO;
|
|
|
+import com.miaxis.tt.dto.TtpaySource;
|
|
|
import com.miaxis.tt.service.ITtOrderService;
|
|
|
import com.miaxis.user.service.IUserInfoService;
|
|
|
import com.miaxis.vip.domain.VipCode;
|
|
@@ -85,11 +86,12 @@ public class TtNotifyController {
|
|
|
public TtNotifyReturnDTO wxpayNotify(@RequestBody TtpayNotifyDTO ttpayNotifyDTO) {
|
|
|
|
|
|
//将回调数据写入数据库
|
|
|
- writeNotifyDataToDb(ttpayNotifyDTO);
|
|
|
+ TtpaySource msg = JSONObject.parseObject(ttpayNotifyDTO.getMsg(), TtpaySource.class);
|
|
|
+ writeNotifyDataToDb(msg);
|
|
|
//创建兑换码
|
|
|
String code = createCode();
|
|
|
//激活用户
|
|
|
- avtivityCode(ttpayNotifyDTO.getMsg().getCp_orderno(),code);
|
|
|
+ avtivityCode(msg.getCp_orderno(),code);
|
|
|
|
|
|
TtNotifyReturnDTO ttNotifyReturnDTO = new TtNotifyReturnDTO();
|
|
|
ttNotifyReturnDTO.setErr_no(0);
|
|
@@ -169,8 +171,7 @@ public class TtNotifyController {
|
|
|
|
|
|
|
|
|
|
|
|
- public void writeNotifyDataToDb(TtpayNotifyDTO ttpayNotifyDTO) {
|
|
|
- TtpayNotifyDTO.TTpaySource msg = ttpayNotifyDTO.getMsg();
|
|
|
+ public void writeNotifyDataToDb(TtpaySource msg) {
|
|
|
TtOrder order= ttOrderService.getOne(new QueryWrapper<TtOrder>().eq("cp_orderno",msg.getCp_orderno()));
|
|
|
if (order == null) {
|
|
|
throw new CustomException("该订单不存在");
|