实现查询申请状态接口 #33
+33
@@ -0,0 +1,33 @@
|
|||||||
|
package com.ruoyi.web.controller.bestsign;
|
||||||
|
|
||||||
|
import com.ruoyi.bestsign.domain.ArbitrSignatuVO;
|
||||||
|
import com.ruoyi.bestsign.domain.PersonRegisterVO;
|
||||||
|
import com.ruoyi.bestsign.service.ArbitrSignatuService;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/arbitrSignatu")
|
||||||
|
public class ArbitrSignatuController {
|
||||||
|
@Autowired
|
||||||
|
ArbitrSignatuService arbitrSignatuService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请状态查询
|
||||||
|
*
|
||||||
|
* @param arbitrSignatuVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/selectApplyStatus")
|
||||||
|
public AjaxResult selectApplyStatus (@Validated @RequestBody ArbitrSignatuVO arbitrSignatuVO) {
|
||||||
|
return arbitrSignatuService.selectApplyStatus(arbitrSignatuVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.ruoyi.bestsign.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class ArbitrSignatuVO {
|
||||||
|
/**
|
||||||
|
* 用户帐号
|
||||||
|
* 任务id
|
||||||
|
*/
|
||||||
|
private String account;
|
||||||
|
private String taskId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.ruoyi.bestsign.service;
|
||||||
|
|
||||||
|
import com.ruoyi.bestsign.domain.ArbitrSignatuVO;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
|
||||||
|
public interface ArbitrSignatuService {
|
||||||
|
|
||||||
|
|
||||||
|
AjaxResult selectApplyStatus(ArbitrSignatuVO arbitrSignatuVO);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+29
@@ -0,0 +1,29 @@
|
|||||||
|
package com.ruoyi.bestsign.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.bestsign.domain.ArbitrSignatuVO;
|
||||||
|
import com.ruoyi.bestsign.service.ArbitrSignatuService;
|
||||||
|
import com.ruoyi.bestsign.utils.BestsignOpenApiClient;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class ArbitrSignatuServiceImpl implements ArbitrSignatuService {
|
||||||
|
@Autowired
|
||||||
|
BestsignOpenApiClient bestsignOpenApiClient;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult selectApplyStatus(ArbitrSignatuVO arbitrSignatuVO) {
|
||||||
|
String strRespon = "";
|
||||||
|
try {
|
||||||
|
strRespon = bestsignOpenApiClient.selectApplyStatus(arbitrSignatuVO.getAccount(),
|
||||||
|
arbitrSignatuVO.getTaskId());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return AjaxResult.error(e.getMessage());
|
||||||
|
}
|
||||||
|
return AjaxResult.success(strRespon);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -116,6 +116,9 @@ public class BestsignOpenApiClient {
|
|||||||
return userObj.toJSONString();
|
return userObj.toJSONString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GET方法示例
|
* GET方法示例
|
||||||
* 下载合同PDF文件
|
* 下载合同PDF文件
|
||||||
@@ -145,4 +148,41 @@ public class BestsignOpenApiClient {
|
|||||||
// 返回结果解析
|
// 返回结果解析
|
||||||
return responseBody;
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-11
@@ -60,10 +60,11 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio
|
|||||||
public IdentityAuthentication selectIdentityAuthentication(IdentityAuthentication identityAuthentication) {
|
public IdentityAuthentication selectIdentityAuthentication(IdentityAuthentication identityAuthentication) {
|
||||||
IdentityAuthentication identityAuthenticationselect = identityAuthenticationMapper.selectIdentityAuthentication(identityAuthentication);
|
IdentityAuthentication identityAuthenticationselect = identityAuthenticationMapper.selectIdentityAuthentication(identityAuthentication);
|
||||||
if(identityAuthenticationselect!=null){
|
if(identityAuthenticationselect!=null){
|
||||||
identityAuthenticationselect.setCertificationStatusName("已身份注册");
|
identityAuthenticationselect.setCertificationStatusName("已身份认证");
|
||||||
}else {
|
}else {
|
||||||
IdentityAuthentication identityAuthenticationselectnew = new IdentityAuthentication();
|
IdentityAuthentication identityAuthenticationselectnew = new IdentityAuthentication();
|
||||||
identityAuthenticationselectnew.setCertificationStatusName("未身份注册");
|
identityAuthenticationselectnew.setCertificationStatusName("未身份认证");
|
||||||
|
identityAuthenticationselectnew.setCertificationStatus(0);
|
||||||
return identityAuthenticationselectnew;
|
return identityAuthenticationselectnew;
|
||||||
}
|
}
|
||||||
return identityAuthenticationselect;
|
return identityAuthenticationselect;
|
||||||
@@ -119,15 +120,15 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio
|
|||||||
GetEidResultRequest reqest = new GetEidResultRequest();
|
GetEidResultRequest reqest = new GetEidResultRequest();
|
||||||
//设置请求参数
|
//设置请求参数
|
||||||
reqest.setEidToken(eidToken);
|
reqest.setEidToken(eidToken);
|
||||||
|
|
||||||
|
// reqest.setInfoType("1");
|
||||||
|
// reqest.setInfoType("13");
|
||||||
|
reqest.setInfoType("2");
|
||||||
|
|
||||||
//获得身份认证结果
|
//获得身份认证结果
|
||||||
GetEidResultResponse respIdenAuth = clientIdenAuth.GetEidResult(reqest);
|
GetEidResultResponse respIdenAuth = clientIdenAuth.GetEidResult(reqest);
|
||||||
String respJSON = GetEidResultResponse.toJsonString(respIdenAuth);
|
String respJSON = GetEidResultResponse.toJsonString(respIdenAuth);
|
||||||
JSONObject objJSON = JSON.parseObject(respJSON);
|
JSONObject objJSON = JSON.parseObject(respJSON);
|
||||||
JSONObject objText = JSON.parseObject(objJSON.getString("Text"));
|
|
||||||
String name = objText.getString("OcrName");
|
|
||||||
// IdentityAuthenticationRespon.setName(name);
|
|
||||||
String identityNo = objText.getString("OcrIdCard");
|
|
||||||
// IdentityAuthenticationRespon.setIdentityNo(identityNo);
|
|
||||||
IdentityAuthenticationRespon.setCertificationStatus(1);
|
IdentityAuthenticationRespon.setCertificationStatus(1);
|
||||||
IdentityAuthenticationRespon.setUserName(userName);
|
IdentityAuthenticationRespon.setUserName(userName);
|
||||||
IdentityAuthenticationRespon.setUserId(userId);
|
IdentityAuthenticationRespon.setUserId(userId);
|
||||||
@@ -138,14 +139,11 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio
|
|||||||
Map<String,String> mapEidInfo = decodeEidInfo(desKey,uerInfo);
|
Map<String,String> mapEidInfo = decodeEidInfo(desKey,uerInfo);
|
||||||
IdentityAuthenticationRespon.setName(mapEidInfo.get("name"));
|
IdentityAuthenticationRespon.setName(mapEidInfo.get("name"));
|
||||||
IdentityAuthenticationRespon.setIdentityNo(mapEidInfo.get("identityNo"));
|
IdentityAuthenticationRespon.setIdentityNo(mapEidInfo.get("identityNo"));
|
||||||
|
IdentityAuthenticationRespon.setCertificationStatus(1);
|
||||||
|
|
||||||
identityAuthenticationMapper.insertIdentityAuthentication(IdentityAuthenticationRespon);
|
identityAuthenticationMapper.insertIdentityAuthentication(IdentityAuthenticationRespon);
|
||||||
// IdentityAuthenticationResult.setUserName(userName);
|
|
||||||
IdentityAuthenticationResult.setCertificationStatus(1);
|
IdentityAuthenticationResult.setCertificationStatus(1);
|
||||||
IdentityAuthenticationResult.setCertificationStatusName("认证成功");
|
IdentityAuthenticationResult.setCertificationStatusName("认证成功");
|
||||||
// IdentityAuthenticationResult.setName(name);
|
|
||||||
// IdentityAuthenticationResult.setIdentityNo(identityNo);
|
|
||||||
System.out.println(GetEidResultResponse.toJsonString(respIdenAuth));
|
|
||||||
} catch (TencentCloudSDKException e) {
|
} catch (TencentCloudSDKException e) {
|
||||||
log.error("认证失败:", e);
|
log.error("认证失败:", e);
|
||||||
throw new RuntimeException("认证失败");
|
throw new RuntimeException("认证失败");
|
||||||
|
|||||||
+1
-1
@@ -37,7 +37,7 @@
|
|||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<select id="selectIdentityAuthentication" parameterType="IdentityAuthentication" resultMap="IdentityAuthenticationResult">
|
<select id="selectIdentityAuthentication" parameterType="IdentityAuthentication" resultMap="IdentityAuthenticationResult">
|
||||||
SELECT i.id ,i.name ,i.identity_no ,i.certification_time ,i.certificationStatus ,i.user_id ,i.user_name
|
SELECT i.id ,i.name ,i.identity_no ,i.certification_time ,i.certification_status ,i.user_id ,i.user_name
|
||||||
from identi_authenti i
|
from identi_authenti i
|
||||||
<where>
|
<where>
|
||||||
<if test="userName != null and userName != '' ">
|
<if test="userName != null and userName != '' ">
|
||||||
|
|||||||
Reference in New Issue
Block a user