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 | 75 +++++++++++++++++++++++++++---------- 1 files changed, 54 insertions(+), 21 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 564e86c..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,30 +98,31 @@ // String s = RandomUtil.randomNumbers(4); // String s1 = "FZ" + time + s; // System.err.println(s1); -// createUser(s1,"邱仕珍","00" -// ,"441622198609245260" -// ,"13682696011" -// ,"61485755117823"); - updateAccount("FZ17403857003793677","邱仕珍","13682696011" - ,"4367427200563236884"); -// updateAccount("test945622121","周帅","19983174515" -// ,"6228480469852935177"); + createUser("1","董国庆","00" + ,"511602199910018718" + ,"18224358736" + ,"6230520460328218072"); +// updateAccount("FZ17403857003793677","邱仕珍","13682696011" +// ,"4367427200563236884"); +// 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(); + queryUserList("420881198207202109"); +// queryBalanceList("FZ17430701653874185"); +// queryPayment("002212025032410341110750073154527547392"); } - public static String queryUserList() + public static String queryUserList(String identifier) throws Exception { JSONObject data = new JSONObject(); // data.put("app_id", APP_ID); data.put("app_id", "app_e7301b75-19f1-40e5-96ac-0fee847d4da0"); data.put("member_type", "01"); - data.put("identifier", "441622198609245260"); + data.put("identifier", identifier); data.put("page_index", "1"); data.put("page_size", "10"); JSONObject body = new JSONObject(); @@ -143,7 +146,32 @@ System.err.println(decrypt); JSONObject jsonObject = JSONObject.parseObject(decrypt); System.err.println(jsonObject); - return "success"; + if (jsonObject!=null){ + 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; } /** * 创建用户 @@ -192,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"); } @@ -236,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"+"发生未知异常(应该是银行卡信息和持卡人信息不一致 但是第三方没有返回准确的错误信息 这里统一返回为银行卡信息或持卡人信息有误)"; @@ -258,9 +292,8 @@ JSONObject data = new JSONObject(); // data.put("app_id", APP_ID); - data.put("app_id", "app_e7301b75-19f1-40e5-96ac-0fee847d4da0"); + data.put("app_id", APP_ID); data.put("member_id", memberId); - data.put("member_type", "01"); JSONObject body = new JSONObject(); // body.put("merId", MER_ID); body.put("merId", "1120241105365033"); @@ -285,7 +318,7 @@ System.err.println(jsonObject); return "success"; } - public static String queryBalanceList() + public static String queryBalanceList(String member_id) throws Exception { SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); Date date = new Date(); @@ -298,8 +331,8 @@ data.put("start_date", format1); data.put("end_date", format); data.put("page_index", "01"); - data.put("page_size", "01"); - data.put("member_id", "FZ17343419268427877"); + data.put("page_size", "10"); + data.put("member_id", member_id); JSONObject body = new JSONObject(); // body.put("merId", MER_ID); body.put("merId", "1120241105365033"); -- Gitblit v1.7.1