|
|
@@ -27,6 +27,7 @@ import me.zhengjie.domain.img.CompareImageDomain;
|
|
|
import me.zhengjie.domain.notary.NotaryDomain;
|
|
|
import me.zhengjie.utils.RedisUtils;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
@@ -36,6 +37,7 @@ import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
+import static com.arcsoft.face.toolkit.ImageFactory.getGrayData;
|
|
|
import static com.arcsoft.face.toolkit.ImageFactory.getRGBData;
|
|
|
|
|
|
@Component
|
|
|
@@ -156,6 +158,7 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
redis.del(redisCount);
|
|
|
}
|
|
|
return ResultCode.SUCCESS;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -174,7 +177,6 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
//先判断是银行客户经理还是当事人
|
|
|
String roleId = compareImageDomain.getRoleId();
|
|
|
SysUserEntity sysUserEntity = null;
|
|
|
- UserAXQInfoEntity userAXQInfoEntity = null;
|
|
|
String idCard = compareImageDomain.getIdCard();
|
|
|
String nickName = compareImageDomain.getName();
|
|
|
|
|
|
@@ -189,6 +191,7 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
if (flag) {
|
|
|
//说明是银行客户经理
|
|
|
QueryWrapper<ContractOrderEntity> contractOrderEntityQueryWrapper = new QueryWrapper<>();
|
|
|
+ //通过business_no 和 客户经理姓名 判断是不是当前客户经理
|
|
|
contractOrderEntityQueryWrapper.eq("business_no", compareImageDomain.getBusinessNo()).eq("customer_name", compareImageDomain.getName());
|
|
|
ContractOrderEntity contractOrderEntity = contractOrderMapper.selectOne(contractOrderEntityQueryWrapper);
|
|
|
if (ObjectUtils.isEmpty(contractOrderEntity)) {
|
|
|
@@ -199,9 +202,9 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
sysUserEntity = userMapper.selectOne(sysUserEntityQueryWrapper);
|
|
|
} else {
|
|
|
//说明是当事人
|
|
|
- if (compareImageDomain.getName().equals(contractOrder.getName())) {
|
|
|
+ if (nickName.equals(contractOrder.getName())) {
|
|
|
compareImageId = contractOrder.getCompareImgId();
|
|
|
- } else if (compareImageDomain.getName().equals(contractOrder.getJointName())) {
|
|
|
+ } else if (nickName.equals(contractOrder.getJointName())) {
|
|
|
compareImageId = contractOrder.getJointCompareImgId();
|
|
|
}
|
|
|
}
|
|
|
@@ -213,8 +216,10 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
count = (Integer) redis.get(redisCount);
|
|
|
System.err.println("redis存入次数" + count);
|
|
|
}
|
|
|
- //将base64转成图片
|
|
|
- File base = null;
|
|
|
+ if (compareImageDomain.getBase64()==null){
|
|
|
+ return ResultCode.PARAM_IS_BLANK;
|
|
|
+ }
|
|
|
+ File base = null;
|
|
|
try {
|
|
|
base = File.createTempFile("compare", ".jpeg");
|
|
|
base.deleteOnExit();
|
|
|
@@ -225,7 +230,6 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
log.info("base64转图片异常");
|
|
|
return ResultCode.FACEAUTH_FAIL;
|
|
|
}
|
|
|
-
|
|
|
boolean redisFlag = (count != null && count >= 2);
|
|
|
if (flag) {
|
|
|
//说明是客户经理
|
|
|
@@ -297,6 +301,9 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
return ResultCode.SUCCESS;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 虹软的人脸照片比对
|
|
|
*
|
|
|
@@ -364,7 +371,6 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
if (pitch >= 10 || yaw >= 10) {
|
|
|
//照片不符合标准
|
|
|
log.info("图片不符合标准");
|
|
|
- base.delete();
|
|
|
return false;
|
|
|
}
|
|
|
//特征提取
|
|
|
@@ -380,11 +386,6 @@ public class NotaryDomainImpl implements NotaryDomain {
|
|
|
file=FileUploadUtil.getFileWithPath(filePath);
|
|
|
} catch (Exception e) {
|
|
|
throw new RuntimeException(e);
|
|
|
- }finally {
|
|
|
- base.delete();
|
|
|
- if (file!=null){
|
|
|
- file.delete();
|
|
|
- }
|
|
|
}
|
|
|
//人脸检测2
|
|
|
ImageInfo imageInfo2 = getRGBData(file);
|