feature:对接发票用途接口

jianshui-ui
路明慧 9 months ago
parent b21551e455
commit 24fa1ab0bb
  1. 36
      jianshui-admin/src/main/java/com/jianshui/api/controller/http/invoice/v1/InvoiceController.java
  2. 2
      jianshui-common/src/main/java/com/jianshui/common/constant/Constants.java
  3. 20
      jianshui-invoice/src/main/java/com/jianshui/invoice/constant/elephant/ElephantConstantsV6.java
  4. 1
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/IInvoiceApiService.java
  5. 5
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/AisinoConsoleInvoiceApiServiceImpl.java
  6. 5
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/AisinoConsoleInvoiceApiZhongQiServiceImpl.java
  7. 5
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/ElephantInvoiceApiServiceImpl.java
  8. 5
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/ElephantInvoiceApiV6ByInspurServiceImpl.java
  9. 24
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/ElephantInvoiceApiV6ServiceImpl.java
  10. 5
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/JcskInvoiceApiServiceImpl.java

@ -2345,6 +2345,42 @@ 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/queryInvoiceUseInfo/{identity}", "/api/invoice/v1/queryInvoiceUseInfo", "/invoice/queryInvoiceUseInfo"})
public Object queryInvoiceUseInfo(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.queryInvoiceUseInfo(decryptResult, companyservice);
// String responseAdapterKey = serviceManageService.getResponseAdapterKey("invoice", companyservice.getCompanyid());
// IInvoiceResponseService invoiceResponseService = invoiceResponseFactory.getService(responseAdapterKey);
//
// return invoiceResponseService.response(result, companyservice, "");
return result;
}
}

@ -164,6 +164,8 @@ public class Constants {
public static final int INT_0 = 0;
public static final int INT_1 = 1;
public static final String JSONObject = "JSONObject";
public static final String JSONArray = "JSONArray";

@ -1,5 +1,21 @@
package com.jianshui.invoice.constant.elephant;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.dxhy.order.protocol.httprequest.ResponseWrapper;
import com.dxhy.order.protocol.invoke.DxhyInterfaceResponse;
import com.dxhy.order.utils.InterfaceUtil;
import com.jianshui.common.constant.Constants;
import com.jianshui.common.utils.JsonKeyCase;
import com.jianshui.common.utils.StringUtils;
import com.jianshui.common.utils.http.HttpUtils;
import com.jianshui.invoice.domain.dto.HXResponse;
import org.apache.commons.lang3.ObjectUtils;
/**
* @Description 大象常量
* @Author 巩权林
@ -163,4 +179,8 @@ public class ElephantConstantsV6 {
*/
public static String SIGN = "eseal/v1/sign";
// 数电-红字确认单确认
public static String INVOICE_USE_INFO_LOCALHOST = "/invoice/api/v6/QueryInvoiceUseInfo";
public static String INVOICE_USE_INFO_METHOD = "QueryInvoiceUseInfo";
}

@ -378,4 +378,5 @@ public interface IInvoiceApiService {
HXResponse findReadInfoByHzqrdbh(BillInfo billInfo, Companyservice companyservice);
HXResponse queryInvoiceUseInfo(JSONObject decryptResult, Companyservice companyservice);
}

@ -1097,6 +1097,11 @@ public class AisinoConsoleInvoiceApiServiceImpl implements IInvoiceApiService {
return null;
}
@Override
public HXResponse queryInvoiceUseInfo(JSONObject decryptResult, Companyservice companyservice) {
return null;
}
@Override
public AjaxResult syncStockInfo(Companyservice companyservice) {

@ -580,6 +580,11 @@ public class AisinoConsoleInvoiceApiZhongQiServiceImpl implements IInvoiceApiSer
return null;
}
@Override
public HXResponse queryInvoiceUseInfo(JSONObject decryptResult, Companyservice companyservice) {
return null;
}
/**
* 开票接口回调-重汽

@ -925,6 +925,11 @@ public class ElephantInvoiceApiServiceImpl implements IInvoiceApiService {
return null;
}
@Override
public HXResponse queryInvoiceUseInfo(JSONObject decryptResult, Companyservice companyservice) {
return null;
}
/**
* 申请/上传 红字发票

@ -1205,6 +1205,11 @@ public class ElephantInvoiceApiV6ByInspurServiceImpl implements IInvoiceApiServi
return null;
}
@Override
public HXResponse queryInvoiceUseInfo(JSONObject decryptResult, Companyservice companyservice) {
return null;
}
/**
* 红字确认单列表查询数电专用

@ -1508,6 +1508,28 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService {
return response;
}
@Override
public HXResponse queryInvoiceUseInfo(JSONObject decryptResult, Companyservice companyservice) {
decryptResult = JsonKeyCase.JsonKeyCase(decryptResult);
log.info("调用大象V6接口报文key转大写后的报文为{}", decryptResult);
DxhyInterfaceResponse dxhyInterfaceResponse = null;
try {
dxhyInterfaceResponse = ElephantUtils.sendRequestWithoutTokenV6(ElephantConstantsV6.INVOICE_USE_INFO_LOCALHOST, ElephantConstantsV6.INVOICE_USE_INFO_METHOD, JSONUtil.parse(decryptResult), companyservice);
} catch (UnsupportedEncodingException | InvalidKeyException | NoSuchAlgorithmException e) {
log.error("【销项发票】【大象接口】【数电】【红字确认单确认接口】发票请求异常,请求报文{},销方信息{}", decryptResult, JSONObject.toJSONString(companyservice));
e.printStackTrace();
return new HXResponse("009999", "系统异常!");
}
HXResponse hxResponse = parseResult(dxhyInterfaceResponse);
if (hxResponse.isSuccess() && ObjectUtils.isNotEmpty(hxResponse.getData()) && StringUtils.isNotBlank(hxResponse.getData().toString())){
JSONObject jsonObject = JSON.parseObject(hxResponse.getData().toString());
hxResponse.setData(JsonKeyCase.JsonKeyCase(jsonObject, Constants.INT_1));
}
return hxResponse;
}
/**
* 简税和金财数科 发票类型互换
@ -1732,7 +1754,7 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService {
* @param dxhyInterfaceResponse
* @return
*/
public HXResponse parseResult(DxhyInterfaceResponse dxhyInterfaceResponse) {
public HXResponse parseResult(DxhyInterfaceResponse dxhyInterfaceResponse) {
if (BeanUtil.isEmpty(dxhyInterfaceResponse)) {
return new HXResponse("9999", "接口请求失败!返回内容不存在!", "", false);

@ -1732,6 +1732,11 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
return null;
}
@Override
public HXResponse queryInvoiceUseInfo(JSONObject decryptResult, Companyservice companyservice) {
return null;
}
/**
* 简税和金财数科 发票类型互换
*

Loading…
Cancel
Save