|
|
@@ -1,5 +1,6 @@
|
|
|
package me.zhengjie.domain.notary.impl;
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -92,13 +93,26 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
}
|
|
|
if (!Img2Base64Util.generateImage(base64, base.getPath())) {
|
|
|
log.info("base64转图片异常");
|
|
|
+ if (ObjectUtil.isNotEmpty(base)){
|
|
|
+ base.delete();
|
|
|
+ }
|
|
|
return ResultCode.FACEAUTH_FAIL;
|
|
|
}
|
|
|
|
|
|
if (!faceCompareUtil.imageSingle(base)){
|
|
|
+ if (ObjectUtil.isNotEmpty(base)){
|
|
|
+ base.delete();
|
|
|
+ }
|
|
|
return ResultCode.SINGLE_PERSON;
|
|
|
}
|
|
|
|
|
|
+ if (!faceCompareUtil.imageCenter(base)){
|
|
|
+ if (ObjectUtil.isNotEmpty(base)){
|
|
|
+ base.delete();
|
|
|
+ }
|
|
|
+ return ResultCode.IMAGE_NOT_STANDARD;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
thirdPartyInterfaceEntity.setBusinessNo(compareImageDomain.getBusinessNo());
|
|
|
thirdPartyInterfaceEntity.setConsultNo(contractOrderEntity.getConsultNo());
|
|
|
@@ -142,7 +156,9 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
redis.del(redisCount);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ if (ObjectUtil.isNotEmpty(base)){
|
|
|
+ base.delete();
|
|
|
+ }
|
|
|
return resultCode;
|
|
|
|
|
|
}
|
|
|
@@ -222,18 +238,27 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
}
|
|
|
if (!Img2Base64Util.generateImage(base64, base.getPath())) {
|
|
|
log.info("base64转图片异常");
|
|
|
+ if (ObjectUtil.isNotEmpty(base)){
|
|
|
+ base.delete();
|
|
|
+ }
|
|
|
return ResultCode.FACEAUTH_FAIL;
|
|
|
}
|
|
|
if (!faceCompareUtil.imageSingle(base)){
|
|
|
+ if (ObjectUtil.isNotEmpty(base)){
|
|
|
+ base.delete();
|
|
|
+ }
|
|
|
return ResultCode.SINGLE_PERSON;
|
|
|
}
|
|
|
+ if (!faceCompareUtil.imageCenter(base)){
|
|
|
+ if (ObjectUtil.isNotEmpty(base)){
|
|
|
+ base.delete();
|
|
|
+ }
|
|
|
+ return ResultCode.IMAGE_NOT_STANDARD;
|
|
|
+ }
|
|
|
boolean redisFlag = (count != null && count >= 2);
|
|
|
if (flag) {
|
|
|
//说明是客户经理
|
|
|
if (sysUserEntity.getCompareImgId() == null || redisFlag) {
|
|
|
- if (! faceCompareUtil.imageCenter(base)){
|
|
|
- return ResultCode.IMAGE_NOT_STANDARD;
|
|
|
- }
|
|
|
//说明客户经理需要做人脸核身
|
|
|
FileInfoEntity fileInfo = faceCompareUtil.uploadFaceFile(base64);
|
|
|
faceCompareEntity = JuheServiceUtil.URLPost(idCard, nickName, base64,faceCompareEntity);
|
|
|
@@ -254,10 +279,6 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
return ResultCode.LIVE_VIDEO_INVALID;
|
|
|
}
|
|
|
} else if (ObjectUtils.isEmpty(compareImageId) || redisFlag) {
|
|
|
- if (! faceCompareUtil.imageCenter(base)){
|
|
|
- return ResultCode.IMAGE_NOT_STANDARD;
|
|
|
- }
|
|
|
-
|
|
|
//说明当事人需要做人脸核身
|
|
|
FileInfoEntity fileInfo = faceCompareUtil.uploadFaceFile(base64);
|
|
|
faceCompareEntity = JuheServiceUtil.URLPost(idCard, nickName, base64,faceCompareEntity);
|
|
|
@@ -304,6 +325,9 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
redis.del(redisCount);
|
|
|
}
|
|
|
}
|
|
|
+ if (ObjectUtil.isNotEmpty(base)){
|
|
|
+ base.delete();
|
|
|
+ }
|
|
|
return resultCode;
|
|
|
}
|
|
|
|