Browse Source

报销列表显示修改(OCR测试)

anderx 1 year ago
parent
commit
88ebcba5eb

+ 3 - 1
pom.xml

@@ -461,10 +461,12 @@
 			<version>0.2.15</version>
 			<scope>compile</scope>
 		</dependency>
+		<!--        orc智能识别-->
+		<!-- https://mvnrepository.com/artifact/net.sourceforge.tess4j/tess4j -->
 <!--		<dependency>-->
 <!--			<groupId>net.sourceforge.tess4j</groupId>-->
 <!--			<artifactId>tess4j</artifactId>-->
-<!--			<version>4.1.1</version>-->
+<!--			<version>5.8.0</version>-->
 <!--		</dependency>-->
 
 

+ 1 - 2
src/main/java/com/goafanti/common/controller/PublicController.java

@@ -994,8 +994,7 @@ public class PublicController extends CertifyApiController {
 
 
 //	/**
-//	 *
-//	 *
+//	 * OCR识别
 //	 */
 //	@PostMapping("/OCR")
 //	@ResponseBody

+ 5 - 4
src/main/java/com/goafanti/common/service/ImageService.java

@@ -1,6 +1,7 @@
 package com.goafanti.common.service;
 
 import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
 
 @Service
 public class ImageService {
@@ -9,8 +10,8 @@ public class ImageService {
     private static final String LANGUAGE = "chi_sim";
 
 
-//    public Object ImageOCR(MultipartFile file) {
-//        String result = null;
+    public Object ImageOCR(MultipartFile file) {
+        String result = null;
 //        try {
 //            byte[] bytes = file.getBytes();
 //            BufferedImage image = ImageIO.read(new ByteArrayInputStream(bytes));
@@ -24,6 +25,6 @@ public class ImageService {
 //        } catch (IOException | TesseractException e) {
 //            throw new RuntimeException(e);
 //        }
-//        return result;
-//    }
+        return result;
+    }
 }