From a5a79dab159308031be35b91f44facd10ae50053 Mon Sep 17 00:00:00 2001 From: kk <1910333201@qq.com> Date: Fri, 26 Jan 2024 17:55:14 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20=E4=B8=8D=E5=8A=A8=E4=BA=A7=E9=94=80?= =?UTF-8?q?=E5=94=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../http/invoice/v1/InvoiceController.java | 39 ++++++++++++++++++- .../framework/config/SecurityConfig.java | 1 + .../dto/api/elephant/addInvoice/Bdcxsxx.java | 5 +++ 3 files changed, 43 insertions(+), 2 deletions(-) diff --git a/jianshui-admin/src/main/java/com/jianshui/api/controller/http/invoice/v1/InvoiceController.java b/jianshui-admin/src/main/java/com/jianshui/api/controller/http/invoice/v1/InvoiceController.java index 2d9294c..75937d7 100644 --- a/jianshui-admin/src/main/java/com/jianshui/api/controller/http/invoice/v1/InvoiceController.java +++ b/jianshui-admin/src/main/java/com/jianshui/api/controller/http/invoice/v1/InvoiceController.java @@ -2076,6 +2076,43 @@ public class InvoiceController { } + /** + * 数电获取发票文件接口(数电专用接口-德才定制) + */ + @ApiImplicitParams({ + @ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), + @ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) + @PostMapping({"/api/invoice/v1/QuerySdInvoiceFileDownload/{identity}", "/api/invoice/v1/QuerySdInvoiceFileDownload", "/invoice/QuerySdInvoiceFileDownload"}) + public Object QuerySdInvoiceFileDownload(HttpServletRequest request, String identity) throws Exception { + + if (StringUtils.isEmpty(identity)) { + return AjaxResult.error(ErrorCode.EMPTY_IDENTITY); + } + + Companyservice companyservice = iCompanyserviceService.selectCompanyserviceByIdentity(identity); + if (companyservice == null) { + return AjaxResult.error(ErrorCode.COMPANY_NOT_FOUND); + } + + // 获得入口报文适配器 + String requestAdapterKey = serviceManageService.getRequestAdapterKey("invoice", companyservice.getCompanyid()); + IInvoiceRequestService invoiceRequestService = invoiceRequestFactory.getService(requestAdapterKey); + JSONObject decryptResult = invoiceRequestService.decrypt(request, companyservice, ""); + + // 获得请求实例,并且进行扣费 + String serviceKey = serviceManageService.getCompanyServiceSupplier("invoice", companyservice.getCompanyid()); + serviceManageService.companyConsume("invoice", companyservice.getCompanyid()); + + IInvoiceApiService invoiceService = invoiceServiceFactory.getService(serviceKey); + HXResponse result = invoiceService.QuerySdInvoiceFile(decryptResult, companyservice); + + String responseAdapterKey = serviceManageService.getResponseAdapterKey("invoice", companyservice.getCompanyid()); + IInvoiceResponseService invoiceResponseService = invoiceResponseFactory.getService(responseAdapterKey); + + return invoiceResponseService.response(result, companyservice, ""); + + } + /** * 发票预览 @@ -2095,9 +2132,7 @@ public class InvoiceController { return "未查询到发票信息"; } - String fileName = invoiceFile.getFileName(); String content = invoiceFile.getFileContent(); - String co = convertPdfBase64ToImageBase64(content); return "data:image/jpeg;base64,"+co; diff --git a/jianshui-framework/src/main/java/com/jianshui/framework/config/SecurityConfig.java b/jianshui-framework/src/main/java/com/jianshui/framework/config/SecurityConfig.java index 21e3d65..5865caa 100644 --- a/jianshui-framework/src/main/java/com/jianshui/framework/config/SecurityConfig.java +++ b/jianshui-framework/src/main/java/com/jianshui/framework/config/SecurityConfig.java @@ -131,6 +131,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { "/invoice/qrcodeResult", "/invoice/mailDelivery", "/invoice/QuerySdInvoiceFile", + "/invoice/QuerySdInvoiceFileDownload", "/invoice/QueryFastRedInvoiceResult", "/invoice/fastRedInvoice" ) diff --git a/jianshui-invoice/src/main/java/com/jianshui/invoice/domain/dto/api/elephant/addInvoice/Bdcxsxx.java b/jianshui-invoice/src/main/java/com/jianshui/invoice/domain/dto/api/elephant/addInvoice/Bdcxsxx.java index 555aed2..1b2f816 100644 --- a/jianshui-invoice/src/main/java/com/jianshui/invoice/domain/dto/api/elephant/addInvoice/Bdcxsxx.java +++ b/jianshui-invoice/src/main/java/com/jianshui/invoice/domain/dto/api/elephant/addInvoice/Bdcxsxx.java @@ -13,9 +13,14 @@ public class Bdcxsxx { private String KDSBZ; // 跨地(市)标志 + private String BDCDZ; // 不动产地址 + private String CQZSH; // 房屋产权证书号/不动产权证号 private String MJDW; // 面积单位 private String ZLQQZ; // 租赁期起止 + private String SJCJHSJE; // 实际成交含税金额 + private String HDJSJG; // 核定计税价格 + private String TDZZSXMBH; // 土地增值税项目编号 }