bug52849
This commit is contained in:
+2
@@ -64,6 +64,7 @@
|
||||
from params_manifest pm left join params_template pt on pm.params_template_id = pt.id
|
||||
) tmp_tb
|
||||
<include refid="BaseQuerySql"/>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="pageInfoAll" resultMap="ParamsManifestEOResultMapForCopy">
|
||||
@@ -86,5 +87,6 @@
|
||||
<if test="projectName !=null and projectName !=''">
|
||||
AND project_name LIKE CONCAT(CONCAT('%',#{projectName}),'%')
|
||||
</if>
|
||||
order by create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
+18
-5
@@ -2,6 +2,7 @@ package com.jero.modules.ocr.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.modules.ocr.entity.OcrRecordEO;
|
||||
import com.jero.modules.ocr.enums.ResultContentEnum;
|
||||
@@ -165,12 +166,24 @@ public class OcrRestfulController{
|
||||
String fileOriPath = ossFile.getUrl();
|
||||
String oriName = ossFile.getFileName();
|
||||
File pdfFile = new File(fileOriPath);
|
||||
FileInputStream fileInputStream = new FileInputStream(pdfFile);
|
||||
MultipartFile multipartFile = new MockMultipartFile(oriName, oriName,
|
||||
ContentType.APPLICATION_OCTET_STREAM.toString(), fileInputStream);
|
||||
return ocrRestfulService.handleFile(multipartFile,multipartFile.getOriginalFilename(),ocrRecordEO,"add");
|
||||
try {
|
||||
FileInputStream fileInputStream = new FileInputStream(pdfFile);
|
||||
MultipartFile multipartFile = new MockMultipartFile(oriName, oriName,
|
||||
ContentType.APPLICATION_OCTET_STREAM.toString(), fileInputStream);
|
||||
return ocrRestfulService.handleFile(multipartFile,multipartFile.getOriginalFilename(),ocrRecordEO,"add");
|
||||
} catch (FileNotFoundException fileNotFoundException) { // 系统找不到指定的文件
|
||||
if (CutEnum.CN.getValue().equals(ocrRecordEO.getCut())) {
|
||||
return Result.error("无法找到该文件");
|
||||
} else {
|
||||
return Result.error("File not found");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return Result.error("无法找到该文件");
|
||||
if (CutEnum.CN.getValue().equals(ocrRecordEO.getCut())) {
|
||||
return Result.error("无法找到该文件");
|
||||
} else {
|
||||
return Result.error("File not found");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user