From 78c1f87d61d1411356a422ab841afde67342d228 Mon Sep 17 00:00:00 2001
From: wangwh <2397901735@qq.com>
Date: Wed, 04 Sep 2024 20:52:15 +0800
Subject: [PATCH] 1、事项登记、详情查询接口 2、ocr识别文字接口 3、办理流转-查询下属人员、选择经办人、获取工作人员信息、添加办理反馈、获取办理反馈信息、修改办理反馈信息 4、督办-添加督办、回复督办、查询督办列表 5、查询评价
---
dyh-service/dyh-sys/src/main/java/cn/huge/module/file/controller/web/FileInfoWebController.java | 28 +++++++++++++++++++++++++++-
1 files changed, 27 insertions(+), 1 deletions(-)
diff --git a/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/controller/web/FileInfoWebController.java b/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/controller/web/FileInfoWebController.java
index 463a767..a093e16 100644
--- a/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/controller/web/FileInfoWebController.java
+++ b/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/controller/web/FileInfoWebController.java
@@ -1,7 +1,6 @@
package cn.huge.module.file.controller.web;
import cn.huge.base.common.exception.ClientException;
-import cn.huge.module.sys.dto.IdcardOcrResultDTO;
import cn.huge.module.utils.BaiduOcrUtils;
import cn.huge.base.common.utils.ContentTypeUtils;
import cn.huge.base.common.utils.ReturnFailUtils;
@@ -185,6 +184,33 @@
}
/**
+ * ocr识别文字
+ * @url {ctx}/api/web/fileInfo/recognitionText?ownerId=&ownerType=
+ * @param request
+ * @return Object
+ */
+ @PostMapping(value = "/recognitionText")
+ public Object recognitionText(MultipartHttpServletRequest request){
+ try{
+ Map<String , Object> result = Maps.newHashMap();
+ Iterator<String> itr = request.getFileNames();
+ while (itr.hasNext()) {
+ MultipartFile file = request.getFile(itr.next());
+ try{
+ Map<String , Object> map = BaiduOcrUtils.ocrText(file.getBytes());
+ result.put("ocrResult", map);
+ }catch (Exception e){
+ log.error("Controller接口[FileInfoController.recognitionText]请求异常:"+e, e);
+ return ReturnFailUtils.getRepInfo("OCR失败!");
+ }
+ }
+ return ReturnSucUtils.getRepInfo("识别成功", result);
+ }catch (Exception e){
+ return ReturnFailUtils.getRepInfo(e.getMessage());
+ }
+ }
+
+ /**
* 查看附件组件-分类查询附件
* @url {ctx}/api/web/fileInfo/listFileByCat
* @param mainId 所属业务主体编号
--
Gitblit v1.8.0