From 21fad5bb63b6e5daae1ed4f4c543705588f64fe8 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期三, 26 十一月 2025 17:14:48 +0800
Subject: [PATCH] update
---
DriverJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/huifu/biz/DouGongPayUtil.java | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/DriverJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/huifu/biz/DouGongPayUtil.java b/DriverJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/huifu/biz/DouGongPayUtil.java
index 44bf810..f33c59e 100644
--- a/DriverJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/huifu/biz/DouGongPayUtil.java
+++ b/DriverJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/huifu/biz/DouGongPayUtil.java
@@ -7,6 +7,7 @@
import com.alibaba.fastjson.JSONObject;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.huifu.properties.HuiFuProperties;
+import com.stylefeng.guns.modular.system.util.RedisUtil;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -35,6 +36,9 @@
@Value("${callbackPath}")
private static String callbackPath;//支付回调网关地址
+
+ @Autowired
+ private RedisUtil redisUtil;
public static void main(String[] args) throws Exception {
@@ -95,7 +99,7 @@
* @param orderId
* @return
*/
- public static ResultUtil wxPayOrder(String money, String openId, String goodsDesc, int type, String orderId, int callType) {
+ public ResultUtil wxPayOrder(String money, String openId, String goodsDesc, int type, String orderId, int callType) {
HttpRequest post = HttpUtil.createPost("https://api.huifu.com/v4/trade/payment/create");
String req_seq_id = orderId + "_" + type + "_" + System.currentTimeMillis() + ToolUtil.getRandomNumber(10);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
@@ -149,9 +153,14 @@
System.out.println(p);
post.body(p);
+
HttpResponse execute = post.execute();
System.out.println(execute.body());
+
+ String randomString = ToolUtil.getRandomString(18);
+ redisUtil.setStrValue("dg_wx_pay:"+randomString,execute.body(),300);
JSONObject jsonObject = JSONObject.parseObject(execute.body());
+ jsonObject.put("dg_wx_pay","dg_wx_pay:"+randomString);
return ResultUtil.success(jsonObject);
}
--
Gitblit v1.7.1