提交 043d1924 authored 作者: 杨启发's avatar 杨启发

Merge branch 'refs/heads/v18.5_pound_list_ocr_20240701' into test

Former-commit-id: 781168a9
......@@ -53,6 +53,12 @@ public class OcrRecognition implements HasKey<Integer> {
@ApiModelProperty(value = "皮重")
private Double tareWeight;
/**
* OCR识别的原始结果
*/
@ApiModelProperty(value = "OCR识别的原始结果")
private String originalResult;
/**
* 创建时间
*/
......
......@@ -2819,10 +2819,12 @@ public class OrderChildServiceImpl implements OrderChildService {
req.setImageUrl(ossDomain+param.getImageUrl());
req.setItemNames(itemNames);
SmartStructuralOCRV2Response resp = client.SmartStructuralOCRV2(req);
Map<String,String> originalResultMap = new HashMap<>();
for (GroupInfo groupInfo : resp.getStructuralList()) {
ItemInfo itemInfo = groupInfo.getGroups()[0].getLines()[0];
String autoName = itemInfo.getKey().getAutoName();
String autoContent = itemInfo.getValue().getAutoContent();
originalResultMap.put(autoName,autoContent);
if (NumberUtils.isCreatable(autoContent)) {
if ("毛重".equals(autoName)) {
vo.setGrossWeight(Double.valueOf(autoContent));
......@@ -2839,6 +2841,7 @@ public class OrderChildServiceImpl implements OrderChildService {
ocrRecognition.setImageUrl(param.getImageUrl());
ocrRecognition.setGrossWeight(vo.getGrossWeight());
ocrRecognition.setTareWeight(vo.getTareWeight());
ocrRecognition.setOriginalResult(JSONUtil.toJsonStr(originalResultMap));
ocrRecognitionDao.saveEntity(ocrRecognition);
} catch (TencentCloudSDKException e) {
log.error(e.getMessage(),e);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论