From 1e12b2abcaa1bdbdb57d3694446337126168bef1 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期五, 28 三月 2025 19:15:08 +0800
Subject: [PATCH] bug修改

---
 xinquan-common/xinquan-common-core/src/main/java/com/xinquan/common/core/utils/JuHeFuUtil.java |   56 +++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 43 insertions(+), 13 deletions(-)

diff --git a/xinquan-common/xinquan-common-core/src/main/java/com/xinquan/common/core/utils/JuHeFuUtil.java b/xinquan-common/xinquan-common-core/src/main/java/com/xinquan/common/core/utils/JuHeFuUtil.java
index 1a06255..cbde3c3 100644
--- a/xinquan-common/xinquan-common-core/src/main/java/com/xinquan/common/core/utils/JuHeFuUtil.java
+++ b/xinquan-common/xinquan-common-core/src/main/java/com/xinquan/common/core/utils/JuHeFuUtil.java
@@ -5,7 +5,9 @@
 import cn.hutool.http.HttpResponse;
 import cn.hutool.http.HttpUtil;
 import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONArray;
 import com.alibaba.fastjson2.JSONObject;
+import com.obs.services.IFSClient;
 import com.xinquan.common.core.domain.R;
 import com.xinquan.common.core.exception.ServiceException;
 
@@ -96,21 +98,21 @@
 //        String s = RandomUtil.randomNumbers(4);
 //        String s1 = "FZ" + time + s;
 //        System.err.println(s1);
-//        createUser(s1,"周帅","00"
-//                ,"130682198203061982"
-//                ,"18132621790"
-//                ,"6221801210000822611");
+        createUser("1","董国庆","00"
+                ,"511602199910018718"
+                ,"18224358736"
+                ,"6230520460328218072");
 //        updateAccount("FZ17403857003793677","邱仕珍","13682696011"
 //                ,"4367427200563236884");
-//        updateAccount("test945622121","周帅","19983174515"
-//                ,"6228480469852935177");
+//        updateAccount("FZ17430446395934603","刘晓梅","18186305036"
+//                ,"6215591804000544393");
 //          balancePay("CZ09809217341", "FZ17343419268427877","0.01", "");
 //        queryBalance("FZ17343419268427877");
 //        String decrypt = decrypt("z8Che/JwxrGj/oTOuAvU8HFN6vXL/OqeioV41ZuPV/xVQPt9vCHHc1R5LgAO51Hq5ilD9wqsminRvSiJj6Fs/Bfk8espZSOO2g1OE7FZyqcLB1w01MSWyxfQT8nc2GH/EfOKXCuaKBCeyW24OvW3ng==");
 //        System.err.println(decrypt);
 //        balanceWithdraw("TX1000928371648172","0.01","FZ17343419268427877","https://xq.xqzhihui.com/api/user/client/app-user-withdraw/base/callbackA");
-        queryUserList("441424198104061249");
-//        queryBalanceList("FZ17427173417891435");
+        queryUserList("420881198207202109");
+//        queryBalanceList("FZ17430701653874185");
 //        queryPayment("002212025032410341110750073154527547392");
     }
     public static String queryUserList(String identifier)
@@ -145,7 +147,29 @@
         JSONObject jsonObject = JSONObject.parseObject(decrypt);
         System.err.println(jsonObject);
         if (jsonObject!=null){
-            return jsonObject.getJSONObject("data").getString("member_id");
+            JSONArray data1 = jsonObject.getJSONArray("data");
+            if(data1==null){
+                return null;
+            }else{
+                for (Object o : data1) {
+                    // 将Object转化为jsonObject
+                    JSONObject jsonObject1 = (JSONObject) o;
+                    if(jsonObject1!=null){
+                        String fzId = jsonObject1.getString("member_id");
+                        String sfz = jsonObject1.getString("identifier");
+                        if (org.springframework.util.StringUtils.hasLength(fzId)&&org.springframework.util.StringUtils.hasLength(sfz)){
+                            if (sfz.equals(identifier)){
+                                return fzId;
+                            }
+                        }else{
+                            return null;
+                        }
+                    }else{
+                        return null;
+                    }
+                }
+                return null;
+            }
         }
         return null;
     }
@@ -196,12 +220,15 @@
 //        String result = sendPost(BASE_URL + CREATE_USER_INTERFACE, body);
         String result = sendPost("https://payapi.juhefu.com/" + CREATE_USER_INTERFACE, body);
         JSONObject resJsonObject = JSONObject.parseObject(result);
+        if (org.springframework.util.StringUtils.hasLength(resJsonObject.getString("error_msg"))){
+            return resJsonObject.getString("error_msg");
+        }
         System.err.println(resJsonObject);
-        String string = resJsonObject.getString("reqCipher");
+        String string = resJsonObject.getString("resCipher");
         String decrypt = decrypt(string);
         System.err.println(decrypt);
         JSONObject jsonObject = JSONObject.parseObject(decrypt);
-        if (resJsonObject.get("error_msg")!=null){
+        if (jsonObject.get("error_msg")!=null){
             System.err.println("添加银行卡失败没有获取到分账id"+resJsonObject.get("error_msg"));
             return resJsonObject.getString("error_msg");
         }
@@ -240,9 +267,12 @@
         JSONObject resJsonObject = JSONObject.parseObject(result);
         System.err.println(resJsonObject);
         if (resJsonObject.get("error_msg")!=null){
+            if (resJsonObject.getString("error_msg").contains("无需更新")){
+                return "success";
+            }
             return resJsonObject.getString("error_msg");
         }
-        String string = resJsonObject.getString("reqCipher");
+        String string = resJsonObject.getString("resCipher");
         String decrypt = decrypt(string);
         if (decrypt==null){
             return "false"+"发生未知异常(应该是银行卡信息和持卡人信息不一致 但是第三方没有返回准确的错误信息 这里统一返回为银行卡信息或持卡人信息有误)";
@@ -301,7 +331,7 @@
         data.put("start_date", format1);
         data.put("end_date", format);
         data.put("page_index", "01");
-        data.put("page_size", "01");
+        data.put("page_size", "10");
         data.put("member_id", member_id);
         JSONObject body = new JSONObject();
 //        body.put("merId", MER_ID);

--
Gitblit v1.7.1