Compare commits
No commits in common. "9e7fc2d5a268ec1f5402b983cd7bfe6374b5d518" and "547bdb6d088a68076731183629966d3c5bbe2e4a" have entirely different histories.
9e7fc2d5a2
...
547bdb6d08
|
@ -69,11 +69,9 @@ public class AliScanFaceServiceImpl implements IAliScanFaceService {
|
|||
String json = params.toJSONString();
|
||||
String service_code = AliFaceConstants.SMILEVERIFYNIN_V1; //调用的组件编码:初始化
|
||||
Result<Object> startServiceIniResult = this.startServiceIni(json, service_code);
|
||||
log.info("[AliScanFaceServiceImpl][aliFacePay][72][调用ABCP调用刷脸的结果] :{}", startServiceIniResult.toString());
|
||||
if (startServiceIniResult.isSuccess()) {
|
||||
Map<String, String> res = (Map<String, String>) startServiceIniResult.getResult();
|
||||
String ftoken = res.get("ftoken");
|
||||
log.info("[AliScanFaceServiceImpl][aliFacePay][76][调用ABCP调用刷脸的结果的ftoken] :{}", ftoken.toString());
|
||||
|
||||
/**
|
||||
* 2、调用后端的支付宝统一收单交易支付接口、存入hisPay
|
||||
|
@ -82,15 +80,12 @@ public class AliScanFaceServiceImpl implements IAliScanFaceService {
|
|||
JSONObject serverParams = (JSONObject) JSON.toJSON(aliOrderVo);
|
||||
|
||||
String url = serverUrl + "openapi/aliPayOrderApi/createOrder";
|
||||
log.info("[AliScanFaceServiceImpl][aliFacePay][85][调用后端的支付宝统一收单交易支付接口路径] :{}", serverUrl);
|
||||
log.info("[AliScanFaceServiceImpl][aliFacePay][85][调用后端的支付宝统一收单交易支付接口参数] :{}", serverParams.toJSONString());
|
||||
String req = HttpRequest.post(url)
|
||||
.header(Header.CONTENT_TYPE, ContentType.JSON.toString(CharsetUtil.CHARSET_UTF_8))
|
||||
.body(serverParams.toJSONString())
|
||||
.execute()
|
||||
.body();
|
||||
JSONObject serverResult = JSONObject.parseObject(req);
|
||||
log.info("[AliScanFaceServiceImpl][aliFacePay][93][调用后端的支付宝统一收单交易支付接口结果] :{}", serverResult.toString());
|
||||
|
||||
return Result.ok(serverResult);
|
||||
} else {
|
||||
|
@ -191,7 +186,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 +197,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 +218,10 @@ 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);
|
||||
return Result.error("等待process回调超时");
|
||||
} else {
|
||||
if (processCode.get() == 0) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(processResult.get());
|
||||
log.info("[AliScanFaceServiceImpl][startServiceIni][225][service_code:{}][ABCP调用刷脸-等待process回调完成结果] :{}", service_code, jsonObject.toString());
|
||||
if (jsonObject.containsKey("traceId")) {
|
||||
res.put("traceId", jsonObject.getString("traceId"));
|
||||
} else {
|
||||
|
@ -246,7 +239,6 @@ public class AliScanFaceServiceImpl implements IAliScanFaceService {
|
|||
} else {
|
||||
if (finishCode.get() == 1000) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(finishResult.get());
|
||||
log.info("[AliScanFaceServiceImpl][startServiceIni][244][service_code:{}] [ABCP调用刷脸-等待finish回调完成结果]:{}", service_code, jsonObject.toString());
|
||||
if (jsonObject.containsKey("ftoken")) {
|
||||
res.put("ftoken", jsonObject.getString("ftoken"));//ftoken参数的有效期为2分钟
|
||||
res.put("barCode", jsonObject.getString("barCode"));
|
||||
|
@ -263,7 +255,6 @@ public class AliScanFaceServiceImpl implements IAliScanFaceService {
|
|||
return finishResultRef.get();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.info("[AliScanFaceServiceImpl][startServiceIni][261][ABCP调用刷脸初始化服务失败] :{}", e.getMessage());
|
||||
return Result.error("ABCP调用刷脸初始化服务失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue