This commit is contained in:
gy b
2023-10-05 20:28:41 +08:00
7 changed files with 148 additions and 12 deletions
@@ -126,6 +126,9 @@ public class BestsignOpenApiClient {
// }
}
/**
* GET方法示例
* 下载合同PDF文件
@@ -155,4 +158,41 @@ public class BestsignOpenApiClient {
// 返回结果解析
return responseBody;
}
public String selectApplyStatus(String account, String taskId) throws Exception {
String methodInvoke = "/user/async/applyCert/status/";
JSONObject requestParam = new JSONObject();
//用户账号
requestParam.put("account", account);
//任务单号
requestParam.put("taskId", taskId);
String timestamsParam = RSAUtils.getRtick();
// 计算参数签名
String paramsSign = RSAUtils.calcRsaSign(this.developerId,
this.privateKey, this.serverHost, methodInvoke, timestamsParam, null,
requestParam.toJSONString());
// 签名参数追加为url参数
String fullUrlParams = String.format(this.urlSignParams, this.developerId,
timestamsParam, paramsSign);
String responseResult = HttpClientSender.sendHttpPost(this.serverHost, methodInvoke,
fullUrlParams, requestParam.toJSONString());
JSONObject responseObj = JSON.parseObject(responseResult);
// 返回errno为0,表示成功,其他表示失败
if (responseObj.getIntValue("errno") == 0) {
JSONObject data = responseObj.getJSONObject("data");
if (data != null) {
String message = data.getString("message");
String status = data.getString("status");
return status;
}
} else {
log.error("查询申请状态异常:"+responseObj.toJSONString());
}
return responseObj.toJSONString();
}
}