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 78ae924..760e99b 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 @@ -1565,6 +1565,140 @@ 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/rpaLogin/{identity}", "/api/invoice/v1/rpaLogin"}) + public Object rpaLogin(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.rpaLogin(decryptResult, companyservice); + + String responseAdapterKey = serviceManageService.getResponseAdapterKey("invoice", companyservice.getCompanyid()); + IInvoiceResponseService invoiceResponseService = invoiceResponseFactory.getService(responseAdapterKey); + + return invoiceResponseService.response(result, companyservice, ""); + + } + + + /** 数电获取实名认证二维码接口(数电专用接口) */ + @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/getRpaQrCode/{identity}", "/api/invoice/v1/getRpaQrCode"}) + public Object getRpaQrCode(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.getRpaQrCode(decryptResult, companyservice); + + String responseAdapterKey = serviceManageService.getResponseAdapterKey("invoice", companyservice.getCompanyid()); + IInvoiceResponseService invoiceResponseService = invoiceResponseFactory.getService(responseAdapterKey); + + return invoiceResponseService.response(result, companyservice, ""); + + } + + + /** 数电实名认证状态查询接口(数电专用接口) */ + @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/getRpaAuthStatus/{identity}", "/api/invoice/v1/getRpaAuthStatus"}) + public Object getRpaAuthStatus(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.getRpaAuthStatus(decryptResult, companyservice); + + String responseAdapterKey = serviceManageService.getResponseAdapterKey("invoice", companyservice.getCompanyid()); + IInvoiceResponseService invoiceResponseService = invoiceResponseFactory.getService(responseAdapterKey); + + return invoiceResponseService.response(result, companyservice, ""); + + } + + + /** 发票平台电子税局账号查询接口(数电专用接口) */ + @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/getRpaAuthStatus/{identity}", "/api/invoice/v1/getRpaAuthStatus"}) + public Object queryRpaTaxAccount(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.queryRpaTaxAccount(decryptResult, companyservice); + + String responseAdapterKey = serviceManageService.getResponseAdapterKey("invoice", companyservice.getCompanyid()); + IInvoiceResponseService invoiceResponseService = invoiceResponseFactory.getService(responseAdapterKey); + + return invoiceResponseService.response(result, companyservice, ""); + + } + + + + diff --git a/jianshui-invoice/src/main/java/com/jianshui/invoice/constant/elephant/ElephantConstantsV6.java b/jianshui-invoice/src/main/java/com/jianshui/invoice/constant/elephant/ElephantConstantsV6.java index d45cea5..d740784 100644 --- a/jianshui-invoice/src/main/java/com/jianshui/invoice/constant/elephant/ElephantConstantsV6.java +++ b/jianshui-invoice/src/main/java/com/jianshui/invoice/constant/elephant/ElephantConstantsV6.java @@ -77,6 +77,21 @@ public class ElephantConstantsV6 { public static String RED_CONFIRMATION_CONFIRM_LOCALHOST = "/invoice/api/v6/RedConfirmationConfirm"; public static String RED_CONFIRMATION_CONFIRM_METHOD = "RedConfirmationConfirm"; + // 数电-数电登录接口 + public static String RPA_LOGIN_LOCALHOST = "/invoice/api/v6/RpaLogin"; + public static String RPA_LOGIN_METHOD = "RpaLogin"; + +// 数电-数电获取实名认证二维码接口(数电专用接口) + public static String GET_RPA_QY_CODE_LOCALHOST = "/invoice/api/v6/GetRpaQrCode"; + public static String GET_RPA_QY_CODE_METHOD = "GetRpaQrCode"; + + // 数电-数电实名认证状态查询接口(数电专用接口) + public static String GET_RPA_AUTH_STATUS_LOCALHOST = "/invoice/api/v6/GetRpaAuthStatus"; + public static String GET_RPA_AUTH_STATUS_METHOD = "GetRpaAuthStatus"; + + // 数电-发票平台电子税局账号查询接口(数电专用接口) + public static String QUERY_RPA_TAX_ACCOUNT_LOCALHOST = "/invoice/api/v6/QueryRpaTaxAccount"; + public static String QUERY_RPA_TAX_ACCOUNT_METHOD = "QueryRpaTaxAccount"; diff --git a/jianshui-invoice/src/main/java/com/jianshui/invoice/service/IInvoiceApiService.java b/jianshui-invoice/src/main/java/com/jianshui/invoice/service/IInvoiceApiService.java index 768beff..dc9392e 100644 --- a/jianshui-invoice/src/main/java/com/jianshui/invoice/service/IInvoiceApiService.java +++ b/jianshui-invoice/src/main/java/com/jianshui/invoice/service/IInvoiceApiService.java @@ -90,6 +90,41 @@ public interface IInvoiceApiService { */ HXResponse redConfirmationConfirm(JSONObject decryptResult, Companyservice companyservice); + /** + * 数电登录接口(数电专用接口) + * @param decryptResult + * @param companyservice + * @return + */ + HXResponse rpaLogin(JSONObject decryptResult, Companyservice companyservice); + + /** + * 数电获取实名认证二维码接口(数电专用接口) + * @param decryptResult + * @param companyservice + * @return + */ + HXResponse getRpaQrCode(JSONObject decryptResult, Companyservice companyservice); + + + /** + * 数电实名认证状态查询接口(数电专用接口) + * @param decryptResult + * @param companyservice + * @return + */ + HXResponse getRpaAuthStatus(JSONObject decryptResult, Companyservice companyservice); + + /** + * 发票平台电子税局账号查询接口(数电专用接口) + * @param decryptResult + * @param companyservice + * @return + */ + HXResponse queryRpaTaxAccount(JSONObject decryptResult, Companyservice companyservice); + + + /** * 申请/上传 红字发票 * diff --git a/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/AisinoConsoleInvoiceApiServiceImpl.java b/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/AisinoConsoleInvoiceApiServiceImpl.java index 78616fd..3b93a60 100644 --- a/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/AisinoConsoleInvoiceApiServiceImpl.java +++ b/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/AisinoConsoleInvoiceApiServiceImpl.java @@ -533,6 +533,26 @@ public class AisinoConsoleInvoiceApiServiceImpl implements IInvoiceApiService { return null; } + @Override + public HXResponse rpaLogin(JSONObject decryptResult, Companyservice companyservice) { + return null; + } + + @Override + public HXResponse getRpaQrCode(JSONObject decryptResult, Companyservice companyservice) { + return null; + } + + @Override + public HXResponse getRpaAuthStatus(JSONObject decryptResult, Companyservice companyservice) { + return null; + } + + @Override + public HXResponse queryRpaTaxAccount(JSONObject decryptResult, Companyservice companyservice) { + return null; + } + /** 红字信息表上传*/ @Override public HXResponse uploadRedInfo(Redinfo redinfo, Companyservice companyservice) { diff --git a/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/ElephantInvoiceApiServiceImpl.java b/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/ElephantInvoiceApiServiceImpl.java index ec30486..fe88727 100644 --- a/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/ElephantInvoiceApiServiceImpl.java +++ b/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/ElephantInvoiceApiServiceImpl.java @@ -768,6 +768,26 @@ public class ElephantInvoiceApiServiceImpl implements IInvoiceApiService { return null; } + @Override + public HXResponse rpaLogin(JSONObject decryptResult, Companyservice companyservice) { + return null; + } + + @Override + public HXResponse getRpaQrCode(JSONObject decryptResult, Companyservice companyservice) { + return null; + } + + @Override + public HXResponse getRpaAuthStatus(JSONObject decryptResult, Companyservice companyservice) { + return null; + } + + @Override + public HXResponse queryRpaTaxAccount(JSONObject decryptResult, Companyservice companyservice) { + return null; + } + /** * 功能描述: 红字信息查询 * diff --git a/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/ElephantInvoiceApiV6ServiceImpl.java b/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/ElephantInvoiceApiV6ServiceImpl.java index ab07884..f5df871 100644 --- a/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/ElephantInvoiceApiV6ServiceImpl.java +++ b/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/ElephantInvoiceApiV6ServiceImpl.java @@ -836,7 +836,7 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { public HXResponse redConfirmationConfirm(JSONObject decryptResult, Companyservice companyservice) { DxhyInterfaceResponse dxhyInterfaceResponse = null; try { - dxhyInterfaceResponse = ElephantUtils.sendRequestWithoutTokenV6(ElephantConstantsV6.RED_CONFIRMATION_LOCALHOST, ElephantConstantsV6.RED_CONFIRMATION_METHOD, JSONUtil.parse(decryptResult), companyservice); + dxhyInterfaceResponse = ElephantUtils.sendRequestWithoutTokenV6(ElephantConstantsV6.RED_CONFIRMATION_CONFIRM_LOCALHOST, ElephantConstantsV6.RED_CONFIRMATION_CONFIRM_METHOD, JSONUtil.parse(decryptResult), companyservice); } catch (UnsupportedEncodingException | InvalidKeyException | NoSuchAlgorithmException e) { log.error("【销项发票】【大象接口】【数电】【红字确认单确认接口】发票请求异常,请求报文{},销方信息{}", decryptResult, JSONObject.toJSONString(companyservice)); e.printStackTrace(); @@ -846,6 +846,87 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { return parseResult(dxhyInterfaceResponse); } + /** + * 数电登录接口(数电专用接口) + * @param decryptResult + * @param companyservice + * @return + */ + @Override + public HXResponse rpaLogin(JSONObject decryptResult, Companyservice companyservice) { + DxhyInterfaceResponse dxhyInterfaceResponse = null; + try { + dxhyInterfaceResponse = ElephantUtils.sendRequestWithoutTokenV6(ElephantConstantsV6.RPA_LOGIN_LOCALHOST, ElephantConstantsV6.RPA_LOGIN_METHOD, JSONUtil.parse(decryptResult), companyservice); + } catch (UnsupportedEncodingException | InvalidKeyException | NoSuchAlgorithmException e) { + log.error("【销项发票】【大象接口】【数电】【数电登录接口】请求异常,请求报文{},销方信息{}", decryptResult, JSONObject.toJSONString(companyservice)); + e.printStackTrace(); + return new HXResponse("009999", "系统异常!"); + } + + return parseResult(dxhyInterfaceResponse); + } + + /** + * 数电获取实名认证二维码接口(数电专用接口) + * @param decryptResult + * @param companyservice + * @return + */ + @Override + public HXResponse getRpaQrCode(JSONObject decryptResult, Companyservice companyservice) { + DxhyInterfaceResponse dxhyInterfaceResponse = null; + try { + dxhyInterfaceResponse = ElephantUtils.sendRequestWithoutTokenV6(ElephantConstantsV6.GET_RPA_QY_CODE_LOCALHOST, ElephantConstantsV6.GET_RPA_QY_CODE_METHOD, JSONUtil.parse(decryptResult), companyservice); + } catch (UnsupportedEncodingException | InvalidKeyException | NoSuchAlgorithmException e) { + log.error("【销项发票】【大象接口】【数电】【数电获取实名认证二维码接口】请求异常,请求报文{},销方信息{}", decryptResult, JSONObject.toJSONString(companyservice)); + e.printStackTrace(); + return new HXResponse("009999", "系统异常!"); + } + + return parseResult(dxhyInterfaceResponse); + } + + + /** + * 数电实名认证状态查询接口(数电专用接口) + * @param decryptResult + * @param companyservice + * @return + */ + @Override + public HXResponse getRpaAuthStatus(JSONObject decryptResult, Companyservice companyservice) { + DxhyInterfaceResponse dxhyInterfaceResponse = null; + try { + dxhyInterfaceResponse = ElephantUtils.sendRequestWithoutTokenV6(ElephantConstantsV6.GET_RPA_AUTH_STATUS_LOCALHOST, ElephantConstantsV6.GET_RPA_AUTH_STATUS_METHOD, JSONUtil.parse(decryptResult), companyservice); + } catch (UnsupportedEncodingException | InvalidKeyException | NoSuchAlgorithmException e) { + log.error("【销项发票】【大象接口】【数电】【数电实名认证状态查询接口】请求异常,请求报文{},销方信息{}", decryptResult, JSONObject.toJSONString(companyservice)); + e.printStackTrace(); + return new HXResponse("009999", "系统异常!"); + } + + return parseResult(dxhyInterfaceResponse); + } + + /** + * 发票平台电子税局账号查询接口(数电专用接口) + * @param decryptResult + * @param companyservice + * @return + */ + @Override + public HXResponse queryRpaTaxAccount(JSONObject decryptResult, Companyservice companyservice) { + DxhyInterfaceResponse dxhyInterfaceResponse = null; + try { + dxhyInterfaceResponse = ElephantUtils.sendRequestWithoutTokenV6(ElephantConstantsV6.QUERY_RPA_TAX_ACCOUNT_LOCALHOST, ElephantConstantsV6.QUERY_RPA_TAX_ACCOUNT_METHOD, JSONUtil.parse(decryptResult), companyservice); + } catch (UnsupportedEncodingException | InvalidKeyException | NoSuchAlgorithmException e) { + log.error("【销项发票】【大象接口】【数电】【发票平台电子税局账号查询接口】请求异常,请求报文{},销方信息{}", decryptResult, JSONObject.toJSONString(companyservice)); + e.printStackTrace(); + return new HXResponse("009999", "系统异常!"); + } + + return parseResult(dxhyInterfaceResponse); + } + /** * 大象通用返回处理 diff --git a/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/JcskInvoiceApiServiceImpl.java b/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/JcskInvoiceApiServiceImpl.java index f160d01..cd34c0b 100644 --- a/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/JcskInvoiceApiServiceImpl.java +++ b/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/JcskInvoiceApiServiceImpl.java @@ -379,6 +379,26 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { return null; } + @Override + public HXResponse rpaLogin(JSONObject decryptResult, Companyservice companyservice) { + return null; + } + + @Override + public HXResponse getRpaQrCode(JSONObject decryptResult, Companyservice companyservice) { + return null; + } + + @Override + public HXResponse getRpaAuthStatus(JSONObject decryptResult, Companyservice companyservice) { + return null; + } + + @Override + public HXResponse queryRpaTaxAccount(JSONObject decryptResult, Companyservice companyservice) { + return null; + } + /** * 红字信息表上传 */