提交 a09fab05 authored 作者: 李瑞鑫's avatar 李瑞鑫

代码冲突

上级 13bc0869
......@@ -2902,44 +2902,6 @@ public class OrderChildServiceImpl implements OrderChildService {
}
}
@Override
public OcrRecognitionResultVO ocrRecognition(OcrRecognitionParam param) {
OcrRecognitionResultVO vo = new OcrRecognitionResultVO();
try{
Credential cred = new Credential(secretId, secretKey);
OcrClient client = new OcrClient(cred, "ap-beijing");
String[] itemNames = {"毛重", "皮重"};
SmartStructuralOCRV2Request req = new SmartStructuralOCRV2Request();
req.setImageUrl(ossDomain+param.getImageUrl());
req.setItemNames(itemNames);
SmartStructuralOCRV2Response resp = client.SmartStructuralOCRV2(req);
for (GroupInfo groupInfo : resp.getStructuralList()) {
ItemInfo itemInfo = groupInfo.getGroups()[0].getLines()[0];
String autoName = itemInfo.getKey().getAutoName();
String autoContent = itemInfo.getValue().getAutoContent();
if (NumberUtils.isCreatable(autoContent)) {
if ("毛重".equals(autoName)) {
vo.setGrossWeight(Double.valueOf(autoContent));
}else if ("皮重".equals(autoName)) {
vo.setTareWeight(Double.valueOf(autoContent));
}
}
}
//保存识别结果
OcrRecognition ocrRecognition = new OcrRecognition();
ocrRecognition.setChildNo(param.getChildNo());
ocrRecognition.setImageType(param.getImageType());
ocrRecognition.setImageUrl(param.getImageUrl());
ocrRecognition.setGrossWeight(vo.getGrossWeight());
ocrRecognition.setTareWeight(vo.getTareWeight());
ocrRecognitionDao.saveEntity(ocrRecognition);
} catch (TencentCloudSDKException e) {
log.error(e.getMessage(),e);
}
return vo;
}
private String generateChildTruckInfo(OrderChild child){
return child.getTruckNo() + "_" + child.getTruckId() + "_" + child.getDriverUserNo();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论