Browse Source

Merge remote-tracking branch 'origin/master'

master
chenchaod 2 months ago
parent
commit
466bd7b956

+ 2
- 0
gly-base-core/src/main/java/cn/com/taiji/core/entity/comm/OcrResult.java View File

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")

+ 0
- 3
gly-base-core/src/main/java/cn/com/taiji/core/model/comm/protocol/ats/ocr/BusinessLicenseOcrResponse.java View File

private String regAuthority;//登记机关 private String regAuthority;//登记机关
private String type;//类型 private String type;//类型


private String code; // 状态码
private String respCode; // 响应代码 private String respCode; // 响应代码
private String respMessage; // 响应消息 private String respMessage; // 响应消息
private String status; // 状态
private String statusDesc; // 状态描述
private String ocrResultId; // OCR结果ID private String ocrResultId; // OCR结果ID
} }

+ 0
- 3
gly-base-core/src/main/java/cn/com/taiji/core/model/comm/protocol/ats/ocr/IdCardOcrResponse.java View File

private String enddate; // 失效日期 private String enddate; // 失效日期
private String agency; // 签发机关 private String agency; // 签发机关


private String code; // 状态码
private String respCode; // 响应代码 private String respCode; // 响应代码
private String respMessage; // 响应消息 private String respMessage; // 响应消息
private String status; // 状态
private String statusDesc; // 状态描述
private String ocrResultId; // OCR结果ID private String ocrResultId; // OCR结果ID
} }

+ 3
- 6
gly-base-core/src/main/java/cn/com/taiji/core/model/comm/protocol/ats/ocr/VehicleLicenseOcrResponse.java View File

private String codeNo; // 证芯编号 private String codeNo; // 证芯编号
private String fuel; // 燃油类型 private String fuel; // 燃油类型


private String code; // 状态码
private String respCode; // 响应代码
private String respMessage; // 响应消息
private String status; // 状态
private String statusDesc; // 状态描述
private String ocrResultId; // OCR结果ID
private String respCode; // 响应代码
private String respMessage; // 响应消息
private String ocrResultId; // OCR结果ID
} }

+ 1
- 1
gly-base-core/src/main/java/cn/com/taiji/core/repo/jpa/comm/OcrResultRepo.java View File



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 View File

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 View File

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识别异常");
} }
} }

+ 0
- 9
zhywpt-service-ats/src/main/java/cn/com/taiji/ats/manager/ocr/BaiduOcrUtil.java View File

res.setBirthday(birthday); res.setBirthday(birthday);
} }


res.setCode("0");
res.setRespCode("0000"); res.setRespCode("0000");
res.setRespMessage("ocr识别成功"); res.setRespMessage("ocr识别成功");
res.setStatus("000000");
res.setStatusDesc("成功");
return res; return res;
} catch (Exception e) { } catch (Exception e) {
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("解析百度ocr返回值异常"); throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("解析百度ocr返回值异常");
res.setCodeNo(getValue(wordsResultObj, "证芯编号")); res.setCodeNo(getValue(wordsResultObj, "证芯编号"));
res.setFuel(getValue(wordsResultObj, "燃油类型")); res.setFuel(getValue(wordsResultObj, "燃油类型"));


res.setCode("0");
res.setRespCode("0000"); res.setRespCode("0000");
res.setRespMessage("ocr识别成功"); res.setRespMessage("ocr识别成功");
res.setStatusDesc("成功");
res.setStatus("000000");
return res; return res;
} catch (Exception e) { } catch (Exception e) {
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("解析百度ocr返回值异常"); throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("解析百度ocr返回值异常");
res.setRegAuthority(getValue(wordsResultObj, "登记机关")); res.setRegAuthority(getValue(wordsResultObj, "登记机关"));
res.setType(getValue(wordsResultObj, "类型")); res.setType(getValue(wordsResultObj, "类型"));


res.setCode("0");
res.setRespCode("0000"); res.setRespCode("0000");
res.setRespMessage("ocr识别成功"); res.setRespMessage("ocr识别成功");
res.setStatusDesc("成功");
res.setStatus("000000");
return res; return res;
} catch (Exception e) { } catch (Exception e) {
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("解析百度ocr返回值异常"); throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("解析百度ocr返回值异常");

Loading…
Cancel
Save