From 431451b0c574fd7c1d9f89f8f3899afd80b7739a Mon Sep 17 00:00:00 2001
From: 刘帅 <rr.iii@qq.com>
Date: 星期一, 21 九月 2026 11:03:27 +0800
Subject: [PATCH] bug:优惠券使用后支付返回数据修改
---
cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java | 31 +++++++++++++++++++++++--------
1 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java b/cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java
index 81351fc..80ddfb5 100644
--- a/cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java
+++ b/cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java
@@ -1750,6 +1750,7 @@
return ResultUtil.error("用户积分不足!");
}
returnModel.setReturnId(returnId);
+ returnModel.setPaySuccess(true);
return ResultUtil.success(returnModel);
}
@@ -1899,6 +1900,7 @@
}
returnModel.setReturnId(returnId);
+ returnModel.setPaySuccess(pointsMerchandise.getPayStatus() == 2);
return ResultUtil.success(returnModel);
} catch (Exception e) {
e.printStackTrace();
@@ -2253,7 +2255,20 @@
}
}).start();
}
- return alipay;
+ return appendPaySuccess(alipay);
+ }
+
+ /**
+ * 支付宝、微信的成功响应仅表示已生成支付单,客户端仍需拉起第三方支付。
+ */
+ private ResultUtil appendPaySuccess(ResultUtil paymentResult) {
+ JSONObject data = paymentResult.getData() == null ? new JSONObject()
+ : JSON.parseObject(JSON.toJSONString(paymentResult.getData()));
+ if (data == null) {
+ data = new JSONObject();
+ }
+ data.put("paySuccess", false);
+ return ResultUtil.getResult(paymentResult.getCode(), paymentResult.getMsg(), data);
}
@@ -2275,7 +2290,7 @@
// 平台门票
ResultUtil weixinpay = payMoneyUtil.weixinpay(name, "", code, cash.toString(),
"/base/pointMer/exchangeGoodPaymentWeChatCallback", "APP", "");
- return weixinpay;
+ return appendPaySuccess(weixinpay);
} else {
String s2 = storeClient.getmerchantNumberByOperatorId(store1.getOperatorId());
System.err.println("微信商户号" + s2);
@@ -2286,7 +2301,7 @@
ResultUtil weixinpay = payMoneyUtil.weixinpayV3(s2, name, code,
"/base/pointMer/exchangeGoodPaymentWeChatCallback1",
cash.toString());
- return weixinpay;
+ return appendPaySuccess(weixinpay);
}
}
break;
@@ -2298,7 +2313,7 @@
// 平台课包
ResultUtil weixinpay = payMoneyUtil.weixinpay(name, "", code, cash.toString(),
"/base/pointMer/exchangeGoodPaymentWeChatCallback", "APP", "");
- return weixinpay;
+ return appendPaySuccess(weixinpay);
} else {
String s2 = storeClient.getmerchantNumberByOperatorId(store.getOperatorId());
System.err.println("微信商户号" + s2);
@@ -2309,7 +2324,7 @@
ResultUtil weixinpay = payMoneyUtil.weixinpayV3(s2, name, code,
"/base/pointMer/exchangeGoodPaymentWeChatCallback1",
cash.toString());
- return weixinpay;
+ return appendPaySuccess(weixinpay);
}
case 3:
if (!integers.isEmpty()) {
@@ -2318,7 +2333,7 @@
// 平台门票
ResultUtil weixinpay = payMoneyUtil.weixinpay(name, "", code, cash.toString(),
"/base/pointMer/exchangeGoodPaymentWeChatCallback", "APP", "");
- return weixinpay;
+ return appendPaySuccess(weixinpay);
} else {
String s2 = storeClient.getmerchantNumberByOperatorId(store1.getOperatorId());
System.err.println("微信商户号" + s2);
@@ -2329,13 +2344,13 @@
ResultUtil weixinpay = payMoneyUtil.weixinpayV3(s2, name, code,
"/base/pointMer/exchangeGoodPaymentWeChatCallback1",
cash.toString());
- return weixinpay;
+ return appendPaySuccess(weixinpay);
}
} else {
// 平台门票
ResultUtil weixinpay = payMoneyUtil.weixinpay(name, "", code, cash.toString(),
"/base/pointMer/exchangeGoodPaymentWeChatCallback", "APP", "");
- return weixinpay;
+ return appendPaySuccess(weixinpay);
}
}
--
Gitblit v1.7.1