master
周文涛 2 years ago
parent a83877351c
commit f7c5914775

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

@ -15,7 +15,7 @@ public class ArrayOUtils {
boolean flag=false; boolean flag=false;
for (String object : objects) { for (String object : objects) {
o2For:for (String o : objects2) { o2For:for (String o : objects2) {
if (object.equals(o)) { if (object.contains(o) || o.contains(object)) {
return true; return true;
} }
} }

Loading…
Cancel
Save