|
|
|
@ -1,5 +1,6 @@ |
|
|
|
|
package cn.iocoder.yudao.server.service; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.io.FileUtil; |
|
|
|
|
import cn.hutool.http.HttpRequest; |
|
|
|
|
import cn.hutool.http.HttpResponse; |
|
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
|
@ -23,15 +24,13 @@ public class OcrProcessingService { |
|
|
|
|
private VehicleLicenseService vehicleLicenseService; |
|
|
|
|
@Autowired |
|
|
|
|
private UnifiedSocialCreditService unifiedSocialCreditService; |
|
|
|
|
@Autowired |
|
|
|
|
private SpeicalCertificateService speicalCertificateService; |
|
|
|
|
|
|
|
|
|
public OcrResVO process(String filePath) { |
|
|
|
|
// 调用第三方OCR服务
|
|
|
|
|
ThirdPartyOcrResult ocrResult = callOcrService(filePath); |
|
|
|
|
ThirdPartyOcrResult ocrResult = callOcrService(FileUtil.getName(filePath)); |
|
|
|
|
// 解析OCR结果
|
|
|
|
|
return parseOcrResults(ocrResult); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private ThirdPartyOcrResult callOcrService(String filePath) { |
|
|
|
|
// 1. 创建JSON请求体
|
|
|
|
|
Map<String, Object> requestBody = new HashMap<>(); |
|
|
|
|