master
周文涛 2 years ago
parent d48bff334f
commit 3eafba9df1

@ -219,7 +219,7 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
} else if (StringUtils.isBlank(inputText)) { } else if (StringUtils.isBlank(inputText)) {
//没有输入值. //没有输入值.
fieldRightMap.put(field, true); fieldRightMap.put(field, true);
ocrResultAdd(ocrResultDTOList, value.getFieldName(), field, inputText, text, probability, imgPath, "没有输入值不做匹配", true,null); ocrResultAdd(ocrResultDTOList, value.getFieldName(), field, inputText, text, probability, imgPath, "没有输入值不做匹配", true,ruleInfo);
} else if ("0".equals(ruleInfo)) { } else if ("0".equals(ruleInfo)) {
//不必校验,有识别到就行,通过 //不必校验,有识别到就行,通过
fieldRightMap.put(field, true); fieldRightMap.put(field, true);
@ -733,7 +733,7 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
if (d == null) { if (d == null) {
ocrResultDTO.setTextRate(0d); ocrResultDTO.setTextRate(0d);
} else { } else {
ocrResultDTO.setTextRate(new BigDecimal(d).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); ocrResultDTO.setTextRate(new BigDecimal(d).setScale(2, RoundingMode.HALF_UP).doubleValue());
} }
System.out.println("-----------------"); System.out.println("-----------------");
System.out.println(failureReason); System.out.println(failureReason);
@ -753,7 +753,7 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
ocrResultDTO.setRuleValidation(ruleValidation); ocrResultDTO.setRuleValidation(ruleValidation);
if ("0".equals(ruleValidationValue)) { if ("0".equals(ruleValidationValue)) {
ocrResultDTO.setRuleValidationText("有名称就算过"); ocrResultDTO.setRuleValidationText("有名称就算过");
}else if(Double.valueOf(ruleValidationValue)>0 &&Double.valueOf(ruleValidationValue)<=99){ }else if(Double.parseDouble(ruleValidationValue)>0 &&Double.parseDouble(ruleValidationValue)<=99){
ocrResultDTO.setRuleValidationText("匹配度>="+ruleValidationValue); ocrResultDTO.setRuleValidationText("匹配度>="+ruleValidationValue);
}else if("100".equals(ruleValidation)){ }else if("100".equals(ruleValidation)){
ocrResultDTO.setRuleValidationText("名称必须与参数完全一致"); ocrResultDTO.setRuleValidationText("名称必须与参数完全一致");

Loading…
Cancel
Save