|
@@ -49,9 +49,8 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
private final RedisUtils redis;
|
|
private final RedisUtils redis;
|
|
|
private static final String APPID = "H6Er8ksqAcKc7Dk4Yum9Rkz4g9Gm77ZXAEMgvenjkTQQ";
|
|
private static final String APPID = "H6Er8ksqAcKc7Dk4Yum9Rkz4g9Gm77ZXAEMgvenjkTQQ";
|
|
|
private static final String SDKKEY = "Abd9D8xZQUqG8vDtU2a1tEkdfThkK1tZppjXzydGwEd6";
|
|
private static final String SDKKEY = "Abd9D8xZQUqG8vDtU2a1tEkdfThkK1tZppjXzydGwEd6";
|
|
|
- private static final String LIBPATH = "/home/tom/nt-test/lib/so";
|
|
|
|
|
-
|
|
|
|
|
- //private static final String LIBPATH = "D:\\arcsoft_lib";
|
|
|
|
|
|
|
+ //private static final String LIBPATH = "/home/tom/nt-test/lib/so";
|
|
|
|
|
+ private static final String LIBPATH = "D:\\arcsoft_lib";
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -61,6 +60,12 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
public ResultCode compareFace(CompareImageDomain compareImageDomain) {
|
|
public ResultCode compareFace(CompareImageDomain compareImageDomain) {
|
|
|
|
|
+ String base64 = "";
|
|
|
|
|
+ if (compareImageDomain.getBase64().startsWith("data:image/png;base64,")){
|
|
|
|
|
+ base64 = compareImageDomain.getBase64().replace("data:image/png;base64,","");
|
|
|
|
|
+ }else {
|
|
|
|
|
+ base64=compareImageDomain.getBase64();
|
|
|
|
|
+ }
|
|
|
//先判断是银行客户经理还是当事人
|
|
//先判断是银行客户经理还是当事人
|
|
|
String roleId = compareImageDomain.getRoleId();
|
|
String roleId = compareImageDomain.getRoleId();
|
|
|
SysUserEntity sysUserEntity = null;
|
|
SysUserEntity sysUserEntity = null;
|
|
@@ -97,7 +102,7 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
|
}
|
|
}
|
|
|
- if (!Img2Base64Util.generateImage(compareImageDomain.getBase64(), base.getPath())) {
|
|
|
|
|
|
|
+ if (!Img2Base64Util.generateImage(base64, base.getPath())) {
|
|
|
System.err.println("base64转图片异常");
|
|
System.err.println("base64转图片异常");
|
|
|
return ResultCode.FACEAUTH_FAIL;
|
|
return ResultCode.FACEAUTH_FAIL;
|
|
|
}
|
|
}
|
|
@@ -107,7 +112,7 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
if (sysUserEntity.getCompareImgId() == null || redisFlag) {
|
|
if (sysUserEntity.getCompareImgId() == null || redisFlag) {
|
|
|
//说明客户经理需要做人脸核身
|
|
//说明客户经理需要做人脸核身
|
|
|
System.err.println(idCard+nickName);
|
|
System.err.println(idCard+nickName);
|
|
|
- if (JuheServiceUtil.URLPost(idCard, nickName, compareImageDomain.getBase64())) {
|
|
|
|
|
|
|
+ if (JuheServiceUtil.URLPost(idCard, nickName, base64)) {
|
|
|
//上传图片到minio FileInfo
|
|
//上传图片到minio FileInfo
|
|
|
FileInfoEntity fileInfo = saveCompareImage(base);
|
|
FileInfoEntity fileInfo = saveCompareImage(base);
|
|
|
fileInfoMapper.insert(fileInfo);
|
|
fileInfoMapper.insert(fileInfo);
|
|
@@ -126,7 +131,7 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
//说明是当事人
|
|
//说明是当事人
|
|
|
if (userAXQInfoEntity.getCompareImgId() == null || redisFlag) {
|
|
if (userAXQInfoEntity.getCompareImgId() == null || redisFlag) {
|
|
|
//说明当事人需要做人脸核身
|
|
//说明当事人需要做人脸核身
|
|
|
- if (JuheServiceUtil.URLPost(idCard, nickName, compareImageDomain.getBase64())) {
|
|
|
|
|
|
|
+ if (JuheServiceUtil.URLPost(idCard, nickName, base64)) {
|
|
|
//上传图片到minio FileInfo
|
|
//上传图片到minio FileInfo
|
|
|
FileInfoEntity fileInfo = saveCompareImage(base);
|
|
FileInfoEntity fileInfo = saveCompareImage(base);
|
|
|
fileInfoMapper.insert(fileInfo);
|
|
fileInfoMapper.insert(fileInfo);
|
|
@@ -272,6 +277,8 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
FileInfoEntity fileInfo = saveCompareImage(base);
|
|
FileInfoEntity fileInfo = saveCompareImage(base);
|
|
|
fileInfoMapper.insert(fileInfo);
|
|
fileInfoMapper.insert(fileInfo);
|
|
|
return fileInfo.getId();
|
|
return fileInfo.getId();
|
|
|
|
|
+ }else {
|
|
|
|
|
+ System.out.println("特征值不符合");
|
|
|
}
|
|
}
|
|
|
if (count == null) {
|
|
if (count == null) {
|
|
|
redis.set(redisCount, 1, 30, TimeUnit.MINUTES);
|
|
redis.set(redisCount, 1, 30, TimeUnit.MINUTES);
|