fix(OCR识别): 修改文件保存方式
This commit is contained in:
@@ -173,16 +173,12 @@
|
|||||||
<classifier>jdk17</classifier>
|
<classifier>jdk17</classifier>
|
||||||
<systemPath>${project.basedir}/lib/spirej.doc.cracked-11.4.2.jar</systemPath>
|
<systemPath>${project.basedir}/lib/spirej.doc.cracked-11.4.2.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--<dependency>
|
|
||||||
<groupId>org.apache.poi</groupId>
|
|
||||||
<artifactId>poi-ooxml-schemas</artifactId>
|
|
||||||
<version>3.17</version>
|
|
||||||
</dependency>-->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bouncycastle</groupId>
|
<groupId>org.bouncycastle</groupId>
|
||||||
<artifactId>bcprov-jdk15on</artifactId>
|
<artifactId>bcprov-jdk14</artifactId>
|
||||||
<version>1.56</version>
|
<version>1.64</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
+53
-21
@@ -1,6 +1,7 @@
|
|||||||
package com.jero.modules.laws.ocr.controller;
|
package com.jero.modules.laws.ocr.controller;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.jero.common.util.MinioUtil;
|
||||||
import com.jero.modules.laws.ocr.MD5Util;
|
import com.jero.modules.laws.ocr.MD5Util;
|
||||||
import com.jero.modules.laws.ocr.entity.OcrCallBackResultEo;
|
import com.jero.modules.laws.ocr.entity.OcrCallBackResultEo;
|
||||||
import com.jero.modules.laws.ocr.entity.OcrRecordEO;
|
import com.jero.modules.laws.ocr.entity.OcrRecordEO;
|
||||||
@@ -11,8 +12,8 @@ import com.jero.modules.laws.ocr.page.OcrRecordEOPage;
|
|||||||
import com.jero.modules.laws.ocr.service.OCRRestfulService;
|
import com.jero.modules.laws.ocr.service.OCRRestfulService;
|
||||||
import com.jero.modules.laws.ocr.service.OcrRecordEOService;
|
import com.jero.modules.laws.ocr.service.OcrRecordEOService;
|
||||||
import com.jero.modules.laws.ocr.web.BaseController;
|
import com.jero.modules.laws.ocr.web.BaseController;
|
||||||
import com.jero.modules.onlyoffice.entity.AttFileEO;
|
import com.jero.modules.oss.entity.OSSFile;
|
||||||
import com.jero.modules.onlyoffice.service.IAttFileEOService;
|
import com.jero.modules.oss.service.IOSSFileService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
@@ -26,12 +27,17 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @program: OcrDemo
|
* @program: OcrDemo
|
||||||
@@ -49,8 +55,10 @@ public class OCRRestfulController extends BaseController<OcrRecordEO> {
|
|||||||
private OCRRestfulService ocrRestfulService;
|
private OCRRestfulService ocrRestfulService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private OcrRecordEOService ocrRecordEOService;
|
private OcrRecordEOService ocrRecordEOService;
|
||||||
|
// @Autowired
|
||||||
|
// private IAttFileEOService attFileEOService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IAttFileEOService attFileEOService;
|
private IOSSFileService ossFileService;
|
||||||
//接口回调公钥
|
//接口回调公钥
|
||||||
@Value("${OCR.publicKey}")
|
@Value("${OCR.publicKey}")
|
||||||
private String OcrPublicKey;
|
private String OcrPublicKey;
|
||||||
@@ -120,19 +128,16 @@ public class OCRRestfulController extends BaseController<OcrRecordEO> {
|
|||||||
|
|
||||||
@ApiOperation(value = "OCR识别-新增ocr内容", notes = "OCR识别-新增ocr内容")
|
@ApiOperation(value = "OCR识别-新增ocr内容", notes = "OCR识别-新增ocr内容")
|
||||||
@PostMapping("/addOcrRecord")
|
@PostMapping("/addOcrRecord")
|
||||||
public ResponseMessage<OcrRecordEO> addOcrRecord(OcrRecordEO ocrRecordEO) throws Exception {
|
public ResponseMessage<OcrRecordEO> addOcrRecord(@RequestBody OcrRecordEO ocrRecordEO) throws Exception {
|
||||||
SimpleDateFormat sdf=new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
|
SimpleDateFormat sdf=new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
|
||||||
logger.info("收到文件上传请求,开始处理文件:【"+sdf.format(new Date())+"】");
|
logger.info("收到文件上传请求,开始处理文件:【"+sdf.format(new Date())+"】");
|
||||||
// 根据attID查找文件
|
// 根据attID查找文件
|
||||||
String fileId = ocrRecordEO.getAttId();
|
String fileId = ocrRecordEO.getAttId();
|
||||||
AttFileEO attFileEO = attFileEOService.getFileInfo(fileId);
|
OSSFile ossFile = ossFileService.getById(fileId);
|
||||||
if (attFileEO != null) {
|
if (!Objects.isNull(ossFile)){
|
||||||
String fileOriPath = filePath + attFileEO.getFilePath();
|
InputStream minioFile = MinioUtil.getMinioFile(MinioUtil.getBucketName(), ossFile.getUrl());
|
||||||
String oriName = attFileEO.getOldFileName();
|
MultipartFile multipartFile = new MockMultipartFile(ossFile.getFileName(), ossFile.getFileName(),
|
||||||
File pdfFile = new File(fileOriPath+attFileEO.getFileName());
|
ContentType.APPLICATION_OCTET_STREAM.toString(), minioFile);
|
||||||
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");
|
return ocrRestfulService.handleFile(multipartFile,multipartFile.getOriginalFilename(),ocrRecordEO,"add");
|
||||||
} else {
|
} else {
|
||||||
return Result.error("0","无法找到该文件",null);
|
return Result.error("0","无法找到该文件",null);
|
||||||
@@ -150,14 +155,11 @@ public class OCRRestfulController extends BaseController<OcrRecordEO> {
|
|||||||
logger.info("收到文件上传请求,开始处理文件:【"+sdf.format(new Date())+"】");
|
logger.info("收到文件上传请求,开始处理文件:【"+sdf.format(new Date())+"】");
|
||||||
// 根据attID查找文件
|
// 根据attID查找文件
|
||||||
String fileId = ocrRecordEO.getAttId();
|
String fileId = ocrRecordEO.getAttId();
|
||||||
AttFileEO attFileEO = attFileEOService.getFileInfo(fileId);
|
OSSFile ossFile = ossFileService.getById(fileId);
|
||||||
if (attFileEO != null) {
|
if (!Objects.isNull(ossFile)){
|
||||||
String fileOriPath = filePath + attFileEO.getFilePath();
|
InputStream minioFile = MinioUtil.getMinioFile(MinioUtil.getBucketName(), ossFile.getUrl());
|
||||||
String oriName = attFileEO.getOldFileName();
|
MultipartFile multipartFile = new MockMultipartFile(ossFile.getFileName(), ossFile.getFileName(),
|
||||||
File pdfFile = new File(fileOriPath+attFileEO.getFileName());
|
ContentType.APPLICATION_OCTET_STREAM.toString(), minioFile);
|
||||||
FileInputStream fileInputStream = new FileInputStream(pdfFile);
|
|
||||||
MultipartFile multipartFile = new MockMultipartFile(oriName, oriName,
|
|
||||||
ContentType.APPLICATION_OCTET_STREAM.toString(), fileInputStream);
|
|
||||||
return ocrRestfulService.handleFile(multipartFile,multipartFile.getOriginalFilename(),ocrRecordEO,"update");
|
return ocrRestfulService.handleFile(multipartFile,multipartFile.getOriginalFilename(),ocrRecordEO,"update");
|
||||||
} else {
|
} else {
|
||||||
return Result.error("0","无法找到该文件",null);
|
return Result.error("0","无法找到该文件",null);
|
||||||
@@ -178,4 +180,34 @@ public class OCRRestfulController extends BaseController<OcrRecordEO> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/demo")
|
||||||
|
public String demo() throws Exception {
|
||||||
|
File file = new File("C:\\Users\\31318\\Pictures\\Saved Pictures\\20200329222041_xxout.jpg");
|
||||||
|
MultipartFile multipartFile = convertFileToMultipartFile(file);
|
||||||
|
assert multipartFile != null;
|
||||||
|
String originalFilename = multipartFile.getOriginalFilename();
|
||||||
|
String upload = MinioUtil.upload(multipartFile, "/temp");
|
||||||
|
return upload;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static MultipartFile convertFileToMultipartFile(File file) {
|
||||||
|
try {
|
||||||
|
Path path = Paths.get(file.getAbsolutePath());
|
||||||
|
String name = file.getName();
|
||||||
|
String originalFileName = file.getName();
|
||||||
|
String contentType = Files.probeContentType(path);
|
||||||
|
byte[] content = null;
|
||||||
|
try {
|
||||||
|
content = Files.readAllBytes(path);
|
||||||
|
} catch (final IOException e) {
|
||||||
|
}
|
||||||
|
MultipartFile result = new MockMultipartFile(name,
|
||||||
|
originalFileName, contentType, content);
|
||||||
|
return result;
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,25 @@ public class OcrRecordEO extends BaseEntity implements Serializable{
|
|||||||
private String standName;
|
private String standName;
|
||||||
private String creationUser;
|
private String creationUser;
|
||||||
private String attId;
|
private String attId;
|
||||||
|
private String wordAttId;
|
||||||
|
|
||||||
|
public String getJsonAttId() {
|
||||||
|
return jsonAttId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJsonAttId(String jsonAttId) {
|
||||||
|
this.jsonAttId = jsonAttId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWordAttId() {
|
||||||
|
return wordAttId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWordAttId(String wordAttId) {
|
||||||
|
this.wordAttId = wordAttId;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String jsonAttId;
|
||||||
/**
|
/**
|
||||||
* java字段名转换为原始数据库列名。<b>如果不存在则返回null</b><br>
|
* java字段名转换为原始数据库列名。<b>如果不存在则返回null</b><br>
|
||||||
* <p>字段列表:</p>
|
* <p>字段列表:</p>
|
||||||
|
|||||||
+4
-1
@@ -22,7 +22,7 @@
|
|||||||
<!-- OCR_RECORD table all fields -->
|
<!-- OCR_RECORD table all fields -->
|
||||||
<sql id="Base_Column_List" >
|
<sql id="Base_Column_List" >
|
||||||
word_file_code, json_file_code, id, doc_real_name, json_real_name, file_name, doc_name, json_name,
|
word_file_code, json_file_code, id, doc_real_name, json_real_name, file_name, doc_name, json_name,
|
||||||
creation_time, modify_time,result_content,file_type,stand_number,stand_name
|
creation_time, modify_time,result_content,file_type,stand_number,stand_name,att_id,word_att_id,json_att_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 查询条件 -->
|
<!-- 查询条件 -->
|
||||||
@@ -181,6 +181,9 @@
|
|||||||
<if test="standName != null" >
|
<if test="standName != null" >
|
||||||
stand_name = #{standName},
|
stand_name = #{standName},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="attId != null" >
|
||||||
|
att_id = #{attId},
|
||||||
|
</if>
|
||||||
</set>
|
</set>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|||||||
+35
-29
@@ -1,17 +1,23 @@
|
|||||||
package com.jero.modules.laws.ocr.service.impl;
|
package com.jero.modules.laws.ocr.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.jero.common.system.vo.LoginUser;
|
||||||
|
import com.jero.common.util.MinioUtil;
|
||||||
|
import com.jero.common.util.SnowflakeUtils;
|
||||||
import com.jero.modules.laws.ocr.Base64Util;
|
import com.jero.modules.laws.ocr.Base64Util;
|
||||||
import com.jero.modules.laws.ocr.OkHttpUtil;
|
import com.jero.modules.laws.ocr.OkHttpUtil;
|
||||||
import com.jero.modules.laws.ocr.RsaUtil;
|
import com.jero.modules.laws.ocr.RsaUtil;
|
||||||
import com.jero.modules.laws.ocr.UUIDUtils;
|
import com.jero.modules.laws.ocr.UUIDUtils;
|
||||||
import com.jero.modules.laws.ocr.mapper.OcrRecordEOMapper;
|
|
||||||
import com.jero.modules.laws.ocr.entity.OcrRecordEO;
|
import com.jero.modules.laws.ocr.entity.OcrRecordEO;
|
||||||
import com.jero.modules.laws.ocr.entity.OcrResultEo;
|
import com.jero.modules.laws.ocr.entity.OcrResultEo;
|
||||||
import com.jero.modules.laws.ocr.http.ResponseMessage;
|
import com.jero.modules.laws.ocr.http.ResponseMessage;
|
||||||
import com.jero.modules.laws.ocr.http.Result;
|
import com.jero.modules.laws.ocr.http.Result;
|
||||||
|
import com.jero.modules.laws.ocr.mapper.OcrRecordEOMapper;
|
||||||
import com.jero.modules.laws.ocr.service.OCRRestfulService;
|
import com.jero.modules.laws.ocr.service.OCRRestfulService;
|
||||||
|
import com.jero.modules.oss.entity.OSSFile;
|
||||||
|
import com.jero.modules.oss.service.IOSSFileService;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -52,6 +58,8 @@ public class OCRRestfulServiceImpl implements OCRRestfulService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private OkHttpUtil okHttpUtil;
|
private OkHttpUtil okHttpUtil;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private IOSSFileService ossFileService;
|
||||||
|
@Autowired
|
||||||
private OcrRecordEOMapper ocrRecordEOMapper;
|
private OcrRecordEOMapper ocrRecordEOMapper;
|
||||||
//ocr处理文件后存放url
|
//ocr处理文件后存放url
|
||||||
@Value("${OCR.ocrPath}")
|
@Value("${OCR.ocrPath}")
|
||||||
@@ -103,13 +111,15 @@ public class OCRRestfulServiceImpl implements OCRRestfulService {
|
|||||||
if ("add".equals(type)) {
|
if ("add".equals(type)) {
|
||||||
OcrRecordEO ocrRecordEO = new OcrRecordEO();
|
OcrRecordEO ocrRecordEO = new OcrRecordEO();
|
||||||
ocrRecordEO.setId(taskId);
|
ocrRecordEO.setId(taskId);
|
||||||
ocrRecordEO.setCreationUser("LoginUserUtil.getUserId()");
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
ocrRecordEO.setCreationUser(sysUser.getId());
|
||||||
ocrRecordEO.setFileName(fileName);
|
ocrRecordEO.setFileName(fileName);
|
||||||
ocrRecordEO.setCreationTime(new Date());
|
ocrRecordEO.setCreationTime(new Date());
|
||||||
ocrRecordEO.setResultContent("转换中");
|
ocrRecordEO.setResultContent("转换中");
|
||||||
ocrRecordEO.setStandNumber(getOcrEO.getStandNumber());
|
ocrRecordEO.setStandNumber(getOcrEO.getStandNumber());
|
||||||
ocrRecordEO.setStandName(getOcrEO.getStandName());
|
ocrRecordEO.setStandName(getOcrEO.getStandName());
|
||||||
ocrRecordEO.setFileType(getOcrEO.getFileType());
|
ocrRecordEO.setFileType(getOcrEO.getFileType());
|
||||||
|
ocrRecordEO.setAttId(getOcrEO.getAttId());
|
||||||
ocrRecordEOMapper.insertSelective(ocrRecordEO);
|
ocrRecordEOMapper.insertSelective(ocrRecordEO);
|
||||||
return Result.success(ocrResultEo.getResultCode(), "加入转换成功", taskId);
|
return Result.success(ocrResultEo.getResultCode(), "加入转换成功", taskId);
|
||||||
} else {
|
} else {
|
||||||
@@ -121,6 +131,7 @@ public class OCRRestfulServiceImpl implements OCRRestfulService {
|
|||||||
ocrRecordEO.setStandName(getOcrEO.getStandName());
|
ocrRecordEO.setStandName(getOcrEO.getStandName());
|
||||||
ocrRecordEO.setFileType(getOcrEO.getFileType());
|
ocrRecordEO.setFileType(getOcrEO.getFileType());
|
||||||
ocrRecordEO.setCreationTime(new Date());
|
ocrRecordEO.setCreationTime(new Date());
|
||||||
|
ocrRecordEO.setAttId(getOcrEO.getAttId());
|
||||||
ocrRecordEOMapper.updateByPrimaryKeySelective(ocrRecordEO);
|
ocrRecordEOMapper.updateByPrimaryKeySelective(ocrRecordEO);
|
||||||
return Result.success(ocrResultEo.getResultCode(), "加入转换成功", taskId);
|
return Result.success(ocrResultEo.getResultCode(), "加入转换成功", taskId);
|
||||||
}
|
}
|
||||||
@@ -144,46 +155,41 @@ public class OCRRestfulServiceImpl implements OCRRestfulService {
|
|||||||
|
|
||||||
public String OcrHandleResult(MultipartFile wordFile,MultipartFile jsonFile,String taskId) throws Exception {
|
public String OcrHandleResult(MultipartFile wordFile,MultipartFile jsonFile,String taskId) throws Exception {
|
||||||
//首先将文件保存至本地
|
//首先将文件保存至本地
|
||||||
String saveWordFilePath=null;
|
String wordId=null;
|
||||||
String saveWordFileName=null;
|
String jsonId=null;
|
||||||
logger.info("将文件保存至本地");
|
logger.info("保存文件");
|
||||||
if(wordFile!=null && !wordFile.isEmpty()){
|
if(wordFile!=null && !wordFile.isEmpty()){
|
||||||
saveWordFileName=UUIDUtils.randomUUID20()+"_"+wordFile.getOriginalFilename().replace("/","_");
|
String wordUrl = MinioUtil.upload(wordFile, "/temp");
|
||||||
saveWordFilePath=ocrFilePath+saveWordFileName;
|
OSSFile ossFile = new OSSFile();
|
||||||
logger.info(saveWordFilePath);
|
ossFile.setId(String.valueOf(SnowflakeUtils.snowflake()));
|
||||||
//生成保存文件
|
ossFile.setFileName(wordFile.getOriginalFilename());
|
||||||
File saveWordFile = new File(saveWordFilePath);
|
ossFile.setUrl(wordUrl);
|
||||||
System.out.println(saveWordFile);
|
ossFileService.save(ossFile);
|
||||||
wordFile.transferTo(saveWordFile);
|
wordId = ossFile.getId();
|
||||||
// FileUtils.copyInputStreamToFile(wordFile.getInputStream(),new File(saveWordFilePath));
|
|
||||||
// savePic(wordFile.getInputStream(),saveWordFilePath);
|
|
||||||
logger.info("word存储完成");
|
logger.info("word存储完成");
|
||||||
}
|
}
|
||||||
String saveJsonFilePath=null;
|
|
||||||
String saveJsonFileName=null;
|
|
||||||
if(jsonFile!=null && !jsonFile.isEmpty()){
|
if(jsonFile!=null && !jsonFile.isEmpty()){
|
||||||
saveJsonFileName=UUIDUtils.randomUUID20()+"_"+jsonFile.getOriginalFilename().replace("/","_");
|
String jsonUrl = MinioUtil.upload(jsonFile, "/temp");
|
||||||
saveJsonFilePath=ocrFilePath+saveJsonFileName;
|
OSSFile ossFile = new OSSFile();
|
||||||
logger.info(saveJsonFilePath);
|
ossFile.setId(String.valueOf(SnowflakeUtils.snowflake()));
|
||||||
File saveJsonFile = new File(saveJsonFilePath);
|
ossFile.setFileName(jsonFile.getOriginalFilename());
|
||||||
System.out.println(saveJsonFile);
|
ossFile.setUrl(jsonUrl);
|
||||||
jsonFile.transferTo(saveJsonFile);
|
ossFileService.save(ossFile);
|
||||||
// FileUtils.copyInputStreamToFile(jsonFile.getInputStream(),new File(saveJsonFilePath));
|
jsonId = ossFile.getId();
|
||||||
// savePic(jsonFile.getInputStream(),saveJsonFilePath);
|
|
||||||
logger.info("Json存储完成");
|
logger.info("Json存储完成");
|
||||||
}
|
}
|
||||||
//开始将文件保存至数据库中
|
//开始将文件保存至数据库中
|
||||||
if(StringUtils.isNotEmpty(saveWordFilePath) && StringUtils.isNotEmpty(saveJsonFilePath)){
|
if(StringUtils.isNotBlank(wordId) && StringUtils.isNotBlank(jsonId)){
|
||||||
OcrRecordEO ocrRecordEO = new OcrRecordEO();
|
OcrRecordEO ocrRecordEO = new OcrRecordEO();
|
||||||
ocrRecordEO.setId(taskId);
|
ocrRecordEO.setId(taskId);
|
||||||
ocrRecordEO.setDocName(saveWordFilePath);
|
ocrRecordEO.setDocRealName(wordFile.getOriginalFilename());
|
||||||
ocrRecordEO.setJsonName(saveJsonFilePath);
|
|
||||||
ocrRecordEO.setDocRealName(saveWordFileName);
|
|
||||||
ocrRecordEO.setWordFileCode(null);
|
ocrRecordEO.setWordFileCode(null);
|
||||||
ocrRecordEO.setJsonRealName(saveJsonFileName);
|
ocrRecordEO.setJsonRealName(jsonFile.getOriginalFilename());
|
||||||
ocrRecordEO.setJsonFileCode(null);
|
ocrRecordEO.setJsonFileCode(null);
|
||||||
ocrRecordEO.setModifyTime(new Date());
|
ocrRecordEO.setModifyTime(new Date());
|
||||||
ocrRecordEO.setResultContent("转换成功");
|
ocrRecordEO.setResultContent("转换成功");
|
||||||
|
ocrRecordEO.setWordAttId(wordId);
|
||||||
|
ocrRecordEO.setJsonAttId(jsonId);
|
||||||
ocrRecordEOMapper.updateByPrimaryKeySelective(ocrRecordEO);
|
ocrRecordEOMapper.updateByPrimaryKeySelective(ocrRecordEO);
|
||||||
return "{\"result\":\"success\"}";
|
return "{\"result\":\"success\"}";
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
Reference in New Issue
Block a user