|
|
@ -1,13 +1,7 @@
|
|
|
|
package org.jeecg.module.custom.ocr.api.thread.tasks;
|
|
|
|
package org.jeecg.module.custom.ocr.api.thread.tasks;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
|
|
|
|
|
import com.google.common.collect.Maps;
|
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.var;
|
|
|
|
|
|
|
|
import org.jeecg.module.custom.ocr.api.entity.FormRecord;
|
|
|
|
import org.jeecg.module.custom.ocr.api.entity.FormRecord;
|
|
|
|
import org.jeecg.module.custom.ocr.api.entity.LivePhoto;
|
|
|
|
import org.jeecg.module.custom.ocr.api.entity.LivePhoto;
|
|
|
|
import org.jeecg.module.custom.ocr.dataobject.Task;
|
|
|
|
import org.jeecg.module.custom.ocr.dataobject.Task;
|
|
|
@ -16,7 +10,6 @@ import org.jeecg.module.custom.ocr.service.TaskService;
|
|
|
|
import org.jeecg.module.custom.ocr.utils.DownloadImgUtil;
|
|
|
|
import org.jeecg.module.custom.ocr.utils.DownloadImgUtil;
|
|
|
|
import org.jeecg.module.custom.ocr.utils.ImageUtils;
|
|
|
|
import org.jeecg.module.custom.ocr.utils.ImageUtils;
|
|
|
|
import org.jeecg.module.custom.ocr.utils.SpringUtils;
|
|
|
|
import org.jeecg.module.custom.ocr.utils.SpringUtils;
|
|
|
|
import org.jeecg.module.custom.ocr.utils.StringUtils;
|
|
|
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
@ -90,6 +83,8 @@ public class PictureImgToLocalTask implements Runnable {
|
|
|
|
} catch (IOException e) {
|
|
|
|
} catch (IOException e) {
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
logger.info("task: {}", task);
|
|
|
|
Map<String, String> ocrPictureClassifyAndHash = ocrPictureService.getOcrPictureClassifyAndHash(task.getLocalImageUrl());
|
|
|
|
Map<String, String> ocrPictureClassifyAndHash = ocrPictureService.getOcrPictureClassifyAndHash(task.getLocalImageUrl());
|
|
|
|
if (ocrPictureClassifyAndHash != null) {
|
|
|
|
if (ocrPictureClassifyAndHash != null) {
|
|
|
|
task.setImgHash(ocrPictureClassifyAndHash.get("hash"));
|
|
|
|
task.setImgHash(ocrPictureClassifyAndHash.get("hash"));
|
|
|
|