|
|
@@ -20,8 +20,6 @@ import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
import java.io.*;
|
|
|
|
|
|
-import static com.arcsoft.face.toolkit.ImageFactory.getRGBData;
|
|
|
-
|
|
|
@Component
|
|
|
@RequiredArgsConstructor
|
|
|
@Slf4j
|
|
|
@@ -119,9 +117,6 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
FileInfoEntity fileInfo = faceCompareUtil.uploadFaceFile(base64);
|
|
|
boolean redisFlag = (count != null && count >= 2);
|
|
|
if (ObjectUtils.isEmpty(id) || redisFlag) {
|
|
|
- if (! faceCompareUtil.imageCenter(base)){
|
|
|
- return ResultCode.IMAGE_NOT_STANDARD;
|
|
|
- }
|
|
|
//要做人脸核身
|
|
|
thirdPartyInterfaceEntity = JuheServiceUtil.URLPost(idCard, nickName, base64,thirdPartyInterfaceEntity);
|
|
|
thirdPartyInterfaceEntity.setFileId(fileInfo.getId() + "");
|
|
|
@@ -140,8 +135,14 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
contractOrderMapper.updateById(orderEntity);
|
|
|
log.info("当事人人脸核身通过");
|
|
|
redis.del(redisCount);
|
|
|
+ if (ObjectUtil.isNotEmpty(base)){
|
|
|
+ base.delete();
|
|
|
+ }
|
|
|
return ResultCode.SUCCESS;
|
|
|
}
|
|
|
+ if (ObjectUtil.isNotEmpty(base)){
|
|
|
+ base.delete();
|
|
|
+ }
|
|
|
return ResultCode.LIVE_VIDEO_INVALID;
|
|
|
}
|
|
|
//要做照片比对
|
|
|
@@ -156,9 +157,6 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
redis.del(redisCount);
|
|
|
}
|
|
|
}
|
|
|
- if (ObjectUtil.isNotEmpty(base)){
|
|
|
- base.delete();
|
|
|
- }
|
|
|
return resultCode;
|
|
|
|
|
|
}
|
|
|
@@ -272,10 +270,16 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
log.info("银行客户经理人脸核身通过");
|
|
|
redis.del(redisCount);
|
|
|
thirdPartyInterfaceRepository.insert(faceCompareEntity);
|
|
|
+ if (ObjectUtil.isNotEmpty(base)){
|
|
|
+ base.delete();
|
|
|
+ }
|
|
|
return ResultCode.SUCCESS;
|
|
|
}
|
|
|
log.info("客户经理人脸核身失败");
|
|
|
thirdPartyInterfaceRepository.insert(faceCompareEntity);
|
|
|
+ if (ObjectUtil.isNotEmpty(base)){
|
|
|
+ base.delete();
|
|
|
+ }
|
|
|
return ResultCode.LIVE_VIDEO_INVALID;
|
|
|
}
|
|
|
} else if (ObjectUtils.isEmpty(compareImageId) || redisFlag) {
|
|
|
@@ -299,9 +303,15 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
redis.del(redisCount);
|
|
|
contractOrderMapper.updateById(orderEntity);
|
|
|
log.info("当事人人脸核身通过");
|
|
|
+ if (ObjectUtil.isNotEmpty(base)){
|
|
|
+ base.delete();
|
|
|
+ }
|
|
|
return ResultCode.SUCCESS;
|
|
|
}
|
|
|
log.info("当事人人脸核身失败");
|
|
|
+ if (ObjectUtil.isNotEmpty(base)){
|
|
|
+ base.delete();
|
|
|
+ }
|
|
|
return ResultCode.LIVE_VIDEO_INVALID;
|
|
|
}
|
|
|
//如果不用做人脸核身 那么就去做照片比对
|
|
|
@@ -325,9 +335,6 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
redis.del(redisCount);
|
|
|
}
|
|
|
}
|
|
|
- if (ObjectUtil.isNotEmpty(base)){
|
|
|
- base.delete();
|
|
|
- }
|
|
|
return resultCode;
|
|
|
}
|
|
|
|