|
|
|
@ -27,6 +27,7 @@ import org.jeecg.modules.ocr.model.TaskModel;
|
|
|
|
|
import org.jeecg.modules.ocr.service.*;
|
|
|
|
|
import org.jeecg.modules.ocr.utils.*;
|
|
|
|
|
import org.jeecg.modules.ocr.vo.SimulateChecksVO;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
|
|
import org.springframework.scheduling.annotation.EnableAsync;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@ -63,6 +64,8 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
RedisUtil redisUtil;
|
|
|
|
|
@Resource
|
|
|
|
|
IOcrIdentifyCallbackLogService ocrIdentifyCallbackLogService;
|
|
|
|
|
@Value("${system.project.fileReviewUrlPrefix")
|
|
|
|
|
private String fileReviewUrlPrefix;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public OcrIdentifyDTO findById(String id) {
|
|
|
|
@ -451,7 +454,7 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
*
|
|
|
|
|
* @param ruleValidationValue 检查要求
|
|
|
|
|
*/
|
|
|
|
|
public static void ocrResultAdd(List<OcrResultDTO> ocrResultDTOList, String fieldName, String field, String inputText, String ocrText, Double ocrPrecisionRate, String imgPath, String failureReason, Boolean ruleValidation, Double d, String ruleValidationValue) {
|
|
|
|
|
public void ocrResultAdd(List<OcrResultDTO> ocrResultDTOList, String fieldName, String field, String inputText, String ocrText, Double ocrPrecisionRate, String imgPath, String failureReason, Boolean ruleValidation, Double d, String ruleValidationValue) {
|
|
|
|
|
OcrResultDTO ocrResultDTO = new OcrResultDTO();
|
|
|
|
|
ocrResultDTO.setTag(field);
|
|
|
|
|
ocrResultDTO.setTagName(fieldName);
|
|
|
|
@ -471,7 +474,7 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
sourceImage.setPath(imgPath);
|
|
|
|
|
int i = imgPath.lastIndexOf("/");
|
|
|
|
|
sourceImage.setFileName(imgPath.substring(i + 1, imgPath.length()));
|
|
|
|
|
sourceImage.setPreviewUrl(OcrConstant.FILE_REVIEW_URL_PREFIX+imgPath);
|
|
|
|
|
sourceImage.setPreviewUrl(fileReviewUrlPrefix+imgPath);
|
|
|
|
|
ocrResultDTO.setSourceImage(sourceImage);
|
|
|
|
|
}
|
|
|
|
|
ocrResultDTO.setFailureReason(failureReason);
|
|
|
|
@ -500,7 +503,7 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
/**
|
|
|
|
|
* 将数据 疯转成 OcrResult,追加到 ocrResultList
|
|
|
|
|
*/
|
|
|
|
|
public static void ocrResultAdd(List<OcrResultDTO> ocrResultDTOList, String fieldName, String field, String inputText, String ocrText, Double ocrPrecisionRate, String imgPath, String failureReason, Boolean ruleValidation, String ruleValidationValue) {
|
|
|
|
|
public void ocrResultAdd(List<OcrResultDTO> ocrResultDTOList, String fieldName, String field, String inputText, String ocrText, Double ocrPrecisionRate, String imgPath, String failureReason, Boolean ruleValidation, String ruleValidationValue) {
|
|
|
|
|
if (ruleValidation) {
|
|
|
|
|
ocrResultAdd(ocrResultDTOList, fieldName, field, inputText, ocrText, ocrPrecisionRate, imgPath, failureReason, ruleValidation, 100d,ruleValidationValue);
|
|
|
|
|
} else {
|
|
|
|
|