|
|
|
@ -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, ""); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|