From 1442f149019ee0590389abd7a88a79c4d9b59034 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期二, 27 五月 2025 18:23:34 +0800
Subject: [PATCH] bug修改

---
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/WithdrawServiceImpl.java |   38 +++++++++++++++++++++++++++-----------
 1 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/WithdrawServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/WithdrawServiceImpl.java
index 5e929ad..8c87354 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/WithdrawServiceImpl.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/WithdrawServiceImpl.java
@@ -138,7 +138,7 @@
             throw new GlobalException("当前订单提现申请已通过!");
         }
 
-        return weChatPay(order.getOrderMoney(), openId,list.get(0).getId(),order.getServeName());
+        return weChatPay(order.getSubsidy()!=null?order.getSubsidy().add(order.getOrderMoney()):order.getOrderMoney(), openId,list.get(0).getId(),order.getServeName());
     }
 
     @Override
@@ -373,39 +373,55 @@
             postMap.put(WechatConstants.APP_ID, "wx98563d0ec9cf21c8");
             // 订单号
             postMap.put("out_bill_no", String.valueOf(UUID.randomUUID()).replaceAll("-", ""));
-            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_scene_id", "1010");
             // 转账备注
-            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");
             // 转账场景报备信息
+            List<Map<String, Object>> list = new ArrayList<>();
             Map<String, Object> info = new HashMap<>();
             info.put("info_type","回收商品名称");
             info.put("info_content",serverName);
-            postMap.put("transfer_scene_report_infos", JSONObject.toJSONString(info));
+            list.add(info);
+            postMap.put("transfer_scene_report_infos", list);
             String result = HttpUtil.postTransBatRequest(
                     WechatConstants.WE_CHAT_PAY_URL_PRE,
                     JSONObject.toJSONString(postMap),
                     "7EEA04429B006E12AAA421C002EC48BBEED5BE94",
                     "1665330417",
-                    "E:\\ershoucert\\apiclient_key.pem", WechatConstants.WE_CHAT_URL_SUF);
+                    "/usr/local/vx/apiclient_key.pem", "/v3/fund-app/mch-transfer/transfer-bills");
             JSONObject jsonObject = JSONObject.parseObject(result);
 //            WithdrawDetail withdrawDetail = new WithdrawDetail();
 //            withdrawDetail.setWithdrawId(withdrawId);
 //            withdrawDetail.setMoney(transferAmount);
 //            withdrawDetail.setOutBatchNo((String) postMap.get(WechatConstants.OUT_BATCH_NO));
 //            withdrawDetailService.save(withdrawDetail);
+            System.err.println(jsonObject);
+//            WithdrawDetail withdrawDetail = new WithdrawDetail();
+//            withdrawDetail.setWithdrawId(withdrawId);
+//            withdrawDetail.setMoney(transferAmount);
+//            withdrawDetail.setOutBatchNo((String) postMap.get(WechatConstants.OUT_BATCH_NO));
+//            withdrawDetailService.save(withdrawDetail);
             if (jsonObject.containsKey(WechatConstants.CREATE_TIME)) {
+                String string = jsonObject.getString("package_info");
+                Withdraw withdraw = this.getById(withdrawId);
+
+                Order order = orderService.getById(withdraw.getOrderId());
+                order.setIsWithdrawal(2);
+                order.setPackageInfo(string);
+                orderService.updateById(order);
                 // 转账成功
                 //保存转账明细
-//                WithdrawDetail withdrawDetail = new WithdrawDetail();
-//                withdrawDetail.setWithdrawId(withdrawId);
-//                withdrawDetail.setMoney(transferAmount);
-//                withdrawDetail.setOutBatchNo((String) postMap.get(WechatConstants.OUT_BATCH_NO));
-//                withdrawDetailService.save(withdrawDetail);
+                WithdrawDetail withdrawDetail = new WithdrawDetail();
+                withdrawDetail.setWithdrawId(withdrawId);
+                withdrawDetail.setMoney(transferAmount);
+                withdrawDetail.setOutBatchNo(postMap.get("out_bill_no")+"");
+                withdrawDetailService.save(withdrawDetail);
 
 
             } else {

--
Gitblit v1.7.1