|
|
|
@ -3,6 +3,10 @@ package com.jianshui.api.controller.http.invoice.v1; |
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.dxhy.order.protocol.invoke.DxhyInterfaceResponse; |
|
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException; |
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
|
|
import com.google.gson.Gson; |
|
|
|
|
import com.jianshui.common.core.domain.AjaxResult; |
|
|
|
|
import com.jianshui.common.core.domain.entity.Companyservice; |
|
|
|
|
import com.jianshui.common.enums.ErrorCode; |
|
|
|
@ -13,6 +17,10 @@ import com.jianshui.common.utils.http.HttpHelper; |
|
|
|
|
import com.jianshui.invoice.constant.elephant.ElephantConstants; |
|
|
|
|
import com.jianshui.invoice.domain.BillInfo; |
|
|
|
|
import com.jianshui.invoice.domain.FindRedInfo; |
|
|
|
|
import com.jianshui.invoice.domain.ele.EleNewMessage; |
|
|
|
|
import com.jianshui.invoice.domain.ele.EleOuterMessage; |
|
|
|
|
import com.jianshui.invoice.domain.ele.FindRedInfoDTO; |
|
|
|
|
import com.jianshui.invoice.domain.ele.HZSQDMessage; |
|
|
|
|
import com.jianshui.invoice.utils.elephant.ElephantUtils; |
|
|
|
|
import com.jianshui.platform.dto.InvoiceAdd.BillInfoPDTO; |
|
|
|
|
import com.jianshui.invoice.domain.Redinfo; |
|
|
|
@ -38,6 +46,7 @@ import javax.servlet.http.HttpServletRequest; |
|
|
|
|
import java.io.UnsupportedEncodingException; |
|
|
|
|
import java.security.InvalidKeyException; |
|
|
|
|
import java.security.NoSuchAlgorithmException; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @Description |
|
|
|
@ -69,53 +78,91 @@ public class InvoiceController { |
|
|
|
|
private InvoiceAddPService addService; |
|
|
|
|
|
|
|
|
|
@GetMapping("/api/v1/test") |
|
|
|
|
public Object test(){ |
|
|
|
|
public EleNewMessage test() { |
|
|
|
|
Companyservice companyservice = new Companyservice(); |
|
|
|
|
FindRedInfo findRedInfo = new FindRedInfo(); |
|
|
|
|
findRedInfo.setSQBQQPCH("127021937706230911155203"); |
|
|
|
|
findRedInfo.setNSRSBH("91370921MACWQ1520M"); |
|
|
|
|
AjaxResult queryResult = null; |
|
|
|
|
DxhyInterfaceResponse dxhyInterfaceResponse = null; |
|
|
|
|
try { |
|
|
|
|
queryResult = ElephantUtils.sendRequestWithoutTokenV6(ElephantConstants.REDINFO_FIND_LOCALHOST, ElephantConstants.REDINFO_FIND_METHOD, JSONUtil.parse(findRedInfo), companyservice); |
|
|
|
|
dxhyInterfaceResponse = ElephantUtils.sendRequestWithoutTokenV6(ElephantConstants.REDINFO_FIND_LOCALHOST, |
|
|
|
|
ElephantConstants.REDINFO_FIND_METHOD, JSONUtil.parse(findRedInfo), companyservice); |
|
|
|
|
} catch (UnsupportedEncodingException | InvalidKeyException | NoSuchAlgorithmException e) { |
|
|
|
|
log.error("【销项发票】【大象接口】【红字信息表查询】发票请求异常,请求报文{},销方信息{}", JSONUtil.parse(findRedInfo).toString(), JSONObject.toJSONString(companyservice)); |
|
|
|
|
log.error("【销项发票】【大象接口】【红字信息表查询】发票请求异常,请求报文{},销方信息{}", |
|
|
|
|
JSONUtil.parse(findRedInfo).toString(), JSONObject.toJSONString(companyservice)); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
throw new JianshuiServiceException("系统异常!"); |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
String data = dxhyInterfaceResponse.getData(); |
|
|
|
|
cn.hutool.json.JSONObject dataStr = new cn.hutool.json.JSONObject(data); |
|
|
|
|
if ("000000".equals(dataStr.getStr("ZTDM"))) { |
|
|
|
|
Gson gson = new Gson(); |
|
|
|
|
EleOuterMessage eleOuterMessage = gson.fromJson(data, EleOuterMessage.class); |
|
|
|
|
String inMsg = ""; |
|
|
|
|
String inMsgInfo = ""; |
|
|
|
|
List<HZSQDMessage> hzsqdxzzxx = eleOuterMessage.getHZSQDXZZXX(); |
|
|
|
|
for (HZSQDMessage hzsqdMessage : hzsqdxzzxx) { |
|
|
|
|
inMsg = hzsqdMessage.getHZSQDXZTXX().getZTDM(); |
|
|
|
|
inMsgInfo = hzsqdMessage.getHZSQDXZTXX().getZTXX(); |
|
|
|
|
hzsqdMessage.getHZSQDXZTXX().setBillNo(findRedInfo.getSQBQQPCH()); |
|
|
|
|
} |
|
|
|
|
EleNewMessage eleNewMessage = new EleNewMessage(); |
|
|
|
|
BeanUtil.copyProperties(eleOuterMessage, eleNewMessage); |
|
|
|
|
eleNewMessage.setStatus(eleOuterMessage.getZTDM().substring(eleOuterMessage.getZTDM().length() - 4)); |
|
|
|
|
if ("060000".equals(inMsg)) { |
|
|
|
|
eleNewMessage.setMessage(inMsgInfo); |
|
|
|
|
eleNewMessage.setData(eleOuterMessage.getHZSQDXZZXX()); |
|
|
|
|
return eleNewMessage; |
|
|
|
|
} else { |
|
|
|
|
eleNewMessage.setMessage(inMsgInfo); |
|
|
|
|
eleNewMessage.setData(eleOuterMessage.getHZSQDXZZXX()); |
|
|
|
|
return eleNewMessage; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
EleNewMessage eleNewMessage = new EleNewMessage(); |
|
|
|
|
eleNewMessage.setStatus("9999"); |
|
|
|
|
eleNewMessage.setMessage("接口请求失败"); |
|
|
|
|
return eleNewMessage; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 功能描述: 红字查询接口 |
|
|
|
|
* |
|
|
|
|
* @param identity |
|
|
|
|
* @return : com.jianshui.invoice.domain.dto.HXResponse |
|
|
|
|
*/ |
|
|
|
|
@PostMapping({"/api/invoice/v1/findRedInfo", "/api/invoice/v1/findRedInfo/{identity}", "/invoice/findRedInfo"}) |
|
|
|
|
public Object findRedInfo(HttpServletRequest request,String identity) throws Exception { |
|
|
|
|
public EleNewMessage findRedInfo(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
log.info("开始执行"); |
|
|
|
|
if (StringUtils.isEmpty(identity)) { |
|
|
|
|
return AjaxResult.error(ErrorCode.EMPTY_IDENTITY); |
|
|
|
|
EleNewMessage eleNewMessage = new EleNewMessage(); |
|
|
|
|
eleNewMessage.setStatus("9999"); |
|
|
|
|
eleNewMessage.setMessage("身份认证参数为空"); |
|
|
|
|
return eleNewMessage; |
|
|
|
|
} |
|
|
|
|
Companyservice companyservice = iCompanyserviceService.selectCompanyserviceByIdentity(identity); |
|
|
|
|
if (companyservice == null) { |
|
|
|
|
return AjaxResult.error(ErrorCode.COMPANY_NOT_FOUND); |
|
|
|
|
EleNewMessage eleNewMessage = new EleNewMessage(); |
|
|
|
|
eleNewMessage.setStatus("9999"); |
|
|
|
|
eleNewMessage.setMessage("企业信息不存在"); |
|
|
|
|
return eleNewMessage; |
|
|
|
|
} |
|
|
|
|
String requestAdapterKey = serviceManageService.getRequestAdapterKey("invoice", companyservice.getCompanyid()); |
|
|
|
|
IInvoiceRequestService invoiceRequestService = invoiceRequestFactory.getService(requestAdapterKey); |
|
|
|
|
JSONObject decryptResult = invoiceRequestService.decrypt(request, companyservice, "find_redinfo"); |
|
|
|
|
// 获得请求实例,并且进行扣费
|
|
|
|
|
log.info("解密数据{}",decryptResult); |
|
|
|
|
FindRedInfo findRedInfo = decryptResult.toJavaObject(FindRedInfo.class); |
|
|
|
|
log.info("解密数据{}", decryptResult); |
|
|
|
|
FindRedInfoDTO findRedInfoDTO = decryptResult.toJavaObject(FindRedInfoDTO.class); |
|
|
|
|
FindRedInfo findRedInfo = new FindRedInfo(); |
|
|
|
|
findRedInfo.setSQBQQPCH(findRedInfoDTO.getBillNo()); |
|
|
|
|
findRedInfo.setNSRSBH(findRedInfoDTO.getNSRSBH()); |
|
|
|
|
log.info("转换数据{}", JSONUtil.toJsonStr(findRedInfo)); |
|
|
|
|
String serviceKey = serviceManageService.getCompanyServiceSupplier("invoice", companyservice.getCompanyid()); |
|
|
|
|
serviceManageService.companyConsume("invoice", companyservice.getCompanyid()); |
|
|
|
|
IInvoiceApiService invoiceService = invoiceServiceFactory.getService(serviceKey); |
|
|
|
|
HXResponse result = invoiceService.findRedInfo(findRedInfo, companyservice); |
|
|
|
|
|
|
|
|
|
String responseAdapterKey = serviceManageService.getResponseAdapterKey("invoice", companyservice.getCompanyid()); |
|
|
|
|
IInvoiceResponseService invoiceResponseService = invoiceResponseFactory.getService(responseAdapterKey); |
|
|
|
|
|
|
|
|
|
return invoiceResponseService.response(result, companyservice, "find_redinfo"); |
|
|
|
|
EleNewMessage result = invoiceService.findRedInfo(findRedInfo, companyservice); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -216,7 +263,7 @@ public class InvoiceController { |
|
|
|
|
@ApiOperation("开票请求接口-(蓝字发票开具,红字发票开具)") |
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体",dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/add", "/api/invoice/v1/add/{identity}", "/invoice/addInvoice"}) |
|
|
|
|
public Object addInvoice(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
if (StringUtils.isEmpty(identity)) { |
|
|
|
@ -260,7 +307,7 @@ public class InvoiceController { |
|
|
|
|
// @ApiOperation("开票查询接口(发票请求流水号)")
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体",dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/query", "/api/invoice/v1/query/{identity}", "/invoice/queryInvoice"}) |
|
|
|
|
public Object queryInvoice(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
if (StringUtils.isEmpty(identity)) { |
|
|
|
@ -289,7 +336,7 @@ public class InvoiceController { |
|
|
|
|
// @ApiOperation("开票查询接口(订单号)")
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体",dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/query_orderno", "/api/invoice/v1/query_orderno/{identity}", "/invoice/queryInvoiceByOrderNo"}) |
|
|
|
|
public Object queryInvoiceOrderno(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
if (StringUtils.isEmpty(identity)) { |
|
|
|
@ -319,7 +366,7 @@ public class InvoiceController { |
|
|
|
|
// @ApiOperation("开票查询接口(范围查询)")
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体",dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/query_scope", "/api/invoice/v1/query_scope/{identity}", "/urlcode/queryInvoice"}) |
|
|
|
|
public Object queryInvoiceScope(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
if (StringUtils.isEmpty(identity)) { |
|
|
|
@ -349,7 +396,7 @@ public class InvoiceController { |
|
|
|
|
// @ApiOperation("作废发票")
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体",dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/deprecate", "/api/invoice/v1/deprecate/{identity}", "/invoice/deleteInvoice"}) |
|
|
|
|
public Object deprecateInvoice(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
if (StringUtils.isEmpty(identity)) { |
|
|
|
@ -378,8 +425,8 @@ public class InvoiceController { |
|
|
|
|
// @ApiOperation("作废发票结果查询")
|
|
|
|
|
@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/deprecate_query", "/api/invoice/v1/deprecate_query/{identity}", "/invoice/deleteInvoiceQuery","/invoice/deprecate_query"}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/deprecate_query", "/api/invoice/v1/deprecate_query/{identity}", "/invoice/deleteInvoiceQuery", "/invoice/deprecate_query"}) |
|
|
|
|
public Object deprecateQueryInvoice(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
if (StringUtils.isEmpty(identity)) { |
|
|
|
|
return AjaxResult.error(ErrorCode.EMPTY_IDENTITY); |
|
|
|
@ -404,12 +451,14 @@ public class InvoiceController { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 红字信息表上传*/ |
|
|
|
|
/** |
|
|
|
|
* 红字信息表上传 |
|
|
|
|
*/ |
|
|
|
|
@Validated |
|
|
|
|
// @ApiOperation("红字信息表上传")
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体",dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/upload_redinfo", "/api/invoice/v1/upload_redinfo/{identity}", "/invoice/redInvoiceApply"}) |
|
|
|
|
public Object uploadRedInfo(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
if (StringUtils.isEmpty(identity)) { |
|
|
|
@ -450,7 +499,7 @@ public class InvoiceController { |
|
|
|
|
// @ApiOperation("红字信息表下载")
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体",dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/download_redinfo", "/api/invoice/v1/download_redinfo/{identity}", "/invoice/redInvoiceDownload"}) |
|
|
|
|
public Object downloadRedInfo(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
if (StringUtils.isEmpty(identity)) { |
|
|
|
@ -492,7 +541,7 @@ public class InvoiceController { |
|
|
|
|
// @ApiOperation("发票推送接口")
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体",dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/push", "/api/invoice/v1/push/{identity}"}) |
|
|
|
|
public Object push(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
if (StringUtils.isEmpty(identity)) { |
|
|
|
@ -522,8 +571,8 @@ public class InvoiceController { |
|
|
|
|
// @ApiOperation("发票批量打印接口")
|
|
|
|
|
@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/batch_print", "/api/invoice/v1/batch_print/{identity}","/invoice/batch_print"}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/batch_print", "/api/invoice/v1/batch_print/{identity}", "/invoice/batch_print"}) |
|
|
|
|
public Object print(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
if (StringUtils.isEmpty(identity)) { |
|
|
|
|
return AjaxResult.error(ErrorCode.EMPTY_IDENTITY); |
|
|
|
@ -565,8 +614,8 @@ public class InvoiceController { |
|
|
|
|
// @ApiOperation("打印机查询接口")
|
|
|
|
|
@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/printer_list", "/api/invoice/v1/printer_list/{identity}","/invoice/printer_list"}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/printer_list", "/api/invoice/v1/printer_list/{identity}", "/invoice/printer_list"}) |
|
|
|
|
public Object printer(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
if (StringUtils.isEmpty(identity)) { |
|
|
|
|
return AjaxResult.error(ErrorCode.EMPTY_IDENTITY); |
|
|
|
@ -608,7 +657,7 @@ public class InvoiceController { |
|
|
|
|
// @ApiOperation("发票签章")
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体",dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/sign_e_seal", "/api/invoice/v1/sign_e_seal/{identity}"}) |
|
|
|
|
public Object signESeal(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
if (StringUtils.isEmpty(identity)) { |
|
|
|
@ -637,7 +686,7 @@ public class InvoiceController { |
|
|
|
|
// @ApiOperation("发票专用章导入注册")
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体",dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/register_e_seal", "/api/invoice/v1/register_e_seal/{identity}"}) |
|
|
|
|
public Object registerESeal(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
if (StringUtils.isEmpty(identity)) { |
|
|
|
@ -666,7 +715,7 @@ public class InvoiceController { |
|
|
|
|
// @ApiOperation("发票专用章图片生成")
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体",dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/create_e_seal", "/api/invoice/v1/create_e_seal/{identity}"}) |
|
|
|
|
public Object createESeal(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
if (StringUtils.isEmpty(identity)) { |
|
|
|
@ -956,18 +1005,18 @@ public class InvoiceController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @Author: kk |
|
|
|
|
* @Description: 通用异步查询接口 |
|
|
|
|
* @DateTime: 2023/6/2 17:35 |
|
|
|
|
* @Params: |
|
|
|
|
* @Return |
|
|
|
|
*/ |
|
|
|
|
* @Author: kk |
|
|
|
|
* @Description: 通用异步查询接口 |
|
|
|
|
* @DateTime: 2023/6/2 17:35 |
|
|
|
|
* @Params: |
|
|
|
|
* @Return |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
// TODO: 2023/4/6 全电接口
|
|
|
|
|
// @ApiOperation("通用异步查询接口")
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体",dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/queryResultInfo/{identity}", "/api/invoice/v1/queryResultInfo"}) |
|
|
|
|
public Object queryResultInfo(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
if (StringUtils.isEmpty(identity)) { |
|
|
|
@ -999,10 +1048,10 @@ public class InvoiceController { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @ApiOperation("获取发票下载地址")
|
|
|
|
|
// @ApiOperation("获取发票下载地址")
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体",dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/getFileUrl/{identity}", "/api/invoice/v1/getFileUrl"}) |
|
|
|
|
public Object getFileUrl(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
if (StringUtils.isEmpty(identity)) { |
|
|
|
@ -1023,7 +1072,7 @@ public class InvoiceController { |
|
|
|
|
String serviceKey = serviceManageService.getCompanyServiceSupplier("invoice", companyservice.getCompanyid()); |
|
|
|
|
serviceManageService.companyConsume("invoice", companyservice.getCompanyid()); |
|
|
|
|
|
|
|
|
|
InvoiceAllFileAcquisitionTWODTO invoiceAllFileAcquisitionTWODTO= decryptResult.toJavaObject(InvoiceAllFileAcquisitionTWODTO.class); |
|
|
|
|
InvoiceAllFileAcquisitionTWODTO invoiceAllFileAcquisitionTWODTO = decryptResult.toJavaObject(InvoiceAllFileAcquisitionTWODTO.class); |
|
|
|
|
IInvoiceApiService invoiceService = invoiceServiceFactory.getService(serviceKey); |
|
|
|
|
HXResponse result = invoiceService.getFileUrl(invoiceAllFileAcquisitionTWODTO, companyservice); |
|
|
|
|
|
|
|
|
@ -1034,10 +1083,10 @@ public class InvoiceController { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @ApiOperation("全电文件获取")
|
|
|
|
|
// @ApiOperation("全电文件获取")
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体",dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/getFileAcquisition/{identity}", "/api/invoice/v1/getFileAcquisition"}) |
|
|
|
|
public Object getFileAcquisition(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
|
|
|
|
@ -1060,7 +1109,7 @@ public class InvoiceController { |
|
|
|
|
String serviceKey = serviceManageService.getCompanyServiceSupplier("invoice", companyservice.getCompanyid()); |
|
|
|
|
serviceManageService.companyConsume("invoice", companyservice.getCompanyid()); |
|
|
|
|
|
|
|
|
|
InvoiceAllFileAcquisitionOnTWODTO invoiceAllFileAcquisitionDTO= decryptResult.toJavaObject(InvoiceAllFileAcquisitionOnTWODTO.class); |
|
|
|
|
InvoiceAllFileAcquisitionOnTWODTO invoiceAllFileAcquisitionDTO = decryptResult.toJavaObject(InvoiceAllFileAcquisitionOnTWODTO.class); |
|
|
|
|
IInvoiceApiService invoiceService = invoiceServiceFactory.getService(serviceKey); |
|
|
|
|
HXResponse result = invoiceService.getFileAcquisitionOn(invoiceAllFileAcquisitionDTO, companyservice); |
|
|
|
|
|
|
|
|
@ -1072,10 +1121,10 @@ public class InvoiceController { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// @ApiOperation("获取人脸识别二维码")
|
|
|
|
|
// @ApiOperation("获取人脸识别二维码")
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体",dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/qrcode/{identity}", "/api/invoice/v1/qrcode"}) |
|
|
|
|
public Object qrcode(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
|
|
|
|
@ -1108,10 +1157,10 @@ public class InvoiceController { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// @ApiOperation("发票查询")
|
|
|
|
|
// @ApiOperation("发票查询")
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体",dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/query/{identity}", "/api/invoice/v1/query"}) |
|
|
|
|
public Object query(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
// query
|
|
|
|
@ -1135,7 +1184,7 @@ public class InvoiceController { |
|
|
|
|
serviceManageService.companyConsume("invoice", companyservice.getCompanyid()); |
|
|
|
|
|
|
|
|
|
IInvoiceApiService invoiceService = invoiceServiceFactory.getService(serviceKey); |
|
|
|
|
InvoiceAllFileQueryTWODTO invoiceAllFileQueryTWODTO = BeanUtil.copyProperties(decryptResult,InvoiceAllFileQueryTWODTO.class); |
|
|
|
|
InvoiceAllFileQueryTWODTO invoiceAllFileQueryTWODTO = BeanUtil.copyProperties(decryptResult, InvoiceAllFileQueryTWODTO.class); |
|
|
|
|
HXResponse result = invoiceService.query(invoiceAllFileQueryTWODTO, companyservice); |
|
|
|
|
|
|
|
|
|
String responseAdapterKey = serviceManageService.getResponseAdapterKey("invoice", companyservice.getCompanyid()); |
|
|
|
@ -1145,10 +1194,10 @@ public class InvoiceController { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// @ApiOperation("获取发票打印XML")
|
|
|
|
|
// @ApiOperation("获取发票打印XML")
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体",dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/print_xml/{identity}", "/api/invoice/v1/print_xml"}) |
|
|
|
|
public Object printXmlml(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
|
|
|
|
@ -1172,7 +1221,7 @@ public class InvoiceController { |
|
|
|
|
|
|
|
|
|
IInvoiceApiService invoiceService = invoiceServiceFactory.getService(serviceKey); |
|
|
|
|
|
|
|
|
|
InvoiceAllPrintXMLTWODTO invoiceAllPrintXMLTWODTO = BeanUtil.copyProperties(decryptResult,InvoiceAllPrintXMLTWODTO.class); |
|
|
|
|
InvoiceAllPrintXMLTWODTO invoiceAllPrintXMLTWODTO = BeanUtil.copyProperties(decryptResult, InvoiceAllPrintXMLTWODTO.class); |
|
|
|
|
HXResponse result = invoiceService.getPrintXML(invoiceAllPrintXMLTWODTO, companyservice); |
|
|
|
|
|
|
|
|
|
String responseAdapterKey = serviceManageService.getResponseAdapterKey("invoice", companyservice.getCompanyid()); |
|
|
|
@ -1182,10 +1231,10 @@ public class InvoiceController { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// @ApiOperation("快速红冲")
|
|
|
|
|
// @ApiOperation("快速红冲")
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体",dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/issueFastRedInvoice/{identity}", "/api/invoice/v1/issueFastRedInvoice"}) |
|
|
|
|
public Object issueFastRedInvoice(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
// issueFastRedInvoice
|
|
|
|
@ -1208,7 +1257,7 @@ public class InvoiceController { |
|
|
|
|
String serviceKey = serviceManageService.getCompanyServiceSupplier("invoice", companyservice.getCompanyid()); |
|
|
|
|
serviceManageService.companyConsume("invoice", companyservice.getCompanyid()); |
|
|
|
|
|
|
|
|
|
InvoiceAllKshcJsonDataTWODTO invoiceAllKshcJsonDataTWODTO= decryptResult.toJavaObject(InvoiceAllKshcJsonDataTWODTO.class); |
|
|
|
|
InvoiceAllKshcJsonDataTWODTO invoiceAllKshcJsonDataTWODTO = decryptResult.toJavaObject(InvoiceAllKshcJsonDataTWODTO.class); |
|
|
|
|
IInvoiceApiService invoiceService = invoiceServiceFactory.getService(serviceKey); |
|
|
|
|
HXResponse result = invoiceService.issueFastRedInvoice(invoiceAllKshcJsonDataTWODTO, companyservice); |
|
|
|
|
|
|
|
|
@ -1220,10 +1269,10 @@ public class InvoiceController { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @ApiOperation("蓝字发票统计")
|
|
|
|
|
// @ApiOperation("蓝字发票统计")
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体",dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/invoice_statistics/{identity}", "/api/invoice/v1/invoice_statistics"}) |
|
|
|
|
public Object invoiceStatistics(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
// invoiceStatic
|
|
|
|
@ -1256,10 +1305,10 @@ public class InvoiceController { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// @ApiOperation("审核红字信息表")
|
|
|
|
|
// @ApiOperation("审核红字信息表")
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体",dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/auditRedInfo/{identity}", "/api/invoice/v1/auditRedInfo"}) |
|
|
|
|
public Object auditRedInfo(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
// auditRedInfo
|
|
|
|
@ -1282,7 +1331,7 @@ public class InvoiceController { |
|
|
|
|
String serviceKey = serviceManageService.getCompanyServiceSupplier("invoice", companyservice.getCompanyid()); |
|
|
|
|
serviceManageService.companyConsume("invoice", companyservice.getCompanyid()); |
|
|
|
|
|
|
|
|
|
InvoiceAllShhzJsonDataTWODTO invoiceAllShhzDTO= decryptResult.toJavaObject(InvoiceAllShhzJsonDataTWODTO.class); |
|
|
|
|
InvoiceAllShhzJsonDataTWODTO invoiceAllShhzDTO = decryptResult.toJavaObject(InvoiceAllShhzJsonDataTWODTO.class); |
|
|
|
|
IInvoiceApiService invoiceService = invoiceServiceFactory.getService(serviceKey); |
|
|
|
|
HXResponse result = invoiceService.auditRedInfo(invoiceAllShhzDTO, companyservice); |
|
|
|
|
|
|
|
|
@ -1294,10 +1343,10 @@ public class InvoiceController { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @ApiOperation("查询红字信息表明细")
|
|
|
|
|
// @ApiOperation("查询红字信息表明细")
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体",dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/queryRedInfoDetail/{identity}", "/api/invoice/v1/queryRedInfoDetail"}) |
|
|
|
|
public Object queryRedInfoDetail(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
// auditRedInfo
|
|
|
|
@ -1320,7 +1369,7 @@ public class InvoiceController { |
|
|
|
|
String serviceKey = serviceManageService.getCompanyServiceSupplier("invoice", companyservice.getCompanyid()); |
|
|
|
|
serviceManageService.companyConsume("invoice", companyservice.getCompanyid()); |
|
|
|
|
|
|
|
|
|
InvoiceAllRedInvoiceDetailTWODTO invoiceAllRedInvoiceDetailDTO= decryptResult.toJavaObject(InvoiceAllRedInvoiceDetailTWODTO.class); |
|
|
|
|
InvoiceAllRedInvoiceDetailTWODTO invoiceAllRedInvoiceDetailDTO = decryptResult.toJavaObject(InvoiceAllRedInvoiceDetailTWODTO.class); |
|
|
|
|
IInvoiceApiService invoiceService = invoiceServiceFactory.getService(serviceKey); |
|
|
|
|
HXResponse result = invoiceService.queryRedInfoDetail(invoiceAllRedInvoiceDetailDTO, companyservice); |
|
|
|
|
|
|
|
|
@ -1332,15 +1381,15 @@ public class InvoiceController { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @Author: kk |
|
|
|
|
* @Description: 单据传入 |
|
|
|
|
* @DateTime: 2023/6/25 10:00 |
|
|
|
|
* @Params: |
|
|
|
|
* @Return |
|
|
|
|
*/ |
|
|
|
|
* @Author: kk |
|
|
|
|
* @Description: 单据传入 |
|
|
|
|
* @DateTime: 2023/6/25 10:00 |
|
|
|
|
* @Params: |
|
|
|
|
* @Return |
|
|
|
|
*/ |
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体",dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)}) |
|
|
|
|
@PostMapping({"/api/invoice/v1/invoiceIncome/{identity}", "/api/invoice/v1/invoiceIncome"}) |
|
|
|
|
public Object invoiceIncome(HttpServletRequest request, String identity) throws Exception { |
|
|
|
|
|
|
|
|
@ -1358,7 +1407,7 @@ public class InvoiceController { |
|
|
|
|
IInvoiceRequestService invoiceRequestService = invoiceRequestFactory.getService(requestAdapterKey); |
|
|
|
|
JSONObject decryptResult = invoiceRequestService.decrypt(request, companyservice, ""); |
|
|
|
|
|
|
|
|
|
BillInfoPDTO billInfoPDTO = BeanUtil.copyProperties(decryptResult,BillInfoPDTO.class); |
|
|
|
|
BillInfoPDTO billInfoPDTO = BeanUtil.copyProperties(decryptResult, BillInfoPDTO.class); |
|
|
|
|
HXResponse result = addService.invoiceIssuance(billInfoPDTO); |
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
@ -1366,6 +1415,4 @@ public class InvoiceController { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|