|
|
|
|
@ -121,7 +121,7 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
|
|
|
|
|
Map<String, CheckSemanticModel> checkSemanticModelMap = getCheckSemanticModelMap(ocrRuleCheckVo.getConfigRuleMap(), ocrRuleCheckVo.getFieldMap(), ocrIdentifyVo.getSourceJsonObjects());
|
|
|
|
|
////
|
|
|
|
|
String text;//ocr 识别的文本,
|
|
|
|
|
String text=null;//ocr 识别的文本,
|
|
|
|
|
Double probability = 0d;
|
|
|
|
|
//用于数据结构化的对象
|
|
|
|
|
List<OcrResult> ocrResultList = new ArrayList<>();
|
|
|
|
|
@ -147,6 +147,7 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
ocrArray.addAll(jsonArray.toJavaList(JSONObject.class));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (ocrArray.size()>0) {
|
|
|
|
|
ocrArrayFor: for (int i = 0; i < ocrArray.size(); i++) {
|
|
|
|
|
JSONObject ocrItem = ocrArray.get(i);
|
|
|
|
|
text = ocrItem.getString("text");//ocr 识别的文本
|
|
|
|
|
@ -176,7 +177,13 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
rMessage.append(field + "_未查到ocr结果<br>");
|
|
|
|
|
rMessage.append(value.getFieldName() + "参数未获取到结果<br>");
|
|
|
|
|
mapPutIfTrue(fieldRightMap, field, false);
|
|
|
|
|
ocrResultAdd(ocrResultList, field, inputText, text, probability, imgPath, value.getFieldName() + "参数未获取到结果", false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
rMessage.append(value.getFieldName() + "_未查到ocr结果<br>");
|
|
|
|
|
ocrResultAdd(ocrResultList, field, inputText, null, 0d, imgPath, "ocr结果未获取", false);
|
|
|
|
|
fieldRightMap.put(field, false);
|
|
|
|
|
}
|
|
|
|
|
@ -539,6 +546,7 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
requestBody.put("task_id", task_id);
|
|
|
|
|
requestBody.put("img_path", image);
|
|
|
|
|
JSONObject semanticResponseJson = RestUtil.post(OcrConstant.api_test_identify_url, requestBody);
|
|
|
|
|
//semanticResponseJson = JSONObject.parseObject("{\"医院名称\":[{\"area\":[[361,93],[623,39],[630,73],[368,127]],\"end\":6,\"ocrText\":\"黑石社区医院\",\"probability\":0.9874083762059627,\"start\":0,\"text\":\"黑石社区医院\"}],\"姓名\":[],\"时间\":[],\"科室\":[]}");
|
|
|
|
|
semanticResponseJson.put("identifyId", masterTaskId);
|
|
|
|
|
this.getSemanticInfo(semanticResponseJson);
|
|
|
|
|
//该子任务已执行,判断主任务是否残留
|
|
|
|
|
|