实现查询申请状态接口
This commit is contained in:
@@ -116,6 +116,9 @@ public class BestsignOpenApiClient {
|
||||
return userObj.toJSONString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* GET方法示例
|
||||
* 下载合同PDF文件
|
||||
@@ -145,4 +148,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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user