|
|
@@ -1,20 +1,15 @@
|
|
|
package me.zhengjie.domain.notary.impl;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import me.zhengjie.base.ResultCode;
|
|
|
-import me.zhengjie.base.config.thread.ThreadPoolExecutorUtil;
|
|
|
-import me.zhengjie.base.face.FaceCompareHandle;
|
|
|
-import me.zhengjie.base.util.FileUploadUtil;
|
|
|
+import me.zhengjie.base.face.FaceCompareUtil;
|
|
|
import me.zhengjie.base.util.JuheServiceUtil;
|
|
|
-import me.zhengjie.base.util.tencent.utils.HttpClientUtil;
|
|
|
import me.zhengjie.base.util.tencent.utils.Img2Base64Util;
|
|
|
import me.zhengjie.dao.mybatis.FaceCompareRepository;
|
|
|
import me.zhengjie.dao.mybatis.entity.*;
|
|
|
import me.zhengjie.dao.mybatis.mapper.ContractOrderMapper;
|
|
|
-import me.zhengjie.dao.mybatis.mapper.FileInfoMapper;
|
|
|
import me.zhengjie.dao.mybatis.mapper.SysUserMapper;
|
|
|
import me.zhengjie.domain.img.CompareImageDomain;
|
|
|
import me.zhengjie.domain.notary.NotaryDomain;
|
|
|
@@ -35,7 +30,7 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
private final ContractOrderMapper contractOrderMapper;
|
|
|
private final RedisUtils redis;
|
|
|
private final FaceCompareRepository thirdPartyInterfaceRepository;
|
|
|
- private final FaceCompareHandle faceCompareHandle;
|
|
|
+ private final FaceCompareUtil faceCompareUtil;
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -100,17 +95,17 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
return ResultCode.FACEAUTH_FAIL;
|
|
|
}
|
|
|
|
|
|
- if (!faceCompareHandle.imageSingle(base)){
|
|
|
+ if (!faceCompareUtil.imageSingle(base)){
|
|
|
return ResultCode.SINGLE_PERSON;
|
|
|
}
|
|
|
|
|
|
|
|
|
thirdPartyInterfaceEntity.setBusinessNo(compareImageDomain.getBusinessNo());
|
|
|
thirdPartyInterfaceEntity.setConsultNo(contractOrderEntity.getConsultNo());
|
|
|
- FileInfoEntity fileInfo = faceCompareHandle.uploadFaceFile(base64);
|
|
|
+ FileInfoEntity fileInfo = faceCompareUtil.uploadFaceFile(base64);
|
|
|
boolean redisFlag = (count != null && count >= 2);
|
|
|
if (ObjectUtils.isEmpty(id) || redisFlag) {
|
|
|
- if (! faceCompareHandle.imageCenter(base)){
|
|
|
+ if (! faceCompareUtil.imageCenter(base)){
|
|
|
return ResultCode.IMAGE_NOT_STANDARD;
|
|
|
}
|
|
|
//要做人脸核身
|
|
|
@@ -140,7 +135,7 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
return ResultCode.LIVE_VIDEO_INVALID;
|
|
|
}*/
|
|
|
|
|
|
- ResultCode resultCode = faceCompareHandle.compareImage(base, id, redisCount, thirdPartyInterfaceEntity);
|
|
|
+ ResultCode resultCode = faceCompareUtil.compareImage(base, id, redisCount, thirdPartyInterfaceEntity);
|
|
|
|
|
|
if (resultCode.code()==100){
|
|
|
if (count != null) {
|
|
|
@@ -229,18 +224,18 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
log.info("base64转图片异常");
|
|
|
return ResultCode.FACEAUTH_FAIL;
|
|
|
}
|
|
|
- if (!faceCompareHandle.imageSingle(base)){
|
|
|
+ if (!faceCompareUtil.imageSingle(base)){
|
|
|
return ResultCode.SINGLE_PERSON;
|
|
|
}
|
|
|
boolean redisFlag = (count != null && count >= 2);
|
|
|
if (flag) {
|
|
|
//说明是客户经理
|
|
|
if (sysUserEntity.getCompareImgId() == null || redisFlag) {
|
|
|
- if (! faceCompareHandle.imageCenter(base)){
|
|
|
+ if (! faceCompareUtil.imageCenter(base)){
|
|
|
return ResultCode.IMAGE_NOT_STANDARD;
|
|
|
}
|
|
|
//说明客户经理需要做人脸核身
|
|
|
- FileInfoEntity fileInfo = faceCompareHandle.uploadFaceFile(base64);
|
|
|
+ FileInfoEntity fileInfo = faceCompareUtil.uploadFaceFile(base64);
|
|
|
faceCompareEntity = JuheServiceUtil.URLPost(idCard, nickName, base64,faceCompareEntity);
|
|
|
faceCompareEntity.setFileId(fileInfo.getId() + "");
|
|
|
if (faceCompareEntity.getResult() == 1) {
|
|
|
@@ -259,12 +254,12 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
return ResultCode.LIVE_VIDEO_INVALID;
|
|
|
}
|
|
|
} else if (ObjectUtils.isEmpty(compareImageId) || redisFlag) {
|
|
|
- if (! faceCompareHandle.imageCenter(base)){
|
|
|
+ if (! faceCompareUtil.imageCenter(base)){
|
|
|
return ResultCode.IMAGE_NOT_STANDARD;
|
|
|
}
|
|
|
|
|
|
//说明当事人需要做人脸核身
|
|
|
- FileInfoEntity fileInfo = faceCompareHandle.uploadFaceFile(base64);
|
|
|
+ FileInfoEntity fileInfo = faceCompareUtil.uploadFaceFile(base64);
|
|
|
faceCompareEntity = JuheServiceUtil.URLPost(idCard, nickName, base64,faceCompareEntity);
|
|
|
faceCompareEntity.setFileId(fileInfo.getId() + "");
|
|
|
|
|
|
@@ -302,7 +297,7 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
return ResultCode.LIVE_VIDEO_INVALID;
|
|
|
}*/
|
|
|
|
|
|
- ResultCode resultCode = faceCompareHandle.compareImage(base, id, redisCount, faceCompareEntity);
|
|
|
+ ResultCode resultCode = faceCompareUtil.compareImage(base, id, redisCount, faceCompareEntity);
|
|
|
|
|
|
if (resultCode.code()==100){
|
|
|
if (count != null) {
|