From ac33810ec25bdc540342f700d67bb177e4370cd2 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期三, 25 六月 2025 17:26:05 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev
---
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/WxChatPayCallBack.java | 34 +++++++++++++++++++++++++---------
1 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/WxChatPayCallBack.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/WxChatPayCallBack.java
index 799dfd0..47485f1 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/WxChatPayCallBack.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/WxChatPayCallBack.java
@@ -97,17 +97,21 @@
System.err.println("微信解密的字符串信息"+decryptedData);
JSONObject jsonInfo = (JSONObject) JSONObject.parse(decryptedData);
String transferBillNo = jsonInfo.getString("transfer_bill_no");
+ String outBillNo = jsonInfo.getString("out_bill_no");
String state = jsonInfo.getString("state");
- WithdrawDetail withdrawDetail = withdrawDetailService.lambdaQuery().eq(WithdrawDetail::getOutBatchNo, transferBillNo).one();
+ WithdrawDetail withdrawDetail = withdrawDetailService.lambdaQuery().eq(WithdrawDetail::getOutBatchNo, outBillNo).one();
Withdraw withdraw = withdrawService.getById(withdrawDetail.getWithdrawId());
Order order = orderService.getById(withdraw.getOrderId());
UserDto data = userClient.getUser(order.getUserId()).getData();
+ if (order.getIsWithdrawal()==3){
+ return "SUCCESS";
+ }
if ("SUCCESS".equals(state)){
- order.setIsWithdrawal(1);
+ order.setIsWithdrawal(3);
withdrawDetail.setStatus("SUCCESS");
withdrawDetailService.updateById(withdrawDetail);
orderService.updateById(order);
- }else if ("CANCELLED".equals(state)){
+ }else if ("CANCELLED".equals(state)||"CANCELING".equals(state)||"FAIL".equals(state)){
// 校验提现
List<Withdraw> list = withdrawService.lambdaQuery().eq(Withdraw::getUserId, order.getUserId())
.eq(Withdraw::getOrderId, order.getId()).list();
@@ -116,7 +120,7 @@
throw new GlobalException("当前订单提现申请已通过!");
}
// 超时未收款 撤销 重新发起转账 更新packageInfo
- weChatPay(order.getOrderMoney(), data.getOpenId(),list.get(0).getId(),order.getServeName());
+ weChatPay(order.getOrderMoney(), data.getOpenId(),list.get(0).getId(),order.getServeName());
}
map.put("code", "SUCCESS");
map.put("message", "成功");
@@ -148,14 +152,14 @@
// 订单号
String s = String.valueOf(UUID.randomUUID()).replaceAll("-", "");
postMap.put("out_bill_no", s);
- System.err.println("====="+postMap.get(WechatConstants.OUT_BATCH_NO));
+ System.err.println("====="+postMap.get("out_bill_no"));
postMap.put(WechatConstants.OPEN_ID, openId);
// 转账金额
postMap.put("transfer_amount", transferAmount);
// 转账备注
- postMap.put("transfer_remark", transferAmount);
+ postMap.put("transfer_remark", "二手回收提现确认收款");
// 回调地址
- postMap.put("notify_url", transferAmount);
+ postMap.put("notify_url", "https://hyhsbqgc.com/api/ruoyi-order/wx/wxChatPay");
// 转账场景报备信息
Map<String, Object> info = new HashMap<>();
info.put("info_type","回收商品名称");
@@ -166,7 +170,7 @@
com.alibaba.fastjson2.JSONObject.toJSONString(postMap),
"7EEA04429B006E12AAA421C002EC48BBEED5BE94",
"1665330417",
- "E:\\ershoucert\\apiclient_key.pem", WechatConstants.WE_CHAT_URL_SUF);
+ "/usr/local/vx/apiclient_key.pem", WechatConstants.WE_CHAT_URL_SUF);
com.alibaba.fastjson2.JSONObject jsonObject = com.alibaba.fastjson2.JSONObject.parseObject(result);
// WithdrawDetail withdrawDetail = new WithdrawDetail();
// withdrawDetail.setWithdrawId(withdrawId);
@@ -183,7 +187,7 @@
withdrawDetailService.updateById(one);
Order order = orderService.getById(withdraw.getOrderId());
order.setPackageInfo(string);
- order.setIsWithdrawal(0);
+ order.setIsWithdrawal(2);
orderService.updateById(order);
}
} else {
@@ -196,4 +200,16 @@
return allTransfersSuccessful;
}
+ public static void main(String[] args) {
+ String s = "1827928ae317443a8ef788e9ed56e8dc";
+ String s1 = HttpUtil.queryTransBatRequest(WechatConstants.WE_CHAT_PAY_QUERY_URL_PRE + s,
+ "7EEA04429B006E12AAA421C002EC48BBEED5BE94",
+ "1665330417",
+ "D:\\apiclient_key.pem", WechatConstants.WE_CHAT_QUERY_URL_SUF + s);
+ System.err.println(s1);
+ JSONObject jsonObject = JSONObject.parseObject(s1);
+ String string = jsonObject.getString("state");
+ System.err.println(string);
+ }
+
}
--
Gitblit v1.7.1