diff --git a/dxhy-core/src/main/java/com/dxhy/core/controller/OpenServicePlatformController.java b/dxhy-core/src/main/java/com/dxhy/core/controller/OpenServicePlatformController.java index 7df80e53..93e500ed 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/controller/OpenServicePlatformController.java +++ b/dxhy-core/src/main/java/com/dxhy/core/controller/OpenServicePlatformController.java @@ -45,4 +45,15 @@ public class OpenServicePlatformController { } } + + @PostMapping("/getInvoiceSnOcrResult") + public List getInvoiceSnOcrResult(@RequestBody Map params) { + try { + String picture = params.get("picture"); + return openServicePlatformService.ocrInvoice(picture); + } catch (Exception e) { + log.error("调用开放平台OCR接口失败,", e); + return null; + } + } } diff --git a/dxhy-core/src/main/java/com/dxhy/core/service/openservice/IOpenServicePlatformService.java b/dxhy-core/src/main/java/com/dxhy/core/service/openservice/IOpenServicePlatformService.java index 7b63feb2..b594817d 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/service/openservice/IOpenServicePlatformService.java +++ b/dxhy-core/src/main/java/com/dxhy/core/service/openservice/IOpenServicePlatformService.java @@ -35,4 +35,5 @@ public interface IOpenServicePlatformService { List getCustomsOcrResult(String uuid, String picture) throws OpenServiceInvokeException; List ocrInvoice(String picture, String userName, String password, String taxno); + List ocrInvoice(String picture); } diff --git a/dxhy-core/src/main/java/com/dxhy/core/service/openservice/impl/OpenServicePlatformServiceImpl.java b/dxhy-core/src/main/java/com/dxhy/core/service/openservice/impl/OpenServicePlatformServiceImpl.java index e64e1122..9cba6c39 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/service/openservice/impl/OpenServicePlatformServiceImpl.java +++ b/dxhy-core/src/main/java/com/dxhy/core/service/openservice/impl/OpenServicePlatformServiceImpl.java @@ -195,6 +195,11 @@ public class OpenServicePlatformServiceImpl implements IOpenServicePlatformServi // return JSONObject.parseArray(decodeStr, OpenServiceOcr.class); } + + @Override + public List ocrInvoice(String picture) { + return OcrToSn(picture); + } /** * Ocr识别使用山能 * @param picture 文件流