数电接口转发

beta-enc
kk 2 years ago
parent 4d58fa5a39
commit d6c8b3e180
  1. 134
      jianshui-admin/src/main/java/com/jianshui/api/controller/http/invoice/v1/InvoiceController.java
  2. 15
      jianshui-invoice/src/main/java/com/jianshui/invoice/constant/elephant/ElephantConstantsV6.java
  3. 35
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/IInvoiceApiService.java
  4. 20
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/AisinoConsoleInvoiceApiServiceImpl.java
  5. 20
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/ElephantInvoiceApiServiceImpl.java
  6. 83
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/ElephantInvoiceApiV6ServiceImpl.java
  7. 20
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/JcskInvoiceApiServiceImpl.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, "");
}

@ -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";

@ -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);
/**
* 申请/上传 红字发票
*

@ -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) {

@ -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;
}
/**
* 功能描述: 红字信息查询
*

@ -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);
}
/**
* 大象通用返回处理

@ -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;
}
/**
* 红字信息表上传
*/

Loading…
Cancel
Save