|
|
@ -81,6 +81,9 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
String imgName = null;//图片名称
|
|
|
|
String imgName = null;//图片名称
|
|
|
|
if (StringUtils.isNotBlank(imgPath)) {
|
|
|
|
if (StringUtils.isNotBlank(imgPath)) {
|
|
|
|
imgName = imgPath.substring(imgPath.lastIndexOf("/") + 1, imgPath.length());
|
|
|
|
imgName = imgPath.substring(imgPath.lastIndexOf("/") + 1, imgPath.length());
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
log.error("异常,识别图片地址为空");
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String message = responseBody.getString("message");//描述
|
|
|
|
String message = responseBody.getString("message");//描述
|
|
|
|
String taskStatus = responseBody.getString("taskStatus");//任务是否完成
|
|
|
|
String taskStatus = responseBody.getString("taskStatus");//任务是否完成
|
|
|
@ -89,6 +92,12 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
// 入库记录
|
|
|
|
// 入库记录
|
|
|
|
OcrIdentifyDetail ocrIdentifyDetail = new OcrIdentifyDetail();
|
|
|
|
OcrIdentifyDetail ocrIdentifyDetail = new OcrIdentifyDetail();
|
|
|
|
if (semanticResult != null) {
|
|
|
|
if (semanticResult != null) {
|
|
|
|
|
|
|
|
long count = ocrIdentifyDetailService.count(new LambdaUpdateWrapper<OcrIdentifyDetail>().eq(OcrIdentifyDetail::getIdentifyId, identifyId).eq(OcrIdentifyDetail::getImageUrl, imgPath));
|
|
|
|
|
|
|
|
if (count>0) {
|
|
|
|
|
|
|
|
//该图片已识别过
|
|
|
|
|
|
|
|
log.error("该图片已识别过");
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
ocrIdentifyDetail.setIdentifyId(identifyId);
|
|
|
|
ocrIdentifyDetail.setIdentifyId(identifyId);
|
|
|
|
ocrIdentifyDetail.setImageName(imgName);
|
|
|
|
ocrIdentifyDetail.setImageName(imgName);
|
|
|
|
ocrIdentifyDetail.setImageUrl(imgPath);
|
|
|
|
ocrIdentifyDetail.setImageUrl(imgPath);
|
|
|
|