From 60019a42837ebf21df1cf737fcf99e86f21f2d64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=9B=AA?= <1044122544@qq.com> Date: Tue, 17 Jun 2025 16:20:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=AE=9D=E5=88=B7=E8=84=B8?= =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AliScanFaceServiceImpl.java | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/dpkj/modules/scanface/ali/service/impl/AliScanFaceServiceImpl.java b/src/main/java/com/dpkj/modules/scanface/ali/service/impl/AliScanFaceServiceImpl.java index 5922732..bd52948 100644 --- a/src/main/java/com/dpkj/modules/scanface/ali/service/impl/AliScanFaceServiceImpl.java +++ b/src/main/java/com/dpkj/modules/scanface/ali/service/impl/AliScanFaceServiceImpl.java @@ -69,21 +69,21 @@ public class AliScanFaceServiceImpl implements IAliScanFaceService { String json = params.toJSONString(); String service_code = AliFaceConstants.SMILEVERIFYNIN_V1; //调用的组件编码:初始化 Result startServiceIniResult = this.startServiceIni(json, service_code); - log.info("[AliScanFaceServiceImpl][aliFacePay][72][调用ABCP调用刷脸的结果] :{}", startServiceIniResult.toString()); + log.info("[AliScanFaceServiceImpl][aliFacePay][72][1、获取刷脸去初始化服务的结果] :{}", startServiceIniResult.toString()); if (startServiceIniResult.isSuccess()) { Map res = (Map) startServiceIniResult.getResult(); String ftoken = res.get("ftoken"); - log.info("[AliScanFaceServiceImpl][aliFacePay][76][调用ABCP调用刷脸的结果的ftoken] :{}", ftoken.toString()); + log.info("[AliScanFaceServiceImpl][aliFacePay][76][[1、获取刷脸去初始化服务的结果-ftoken值] :{}", ftoken); /** * 2、调用后端的支付宝统一收单交易支付接口、存入hisPay */ aliOrderVo.setAuthCode(ftoken);//Demo值:"fp128d26333fa66e66e7f34c493d30cdh76" JSONObject serverParams = (JSONObject) JSON.toJSON(aliOrderVo); + log.info("[AliScanFaceServiceImpl][aliFacePay][83][调用后端的支付宝统一收单交易支付接口参数] :{}", serverParams.toString()); String url = serverUrl + "openapi/aliPayOrderApi/createOrder"; - log.info("[AliScanFaceServiceImpl][aliFacePay][85][调用后端的支付宝统一收单交易支付接口路径] :{}", serverUrl); - log.info("[AliScanFaceServiceImpl][aliFacePay][85][调用后端的支付宝统一收单交易支付接口参数] :{}", serverParams.toJSONString()); + log.info("[AliScanFaceServiceImpl][aliFacePay][86][调用后端的支付宝统一收单交易支付接口路径] :{}", url); String req = HttpRequest.post(url) .header(Header.CONTENT_TYPE, ContentType.JSON.toString(CharsetUtil.CHARSET_UTF_8)) .body(serverParams.toJSONString()) @@ -191,7 +191,7 @@ public class AliScanFaceServiceImpl implements IAliScanFaceService { AbcpInvoke.CallbackRsp callbackRsp = new AbcpInvoke.CallbackRsp() { @Override public void OnProcess(int code, String subCode, String subMsg, String result) { - log.info("[AliScanFaceServiceImpl][OnProcess][189][service_code:{}][code:{}][subCode:{}][subMsg:{}][result:{}]", service_code, code, subCode, subMsg, result); + log.info("[AliScanFaceServiceImpl][OnProcess][123][service_code:{}][code:{}][subCode:{}][subMsg:{}][result:{}]", service_code, code, subCode, subMsg, result); try { processCode.set(code); processResult.set(result); @@ -202,7 +202,7 @@ public class AliScanFaceServiceImpl implements IAliScanFaceService { @Override public void OnFinish(int code, String subCode, String subMsg, String result) { - log.info("[AliScanFaceServiceImpl][OnFinish][200][ABCP服务调用 刷脸初始化服务,获取ftoken:][service_code:{}][code:{}][subCode:{}][subMsg:{}][result:{}]", service_code, code, subCode, subMsg, result); + log.info("[AliScanFaceServiceImpl][OnFinish][128][service_code:{}][code:{}][subCode:{}][subMsg:{}][result:{}]", service_code, code, subCode, subMsg, result); /**Demo示例记录 * [service_code:BPaaSSmileVerifyNonInitV1][code:1000][subCode:E00000][subMsg:SUCCESS][result:{"code":1000,"subCode":"OK_SUCCESS","subMessage":"SUCCESS","barCode":"281215320962898068","ftoken":"fp1efd3d4c0230a28f5261efe7c5050eh28","alipayUid":"2088812449506047","accountList":"[\"104***@qq.com\"]","authToken":"44686f7195c77ee2e09c09bcdc657dd5h28i","result":{"accountList":["104***@qq.com"],"alipayUid":"2088812449506047","allowRetry":false,"authToken":"44686f7195c77ee2e09c09bcdc657dd5h28i","barCode":"281215320962898068","certName":"您好,*雪","ftoken":"fp1efd3d4c0230a28f5261efe7c5050eh28","type":"selectUid"},"easterEgg":false,"zolozConfig":{"installAngle":90},"serviceId":"pay","traceId":"2444-44-1745802328","callStartTimeMs":1745802328114,"localTime":"2025-04-28-09-05-41-791"}] @@ -223,12 +223,13 @@ public class AliScanFaceServiceImpl implements IAliScanFaceService { // 等待process回调完成(设置超时避免死锁) boolean awaitSuccess = latch.await(10, TimeUnit.SECONDS); if (!awaitSuccess) { - log.info("[AliScanFaceServiceImpl][startServiceIni][221][service_code:{}][ABCP调用刷脸:等待process回调超时]", service_code); + log.info("[AliScanFaceServiceImpl][startServiceIni][226][10秒-等待process回调超时]"); return Result.error("等待process回调超时"); } else { + log.info("[AliScanFaceServiceImpl][startServiceIni][229][ABCP调用刷脸初始化服务-process回调结果-processCode] :{}", processCode); if (processCode.get() == 0) { JSONObject jsonObject = JSONObject.parseObject(processResult.get()); - log.info("[AliScanFaceServiceImpl][startServiceIni][225][service_code:{}][ABCP调用刷脸-等待process回调完成结果] :{}", service_code, jsonObject.toString()); + log.info("[AliScanFaceServiceImpl][startServiceIni][232][ABCP调用刷脸初始化服务-process回调结果] :{}", jsonObject.toString()); if (jsonObject.containsKey("traceId")) { res.put("traceId", jsonObject.getString("traceId")); } else { @@ -242,11 +243,13 @@ public class AliScanFaceServiceImpl implements IAliScanFaceService { // 等待finish回调完成(设置超时避免死锁) boolean awaitFinishSuccess = latchFinish.await(120, TimeUnit.SECONDS); if (!awaitFinishSuccess) { + log.info("[AliScanFaceServiceImpl][startServiceIni][246][120秒-等待finish回调超时]"); return Result.error("等待finish回调超时"); } else { + log.info("[AliScanFaceServiceImpl][startServiceIni][249][ABCP调用刷脸初始化服务-finish回调结果-finishCode] :{}", finishCode); if (finishCode.get() == 1000) { JSONObject jsonObject = JSONObject.parseObject(finishResult.get()); - log.info("[AliScanFaceServiceImpl][startServiceIni][244][service_code:{}] [ABCP调用刷脸-等待finish回调完成结果]:{}", service_code, jsonObject.toString()); + log.info("[AliScanFaceServiceImpl][startServiceIni][252][ABCP调用刷脸初始化服务-finish回调结果] :{}", jsonObject.toString()); if (jsonObject.containsKey("ftoken")) { res.put("ftoken", jsonObject.getString("ftoken"));//ftoken参数的有效期为2分钟 res.put("barCode", jsonObject.getString("barCode")); @@ -260,10 +263,10 @@ public class AliScanFaceServiceImpl implements IAliScanFaceService { } //结果返回 + log.info("[AliScanFaceServiceImpl][startServiceIni][266][][ABCP调用刷脸初始化服务成功返回结果:] :{}", finishResultRef.get()); return finishResultRef.get(); } catch (Exception e) { e.printStackTrace(); - log.info("[AliScanFaceServiceImpl][startServiceIni][261][ABCP调用刷脸初始化服务失败] :{}", e.getMessage()); return Result.error("ABCP调用刷脸初始化服务失败:" + e.getMessage()); } }