|
|
|
@ -108,8 +108,6 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
ocrIdentifyDetailService.save(ocrIdentifyDetail);
|
|
|
|
|
}
|
|
|
|
|
//===================
|
|
|
|
|
String ocrIdentifyDetailId = ocrIdentifyDetail.getId();//明细id
|
|
|
|
|
// 进行数据化 结构
|
|
|
|
|
if (semanticResult != null) {
|
|
|
|
|
OcrIdentifyVo ocrIdentifyVo = this.findById(identifyId);
|
|
|
|
|
OcrRuleCheckVo ocrRuleCheckVo = ocrIdentifyVo.getOcrRuleCheckVo();
|
|
|
|
@ -160,7 +158,7 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
ocrResultAdd(ocrResultList,value.getFieldName(), field, inputText, text, probability, imgPath, "", true);
|
|
|
|
|
} else if ("0".equals(ruleInfo)) {
|
|
|
|
|
//必定验证参数,必须有值且匹配
|
|
|
|
|
if (StringUtils.isBlank(inputText) || text.contains(inputText)) {
|
|
|
|
|
if (StringUtils.isBlank(inputText) || text.contains(inputText) || inputText.contains(text)) {
|
|
|
|
|
fieldRightMap.put(field, true);
|
|
|
|
|
ocrResultAdd(ocrResultList,value.getFieldName(), field, inputText, text, probability, imgPath, "", true);
|
|
|
|
|
} else {
|
|
|
|
@ -289,14 +287,17 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
@Override
|
|
|
|
|
@Async
|
|
|
|
|
public void updateTaskResultInfo(String id){
|
|
|
|
|
/*OcrIdentifyVo ocrIdentifyVo = this.findById(id);*/
|
|
|
|
|
/*List<OcrIdentifyDetail> identifyDetails = ocrIdentifyDetailService.listByIdentifyId(ocrIdentifyVo.getId());*/
|
|
|
|
|
/*for (OcrIdentifyDetail identifyDetail : identifyDetails) {
|
|
|
|
|
OcrIdentifyVo ocrIdentifyVo = this.findById(id);
|
|
|
|
|
List<OcrIdentifyDetail> identifyDetails = ocrIdentifyDetailService.listByIdentifyId(ocrIdentifyVo.getId());
|
|
|
|
|
for (OcrIdentifyDetail identifyDetail : identifyDetails) {
|
|
|
|
|
JSONObject semanticResult = JSONObject.parseObject(identifyDetail.getSemanticResult());
|
|
|
|
|
String imgPath = identifyDetail.getImageUrl();
|
|
|
|
|
// 进行数据化 结构
|
|
|
|
|
if (semanticResult != null) {
|
|
|
|
|
OcrRuleCheckVo ocrRuleCheckVo = ocrIdentifyVo.getOcrRuleCheckVo();
|
|
|
|
|
if (ocrRuleCheckVo.getConfigName().contains("科室")) {
|
|
|
|
|
System.out.println("111");
|
|
|
|
|
}
|
|
|
|
|
Map<String, CheckSemanticModel> checkSemanticModelMap = getCheckSemanticModelMap(ocrRuleCheckVo.getConfigRuleMap(), ocrRuleCheckVo.getFieldMap(), ocrIdentifyVo.getSourceJsonObjects());
|
|
|
|
|
////
|
|
|
|
|
String text=null;//ocr 识别的文本,
|
|
|
|
@ -343,7 +344,7 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
ocrResultAdd(ocrResultList,value.getFieldName(), field, inputText, text, probability, imgPath, "", true);
|
|
|
|
|
} else if ("0".equals(ruleInfo)) {
|
|
|
|
|
//必定验证参数,必须有值且匹配
|
|
|
|
|
if (StringUtils.isBlank(inputText) || text.contains(inputText)) {
|
|
|
|
|
if (StringUtils.isBlank(inputText) || text.contains(inputText) || inputText.contains(text)) {
|
|
|
|
|
fieldRightMap.put(field, true);
|
|
|
|
|
ocrResultAdd(ocrResultList,value.getFieldName(), field, inputText, text, probability, imgPath, "", true);
|
|
|
|
|
} else {
|
|
|
|
@ -375,7 +376,7 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
identifyDetail.setDataStructured(JSONArray.toJSONString(ocrResultList));//数据结构化
|
|
|
|
|
ocrIdentifyDetailService.updateById(identifyDetail);
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//4.更新主任务状态
|
|
|
|
|
LambdaUpdateWrapper<OcrIdentify> updateWrapper = new LambdaUpdateWrapper<OcrIdentify>();
|
|
|
|
@ -592,20 +593,20 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
copyEntity.setField(field);
|
|
|
|
|
|
|
|
|
|
//1/0
|
|
|
|
|
if (configRuleMap != null) {
|
|
|
|
|
if (configRuleMap != null && configRuleMap.containsKey(field)) {
|
|
|
|
|
configRule = configRuleMap.get(field);
|
|
|
|
|
copyEntity.setRuleInfo(configRule);
|
|
|
|
|
}
|
|
|
|
|
//端字段含义
|
|
|
|
|
fieldName = fieldMap.get(field);
|
|
|
|
|
//检查数据
|
|
|
|
|
inputText = inputMap.get(field);
|
|
|
|
|
//端字段含义
|
|
|
|
|
fieldName = fieldMap.get(field);
|
|
|
|
|
//检查数据
|
|
|
|
|
inputText = inputMap.get(field);
|
|
|
|
|
|
|
|
|
|
copyEntity.setFieldName(fieldName);
|
|
|
|
|
copyEntity.setFieldName(fieldName);
|
|
|
|
|
|
|
|
|
|
copyEntity.setInputText(inputText);
|
|
|
|
|
copyEntity.setInputText(inputText);
|
|
|
|
|
|
|
|
|
|
checkSemanticModelMap.put(field, copyEntity);
|
|
|
|
|
checkSemanticModelMap.put(field, copyEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return checkSemanticModelMap;
|
|
|
|
|