...
|
...
|
@@ -21,6 +21,7 @@ import com.yoho.service.model.reviewed.request.ImageReviewedReq; |
|
|
import com.yoho.service.model.reviewed.response.IdCardRspBO;
|
|
|
import com.yoho.service.model.reviewed.response.ImageReviewResp;
|
|
|
import com.yoho.tools.common.beans.ApiResponse;
|
|
|
import com.yoho.tools.common.beans.Response;
|
|
|
import com.yohobuy.ufo.model.user.resp.AuthorizeResultRespVO;
|
|
|
import com.yohoufo.common.constant.CertPhotoEnum;
|
|
|
import com.yohoufo.common.exception.GatewayException;
|
...
|
...
|
@@ -417,17 +418,22 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService { |
|
|
long num = cacheService.incrementPhotoCheckCount(dayStr,reqVO.getUid());
|
|
|
logger.info("checkCertPhoto call begin reqVO {} ,call redis count {}",reqVO, num);
|
|
|
|
|
|
ImageReviewResp resp =ocrCertPhotoService.ocrCheck(reqVO,imageBOList);
|
|
|
logger.info("checkCertPhoto call end reqVO {} ,resp {} ",reqVO,JSON.toJSONString(resp));
|
|
|
Response<ImageReviewResp> imageReviewRespResponse =ocrCertPhotoService.ocrCheck(reqVO,imageBOList);
|
|
|
logger.info("checkCertPhoto call end reqVO {} ,resp {} ",reqVO,JSON.toJSONString(imageReviewRespResponse));
|
|
|
|
|
|
if(resp==null||!"success".equals(resp.getResultCode())){
|
|
|
result.setMessage("验证失败,您上传的证件照片信息不正确");
|
|
|
if(imageReviewRespResponse==null||imageReviewRespResponse.getCode()!=200){
|
|
|
result.setMessage("验证图片异常,请重试!");
|
|
|
}else{
|
|
|
ImageReviewResp reviewResp = imageReviewRespResponse.getData();
|
|
|
if(reviewResp==null||!"success".equals(reviewResp.getResultCode())){
|
|
|
throw new UfoServiceException(400, "您上传的证件照片信息不正确,请重新上传!");
|
|
|
}
|
|
|
|
|
|
//比较信息
|
|
|
JSONObject jo = JSON.parseObject(resp.getResultDatas());
|
|
|
JSONObject jo = JSON.parseObject(reviewResp.getResultDatas());
|
|
|
if(jo!=null&&jo.containsKey("front")&&jo.containsKey("back")){
|
|
|
IdCardRspBO front = jo.getObject("front",IdCardRspBO.class);
|
|
|
IdCardRspBO back = jo.getObject("back",IdCardRspBO.class);
|
|
|
IdCardRspBO front = JSON.parseObject(jo.getJSONObject("front").getString("resultData"),IdCardRspBO.class);
|
|
|
IdCardRspBO back = JSON.parseObject(jo.getJSONObject("back").getString("resultData"),IdCardRspBO.class);
|
|
|
if(front!=null&&back!=null){
|
|
|
logger.info("checkCertPhoto front {} ,back {}",front,back);
|
|
|
String endData = back.getEndDate();
|
...
|
...
|
@@ -435,9 +441,9 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService { |
|
|
throw new UfoServiceException(400, "身份证照片有效期不合法!");
|
|
|
}
|
|
|
endData = endData.trim();
|
|
|
if(!"长期".equals(endData)){
|
|
|
if(!endData.contains("长期")){
|
|
|
//转日期
|
|
|
Date end = DateUtil.getDate(endData,"yyyy.MM.dd");
|
|
|
Date end = DateUtil.getDate(endData,"yyyyMMdd");
|
|
|
if(end==null||end.getTime() <= new Date().getTime()){
|
|
|
throw new UfoServiceException(400, "身份证照片不在有效期!");
|
|
|
}
|
...
|
...
|
@@ -446,6 +452,10 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService { |
|
|
||!reqVO.getCertNo().equals(front.getCode())){
|
|
|
throw new UfoServiceException(400, "名字或者身份证号不匹配!");
|
|
|
}
|
|
|
|
|
|
//验证成功
|
|
|
result.setPass(CertPhotoEnum.valid.isCheckPass());
|
|
|
result.setPhotoValidStatus(CertPhotoEnum.valid.getStatus());
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|