|
|
@@ -53,11 +53,12 @@ public class IdentifyServiceImpl implements IdentifyService {
|
|
|
String s1Key = IMAGE_IDENTIFY_KEY + "idCard:" + "front:" + s1MD5;
|
|
|
if (StringUtils.isNotBlank(s1) && !ObjectUtil.isAllFieldNull(redisTemplate.opsForValue().get(s1Key))) {
|
|
|
//走缓存
|
|
|
- BeanUtils.copyProperties(Objects.requireNonNull(redisTemplate.opsForValue().get(s1Key)), customerInfoVO);
|
|
|
+ CustomerInfoVO customerInfoVO1 = new CustomerInfoVO();
|
|
|
+ BeanUtils.copyProperties(Objects.requireNonNull(redisTemplate.opsForValue().get(s1Key)), customerInfoVO1);
|
|
|
+ Idcard.conversionFront(customerInfoVO, customerInfoVO1);
|
|
|
} else {
|
|
|
//识别身份证正面
|
|
|
Idcard.getIdCardFront(s1, customerInfoVO);
|
|
|
- AssertionUtils.isEmpty(customerInfoVO, "身份证识别失败");
|
|
|
//设置缓存
|
|
|
redisTemplate.opsForValue().set(s1Key, customerInfoVO, 1, TimeUnit.DAYS);
|
|
|
}
|
|
|
@@ -69,11 +70,12 @@ public class IdentifyServiceImpl implements IdentifyService {
|
|
|
String s2Key = IMAGE_IDENTIFY_KEY + "idCard:" + "back:" + s2MD5;
|
|
|
if (StringUtils.isNotBlank(s2) && !ObjectUtil.isAllFieldNull(redisTemplate.opsForValue().get(s2Key))) {
|
|
|
//走缓存
|
|
|
+ CustomerInfoVO customerInfoVO2 = new CustomerInfoVO();
|
|
|
BeanUtils.copyProperties(Objects.requireNonNull(redisTemplate.opsForValue().get(s2Key)), customerInfoVO);
|
|
|
+ Idcard.conversionBack(customerInfoVO, customerInfoVO2);
|
|
|
} else {
|
|
|
//识别身份证背面
|
|
|
Idcard.getIdCardBack(s2, customerInfoVO);
|
|
|
- AssertionUtils.isEmpty(customerInfoVO, "身份证识别失败");
|
|
|
//设置缓存
|
|
|
redisTemplate.opsForValue().set(s2Key, customerInfoVO, 1, TimeUnit.DAYS);
|
|
|
}
|
|
|
@@ -94,11 +96,13 @@ public class IdentifyServiceImpl implements IdentifyService {
|
|
|
String s1Key = IMAGE_IDENTIFY_KEY + "drivingPermit:" + "front:" + s1MD5;
|
|
|
if (StringUtils.isNotBlank(s1) && !ObjectUtil.isAllFieldNull(redisTemplate.opsForValue().get(s1Key))) {
|
|
|
//走缓存
|
|
|
+ CardUserInfo cardUserInfo1 = new CardUserInfo();
|
|
|
BeanUtils.copyProperties(Objects.requireNonNull(redisTemplate.opsForValue().get(s1Key)), cardUserInfo);
|
|
|
+ MultiObjectDetect.conversionFront(cardUserInfo, cardUserInfo1);
|
|
|
+
|
|
|
} else {
|
|
|
//行驶证正面识别
|
|
|
MultiObjectDetect.drivingPermitFront(s1, cardUserInfo);
|
|
|
- AssertionUtils.isEmpty(cardUserInfo, "行驶证正面识别失败");
|
|
|
//设置缓存
|
|
|
redisTemplate.opsForValue().set(s1Key, cardUserInfo, 1, TimeUnit.DAYS);
|
|
|
}
|
|
|
@@ -110,15 +114,17 @@ public class IdentifyServiceImpl implements IdentifyService {
|
|
|
String s2Key = IMAGE_IDENTIFY_KEY + "drivingPermit:" + "back:" + s2MD5;
|
|
|
if (StringUtils.isNotBlank(s2) && !ObjectUtil.isAllFieldNull(redisTemplate.opsForValue().get(s2Key))) {
|
|
|
//走缓存
|
|
|
- BeanUtils.copyProperties(Objects.requireNonNull(redisTemplate.opsForValue().get(s2Key)), cardUserInfo);
|
|
|
+ CardUserInfo cardUserInfo2 = new CardUserInfo();
|
|
|
+ BeanUtils.copyProperties(Objects.requireNonNull(redisTemplate.opsForValue().get(s2Key)), cardUserInfo2);
|
|
|
+ MultiObjectDetect.conversionBack(cardUserInfo, cardUserInfo2);
|
|
|
} else {
|
|
|
//行驶证反面识别
|
|
|
MultiObjectDetect.drivingPermitBack(s2, cardUserInfo);
|
|
|
- AssertionUtils.isEmpty(cardUserInfo, "行驶证正面识别失败");
|
|
|
//设置缓存
|
|
|
redisTemplate.opsForValue().set(s2Key, cardUserInfo, 1, TimeUnit.DAYS);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
AssertionUtils.isEmpty(cardUserInfo, "行驶证正面识别失败");
|
|
|
map.put("carInfo", cardUserInfo);
|
|
|
return HttpResult.ok("success", map);
|