|
|
|
@ -1110,21 +1110,12 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
Date overDataCheckTime = new Date();
|
|
|
|
|
|
|
|
|
|
JSONObject responseBody=new JSONObject();
|
|
|
|
|
//获取最小
|
|
|
|
|
Double min = 0d;
|
|
|
|
|
//获取最大
|
|
|
|
|
Double max = 0d;
|
|
|
|
|
if (CollectionUtils.isNotEmpty(ocrResultDTOList)) {
|
|
|
|
|
min = ocrResultDTOList.stream().sorted((a, b) -> a.getTextRate().compareTo(b.getTextRate())).findFirst().get().getTextRate();
|
|
|
|
|
max = ocrResultDTOList.stream().sorted((a, b) -> b.getTextRate().compareTo(a.getTextRate())).findFirst().get().getTextRate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//OCR和NlU执行时间总和(秒)
|
|
|
|
|
double ocrAndNluTimeSum = identifyDetailList.stream().mapToDouble(i -> (i.getOcrTime() == null ? 0 : i.getOcrTime()) + (i.getNluTime() == null ? 0 : i.getNluTime())).sum();
|
|
|
|
|
//执行时间(毫秒)
|
|
|
|
|
double dataStructuredTime = new BigDecimal(overDataCheckTime.getTime() - startDataCheckTime.getTime()).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
|
|
|
double executionTime = new BigDecimal(ocrAndNluTimeSum+(dataStructuredTime/1000)).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
|
|
|
responseBody.put("min",min);
|
|
|
|
|
responseBody.put("max",max);
|
|
|
|
|
responseBody.put("dataStructuredTime",dataStructuredTime);
|
|
|
|
|
responseBody.put("allExecutionTime",executionTime);
|
|
|
|
|
|
|
|
|
@ -1140,10 +1131,21 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
long count = fieldRightMap.values().stream().filter(o->!o).count();
|
|
|
|
|
//long count = ocrResultDTOList.stream().filter(o -> !o.getRuleValidation()).count();
|
|
|
|
|
responseBody.put("taskResult",count>0?0:1);//匹配成功或失败
|
|
|
|
|
//List<String> haveRateTagList = ocrResultDTOList.stream().filter(o -> o.getOcrPrecisionRate() > 0).map(OcrResultDTO::getTag).collect(Collectors.toList());
|
|
|
|
|
List<String> haveRateTagList = ocrResultDTOList.stream().filter(o -> o.getOcrPrecisionRate() > 0).map(OcrResultDTO::getTag).collect(Collectors.toList());
|
|
|
|
|
//过滤掉0的值
|
|
|
|
|
//ocrResultDTOList = ocrResultDTOList.stream().filter(o->haveRateTagList.contains(o.getTag()) && o.getOcrPrecisionRate()>0).collect(Collectors.toList());
|
|
|
|
|
ocrResultDTOList = ocrResultDTOList.stream().filter(o->haveRateTagList.contains(o.getTag()) && o.getOcrPrecisionRate()>0).collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
//获取最小
|
|
|
|
|
Double min = 0d;
|
|
|
|
|
//获取最大
|
|
|
|
|
Double max = 0d;
|
|
|
|
|
if (CollectionUtils.isNotEmpty(ocrResultDTOList)) {
|
|
|
|
|
min = ocrResultDTOList.stream().sorted((a, b) -> a.getTextRate().compareTo(b.getTextRate())).findFirst().get().getTextRate();
|
|
|
|
|
max = ocrResultDTOList.stream().sorted((a, b) -> b.getTextRate().compareTo(a.getTextRate())).findFirst().get().getTextRate();
|
|
|
|
|
}
|
|
|
|
|
responseBody.put("min",min);
|
|
|
|
|
responseBody.put("max",max);
|
|
|
|
|
|
|
|
|
|
responseBody.put("detailList", ocrResultDTOList);
|
|
|
|
|
//============
|
|
|
|
|
return responseBody;
|
|
|
|
|