实现身份认证查询
This commit is contained in:
@@ -25,6 +25,8 @@ public class ArbitrateRecord extends BaseEntity {
|
||||
private String verificaOpinion;
|
||||
/** 审核裁决书意见 */
|
||||
private String checkOpinion;
|
||||
/** 裁决书附件id */
|
||||
private Long annexId;
|
||||
|
||||
|
||||
|
||||
|
||||
+41
-7
@@ -19,7 +19,47 @@ public class IdentityAuthentication extends BaseEntity {
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date certificationTime;
|
||||
/** 认证状态 */
|
||||
private int certificationStatus;
|
||||
private Integer certificationStatus;
|
||||
|
||||
public Integer getCertificationStatus() {
|
||||
return certificationStatus;
|
||||
}
|
||||
|
||||
public void setCertificationStatus(Integer certificationStatus) {
|
||||
this.certificationStatus = certificationStatus;
|
||||
}
|
||||
|
||||
/** 认证状态名称 */
|
||||
private String certificationStatusName;
|
||||
|
||||
public String getCertificationStatusName() {
|
||||
return certificationStatusName;
|
||||
}
|
||||
|
||||
public void setCertificationStatusName(String certificationStatusName) {
|
||||
this.certificationStatusName = certificationStatusName;
|
||||
}
|
||||
|
||||
/** 用户ID */
|
||||
private Long userId;
|
||||
/** 用户账号 */
|
||||
private String userName;
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
@@ -53,11 +93,5 @@ public class IdentityAuthentication extends BaseEntity {
|
||||
this.certificationTime = certificationTime;
|
||||
}
|
||||
|
||||
public int getCertificationStatus() {
|
||||
return certificationStatus;
|
||||
}
|
||||
|
||||
public void setCertificationStatus(int certificationStatus) {
|
||||
this.certificationStatus = certificationStatus;
|
||||
}
|
||||
}
|
||||
|
||||
+9
@@ -1,4 +1,13 @@
|
||||
package com.ruoyi.wisdomarbitrate.mapper;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication;
|
||||
|
||||
public interface IdentityAuthenticationMapper {
|
||||
int insertIdentityAuthentication(IdentityAuthentication identityAuthentication);
|
||||
IdentityAuthentication selectIdentityAuthentication(IdentityAuthentication identityAuthentication);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+3
-1
@@ -5,5 +5,7 @@ import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication;
|
||||
public interface IdentityAuthenticationService {
|
||||
|
||||
|
||||
IdentityAuthentication selectIdentityInformation();
|
||||
IdentityAuthentication selectIdentityAuthentication(IdentityAuthentication identityAuthentication);
|
||||
|
||||
|
||||
}
|
||||
|
||||
+12
-53
@@ -38,62 +38,21 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(IdentityAuthenticationServiceImpl.class);
|
||||
|
||||
|
||||
@Override
|
||||
public IdentityAuthentication selectIdentityInformation() {
|
||||
/* IdentityAuthentication identityAuthentication = new IdentityAuthentication();
|
||||
try{
|
||||
Credential credIdentityAuthentication = new Credential(credentialSecretId, credentialSecretKey);
|
||||
HttpProfile httpProfileIdentityAuthentication = new HttpProfile();
|
||||
httpProfileIdentityAuthentication.setEndpoint("ocr.tencentcloudapi.com");
|
||||
String imagePathIdentityAuthentication = "本地png/jpg文件的绝对地址";
|
||||
InputStream inputStreamIdentityAuthentication = null;
|
||||
byte[] buffer = null;
|
||||
//读取图片字节数组
|
||||
try {
|
||||
inputStreamIdentityAuthentication = new FileInputStream(imagePathIdentityAuthentication);
|
||||
int count = 0;
|
||||
while (count == 0) {
|
||||
count = inputStreamIdentityAuthentication.available();
|
||||
}
|
||||
buffer = new byte[count];
|
||||
inputStreamIdentityAuthentication.read(buffer);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (inputStreamIdentityAuthentication != null) {
|
||||
try {
|
||||
// 关闭inputStream流
|
||||
inputStreamIdentityAuthentication.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String imageBase64IdentityAuthentication = Base64.getEncoder().encodeToString(buffer);
|
||||
|
||||
ClientProfile clientProfileIdentityAuthentication = new ClientProfile();
|
||||
clientProfileIdentityAuthentication.setHttpProfile(httpProfileIdentityAuthentication);
|
||||
OcrClient clientIdentityAuthentication = new OcrClient(credIdentityAuthentication, "ap-shanghai", clientProfileIdentityAuthentication);
|
||||
RecognizeTableAccurateOCRRequest reqIdentityAuthentication = new RecognizeTableAccurateOCRRequest();
|
||||
reqIdentityAuthentication.setImageBase64(imageBase64IdentityAuthentication);
|
||||
RecognizeTableAccurateOCRResponse respIdentityAuthentication = clientIdentityAuthentication.RecognizeTableAccurateOCR(reqIdentityAuthentication);
|
||||
String stringRes = RecognizeTableAccurateOCRResponse.toJsonString(respIdentityAuthentication);
|
||||
JSONObject stringObjectRes = (JSONObject) JSON.parse(stringRes);
|
||||
JSONObject stringres = (JSONObject) stringObjectRes.get("Response");
|
||||
|
||||
|
||||
identityAuthentication.setName(stringres.get("name").toString());
|
||||
identityAuthentication.setIdentityNo(stringres.get("IdNum").toString());
|
||||
|
||||
// System.out.println(RecognizeTableAccurateOCRResponse.toJsonString(respIdentityAuthentication);
|
||||
|
||||
} catch (TencentCloudSDKException e) {
|
||||
log.error("身份认证失败", e);
|
||||
public IdentityAuthentication selectIdentityAuthentication(IdentityAuthentication identityAuthentication) {
|
||||
IdentityAuthentication identityAuthenticationselect = identityAuthenticationMapper.selectIdentityAuthentication(identityAuthentication);
|
||||
if(identityAuthenticationselect!=null){
|
||||
identityAuthenticationselect.setCertificationStatusName("已身份注册");
|
||||
}else {
|
||||
IdentityAuthentication identityAuthenticationselectnew = new IdentityAuthentication();
|
||||
identityAuthenticationselectnew.setCertificationStatusName("未身份注册");
|
||||
return identityAuthenticationselectnew;
|
||||
}
|
||||
return identityAuthenticationselect;
|
||||
|
||||
return identityAuthentication;*/
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user