|
|
@ -132,6 +132,7 @@ public class OcrIdentifyController extends JeecgController<OcrIdentify, IOcrIden
|
|
|
|
}
|
|
|
|
}
|
|
|
|
OcrRuleCheckVo ocrRuleCheckVo = ocrRuleCheckMap.get(record.getRuleCheck());
|
|
|
|
OcrRuleCheckVo ocrRuleCheckVo = ocrRuleCheckMap.get(record.getRuleCheck());
|
|
|
|
if (ocrRuleCheckVo!=null && StringUtils.isNotBlank(ocrRuleCheckVo.getMetadataConfigId())) {
|
|
|
|
if (ocrRuleCheckVo!=null && StringUtils.isNotBlank(ocrRuleCheckVo.getMetadataConfigId())) {
|
|
|
|
|
|
|
|
record.setOcrRuleCheckInfoConfigRule(ocrRuleCheckVo.getConfigRule());
|
|
|
|
record.setMetadataConfigId(ocrRuleCheckVo.getMetadataConfigId());
|
|
|
|
record.setMetadataConfigId(ocrRuleCheckVo.getMetadataConfigId());
|
|
|
|
OcrMetadataConfigVo ocrMetadataConfigVo = metadataConfigMap.get(ocrRuleCheckVo.getMetadataConfigId());
|
|
|
|
OcrMetadataConfigVo ocrMetadataConfigVo = metadataConfigMap.get(ocrRuleCheckVo.getMetadataConfigId());
|
|
|
|
if (ocrMetadataConfigVo!=null) {
|
|
|
|
if (ocrMetadataConfigVo!=null) {
|
|
|
@ -141,12 +142,6 @@ public class OcrIdentifyController extends JeecgController<OcrIdentify, IOcrIden
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*for (OcrIdentify record : pageList.getRecords()) {
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(record.getRequestId())) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
System.out.println(record.getTaskResult().equals("1")?"匹配成功":"匹配失败");
|
|
|
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
return Result.OK(pageList);
|
|
|
|
return Result.OK(pageList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -271,22 +266,8 @@ public class OcrIdentifyController extends JeecgController<OcrIdentify, IOcrIden
|
|
|
|
Map<String, OcrRuleCheckVo> ocrRuleCheckMap = ocrRuleCheckService.listToMap(null);
|
|
|
|
Map<String, OcrRuleCheckVo> ocrRuleCheckMap = ocrRuleCheckService.listToMap(null);
|
|
|
|
Map<String, OcrMetadataConfigVo> metadataConfigMap = ocrMetadataConfigService.listToMap(null);
|
|
|
|
Map<String, OcrMetadataConfigVo> metadataConfigMap = ocrMetadataConfigService.listToMap(null);
|
|
|
|
Map<String, String> taskNameMap = ocrTaskTypeService.listNameToMap(null);
|
|
|
|
Map<String, String> taskNameMap = ocrTaskTypeService.listNameToMap(null);
|
|
|
|
/*List<OcrIdentifyDetail> ocrIdentifyDetailList = ocrIdentifyDetailService.list(new LambdaQueryWrapper<OcrIdentifyDetail>().eq(OcrIdentifyDetail::getIdentifyId, id));
|
|
|
|
|
|
|
|
List<OcrIdentifyDetail> identifyDetailList = new ArrayList<>();*/
|
|
|
|
|
|
|
|
/* if ("1".equals(ocrIdentify.getStatus()) &&ocrIdentifyDetailList!=null&&ocrIdentifyDetailList.size()>0) {
|
|
|
|
|
|
|
|
//判断明细是否识别成功
|
|
|
|
|
|
|
|
identifyDetailList = ocrIdentifyDetailList.stream().filter(o -> o.getIdentifyId().equals(ocrIdentify.getId())).collect(Collectors.toList());
|
|
|
|
|
|
|
|
if (identifyDetailList.size()>0) {
|
|
|
|
|
|
|
|
long errorCount = identifyDetailList.stream().filter(i -> i.getStatus().equals("1")).count();
|
|
|
|
|
|
|
|
//errorCount>0,说明有失败的明细
|
|
|
|
|
|
|
|
ocrIdentify.setTaskResult(errorCount>0?"0":"1");
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
//失败
|
|
|
|
|
|
|
|
ocrIdentify.setTaskResult("0");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
List<OcrIdentifyDetail> identifyDetailList = ocrIdentifyDetailService.list(new LambdaQueryWrapper<OcrIdentifyDetail>().eq(OcrIdentifyDetail::getIdentifyId,id));
|
|
|
|
List<OcrIdentifyDetail> identifyDetailList = ocrIdentifyDetailService.list(new LambdaQueryWrapper<OcrIdentifyDetail>().eq(OcrIdentifyDetail::getIdentifyId,id));
|
|
|
|
ocrIdentify.setImgNum((long)identifyDetailList.size());
|
|
|
|
ocrIdentify.setImgNum((long)identifyDetailList.size());
|
|
|
|
if (StringUtils.isNotBlank(ocrIdentify.getTaskResultInfo())) {
|
|
|
|
if (StringUtils.isNotBlank(ocrIdentify.getTaskResultInfo())) {
|
|
|
|
List<OcrResult2> ocrResult2s = JSONObject.parseArray(ocrIdentify.getTaskResultInfo()).toJavaList(OcrResult2.class);
|
|
|
|
List<OcrResult2> ocrResult2s = JSONObject.parseArray(ocrIdentify.getTaskResultInfo()).toJavaList(OcrResult2.class);
|
|
|
|
int tagNum = ocrResult2s.size();
|
|
|
|
int tagNum = ocrResult2s.size();
|
|
|
@ -299,6 +280,7 @@ public class OcrIdentifyController extends JeecgController<OcrIdentify, IOcrIden
|
|
|
|
|
|
|
|
|
|
|
|
OcrRuleCheckVo ocrRuleCheckVo = ocrRuleCheckMap.get(ocrIdentify.getRuleCheck());
|
|
|
|
OcrRuleCheckVo ocrRuleCheckVo = ocrRuleCheckMap.get(ocrIdentify.getRuleCheck());
|
|
|
|
if (ocrRuleCheckVo!=null && StringUtils.isNotBlank(ocrRuleCheckVo.getMetadataConfigId())) {
|
|
|
|
if (ocrRuleCheckVo!=null && StringUtils.isNotBlank(ocrRuleCheckVo.getMetadataConfigId())) {
|
|
|
|
|
|
|
|
ocrIdentify.setOcrRuleCheckInfoConfigRule(ocrRuleCheckVo.getConfigRule());
|
|
|
|
ocrIdentify.setRuleCheck_dictText(ocrRuleCheckVo.getConfigName());
|
|
|
|
ocrIdentify.setRuleCheck_dictText(ocrRuleCheckVo.getConfigName());
|
|
|
|
ocrIdentify.setMetadataConfigId(ocrRuleCheckVo.getMetadataConfigId());
|
|
|
|
ocrIdentify.setMetadataConfigId(ocrRuleCheckVo.getMetadataConfigId());
|
|
|
|
ocrIdentify.setMetadataConfigId_dictText(ocrRuleCheckVo.getMetadataConfigName());
|
|
|
|
ocrIdentify.setMetadataConfigId_dictText(ocrRuleCheckVo.getMetadataConfigName());
|
|
|
|