소스 검색

OCR添加异常情况日志记录

master
qiubh 2 달 전
부모
커밋
36f4ff8fd7

+ 2
- 0
gly-base-core/src/main/java/cn/com/taiji/core/entity/comm/OcrResult.java 파일 보기

private OcrType ocrType;// 类型 private OcrType ocrType;// 类型
@Column(name = "CODE") @Column(name = "CODE")
private String code; private String code;
@Column(name = "MESSAGE")
private String message;
@Column(name = "OCR_SERVICE_TYPE") @Column(name = "OCR_SERVICE_TYPE")
private Integer ocrServiceType=1;// 1-百度 2-太极 private Integer ocrServiceType=1;// 1-百度 2-太极
// @Column(name = "RESULT_ID") // @Column(name = "RESULT_ID")

+ 1
- 1
gly-base-core/src/main/java/cn/com/taiji/core/repo/jpa/comm/OcrResultRepo.java 파일 보기



public interface OcrResultRepo extends AbstractJpaRepo<OcrResult, String>{ public interface OcrResultRepo extends AbstractJpaRepo<OcrResult, String>{


@Query(" from OcrResult where url = ?1 and ocrType = ?2")
@Query(" from OcrResult where url = ?1 and ocrType = ?2 and code='0000'")
OcrResult findByUrlAndType(String url, OcrType ocrType); OcrResult findByUrlAndType(String url, OcrType ocrType);


} }

+ 12
- 3
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/manager/AbstractIawManager.java 파일 보기

res.setImageUrl(new MinioUtil().getOuterUrl(res.getImageUrl())); res.setImageUrl(new MinioUtil().getOuterUrl(res.getImageUrl()));
return res; return res;
} catch (ServiceHandleException e) { } catch (ServiceHandleException e) {
throw new ManagerException("身份证OCR识别异常,请手动输入信息");
ocrResult.setCode(e.getErrorCode());
ocrResult.setMessage(e.getMessage());
ocrResultRepo.save(ocrResult);
throw new ManagerException("身份证OCR识别异常,请重新上传照片或手动输入信息");
} }
} }


res.setImageUrl(new MinioUtil().getOuterUrl(res.getImageUrl())); res.setImageUrl(new MinioUtil().getOuterUrl(res.getImageUrl()));
return res; return res;
} catch (ServiceHandleException e) { } catch (ServiceHandleException e) {
throw new ManagerException("行驶证OCR识别异常,请手动输入信息");
ocrResult.setCode(e.getErrorCode());
ocrResult.setMessage(e.getMessage());
ocrResultRepo.save(ocrResult);
throw new ManagerException("行驶证OCR识别异常,请重新上传照片或手动输入信息");
} }
} }


res.setImageUrl(new MinioUtil().getOuterUrl(res.getImageUrl())); res.setImageUrl(new MinioUtil().getOuterUrl(res.getImageUrl()));
return res; return res;
} catch (ServiceHandleException e) { } catch (ServiceHandleException e) {
throw new ManagerException("营业执照OCR识别异常,请手动输入信息");
ocrResult.setCode(e.getErrorCode());
ocrResult.setMessage(e.getMessage());
ocrResultRepo.save(ocrResult);
throw new ManagerException("营业执照OCR识别异常,请重新上传照片或手动输入信息");
} }
} }



+ 9
- 0
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/manager/AbstractUserwManager.java 파일 보기

res.setOcrResultId(ocrResult.getId()); res.setOcrResultId(ocrResult.getId());
return res; return res;
} catch (ServiceHandleException e) { } catch (ServiceHandleException e) {
ocrResult.setCode(e.getErrorCode());
ocrResult.setMessage(e.getMessage());
ocrResultRepo.save(ocrResult);
throw new ManagerException("身份证OCR识别异常"); throw new ManagerException("身份证OCR识别异常");
} }
} }
res.setOcrResultId(ocrResult.getId()); res.setOcrResultId(ocrResult.getId());
return res; return res;
} catch (ServiceHandleException e) { } catch (ServiceHandleException e) {
ocrResult.setCode(e.getErrorCode());
ocrResult.setMessage(e.getMessage());
ocrResultRepo.save(ocrResult);
throw new ManagerException("行驶证OCR识别异常"); throw new ManagerException("行驶证OCR识别异常");
} }
} }
res.setOcrResultId(ocrResult.getId()); res.setOcrResultId(ocrResult.getId());
return res; return res;
} catch (ServiceHandleException e) { } catch (ServiceHandleException e) {
ocrResult.setCode(e.getErrorCode());
ocrResult.setMessage(e.getMessage());
ocrResultRepo.save(ocrResult);
throw new ManagerException("营业执照OCR识别异常"); throw new ManagerException("营业执照OCR识别异常");
} }
} }

Loading…
취소
저장