diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bestsign/ArbitrSignatuController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bestsign/ArbitrSignatuController.java new file mode 100644 index 0000000..def71be --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bestsign/ArbitrSignatuController.java @@ -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); + } + + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/bestsign/domain/ArbitrSignatuVO.java b/ruoyi-system/src/main/java/com/ruoyi/bestsign/domain/ArbitrSignatuVO.java new file mode 100644 index 0000000..1edcaec --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/bestsign/domain/ArbitrSignatuVO.java @@ -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; + + + + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/ArbitrSignatuService.java b/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/ArbitrSignatuService.java new file mode 100644 index 0000000..d15b083 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/ArbitrSignatuService.java @@ -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); + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/impl/ArbitrSignatuServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/impl/ArbitrSignatuServiceImpl.java new file mode 100644 index 0000000..998de51 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/bestsign/service/impl/ArbitrSignatuServiceImpl.java @@ -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); + + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/BestsignOpenApiClient.java b/ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/BestsignOpenApiClient.java index 708a40b..09d0063 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/BestsignOpenApiClient.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/BestsignOpenApiClient.java @@ -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(); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java index b76fcda..bc1a677 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java @@ -60,10 +60,11 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio public IdentityAuthentication selectIdentityAuthentication(IdentityAuthentication identityAuthentication) { IdentityAuthentication identityAuthenticationselect = identityAuthenticationMapper.selectIdentityAuthentication(identityAuthentication); if(identityAuthenticationselect!=null){ - identityAuthenticationselect.setCertificationStatusName("已身份注册"); + identityAuthenticationselect.setCertificationStatusName("已身份认证"); }else { IdentityAuthentication identityAuthenticationselectnew = new IdentityAuthentication(); - identityAuthenticationselectnew.setCertificationStatusName("未身份注册"); + identityAuthenticationselectnew.setCertificationStatusName("未身份认证"); + identityAuthenticationselectnew.setCertificationStatus(0); return identityAuthenticationselectnew; } return identityAuthenticationselect; @@ -119,15 +120,15 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio GetEidResultRequest reqest = new GetEidResultRequest(); //设置请求参数 reqest.setEidToken(eidToken); + +// reqest.setInfoType("1"); +// reqest.setInfoType("13"); + reqest.setInfoType("2"); + //获得身份认证结果 GetEidResultResponse respIdenAuth = clientIdenAuth.GetEidResult(reqest); String respJSON = GetEidResultResponse.toJsonString(respIdenAuth); 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.setUserName(userName); IdentityAuthenticationRespon.setUserId(userId); @@ -138,14 +139,11 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio Map mapEidInfo = decodeEidInfo(desKey,uerInfo); IdentityAuthenticationRespon.setName(mapEidInfo.get("name")); IdentityAuthenticationRespon.setIdentityNo(mapEidInfo.get("identityNo")); + IdentityAuthenticationRespon.setCertificationStatus(1); identityAuthenticationMapper.insertIdentityAuthentication(IdentityAuthenticationRespon); -// IdentityAuthenticationResult.setUserName(userName); IdentityAuthenticationResult.setCertificationStatus(1); IdentityAuthenticationResult.setCertificationStatusName("认证成功"); -// IdentityAuthenticationResult.setName(name); -// IdentityAuthenticationResult.setIdentityNo(identityNo); - System.out.println(GetEidResultResponse.toJsonString(respIdenAuth)); } catch (TencentCloudSDKException e) { log.error("认证失败:", e); throw new RuntimeException("认证失败"); diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml index 946acea..9132c83 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml @@ -37,7 +37,7 @@