feature 1.增加OCR识别接口

release
zhenghaiyang@ele-cloud.com 2 years ago
parent aa01a218cd
commit 3ab4cc480a
  1. 11
      dxhy-core/src/main/java/com/dxhy/core/controller/OpenServicePlatformController.java
  2. 1
      dxhy-core/src/main/java/com/dxhy/core/service/openservice/IOpenServicePlatformService.java
  3. 5
      dxhy-core/src/main/java/com/dxhy/core/service/openservice/impl/OpenServicePlatformServiceImpl.java

@ -45,4 +45,15 @@ public class OpenServicePlatformController {
} }
} }
@PostMapping("/getInvoiceSnOcrResult")
public List<OpenServiceOcr> getInvoiceSnOcrResult(@RequestBody Map<String, String> params) {
try {
String picture = params.get("picture");
return openServicePlatformService.ocrInvoice(picture);
} catch (Exception e) {
log.error("调用开放平台OCR接口失败,", e);
return null;
}
}
} }

@ -35,4 +35,5 @@ public interface IOpenServicePlatformService {
List<OpenServiceOcr> getCustomsOcrResult(String uuid, String picture) throws OpenServiceInvokeException; List<OpenServiceOcr> getCustomsOcrResult(String uuid, String picture) throws OpenServiceInvokeException;
List<OpenServiceOcr> ocrInvoice(String picture, String userName, String password, String taxno); List<OpenServiceOcr> ocrInvoice(String picture, String userName, String password, String taxno);
List<OpenServiceOcr> ocrInvoice(String picture);
} }

@ -195,6 +195,11 @@ public class OpenServicePlatformServiceImpl implements IOpenServicePlatformServi
// return JSONObject.parseArray(decodeStr, OpenServiceOcr.class); // return JSONObject.parseArray(decodeStr, OpenServiceOcr.class);
} }
@Override
public List<OpenServiceOcr> ocrInvoice(String picture) {
return OcrToSn(picture);
}
/** /**
* Ocr识别使用山能 * Ocr识别使用山能
* @param picture 文件流 * @param picture 文件流

Loading…
Cancel
Save