Merge remote-tracking branch 'origin/beta-prop-all' into beta-prop-all

master
路明慧 1 year ago
commit 369ca3e10c
  1. 2
      jianshui-admin/src/main/java/com/jianshui/api/controller/http/invoice/v1/InvoiceController.java
  2. 3
      jianshui-common/src/main/java/com/jianshui/common/utils/encrypt/JianshuiInvoiceDecryptUtil.java
  3. 3
      jianshui-common/src/main/java/com/jianshui/common/utils/encrypt/JianshuiInvoiceEncryptUtil.java
  4. 4
      jianshui-income/src/main/java/com/jianshui/income/service/impl/adapter/request/AisinoIncomeRequestAdapterImpl.java
  5. 4
      jianshui-income/src/main/java/com/jianshui/income/service/impl/adapter/request/ElephentIncomeAuthRequestAdapterImpl.java
  6. 6
      jianshui-income/src/main/java/com/jianshui/income/service/impl/adapter/response/AisinoIncomeResponseAdapterImpl.java
  7. 4
      jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/service/impl/adapter/request/AisinoIncomeRequestAdapterImpl.java
  8. 32
      jianshui-invoice/src/main/java/com/jianshui/invoice/enums/InvoiceBackStatusEnum.java
  9. 3
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/IInvoiceApiService.java
  10. 9
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/adapter/request/AisinoInvoiceRequestAdapterImpl.java
  11. 6
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/adapter/request/Nuonuo2InvoiceRequestAdapterImpl.java
  12. 5
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/AisinoConsoleInvoiceApiServiceImpl.java
  13. 9
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/AisinoConsoleInvoiceApiZhongQiServiceImpl.java
  14. 5
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/ElephantInvoiceApiServiceImpl.java
  15. 429
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/ElephantInvoiceApiV6ServiceImpl.java
  16. 4
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/JcskInvoiceApiServiceImpl.java
  17. 81
      jianshui-invoice/src/main/java/com/jianshui/invoice/task/AddInvoiceBatchTask.java
  18. 63
      jianshui-invoice/src/main/java/com/jianshui/invoice/task/QueryInvoiceTask.java
  19. 35
      jianshui-invoice/src/main/java/com/jianshui/invoice/utils/IncomeTest.java
  20. 60
      jianshui-invoice/src/main/java/com/jianshui/invoice/utils/InvoiceTest.java
  21. 22
      jianshui-invoice/src/main/java/com/jianshui/invoice/utils/JcskTest.java
  22. 52
      jianshui-invoice/src/main/java/com/jianshui/invoice/utils/QdEleInvoiceTest.java

@ -1956,7 +1956,7 @@ public class InvoiceController {
rawJson.put(k, map.get(k)[0]);
}
if (StringUtils.isEmpty(rawJson)) {
log.info("[重汽批量开票接口]未获取到请求参数!identity={},e={}", identity);
log.info("[重汽批量开票接口]未获取到请求参数!identity={}", identity);
return;
}
String order = rawJson.getString("order");

@ -11,13 +11,10 @@ import javax.crypto.Cipher;
import javax.crypto.spec.GCMParameterSpec;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import javax.xml.bind.DatatypeConverter;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.SecureRandom;
import java.util.Arrays;
/**
* 功能描述

@ -14,13 +14,12 @@ import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.SecureRandom;
/**
* 功能描述
* 加密常用类
*/
public class AisinoInvoiceEncryptUtil {
public class JianshuiInvoiceEncryptUtil {
private static final String ALGORITHM = "AES/GCM/NoPadding";
private static final int IV_LENGTH = 12; // 初始化向量长度为12字节(96位)

@ -5,7 +5,7 @@ import com.jianshui.common.core.domain.entity.Companyservice;
import com.jianshui.common.enums.ErrorCode;
import com.jianshui.common.exception.jianshui.JianshuiParamErrorException;
import com.jianshui.common.utils.StringUtils;
import com.jianshui.common.utils.encrypt.AisinoInvoiceDecryptUtil;
import com.jianshui.common.utils.encrypt.JianshuiInvoiceDecryptUtil;
import com.jianshui.income.service.IIncomeRequestService;
import com.jianshui.system.service.ICompanyserviceService;
import lombok.extern.slf4j.Slf4j;
@ -89,7 +89,7 @@ public class AisinoIncomeRequestAdapterImpl implements IIncomeRequestService {
// 平台解密
try {
order = AisinoInvoiceDecryptUtil.decrypt(order, JKey);
order = JianshuiInvoiceDecryptUtil.decrypt(order, JKey);
} catch (Exception e) {
e.printStackTrace();
throw new JianshuiParamErrorException(ErrorCode.DECRYPT_ERROR, companyservice, "income");

@ -5,7 +5,7 @@ import com.jianshui.common.core.domain.entity.Companyservice;
import com.jianshui.common.enums.ErrorCode;
import com.jianshui.common.exception.jianshui.JianshuiParamErrorException;
import com.jianshui.common.utils.StringUtils;
import com.jianshui.common.utils.encrypt.AisinoInvoiceDecryptUtil;
import com.jianshui.common.utils.encrypt.JianshuiInvoiceDecryptUtil;
import com.jianshui.income.service.IIncomeRequestService;
import com.jianshui.system.service.ICompanyserviceService;
import lombok.extern.slf4j.Slf4j;
@ -71,7 +71,7 @@ public class ElephentIncomeAuthRequestAdapterImpl implements IIncomeRequestServi
// 平台解密
try {
order = AisinoInvoiceDecryptUtil.decrypt(order, JKey);
order = JianshuiInvoiceDecryptUtil.decrypt(order, JKey);
} catch (Exception e) {
e.printStackTrace();
throw new JianshuiParamErrorException(ErrorCode.DECRYPT_ERROR, companyservice, "income");

@ -3,20 +3,14 @@ package com.jianshui.income.service.impl.adapter.response;
import com.alibaba.fastjson.JSONObject;
import com.jianshui.common.core.domain.AjaxResult;
import com.jianshui.common.core.domain.entity.Companyservice;
import com.jianshui.common.enums.ErrorCode;
import com.jianshui.common.exception.jianshui.JianshuiParamErrorException;
import com.jianshui.common.utils.StringUtils;
import com.jianshui.common.utils.encrypt.AisinoInvoiceDecryptUtil;
import com.jianshui.common.utils.http.HttpHelper;
import com.jianshui.income.service.IIncomeRequestService;
import com.jianshui.income.service.IIncomeResponseService;
import com.jianshui.system.service.ICompanyserviceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.servlet.ServletRequest;
/**
* @Description
* @Author 巩权林

@ -5,7 +5,7 @@ import com.jianshui.common.core.domain.entity.Companyservice;
import com.jianshui.common.enums.ErrorCode;
import com.jianshui.common.exception.jianshui.JianshuiParamErrorException;
import com.jianshui.common.utils.StringUtils;
import com.jianshui.common.utils.encrypt.AisinoInvoiceDecryptUtil;
import com.jianshui.common.utils.encrypt.JianshuiInvoiceDecryptUtil;
import com.jianshui.invoiceall.service.IInvoiceAllRequestService;
import com.jianshui.system.service.ICompanyserviceService;
import lombok.extern.slf4j.Slf4j;
@ -88,7 +88,7 @@ public class AisinoIncomeRequestAdapterImpl implements IInvoiceAllRequestService
// 平台解密
try {
order = AisinoInvoiceDecryptUtil.decrypt(order, JKey);
order = JianshuiInvoiceDecryptUtil.decrypt(order, JKey);
} catch (Exception e) {
e.printStackTrace();
throw new JianshuiParamErrorException(ErrorCode.DECRYPT_ERROR, companyservice, "invoiceall");

@ -0,0 +1,32 @@
package com.jianshui.invoice.enums;
/**
* @author kk
* @date 2024/4/8 16:27
* @param:
* @return: 批量回调状态枚举
*/
public enum InvoiceBackStatusEnum {
NOT_CALLED("0", "未回调"),
CALLBACK_SUCCESS("1", "回调成功"),
CALLBACK_FAILED("2", "回调失败"),
MULTIPLE_FAILURES("3", "回调多次失败,不再回调"),
PREPROCESSING_FAILED("4", "预处理失败,不再回调"),
IN_PROCESS("5", "开票中(有结果后回调)");
private final String code;
private final String desc;
InvoiceBackStatusEnum(String code, String desc) {
this.code = code;
this.desc = desc;
}
public String getCode() {
return code;
}
public String getDesc() {
return desc;
}
}

@ -23,6 +23,9 @@ public interface IInvoiceApiService {
*/
public HXResponse addInvoice(BillInfo billInfo, Companyservice companyservice) throws IllegalAccessException, InstantiationException;
/** 异步批量开票接口*/
public HXResponse addInvoiceBeatch(BillInfo billInfo, Companyservice companyservice) throws IllegalAccessException, InstantiationException;
/**
* 发票失败重开接口

@ -1,8 +1,6 @@
package com.jianshui.invoice.service.impl.adapter.request;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
@ -11,7 +9,7 @@ import com.jianshui.common.enums.ErrorCode;
import com.jianshui.common.exception.jianshui.JianshuiParamErrorException;
import com.jianshui.common.utils.IdcardUtils;
import com.jianshui.common.utils.StringUtils;
import com.jianshui.common.utils.encrypt.AisinoInvoiceDecryptUtil;
import com.jianshui.common.utils.encrypt.JianshuiInvoiceDecryptUtil;
import com.jianshui.invoice.domain.BillDetail;
import com.jianshui.invoice.domain.BillInfo;
import com.jianshui.invoice.domain.Redinfo;
@ -22,7 +20,6 @@ import com.jianshui.invoice.domain.dto.adapter.request.aisino_jn.HxBillInfoDTO;
import com.jianshui.invoice.domain.dto.adapter.request.aisino_jn.HxRedInfoDTO;
import com.jianshui.invoice.domain.dto.adapter.request.aisino_jn.HxRedInfoDetailsDTO;
import com.jianshui.invoice.service.IInvoiceRequestService;
import com.jianshui.invoice.utils.elephant.ElephantUtils;
import com.jianshui.system.service.ICompanyserviceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
@ -107,7 +104,7 @@ public class AisinoInvoiceRequestAdapterImpl implements IInvoiceRequestService {
// 平台解密
try {
// TODO: 2023/9/20
order = AisinoInvoiceDecryptUtil.decrypt(order, JKey);
order = JianshuiInvoiceDecryptUtil.decrypt(order, JKey);
} catch (Exception e) {
e.printStackTrace();
throw new JianshuiParamErrorException(ErrorCode.DECRYPT_ERROR, companyservice, "invoice");
@ -369,7 +366,7 @@ public class AisinoInvoiceRequestAdapterImpl implements IInvoiceRequestService {
// 平台解密
try {
// TODO: 2023/9/20
order = AisinoInvoiceDecryptUtil.decrypt(order, JKey);
order = JianshuiInvoiceDecryptUtil.decrypt(order, JKey);
} catch (Exception e) {
e.printStackTrace();
throw new JianshuiParamErrorException(ErrorCode.DECRYPT_ERROR, companyservice, "invoice");

@ -1,17 +1,13 @@
package com.jianshui.invoice.service.impl.adapter.request;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.jianshui.common.core.domain.AjaxResult;
import com.jianshui.common.core.domain.entity.Companyservice;
import com.jianshui.common.enums.ErrorCode;
import com.jianshui.common.exception.jianshui.JianshuiParamErrorException;
import com.jianshui.common.utils.DateUtils;
import com.jianshui.common.utils.IdcardUtils;
import com.jianshui.common.utils.StringUtils;
import com.jianshui.common.utils.TimeUtil;
import com.jianshui.common.utils.encrypt.AisinoInvoiceDecryptUtil;
import com.jianshui.common.utils.http.HttpHelper;
import com.jianshui.invoice.domain.BillDetail;
import com.jianshui.invoice.domain.BillInfo;
@ -22,12 +18,10 @@ import com.jianshui.invoice.domain.dto.adapter.request.nuonuo2.*;
import com.jianshui.invoice.service.IInvoiceRequestService;
import com.jianshui.system.service.ICompanyserviceService;
import lombok.extern.slf4j.Slf4j;
import nuonuo.open.sdk.NNOpenSDK;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import java.util.*;

@ -344,6 +344,11 @@ public class AisinoConsoleInvoiceApiServiceImpl implements IInvoiceApiService {
}
}
@Override
public HXResponse addInvoiceBeatch(BillInfo billInfo, Companyservice companyservice) throws IllegalAccessException, InstantiationException {
return null;
}
/**
* 开票接口回调-重汽
* 2023-09-26

@ -88,6 +88,11 @@ public class AisinoConsoleInvoiceApiZhongQiServiceImpl implements IInvoiceApiSer
static final String SUFFIX = ".tmp";//后缀字符串定义文件的扩展名;如果为null,则将使用后缀".tmp"
@Override
public HXResponse addInvoice(BillInfo billInfo, Companyservice companyservice) throws IllegalAccessException, InstantiationException {
return null;
}
/**
* 1.发票开具 SID = 1
*
@ -98,10 +103,10 @@ public class AisinoConsoleInvoiceApiZhongQiServiceImpl implements IInvoiceApiSer
* @date 2022/6/27 16:50
*/
@Override
public HXResponse addInvoice(BillInfo billInfo, Companyservice companyservice) throws IllegalAccessException, InstantiationException {
public HXResponse addInvoiceBeatch(BillInfo billInfo, Companyservice companyservice) throws IllegalAccessException, InstantiationException {
// 1.订单唯一校验。新增历史订单部分(删除)
// 1.订单唯一校验。新增历史订单部分(删除)
// 订单号唯一校验 start
String outNO = billInfo.getOutTradeOrderno() != null ? billInfo.getOutTradeOrderno() : "";
if (StrUtil.isEmpty(outNO)) {

@ -286,6 +286,11 @@ public class ElephantInvoiceApiServiceImpl implements IInvoiceApiService {
}
@Override
public HXResponse addInvoiceBeatch(BillInfo billInfo, Companyservice companyservice) throws IllegalAccessException, InstantiationException {
return null;
}
/**
* 发票失败重开接口

@ -6,6 +6,7 @@ import cn.hutool.core.codec.Base64;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONConfig;
import cn.hutool.json.JSONUtil;
import com.alibaba.druid.support.json.JSONUtils;
@ -48,10 +49,8 @@ import com.jianshui.invoice.domain.dto.api.jcsk.CxhzTwoDTO;
import com.jianshui.invoice.domain.ele.*;
import com.jianshui.invoice.domain.vo.InvoiceAllQycodeResultElEVO;
import com.jianshui.invoice.domain.vo.jcsk.*;
import com.jianshui.invoice.mapper.BillInfoMapper;
import com.jianshui.invoice.mapper.InvoiceFileMapper;
import com.jianshui.invoice.mapper.InvoiceMapper;
import com.jianshui.invoice.mapper.RedinfoMapper;
import com.jianshui.invoice.enums.InvoiceBackStatusEnum;
import com.jianshui.invoice.mapper.*;
import com.jianshui.invoice.service.IBillInfoService;
import com.jianshui.invoice.service.IInvoiceApiService;
import com.jianshui.invoice.task.QueryInvoiceTask;
@ -133,6 +132,11 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService {
@Autowired
private InvoiceFileMapper invoiceFileMapper;
@Autowired
private InvoiceBackMapper invoiceBackMapper;
private static String ELE_File_URL;
private static String ELE_File_URL_DC;
@ -204,8 +208,6 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService {
}
// 订单票面信息
DDPCXX ddpcxx = new DDPCXX();
// ddpcxx.setKPFS("1"); // 设置开票方式为手动开票
@ -430,8 +432,7 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService {
} else if (StringUtils.isNotEmpty(billInfo.getOutTradeOrderno())) {
queryWrapper.eq("out_trade_orderno", billInfo.getOutTradeOrderno());
} else {
HXResponse response = new HXResponse("9997", "订单号或流水号不能同时为空");
return response;
return new HXResponse("9997", "订单号或流水号不能同时为空");
}
queryWrapper.orderByDesc("id");
@ -1087,10 +1088,7 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService {
}
@Override
public void callBackAisino(InvoiceBack invoiceBack, String callBackUrl, String identity,Long id) {
}
/** 邮箱交付 */
@Override
@ -2996,4 +2994,413 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService {
}
/** 批量开票接口 */
@Override
public HXResponse addInvoiceBeatch(BillInfo billInfo, Companyservice companyservice) throws IllegalAccessException, InstantiationException {
return submitAddInvoice(billInfo,companyservice);
}
@Override
public void callBackAisino(InvoiceBack invoiceBack, String callBackUrl, String identity,Long id) {
if (id == null) {
log.info("【控制台】发票回调,id为空");
return;
}
// 回调地址获取
if (StrUtil.isEmpty(callBackUrl)) {
ICompanyservicePropService companyserviceProp = SpringUtils.getBean(ICompanyservicePropService.class);
CompanyserviceProp secretIdProp = companyserviceProp.selectPropByKey(Long.valueOf(identity), "aisino_callback_url");
if (BeanUtil.isNotEmpty(secretIdProp) && secretIdProp.getValue() != null && !"".equals(secretIdProp.getValue())) {
callBackUrl = secretIdProp.getValue();
}
}
Invoice invoice = invoiceMapper.selectInvoiceById(id);
if (invoice == null) {
log.info("【控制台】发票信息未查询到,id={}", id);
invoice = new Invoice();
invoice.setOutTradeOrderno(invoiceBack.getSystemOrderno());
invoice.setState(22);
String resultMsg = invoiceBack.getResultMsg();
String message = (resultMsg != null && resultMsg.length() > 200) ? resultMsg.substring(0, 200) : resultMsg;
invoice.setMessage(message);
}
try {
log.info("【控制台】发票回调接口,发送数据开始,id={},callBackUrl={},param={}", id, callBackUrl, JSONUtil.toJsonStr(invoice));
String result = HttpUtil.post(callBackUrl, JSONUtil.toJsonStr(invoice));
log.info("【控制台】发票回调接口,发送数据结束,id={},接口返回信息={}", id, result);
cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(result);
if (jsonObject != null) {
String status = jsonObject.get("status") != null ? jsonObject.get("status").toString() : "";
String message = jsonObject.get("message") != null ? jsonObject.get("message").toString() : "";
if ("0000".equals(status)) {
invoiceBack.setStatus("1");
invoiceBack.setBackMsg(message != null ? message.substring(0, Math.min(message.length(), 200)) : "");
invoiceBack.setUpdateTime(new Date());
invoiceBackMapper.updateInvoiceBack(invoiceBack);
} else if ("9999".equals(status)) {
invoiceBack.setStatus("3");
invoiceBack.setBackMsg(message != null ? message.substring(0, Math.min(message.length(), 200)) : "");
invoiceBack.setUpdateTime(new Date());
invoiceBackMapper.updateInvoiceBack(invoiceBack);
} else {
invoiceBack.setStatus("2");
invoiceBack.setUpdateTime(new Date());
invoiceBack.setBackMsg(status + message != null ? message.substring(0, Math.min(message.length(), 200)) : "");
invoiceBackMapper.updateInvoiceBack(invoiceBack);
}
}
} catch (Exception e) {
log.info("【控制台】发票回调接口,发送数据异常,id={},e={}", id,e);
invoiceBack.setStatus("2");
invoiceBack.setBackMsg("发送数据异常!");
invoiceBackMapper.updateInvoiceBack(invoiceBack);
}
}
/**
* @author kk
* @date 2024/4/8 14:55
* @param: [billInfo, companyservice]
* @return: 提交开票
*/
public HXResponse submitAddInvoice(BillInfo billInfo, Companyservice companyservice) throws IllegalAccessException, InstantiationException {
// 1.订单唯一校验。新增历史订单部分(删除)。
// 订单号唯一校验 start
String outNO = billInfo.getOutTradeOrderno() != null ? billInfo.getOutTradeOrderno() : "";
if (StrUtil.isEmpty(outNO)) {
return new HXResponse("批量开票:订单号为空,请检查报文!");
}
// update_by 0未删除 1已删除
Invoice invoiceValidateTemp = new Invoice();
List<Invoice> invoicesValidate = invoiceMapper.selectByOutTradeOrdernoList(companyservice.getCompanyid(), outNO, "0");
// 开票回调失败防重复处理 start
if (!org.springframework.util.CollectionUtils.isEmpty(invoicesValidate)) {
for (Invoice invoice : invoicesValidate) {
QueryWrapper<InvoiceBack> invoiceBackQueryWrapper = new QueryWrapper<>();
invoiceBackQueryWrapper.eq("system_orderno", invoice.getOutTradeOrderno());
InvoiceBack invoiceBackVali = invoiceBackMapper.selectOne(invoiceBackQueryWrapper);
if (BeanUtil.isEmpty(invoiceBackVali)) {
invoiceBackVali = new InvoiceBack();
invoiceBackVali.setSystemOrderno(invoice.getOutTradeOrderno());
invoiceBackVali.setCreateTime(new Date());
invoiceBackVali.setId(IdUtils.randomUUID());
invoiceBackVali.setIdentity(companyservice.getIdentity());
invoiceBackVali.setBackUrl("");
invoiceBackVali.setStatus("0");
invoiceBackVali.setCreateTime(new Date());
invoiceBackVali.setSystemOrderno(invoice.getOutTradeOrderno());
invoiceBackVali.setBackMsg("");
invoiceBackVali.setResultCode("0000");
invoiceBackVali.setResultMsg("开票成功!");
invoiceBackVali.setUpdateTime(new Date());
invoiceBackMapper.insertInvoiceBack(invoiceBackVali);
} else {
invoiceBackVali.setResultCode("0000");
invoiceBackVali.setResultMsg("开票成功!");
invoiceBackVali.setStatus("0");
invoiceBackVali.setUpdateTime(new Date());
invoiceBackMapper.updateInvoiceBack(invoiceBackVali);
}
// 再次推送
try {
callBackAisino(invoiceBackVali, "", companyservice.getIdentity(), invoice.getId());
} catch (Exception e) {
log.info("【批量开票】发票回调失败!invoiceId={}", invoice.getId());
}
}
return new HXResponse("0000", "批量开票:重复订单已推送!");
}
// end
// 预处理
try {
billInfo = BillInfoUtils.processBillInfo(billInfo, companyservice);
} catch (JianshuiParamErrorException e) {
return new HXResponse(e.getMessage());
} catch (Exception e) {
log.error("【销项】【大象发票】【批量开票】开票接口校验异常", e);
return new HXResponse("格式校验失败,请检查报文");
}
// 订单头信息
DDTXX ddtxx = new DDTXX(billInfo);
CompanyserviceProp companyserviceProp = companyservicePropMapper.selectPropByKey(companyservice.getCompanyid(), "account_show");
if (companyserviceProp != null && "1".equals(companyserviceProp.getValue())){
StringBuilder bz = new StringBuilder();
if (StringUtils.isNotBlank(ddtxx.getBZ())){
bz.append(ddtxx.getBZ()).append("\n");
}
String buyerBank = billInfo.getBuyerBank();
String buyerAccount = billInfo.getBuyerAccount();
String sellerAccount = billInfo.getSellerAccount();
String sellerBank = billInfo.getSellerBank();
bz.append("购方开户银行账号:");
if (StringUtils.isNotBlank(buyerBank)) {
bz.append("\t").append(buyerBank);
}
if (StringUtils.isNotBlank(buyerAccount)) {
bz.append("\t").append(buyerAccount);
}
bz.append("\n");
bz.append("销方开户银行账号:");
if (StringUtils.isNotBlank(sellerBank)) {
bz.append("\t").append(sellerBank);
}
if (StringUtils.isNotBlank(sellerAccount)) {
bz.append("\t").append(sellerAccount);
}
log.info("备注信息:\n{}", bz);
ddtxx.setBZ(bz.toString());
}
// 订单票面信息
DDPCXX ddpcxx = new DDPCXX();
// ddpcxx.setKPFS("1"); // 设置开票方式为手动开票
ddpcxx.setDDQQPCH(billInfo.getSystemOrderno());
ddpcxx.setNSRSBH(billInfo.getSellerTaxnum());
ddpcxx.setKPZD(billInfo.getTerminalNumber());
String invioceType = billInfo.getInvoiceType();
String fplxdm = ElephantUtils.transElephantType(invioceType, 1);
ddpcxx.setFPLXDM(fplxdm);
//kk 2023/9/15 V6数电新增
// 标准开具
Qdtxx qdtxx = BeanUtil.copyProperties(billInfo, Qdtxx.class);
// 2023/9/22 特定要素类型代码处理
qdtxx.setTdys(billInfo.getTdys());
qdtxx.setQydm(billInfo.getDqbm());
qdtxx.setFJYSLIST(billInfo.getFjyslist());// 附加要素列表
qdtxx.setHWYSLIST(billInfo.getHwysList()); // 货物运输
if(billInfo.getBdcxsxxList() != null && !billInfo.getBdcxsxxList().isEmpty()){
qdtxx.setBDCXSXX(billInfo.getBdcxsxxList().get(0)); // 不动产销售信息
}
if(billInfo.getJzfwList() != null && !billInfo.getJzfwList().isEmpty()){
qdtxx.setJZFWXX(billInfo.getJzfwList().get(0));// 建筑服务信息
}
if(billInfo.getBdczlxxList() != null && !billInfo.getBdczlxxList().isEmpty()){
qdtxx.setBDCZLXX(billInfo.getBdczlxxList().get(0));// 不动产租赁信息
}
// qdtxx.setBDCZLXX(billInfo.getBdczlxxList()); //不动产租赁信息
// 特殊票种地请求接口名转换
String url = ElephantConstantsV6.ADD_INVOICE_LOCALHOST;
if (CollectionUtils.isNotEmpty(qdtxx.getHWYSLIST())) {
//GenerateQdHwysInvoice 货物运输
url = ElephantConstantsV6.GENERATE_QD_HWYS_INVOICE;
} else if (BeanUtil.isNotEmpty(qdtxx.getBDCXSXX())) {
// GenerateQdBdcxsInvoice 不动产销售信息
url = ElephantConstantsV6.GENERATE_QD_BDCXS_INVOICE;
} else if (BeanUtil.isNotEmpty(qdtxx.getJZFWXX())) {
// GenerateQdJzfwInvoice 建筑服务信息
url = ElephantConstantsV6.GENERATE_QD_JZFW_INVOICE;
} else if (BeanUtil.isNotEmpty(qdtxx.getBDCZLXX())) {
// GenerateQdBdczlInvoice 不动产租赁信息
url = ElephantConstantsV6.GENERATE_QD_BDXZL_INVOICE;
}
// 开始处理详情
List<BillDetail> details = billInfo.getBillDetailList();
List<DDMXXX> ddmxxxList = new ArrayList<>();
for (int i = 0; i < details.size(); i++) {
BillDetail detail = details.get(i);
DDMXXX ddmxxx = new DDMXXX(billInfo, detail);
ddmxxxList.add(ddmxxx);
}
// 开始封装请求报文
ElephantInvoiceAddDTO elephantInvoiceAddDTO = new ElephantInvoiceAddDTO();
elephantInvoiceAddDTO.setDDPCXX(ddpcxx);
DDZXX ddzxx = new DDZXX();
ddzxx.setDDTXX(ddtxx);
ddzxx.setDDMXXX(ddmxxxList);
// 全电头信息
ddzxx.setQDTXX(qdtxx);
List<DDZXX> ddzxxes = new ArrayList<>();
ddzxxes.add(ddzxx);
elephantInvoiceAddDTO.setDDZXX(ddzxxes);
AjaxResult queryResult = null;
try {
queryResult = ElephantUtils.sendRequestWithoutTokenV6New(url, "", JSONUtil.parse(elephantInvoiceAddDTO), companyservice);
} catch (UnsupportedEncodingException | NoSuchAlgorithmException | InvalidKeyException e) {
log.error("【销项发票】【大象接口】【发票开具】发票请求异常,请求报文{},销方信息{}", JSONUtil.parse(elephantInvoiceAddDTO).toString(), JSONObject.toJSONString(companyservice));
return new HXResponse("系统异常!");
}
log.info("【销项发票】【大象发票】发票开具请求结果{}", queryResult.toString());
// 判断外层报文是否成功
if (queryResult.isError()) {
throw new JianshuiServiceException(queryResult.getMsg());
}
JSONObject result = queryResult.getJsonData();
JSONObject contentJson = result;
// 如果content不为空,判断状态代码
if (contentJson != null) {
String ztdm = contentJson.getString("ZTDM");
if (!StringUtils.equals("0000", ztdm) && !StringUtils.equals("010000", ztdm)) {
return new HXResponse(contentJson.getString("ZTXX"));
}
}
billInfo.setState(20);
billInfoMapper.updateBillInfo(billInfo);
// 还需要单独调用下发票结果获取接口,获取订单结果
JSONObject queryBody = new JSONObject();
queryBody.put("NSRSBH", companyservice.getSellertax());
// queryBody.put("DDQQPCH", billInfo.getSystemOrderno());
// queryBody.put("FPLXDM", fplxdm);
// queryBody.put("SFFHSBSJ", "0");
// TODO: 2023/10/8 数电
// 订单请求流水号
queryBody.put("DDQQLSH", billInfo.getSystemOrderno());
/*// 提取码
queryBody.put("TQM", "0");
// 订单号
queryBody.put("DDH", "0");
// 红字确认单编号
queryBody.put("HZQRDBH", "0");
// 版式文件(0:需要;1:不需要)
queryBody.put("BSWJ", "0");
// 订单日期起
queryBody.put("DDRQQ", "0");
// 订单日期止
queryBody.put("DDRQZ", "0");*/
// queryResult = ElephantUtils.sendRequest(ElephantConstantsV6.ADD_INVOICE_RESULT, JSONUtil.parse(queryBody));
try {
queryResult = ElephantUtils.sendRequestWithoutTokenV6New(ElephantConstantsV6.ADD_INVOICE_RESULT_LOCALHOST, ElephantConstantsV6.ADD_INVOICE_RESULT_METHOD, JSONUtil.parse(queryBody), companyservice);
} catch (UnsupportedEncodingException | InvalidKeyException | NoSuchAlgorithmException e) {
log.error("【销项发票】【大象接口】【发票开具】发票请求异常,请求报文{},销方信息{}", JSONUtil.parse(elephantInvoiceAddDTO).toString(), JSONObject.toJSONString(companyservice));
return new HXResponse("系统异常!");
}
log.info("【销项发票】【大象发票】发票开具请求拉取结果{}", queryResult.toString());
// 判断外层报文是否成功
if (queryResult.isError()) {
return new HXResponse(queryResult.getMsg());
}
// 如果content不为空,判断状态代码
contentJson = queryResult.getJsonData();
if (contentJson != null) {
String ztdm = contentJson.getString("ZTDM");
// 021002 020111
if (!StringUtils.equalsAny(ztdm, "020111", "020000", "010000","000000")) {
// 开票失败
if (StringUtils.equals("020002", ztdm)) {
billInfo.setState(22);
billInfoMapper.updateBillInfo(billInfo);
}
// kk: 2023/12/5 判断人脸识别的状态
String DDFPZXX = contentJson.getString("DDFPZXX") != null ? contentJson.getString("DDFPZXX") : "";
if(StrUtil.isNotEmpty(DDFPZXX)){
DDFPZXX ddfpzxx = BeanUtil.copyProperties(DDFPZXX,DDFPZXX.class);
if(ddfpzxx != null && ddfpzxx.getDDFPXX() != null && "03200".equals(ddfpzxx.getDDFPXX().getDDZT())){
return new HXResponse("E004",ddfpzxx.getDDFPXX().getDDZTXX() != null ? ddfpzxx.getDDFPXX().getDDZTXX():"发票开具失败,请确认是否人脸识别超期!");
}
}
return new HXResponse(contentJson.getString("ZTXX"));
}
// 如果全部开具成功
if (StringUtils.equals("020000", ztdm)) {
billInfo.setState(2);
billInfoMapper.updateBillInfo(billInfo);
}
}
// 更新结果为开票中,队列里去刷新开票结果,并进行推送
// 增加主动回调方式,可配置
ICompanyservicePropService companyservicePropT = SpringUtils.getBean(ICompanyservicePropService.class);
CompanyserviceProp secretIdProp = companyservicePropT.selectPropByKey(companyservice.getCompanyid(), "aisino_callback_url");
if (BeanUtil.isNotEmpty(secretIdProp) && secretIdProp.getValue() != null && !"".equals(secretIdProp.getValue())) {
String callBackUrl = secretIdProp.getValue();
InvoiceBack queryInvoiceBack = new InvoiceBack();
queryInvoiceBack.setSystemOrderno(billInfo.getOutTradeOrderno());
List<InvoiceBack> invoiceBackList = invoiceBackMapper.selectInvoiceBackList(queryInvoiceBack);
if (org.springframework.util.CollectionUtils.isEmpty(invoiceBackList)) {
queryInvoiceBack.setId(IdUtils.randomUUID());
queryInvoiceBack.setIdentity(companyservice.getIdentity());
queryInvoiceBack.setBackUrl(callBackUrl);
queryInvoiceBack.setStatus(InvoiceBackStatusEnum.IN_PROCESS.getCode());
queryInvoiceBack.setCreateTime(new Date());
queryInvoiceBack.setSystemOrderno(billInfo.getOutTradeOrderno());
queryInvoiceBack.setBackMsg("");
queryInvoiceBack.setResultCode("0000");
queryInvoiceBack.setResultMsg("开票中,进入队列");
queryInvoiceBack.setUpdateTime(new Date());
invoiceBackMapper.insertInvoiceBack(queryInvoiceBack);
}
}
// 定时拉取保存发票
AsyncManager.me().execute(new QueryInvoiceTask(billInfo, companyservice, this));
// 数电的加入金财表
InvoiceAllApiLog allApiLog = new InvoiceAllApiLog();
allApiLog.setUrl(WebServiceConstant.LZFPKJ);
allApiLog.setSendMsg("");
allApiLog.setResultMsg("");
allApiLog.setCompany(companyservice.getSellertax());
allApiLog.setIdentityId(companyservice.getIdentity());
allApiLog.setRequestId(billInfo.getSystemOrderno());
allApiLog.setCreateTime(new Date());
allApiLog.setCompanyName("批量大象V6");
allApiLogMapper.insertInvoiceAllApiLog(allApiLog);
HXResponse response = new HXResponse("0000", "同步成功");
response.put("fpqqlsh", billInfo.getSystemOrderno());
return response;
}
}

@ -260,6 +260,10 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
}
@Override
public HXResponse addInvoiceBeatch(BillInfo billInfo, Companyservice companyservice) throws IllegalAccessException, InstantiationException {
return null;
}
/**

@ -40,22 +40,17 @@ import java.util.TimerTask;
@Slf4j
public class AddInvoiceBatchTask extends TimerTask {
// private BillInfo finalBillInfo;
// private Companyservice companyservice;
// private IInvoiceApiService invoiceApiService;
//
private ICompanyserviceService iCompanyserviceService;
//
private IServiceManageService serviceManageService;
//
private IInvoiceRequestFactory invoiceRequestFactory;
//
private IInvoiceServiceFactory invoiceServiceFactory;
//
private InvoiceBackMapper invoiceBackMapper;
private String identity;
private String order;
private final String LOG_MESSAGE = "重汽批量开票接口";
public AddInvoiceBatchTask(ICompanyserviceService iCompanyserviceService, IServiceManageService serviceManageService
@ -67,7 +62,6 @@ public class AddInvoiceBatchTask extends TimerTask {
this.invoiceBackMapper = invoiceBackMapper;
this.identity = identity;
this.order = order;
}
@SneakyThrows
@ -77,7 +71,7 @@ public class AddInvoiceBatchTask extends TimerTask {
// 异步处理
// 1-1 identity校验
if (StringUtils.isEmpty(identity)) {
log.info("[重汽批量开票接口]身份认证参数为空!");
log.info("{}:身份认证参数为空!",LOG_MESSAGE);
return;
}
@ -86,11 +80,11 @@ public class AddInvoiceBatchTask extends TimerTask {
try {
companyservice = iCompanyserviceService.selectCompanyserviceByIdentity(identity);
} catch (Exception e) {
log.info("[重汽批量开票接口]获取企业信息异常!identity={},e={}", identity, e);
log.info("{}:获取企业信息异常!identity={},e={}", LOG_MESSAGE,identity, e.toString());
return;
}
if (companyservice == null) {
log.info("[重汽批量开票接口]企业信息不存在!identity={}", identity);
log.info("{}:企业信息不存在!identity={}",LOG_MESSAGE, identity);
return;
}
@ -101,7 +95,7 @@ public class AddInvoiceBatchTask extends TimerTask {
IInvoiceRequestService invoiceRequestService = invoiceRequestFactory.getService(requestAdapterKey);
decryptResult = invoiceRequestService.decryptZq(identity,order, companyservice, "addBatch");
} catch (Exception e) {
log.info("[重汽批量开票接口]请求解密失败!identity={},e={}", identity, e);
log.info("{}:请求解密失败!identity={},e={}",LOG_MESSAGE, identity, e.toString());
return;
}
@ -110,11 +104,11 @@ public class AddInvoiceBatchTask extends TimerTask {
try {
billJson = JSONUtil.parseObj(decryptResult);
} catch (Exception e) {
log.info("[重汽批量开票接口]报文格式化异常!identity={},e={}", identity, e);
log.info("{}:报文格式化异常!identity={},e={}",LOG_MESSAGE, identity, e.toString());
return;
}
if (billJson.get("billInfo") == null) {
log.info("[重汽批量开票接口]未匹配到发票报文!identity={}", identity);
log.info("{}:未匹配到发票报文!identity={}",LOG_MESSAGE, identity);
return;
}
@ -122,11 +116,11 @@ public class AddInvoiceBatchTask extends TimerTask {
try {
billJsonArray = JSONUtil.parseArray(billJson.get("billInfo"));
} catch (Exception e) {
log.info("[重汽批量开票接口]发票报文获取异常!identity={},e={}", identity, e);
log.info("{}:发票报文获取异常!identity={},e={}",LOG_MESSAGE, identity, e.toString());
return;
}
if (billJsonArray.size() == 0) {
log.info("[重汽批量开票接口]发票报文为空!identity={}", identity);
if (billJsonArray.isEmpty()) {
log.info("{}:发票报文为空!identity={}",LOG_MESSAGE, identity);
return;
}
@ -146,7 +140,7 @@ public class AddInvoiceBatchTask extends TimerTask {
BillInfo billInfo = BeanUtil.copyProperties(billInfoObj, BillInfo.class);
if (billInfo == null) {
log.info("[重汽批量开票接口]报文格式错误!identity={}", identity);
log.info("{}:报文格式错误!identity={}",LOG_MESSAGE, identity);
continue;
}
billInfo.setSource("2");
@ -159,9 +153,7 @@ public class AddInvoiceBatchTask extends TimerTask {
billInfo.setServiceSupplierKey(serviceKey);
invoiceService = invoiceServiceFactory.getService(serviceKey);
} catch (Exception e) {
//invoiceBack.setResultCode("9999");
//invoiceBack.setResultMsg("扣费失败!");
log.info("[重汽批量开票接口]扣费失败!identity={},e={}", identity, e);
log.info("{}:扣费失败!identity:{},e:{}",LOG_MESSAGE, identity, e.toString());
continue;
}
@ -173,11 +165,11 @@ public class AddInvoiceBatchTask extends TimerTask {
Thread.sleep(1000);
} catch (InterruptedException e) {
// 处理中断异常
log.error("延时异常:{}",e.toString());
log.error("{}:延时异常:{}",LOG_MESSAGE,e.toString());
}
HXResponse resultHx = invoiceService.addInvoice(billInfo, companyservice);
log.info("[重汽批量开票接口]开票identity={},返回结果result={}", identity, resultHx);
log.info("{}:开票identity={},返回结果result={}",LOG_MESSAGE, identity, resultHx);
if (!resultHx.isSuccess()) {
@ -203,7 +195,7 @@ public class AddInvoiceBatchTask extends TimerTask {
invoiceService.callBackAisino(invoiceBack, "", identity,0L);
}
log.info("[重汽批量开票接口]提交开票异常,开票失败!identity={},msg={}", identity, resultHx.getMessage());
log.info("{}:提交开票异常,开票失败!identity={},msg={}",LOG_MESSAGE, identity, resultHx.getMessage());
}
} catch (Exception e) {
@ -231,44 +223,9 @@ public class AddInvoiceBatchTask extends TimerTask {
invoiceService.callBackAisino(invoiceBack, "", identity,0L);
}
log.info("[重汽批量开票接口]提交开票异常,开票失败!identity={},e={}", identity, e);
log.info("{}:提交开票异常,开票失败!identity={},e={}",LOG_MESSAGE, identity, e.toString());
}
}
/*RedisCache redisCache = SpringUtils.getBean(RedisCache.class);
InvoiceMapper invoiceMapper = SpringUtils.getBean(InvoiceMapper.class);
Thread.sleep(10 * 1000); // 睡眠10秒再去查询
log.info("【定时任务】【发票查询】开始查询发票:{}", JSONObject.toJSONString(this.finalBillInfo));
QueryBillInfoDTO queryBillInfoDTO = new QueryBillInfoDTO();
queryBillInfoDTO.setFpqqlsh(this.finalBillInfo.getSystemOrderno());
invoiceApiService.queryInvoice(queryBillInfoDTO, this.companyservice);
// 获取发票
Invoice invoice = invoiceMapper.selectBySystemOrderNo(this.companyservice.getCompanyid(), this.finalBillInfo.getSystemOrderno());
if (invoice == null || StringUtils.equalsAny(Integer.toString(invoice.getState()), "0", "20")) {
// 查询下失败队列,是否有次数
String keys = "invoice_query_times_" + this.companyservice.getCompanyid() + "_" + this.finalBillInfo.getSystemOrderno();
Integer queryTimes = redisCache.getCacheObject(keys);
// 查询重试次数超过20次,就不查了
if (queryTimes != null && queryTimes > 20) {
log.error("【定时任务】【发票查询】发票信息始终不存在,不再进行查询:{}", JSONObject.toJSONString(this.finalBillInfo));
redisCache.deleteObject(keys);
return;
}
if (queryTimes == null) {
queryTimes = 0;
}
queryTimes += 1;
redisCache.setCacheObject(keys, queryTimes);
// log.error("【定时任务】【发票查询】发票信息不存在或还在开票中,再次进入查询:{}", JSONObject.toJSONString(this.finalBillInfo));
// AsyncManager.me().execute(new AddInvoiceBatchTask(this.finalBillInfo, companyservice, this.invoiceApiService));
}
// RedisQueueUtil.build().setData(invoice).onQueue("invoice_add_callback_consumer").retry(0).dispatch();*/
}
}

@ -1,14 +1,20 @@
package com.jianshui.invoice.task;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jianshui.common.core.domain.entity.Companyservice;
import com.jianshui.common.core.redis.RedisCache;
import com.jianshui.common.utils.StringUtils;
import com.jianshui.common.utils.spring.SpringUtils;
import com.jianshui.common.utils.uuid.IdUtils;
import com.jianshui.framework.manager.AsyncManager;
import com.jianshui.invoice.domain.BillInfo;
import com.jianshui.invoice.domain.Invoice;
import com.jianshui.invoice.domain.InvoiceBack;
import com.jianshui.invoice.domain.dto.QueryBillInfoDTO;
import com.jianshui.invoice.mapper.InvoiceBackMapper;
import com.jianshui.invoice.mapper.InvoiceMapper;
import com.jianshui.invoice.service.IInvoiceApiService;
import com.jianshui.queue.utils.RedisQueueUtil;
@ -17,6 +23,7 @@ import lombok.extern.slf4j.Slf4j;
import lombok.extern.slf4j.XSlf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
import java.util.TimerTask;
/**
@ -32,10 +39,14 @@ public class QueryInvoiceTask extends TimerTask {
private IInvoiceApiService invoiceApiService;
private InvoiceBackMapper invoiceBackMapper;
public QueryInvoiceTask(BillInfo billInfo, Companyservice companyservice, IInvoiceApiService invoiceApiService) {
this.finalBillInfo = billInfo;
this.companyservice = companyservice;
this.invoiceApiService = invoiceApiService;
this.invoiceBackMapper = invoiceBackMapper;
}
@SneakyThrows
@ -68,8 +79,60 @@ public class QueryInvoiceTask extends TimerTask {
redisCache.setCacheObject(keys, queryTimes);
log.error("【定时任务】【发票查询】发票信息不存在或还在开票中,再次进入查询:{}", JSONObject.toJSONString(this.finalBillInfo));
AsyncManager.me().execute(new QueryInvoiceTask(this.finalBillInfo, companyservice, this.invoiceApiService));
} else if (invoice == null || StringUtils.equalsAny(Integer.toString(invoice.getState()), "2", "22")) {
// 2开票成功 22开票失败
// 再次推送
pushCoustomInvoiceInfo(invoice);
}
RedisQueueUtil.build().setData(invoice).onQueue("invoice_add_callback_consumer").retry(0).dispatch();
}
/** 发票开具回调 */
private void pushCoustomInvoiceInfo(Invoice invoice) {
try {
log.info("【重汽批量开票】进入发票批量开具回调队列:InvoiceId={}",invoice.getId());
String kpStatus = Integer.toString(invoice.getState()).equals("2") ? "0000":"9999";
String kpMsg = Integer.toString(invoice.getState()).equals("2") ? "开票成功":"开票失败";
QueryWrapper<InvoiceBack> invoiceBackQueryWrapper = new QueryWrapper<>();
invoiceBackQueryWrapper.eq("system_orderno", invoice.getOutTradeOrderno());
InvoiceBack invoiceBackVali = invoiceBackMapper.selectOne(invoiceBackQueryWrapper);
if (BeanUtil.isEmpty(invoiceBackVali)) {
invoiceBackVali = new InvoiceBack();
invoiceBackVali.setSystemOrderno(invoice.getOutTradeOrderno());
invoiceBackVali.setCreateTime(new Date());
invoiceBackVali.setId(IdUtils.randomUUID());
invoiceBackVali.setIdentity(companyservice.getIdentity());
invoiceBackVali.setBackUrl("");
invoiceBackVali.setStatus("0");
invoiceBackVali.setCreateTime(new Date());
invoiceBackVali.setSystemOrderno(invoice.getOutTradeOrderno());
invoiceBackVali.setBackMsg("");
invoiceBackVali.setResultCode(kpStatus);
invoiceBackVali.setResultMsg(kpMsg);
invoiceBackVali.setUpdateTime(new Date());
invoiceBackMapper.insertInvoiceBack(invoiceBackVali);
} else {
invoiceBackVali.setResultCode(kpStatus);
invoiceBackVali.setResultMsg(kpMsg);
invoiceBackVali.setStatus("0");
invoiceBackVali.setUpdateTime(new Date());
invoiceBackMapper.updateInvoiceBack(invoiceBackVali);
}
log.info("【重汽批量开票】发票回调队列开始回调,组装参数:回调参数={},identity={},invoiceId={}", invoiceBackVali.toString(),companyservice.getIdentity(),invoice.getId());
invoiceApiService.callBackAisino(invoiceBackVali, "", companyservice.getIdentity(), invoice.getId());
log.info("【重汽批量开票】 发票批量开具回调队列处理完成: InvoiceId={}",invoice.getId());
} catch (Exception e) {
log.info("【重汽批量开票】发票回调队列失败!invoiceId={},捕捉异常{}", invoice.getId(),e.toString());
}
}
}

@ -3,9 +3,8 @@ package com.jianshui.invoice.utils;
import cn.hutool.core.date.DateUtil;
import cn.hutool.json.JSONUtil;
import com.jianshui.common.utils.DateUtils;
import com.jianshui.common.utils.StringUtils;
import com.jianshui.common.utils.encrypt.AisinoInvoiceDecryptUtil;
import com.jianshui.common.utils.encrypt.JianshuiInvoiceDecryptUtil;
import com.jianshui.common.utils.uuid.UUID;
import java.util.*;
@ -40,7 +39,7 @@ public class IncomeTest {
"}\n";
// String order = "{\"jym\":\"165330\",\"fpje\":\"83.07\",\"fpdm\":\"011002100511\",\"kprq\":\"20220209\",\"fphm\":\"41985485\",\"fpzl\":\"10\",\"taxNo\":\"91370100664851254J\"}";
// String order = "{\"jym\":\"356607\",\"fpje\":\"259.23\",\"fpdm\":\"011002000711\",\"kprq\":\"20210111\",\"fphm\":\"66914035\",\"fpzl\":\"01\",\"taxNo\":\"91370102MA3UD2FG21\" }";
String m = AisinoInvoiceDecryptUtil.encrypt(order, key);
String m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("json : " + order);
System.out.println(m);
System.out.println("------------------------------------------------");
@ -48,14 +47,14 @@ public class IncomeTest {
System.out.println("-------------------批量发票查验-----------------------------");
order = "{\"invoiceList\":[{\"fpdm\":\"3200211130\",\"fphm\":\"49523142\",\"fpje\":\"986359.73\",\"fpzl\":\"01\",\"kprq\":\"20210712\"}],\"pch\":\"761651651651651515151568438476\",\"taxNo\":\"91370102MA3UD2FG21\"}";
System.out.println("json : \n" + order);
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println(m);
System.out.println("------------------------------------------------");
System.out.println("-------------------批量发票查验结果查询-----------------------------");
order = "{\"pch\":\"761651651651651515151568438476\",\"taxNo\":\"91370102MA3UD2FG21\"}";
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("json : \n" + order);
System.out.println(m);
System.out.println("------------------------------------------------");
@ -64,7 +63,7 @@ public class IncomeTest {
System.out.println("-------------------企业档案查询-----------------------------");
order = "{\"SBH\":\"1403016L1NN5336\",\"taxNo\":\"1403016L1NN5336\"}";
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("json : \n" + order);
System.out.println(m);
System.out.println("------------------------------------------------");
@ -99,7 +98,7 @@ public class IncomeTest {
order = JSONUtil.toJsonStr(map);
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("json : " + order);
System.out.println(m);
System.out.println("------------------------------------------------");
@ -107,7 +106,7 @@ public class IncomeTest {
System.out.println("-------------------获取认证结果-----------------------------");
// order = "{\"PCH\":\"3eb6645e2fc84b8384ac2db8c3fd78f7\",\"taxNo\":\"9111122223333CKFPT\"}";
order = "{\"PCH\":\"20220020021312341\",\"taxNo\":\"9111122223333CKFPT\"}";
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("json : \n" + order);
System.out.println(m);
System.out.println("------------------------------------------------");
@ -118,7 +117,7 @@ public class IncomeTest {
order = "{\"GMFSBH\":\"9111122223333CKFPT\",\"PCH\":\""+ "67074fed71cc42da8fc12bdcd2111s99" +"\"," +
"\"QRBZ\":\"1\",\"TJSJ\":\"202209\",\"RZSKSSQ\":\"202209\",\"QRMM\":\"123456\",\"taxNo\":\"9111122223333CKFPT\"}";
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("json : \n" + order);
System.out.println(m);
System.out.println("------------------------------------------------");
@ -127,7 +126,7 @@ public class IncomeTest {
order = "{\"GMFSBH\":\"9111122223333CKFPT\",\"PCH\":\"2d92821a9dfc4f1aaa744bcbd1696ebd\"," +
"\"QRBZ\":\"0\",\"TJSJ\":\"202209\",\"taxNo\":\"9111122223333CKFPT\"}";
order = "{\"PCH\":\"67074fed71cc42da8fc12bdcd2111s99\",\"TJSJ\":\"202209\",\"taxNo\":\"9111122223333CKFPT\",\"GMFSBH\":\"9111122223333CKFPT\",\"QRBZ\":\"1\"}";
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("json : \n" + order);
System.out.println(m);
System.out.println("------------------------------------------------");
@ -135,21 +134,21 @@ public class IncomeTest {
System.out.println("-------------------状态采集-----------------------------");
order = "{\"GMFSBH\":\"9111122223333CKFPT\",\"PCH\":\"0827f998cdfd40b0a5626150520b4dea\"," +
"\"ZTBGKSRQ\":\"20190101010120\",\"ZTBGJSRQ\":\"20191001010120\",\"ZTBZ\":\"1\",\"KSHS\":\"1\",\"taxNo\":\"9111122223333CKFPT\"}";
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("json : \n" + order);
System.out.println(m);
System.out.println("------------------------------------------------");
System.out.println("-------------------设置密码-----------------------------");
order = "{\"SBH\":\"9111122223333CKFPT\",\"YWMM\":\"123456\",\"NEWYWMM\":\"123456\",\"taxNo\":\"9111122223333CKFPT\"}";
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("json : \n" + order);
System.out.println(m);
System.out.println("------------------------------------------------");
System.out.println("-------------------重置密码-----------------------------");
order = "{\"SBH\":\"9111122223333CKFPT\",\"taxNo\":\"9111122223333CKFPT\"}";
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("json : \n" + order);
System.out.println(m);
System.out.println("------------------------------------------------");
@ -169,7 +168,7 @@ public class IncomeTest {
" \"FHHS\": \"10\",\n" + // 当该参数有值时,接口按照参数返回发票条数,如果没值时,接口按照默认值返回发票条数
" \"taxNo\": \"9111122223333CKFPT\"\n" + // 测试税号
"}";
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("json : \n" + order);
System.out.println(m);
System.out.println("------------------------------------------------");
@ -188,7 +187,7 @@ public class IncomeTest {
" \"taxNo\": \"9111122223333CKFPT\"\n" + // 测试税号
"}";
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("json : \n" + order);
System.out.println(m);
System.out.println("------------------------------------------------");
@ -199,7 +198,7 @@ public class IncomeTest {
" \"RZSKSSQ\": \"202209\",\n" +
" \"taxNo\": \"9111122223333CKFPT\"\n" + // 测试税号
"}";
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("json : \n" + order);
System.out.println(m);
System.out.println("------------------------------------------------");
@ -213,7 +212,7 @@ public class IncomeTest {
" \"RZSKSSQ\": \"202209\",\n" +
" \"taxNo\": \"9111122223333CKFPT\"\n" +
"}";
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("json : \n" + order);
System.out.println(m);
System.out.println("------------------------------------------------");
@ -225,7 +224,7 @@ public class IncomeTest {
" \"GMFSBH\": \"9111122223333CKFPT\",\n" +
" \"taxNo\": \"9111122223333CKFPT\"\n" +
"}";
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("json : \n" + order);
System.out.println(m);
System.out.println("------------------------------------------------");

@ -2,13 +2,7 @@ package com.jianshui.invoice.utils;
import cn.hutool.core.util.IdUtil;
import com.jianshui.common.utils.encrypt.AisinoInvoiceDecryptUtil;
import com.jianshui.common.utils.encrypt.AisinoInvoiceEncryptUtil;
import org.apache.commons.codec.binary.Base64;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import java.security.SecureRandom;
import com.jianshui.common.utils.encrypt.JianshuiInvoiceDecryptUtil;
/**
* @Description
@ -362,7 +356,7 @@ public class InvoiceTest {
System.out.println(order);
String m = AisinoInvoiceDecryptUtil.encrypt(order, key);
String m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("-------------------发票开具-----------------------------");
System.out.println(m);
System.out.println("------------------------------------------------");
@ -371,12 +365,12 @@ public class InvoiceTest {
System.out.println(query);
m = AisinoInvoiceDecryptUtil.encrypt(query, key);
m = JianshuiInvoiceDecryptUtil.encrypt(query, key);
System.out.println(m);
System.out.println("------------------------------------------------");
System.out.println("-------------------发票查询(订单号)-----------------------------");
query = "{\"identity\":\"1200\",\"orderno\":[ '00000000005223210916']}";
m = AisinoInvoiceDecryptUtil.encrypt(query, key);
m = JianshuiInvoiceDecryptUtil.encrypt(query, key);
System.out.println(m);
System.out.println("------------------------------------------------");
@ -387,7 +381,7 @@ public class InvoiceTest {
" \"fphm\": \"66198156\",\n" +
"}";
m = AisinoInvoiceDecryptUtil.encrypt(query, key);
m = JianshuiInvoiceDecryptUtil.encrypt(query, key);
System.out.println(m);
System.out.println("------------------------------------------------");
@ -398,7 +392,7 @@ public class InvoiceTest {
" \"sellerTaxnum\": \"110101MYJ2GPQQ4\"\n" +
"}";
m = AisinoInvoiceDecryptUtil.encrypt(query, key);
m = JianshuiInvoiceDecryptUtil.encrypt(query, key);
System.out.println(m);
System.out.println("------------------------------------------------");
@ -408,7 +402,7 @@ public class InvoiceTest {
" \"dyjmc\": \"\"" +
"}";
m = AisinoInvoiceDecryptUtil.encrypt(query, key);
m = JianshuiInvoiceDecryptUtil.encrypt(query, key);
System.out.println(m);
System.out.println("------------------------------------------------");
@ -435,7 +429,7 @@ public class InvoiceTest {
" ]\n" +
"}";
m = AisinoInvoiceDecryptUtil.encrypt(query, key);
m = JianshuiInvoiceDecryptUtil.encrypt(query, key);
System.out.println(m);
System.out.println("------------------------------------------------");
@ -447,17 +441,17 @@ public class InvoiceTest {
"\"invoiceCode\": \"150000020026\"," +
"\"invoiceNum\": \"94579496\"" +
"}]}";
m = AisinoInvoiceDecryptUtil.encrypt(query, key);
m = JianshuiInvoiceDecryptUtil.encrypt(query, key);
System.out.println(m);
System.out.println("------------------------------------------------");
query = "";
m = AisinoInvoiceDecryptUtil.encrypt(query, key);
m = JianshuiInvoiceDecryptUtil.encrypt(query, key);
System.out.println(m);
System.out.println("------------------------------------------------");
order = "{\"identity\":\"1131\",\"order\":{\"buye rname\":\"山东爱信诺\",\"taxnum\":\"124511234993295177\",\"phone\":\"0\",\"address\":\"山东省济南市华信路 10\",\"account\":\"\",\"telephone\":\"0\",\"orderno\":\"nuonuo12345631\",\"invoicedate\":\"2018-10 -31 19:16:51\",\"clerk\":\"黄芝\",\"saleaccount\":\"宇宙行 442612010103507108\",\"salephone\":\"0774-7893911\",\"saleaddress\":\"富川瑶族自治县新 永 路 138 号 \",\"saletaxnum\":\"339901999999142\",\"kptype\":\"1\",\"message\":\"\",\"invoiceNow\":\"1\",\"payee\":\"林莉苏\",\"checker\":\"林莉苏\",\"tsfs\":\"-1\",\"email\":\"502192347@qq.com\",\"qdbz\":\"0\",\"qdxmmc\":\"\",\"dkbz\":\" 0\",\"deptid\":\"\",\"clerkid\":\"\",\"invoiceLine\":\"p\",\"cpybz\":\"\",\"detail\":[{\"goodsname\":\"苹果\",\"num\":\"1\",\"price\":\"1\",\"hsbz\":\"1\",\"taxrate\":\"0.13\",\"spec\":\"\",\"unit\":\"吨 \",\"spbm\":\"10101150101\",\"zsbm\":\"\",\"fphxz\":\"0\",\"yhzcbs\":\"0\",\"zzstsgl\":\"\",\"lsl bs\":\"\",\"kce\":\"\"}]}}";
// order="{\"identity\":\"1132\",\"order\":[{\"buyername\":\"浙江爱信诺\",\"taxnum\":\"334511234993295178\",\"phone\":\"0\",\"address\":\" 浙江省杭州市万塘路 \",\"account\":\"\",\"telephone\":\"0\",\"orderno\":\"nuonuo243451234\",\"invoicedate\":\"2018-10-31 19:16:51\",\"clerk\":\"黄芝\",\"saleaccount\":\"宇宙行 442612010103507108\",\"salephone\":\"0774-7893911\",\"saleaddress\":\"富川瑶族自治县新 永路 138 号 \",\"saletaxnum\":\"150301199811285326\",\"kptype\":\"1\",\"message\":\"1\",\"invoiceNow\":\"1\",\"payee\":\"林莉苏 \",\"checker\":\"林莉苏 \",\"tsfs\":\"-1\",\"email\":\"502192347@qq.com\",\"qdbz\":\"0\",\"qdxmmc\":\"\",\"dkbz\":\"0\",\"deptid\":\"\",\"clerkid\":\"\",\"invoiceLine\":\"c\",\"cpybz\":\"\",\"detail\":[{\"goodsname\":\"苹果\",\"num\":\"1\",\"price\":\"1\",\"hsbz\":\"1\",\"taxrate\":\"0.13\",\"spec\":\"111\",\"unit\":\"吨 \",\"spbm\":\"10101150101\",\"zsbm\":\"111\",\"fphxz\":\"0\",\"yhzcbs\":\"0\",\"zzstsgl\":\"1\",\"lslbs\":\"1\",\"kce\":\"0\",\"tax\":\"1.20\",\"spbm\":\"112\",\"taxamt\":\"112\"}]},{\"buyername\":\"浙江爱信诺\",\"taxnum\":\"393511234993295177\",\"phone\":\"0\",\"address\":\" 浙江省杭州市万塘路 \",\"account\":\"\",\"telephone\":\"0\",\"orderno\":\"nuonuo243451243\",\"invoicedate\":\"2018-10-31 19:16:51\",\"clerk\":\"黄芝\",\"saleaccount\":\"宇宙行 442612010103507108\",\"salephone\":\"0774-7893911\",\"saleaddress\":\"富川瑶族自治县新 永路 138 号 \",\"saletaxnum\":\"150301199811285326\",\"kptype\":\"1\",\"message\":\"1\",\"invoiceNow\":\"1\",\"payee\":\"林莉苏 \",\"checker\":\"林莉苏 \",\"tsfs\":\"-1\",\"email\":\"502192347@qq.com\",\"qdbz\":\"0\",\"qdxmmc\":\"\",\"dkbz\":\"0\",\"deptid\":\"\",\"clerkid\":\"\",\"invoiceLine\":\"c\",\"cpybz\":\"\",\"detail\":[{\"goodsname\":\"苹果\",\"num\":\"1\",\"price\":\"1\",\"hsbz\":\"1\",\"taxrate\":\"0.13\",\"spec\":\"111\",\"unit\":\"吨 \",\"spbm\":\"10101150101\",\"zsbm\":\"111\",\"fphxz\":\"0\",\"yhzcbs\":\"0\",\"zzstsgl\":\"1\",\"lslbs\":\"1\",\"kce\":\"0\",\"tax\":\"1.20\",\"spbm\":\"112\",\"taxamt\":\"112\"}]}]}";
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println(m);
@ -465,7 +459,7 @@ public class InvoiceTest {
query = "{\"FP\":{\"GMFDZDH\":\"山东省潍坊市奎文区胜利东街4778号中央商务区2号楼301号\",\"XHFSBH\":\"91370703334376454N\",\"QDXMMC\":\"销售货物或者提供应税劳务、服务清单\",\"KPRQ\":\"20230331163347\",\"SGBZ\":\"\",\"XHFDZDH\":\"山东省潍坊市寒亭区白云路9号3号楼1-9 15165614885\",\"KPR\":\"庄莹莹\",\"QDBZ\":0,\"FHR\":\"于艺娇\",\"KPLX\":0,\"FPMX\":[{\"XMMC\":\"*设计服务*物料制作费\",\"ZXBM\":\"\",\"DJ\":\"128.712871\",\"ZZSTSGL\":\"\",\"KCE\":\"\",\"SPBM\":\"3040301990000000000\",\"SPSL\":\"1\",\"GGXH\":\"\",\"SE\":\"1.29\",\"DW\":\"批\",\"YHZCBS\":\"0\",\"SL\":\"0.01\",\"JE\":\"128.71\",\"FPHXZ\":0}],\"XHFMC\":\"山东达飞文化传播有限公司\",\"XHFYHZH\":\"潍坊农村商业银行股份有限公司寒亭支行 9070107120142050010911\",\"BZ\":\"\",\"EWM\":\"01,10,037002000311,66223914,128.71,20230331,05834122603484774628,2C6E,\",\"HJJE\":\"128.71\",\"FWM\":\"03-17-*>>1/062*89538-9/2265>975>20477<-/2-149-+4503*/6+3-/<>2+>90523-8><<7*8545668<276-503+9150181/-194>21</587*\",\"GMFYHZH\":\"中信银行潍坊分行8110601012700778796\",\"JYM\":\"05834122603484774628\",\"QZID\":\"4169455300053b94000000040003fb18\",\"JSHJ\":\"130.00\",\"BMBBBH\":\"48.0\",\"YFPDM\":\"\",\"FPHM\":\"66223914\",\"JQBH\":\"539902787121\",\"YFPHM\":\"\",\"FPDM\":\"037002000311\",\"GMFYX\":\"\",\"HJSE\":\"1.29\",\"GMFMC\":\"潍坊圣希门诊部有限公司\",\"MBDM\":\"3700\",\"SKR\":\"张海英\",\"GMFSJ\":\"\",\"GMFSBH\":\"91370700MA3MNWGFXD\",\"DKBZ\":0}}";
// query = "{}";
m = AisinoInvoiceDecryptUtil.encrypt(query, key);
m = JianshuiInvoiceDecryptUtil.encrypt(query, key);
System.out.println(m);
System.out.println("-------------------红字信息表申请-----------------------------");
// String redapply = "{\n" +
@ -535,29 +529,29 @@ public class InvoiceTest {
" \"fphxz\": \"0\"\n" +
" }]\n" +
" }";
String redapplyDecrypt = AisinoInvoiceDecryptUtil.encrypt(redapply, key);
String redapplyDecrypt = JianshuiInvoiceDecryptUtil.encrypt(redapply, key);
System.out.println(redapplyDecrypt);
System.out.println("------------------------------------------------");
System.out.println("-------------------红字信息表结果查询-----------------------------");
// redapply = "{\"buyerTaxNo\":\"91120116741399389F\",\"invoiceLine\":\"s\"}";
redapply = "{\"SQBXZQQPCH\":\"FSFP001-00000017\",\"NSRSBH\":\"366557441212122\",\"FPLXDM\":\"s\",\"XXBFW\":\"1\",\"billNo\":\"661545026858220629144108\"}";
redapplyDecrypt = AisinoInvoiceDecryptUtil.encrypt(redapply, key);
redapplyDecrypt = JianshuiInvoiceDecryptUtil.encrypt(redapply, key);
System.out.println(redapplyDecrypt);
System.out.println("------------------------------------------------");
System.out.println("-------------------月汇总信息查询-----------------------------");
// redapply = "{\"nsrsbh\":\"91370124163533637H\",\"fjh\":\"1\",\"ssyf\":\"202106\"}";
redapply = "{\"nsrsbh\":\"92370102MA3LDY427Q\",\"fjh\":\"587001605138\",\"ssyf\":\"202106\"}";
redapplyDecrypt = AisinoInvoiceDecryptUtil.encrypt(redapply, key);
redapplyDecrypt = JianshuiInvoiceDecryptUtil.encrypt(redapply, key);
System.out.println(redapplyDecrypt);
System.out.println("------------------------------------------------");
System.out.println("-------------------红字信息表撤销-----------------------------");
redapply = "{\"nsrsbh\":\"91370124163533637H\",\"fjh\":\"1\",\"xxbbh\":\"321321\"}";
redapplyDecrypt = AisinoInvoiceDecryptUtil.encrypt(redapply, key);
redapplyDecrypt = JianshuiInvoiceDecryptUtil.encrypt(redapply, key);
System.out.println(redapplyDecrypt);
System.out.println("------------------------------------------------");
System.out.println("-------------------库存查询-----------------------------");
redapply = "{}";
redapplyDecrypt = AisinoInvoiceDecryptUtil.encrypt(redapply, key);
redapplyDecrypt = JianshuiInvoiceDecryptUtil.encrypt(redapply, key);
System.out.println(redapplyDecrypt);
System.out.println("------------------------------------------------");
System.out.println("-------------------发票专用章生成-----------------------------");
@ -567,7 +561,7 @@ public class InvoiceTest {
" \"FPZYZHPHM\": \"132123131312312312\",\n" +
" \"FPZYZSXBM\": \"\"\n" +
"}";
redapplyDecrypt = AisinoInvoiceDecryptUtil.encrypt(redapply, key);
redapplyDecrypt = JianshuiInvoiceDecryptUtil.encrypt(redapply, key);
System.out.println(redapplyDecrypt);
System.out.println("------------------------------------------------");
@ -685,7 +679,7 @@ public class InvoiceTest {
" }\n" +
"}";
System.out.println(order);
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("-------------------用户登记-----------------------------");
System.out.println(m);
System.out.println("------------------------------------------------");
@ -794,7 +788,7 @@ public class InvoiceTest {
" \"serviceId\": \"lzfpkj\"\n" +
"}";
System.out.println(order);
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("-------------------蓝字发票开具-----------------------------");
System.out.println(m);
System.out.println("------------------------------------------------");
@ -810,7 +804,7 @@ public class InvoiceTest {
"}";
order = "{\"async\":false,\"nsrsbh\":\"51440300502682056B\",\"bsrysfzjhm\":\"450981198703130942\",\"requestId\":\"20230913@ca426816-7a79-416a-8e9b-59f8b4e80982\",\"dqbm\":\"shenzhen\",\"appkey\":\"+yBB13/8JybLGc+p1Pr8jw==\",\"serviceId\":\"tycxjk\"}";
System.out.println(order);
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("-------------------通用发票查询-----------------------------");
System.out.println(m);
System.out.println("------------------------------------------------");
@ -825,7 +819,7 @@ public class InvoiceTest {
" \"serviceId\": \"hqrlsbewm\"\n" +
"}";
System.out.println(order);
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("-------------------获取人脸识别二维码-----------------------------");
System.out.println(m);
System.out.println("------------------------------------------------");
@ -931,7 +925,7 @@ public class InvoiceTest {
"}";
System.out.println(order);
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("-------------------红字申请表上传-控制台-----------------------------");
System.out.println(m);
System.out.println("------------------------------------------------");
@ -947,7 +941,7 @@ public class InvoiceTest {
order = "{\"identity\":\"1260\",\"SQBXZQQPCH\":\"230324155308\",\"NSRSBH\":\"9137010096471813XB\",\"FPLXDM\":\"s\",\"XXBFW\":0}";
System.out.println(order);
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("-------------------红字申请表下载-控制台-----------------------------");
System.out.println(m);
System.out.println("------------------------------------------------");
@ -1045,7 +1039,7 @@ public class InvoiceTest {
order = "{\"async\":true,\"nsrsbh\":\"51440300502682056B\",\"jsonData\":{\"kprq\":\"20230905000000\",\"wjgs\":\"PDF\",\"fphm\":\"23952000000015068928\"},\"bsrysfzjhm\":\"450981198703130942\",\"dqbm\":\"shenzhen\",\"appkey\":\"+yBB13/8JybLGc+p1Pr8jw==\",\"serviceId\":\"qdfpwjhq\"}";
System.out.println(order);
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("-------------------发票查询-数科-----------------------------");
System.out.println(m);
System.out.println("------------------------------------------------");
@ -1054,7 +1048,7 @@ public class InvoiceTest {
// order = "Afepz1WAiJb1NSFa55EWPgW7dTwjzt4VVx21H17XyPe+i3I1XABxOmzCJ+DOZGO4iATVfrgz7nDk/w/JB79AVKSBmTMCobqpDEXfSaO9yyanVTvZqndxfCrDuuCLhTTYlEMzUcswaeCaFkI1O9T7ab\\ngQElxC/4QEh6E2IxbTHrZO5seOr4zZdDhG8FUZ1rl0s7tDY15d0=";
m = AisinoInvoiceDecryptUtil.decrypt(m, key);
m = JianshuiInvoiceDecryptUtil.decrypt(m, key);
System.out.println(m);
order = "iE5UDKqLJhXLWVl8VHJDvAzYjExPttGTOhlduaPoOxLZbF0fCokKJabrFecWbrZTdHkJuUlySh4TcLLsSX0vugooLTJj9MQNXGv3mppg6NIW8gOugMxmzFCK8AKVwPpgzOmbwEIkKoC+YvhCuXGkduIi0ucCPG8eaQ+jnkZz5WKa3P65AMvQGdONLwxzUlyyYnvFgQ6+JoDZQoZUnMlmOvPBorUgq1zY0YRfLZMgNeGC/VdKd1FMSNZ6R3x9xMC4GhI3dgHybolTxy1gEk9bHopNzTvvCRHfYDqOsO+VFk24a2771G3WHOb3wAUeqm/5JecA6ocQAMhn69tZYsQgzUq/wPl42Fkh62HD55OoTNchfsiGNbxrJuagphjoyJlWCFo1sELv31WOTT8Wv02ACR5Djyd3FSRthxmSNVT134bivA7VdKJPlKy7DVwCmJuyFnB2V8BTv+3lwBtNq2Hlc0473n8a+Q6UQDewZrfe/kJUL3QQq76VQfrM7+pZAZVmDKxAjf/3bNL3Ihq6FQKYSpLFNuvXxBKuWMzQ+9i7OV0nPXcqZL5e3E7j4CQEQavZj3r46e8Js5WQ8oPdrUmT6+NsVWoxP0eHZ4XO6jhjNvjLq2bAJGLVU+E4ra6BFLedvP+OcwtlVjmpGXuiJ0fSXNACNLbMyE9mn3vhPpiBP8KY4t8EShawJWkYTD4+HOoM+GxBfwVPBNFN0gwdDCNzyCOQvMsfpUwn6VmU2AgZblSOr2G88RowoTPYEqghgHa53QqAc9HYS4+r6QoUKzZmN/hUP1+3+xVY4C3anVqk7275aSTG4uzAN7+wTIfQTSvDAXTUeyBoyo5skP4a2tz0lnJv/IFvDYuZEa6CQ6ezfYQYfCiGeGzCn6JDX6QjRNr7vReEHby9/f5fZE018RmpG5YvjvRyPNtnPMhWMSIYUKU20iiNuQfqoQ7ZxXttxQDSWW9eijUAEzmQHdDqw47saVW48ROZutUkg7VZ4e+7MLCE5zPnX0FCBv9dzGSnbE4y53ftgYrS4Gz+VZxNZ07GObBbQvulbqqgbsWjrNuK0SZP/V1oLz0LP3Xcnky9M5e06p6QpKtwrla1N1kBrMojNBki6AHIHDU5V4H5j7wqpWVp6inbf+zIAU4y4a+tJjyCmwE1++aMpBja4QvTmcgCBG4M26dlifD927lm/Z5gJYVVK6Drg15laeO7RK9bUVB7HXD6IQAcaNJXGyvbnBm71qRVVELjI/yjQLvCRZzH+gO2l9zJBSX9OnBxSYFK9BVheMSZqVmpws7q1kSY8C/CfP6t7LSbj4VeNmhWpzMoA7FXyjFFR4jfj+PE0tcGf/r4lLaCbnXL4wYPtK0Zhk2gyCcB5SiCAuIAq2TniY+vr/QR00qwU2d8io4KUPkhImHeWrO5fRkF7KS9LHu6z+QC45Lgm3NMVHXQ34uu7choRTj4VZYRjPNOsad0GvCjlemR41hRbiEr9pawBmya7plejcVwYz3M6NvH/nBkNXR2XrHcbOqfaiZ4jTQu66EbwidSQaOBVicG8theiWJAgZW1bO+1yXvWXZNS5fLWgeVrpS7NhbRL0qKQ0p0I03bUcsNF86ng5UwFbPyqWlIRAEJIBlT25z+N24BFE5eVEqOqVTR9EBVAllWDW+TZR9pULdQkCSOiuLRMypCjoE868A+04Bp/PutjCeqiU8LeoIiRxlZvWu1I/hAJNPlL3htCMyPss9rAxYqyOUyJgATE3uIoWxvyYpmdUXlmYCv8XcdCXVkBvv84AleSX4eSamfjMv0uxf044fke2Hd5M+uHPue+wtx8Rzivq3zLvE+xxeTsJPIoboOqU+EgGz/gz5EhNNFAKLt0Awtv2wf9sLep43epuZ0nta9f5tPJZNDPW8opXBW/hL9SFL6W6uuexjnbmI/X2qmXnq0etAgWvd4kY8OrAULgyiOr6lg93mLP0/jVPtbj07eVNxjTdqMTpgisLpiVMnIIbC7g/ayKFlmy/yUFRJH7yJ3ZbhtbszoISl/BBvqxYQ0HrltkZCNwSBK6J6AA59dsiUR3buqxdRyzLtdxiQKXLjSU46wSKpZnVQ19eiye1243zoLQSd1g7Ux46Skay7UtzDzpOiqDs+1JE724LlmLtQXIgwNyFp3a/Dfk/CIMy3t0mQk/mph1i6Cgokw3bklmrvPrQttegvtIKAlNxL9AwbnKtQbxGA3jrQ5RKw5ArRir6SOpOJYJ1nCNOqZzlJKDYINZ8Gnkoy/MvTNgCjGKuVNtuP2AoK7CD/mkiSXbbFa8NrcqNEt86nVZMCH+NiB69OwxOUE3u7GOMxjfVu2Oh9mWXun3AMxqTbEbyZH8WXkGyC9NC81i5DxXDMa7h954T+HZpyD/XdOZpUnwbBLooadL0B6o";
@ -2118,7 +2112,7 @@ public class InvoiceTest {
" }\n" +
" ]\n" +
"}";
System.out.println(AisinoInvoiceDecryptUtil.encrypt(order,key));
System.out.println(JianshuiInvoiceDecryptUtil.encrypt(order,key));
System.out.println("========================");
// System.out.println(AisinoInvoiceEncryptUtil.encryptAES(order,key));

File diff suppressed because one or more lines are too long

@ -2,7 +2,7 @@ package com.jianshui.invoice.utils;
import cn.hutool.core.util.IdUtil;
import com.jianshui.common.utils.encrypt.AisinoInvoiceDecryptUtil;
import com.jianshui.common.utils.encrypt.JianshuiInvoiceDecryptUtil;
/**
* @Description
@ -346,7 +346,7 @@ public class QdEleInvoiceTest {
System.out.println(order);
String m = AisinoInvoiceDecryptUtil.encrypt(order, key);
String m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("-------------------发票开具-----------------------------");
System.out.println(m);
System.out.println("------------------------------------------------");
@ -355,12 +355,12 @@ public class QdEleInvoiceTest {
System.out.println(query);
m = AisinoInvoiceDecryptUtil.encrypt(query, key);
m = JianshuiInvoiceDecryptUtil.encrypt(query, key);
System.out.println(m);
System.out.println("------------------------------------------------");
System.out.println("-------------------发票查询(订单号)-----------------------------");
query = "{\"identity\":\"1200\",\"orderno\":[ '00000000005223210916']}";
m = AisinoInvoiceDecryptUtil.encrypt(query, key);
m = JianshuiInvoiceDecryptUtil.encrypt(query, key);
System.out.println(m);
System.out.println("------------------------------------------------");
@ -371,7 +371,7 @@ public class QdEleInvoiceTest {
" \"fphm\": \"66198156\",\n" +
"}";
m = AisinoInvoiceDecryptUtil.encrypt(query, key);
m = JianshuiInvoiceDecryptUtil.encrypt(query, key);
System.out.println(m);
System.out.println("------------------------------------------------");
@ -382,7 +382,7 @@ public class QdEleInvoiceTest {
" \"sellerTaxnum\": \"110101MYJ2GPQQ4\"\n" +
"}";
m = AisinoInvoiceDecryptUtil.encrypt(query, key);
m = JianshuiInvoiceDecryptUtil.encrypt(query, key);
System.out.println(m);
System.out.println("------------------------------------------------");
@ -392,7 +392,7 @@ public class QdEleInvoiceTest {
" \"dyjmc\": \"\"" +
"}";
m = AisinoInvoiceDecryptUtil.encrypt(query, key);
m = JianshuiInvoiceDecryptUtil.encrypt(query, key);
System.out.println(m);
System.out.println("------------------------------------------------");
@ -419,7 +419,7 @@ public class QdEleInvoiceTest {
" ]\n" +
"}";
m = AisinoInvoiceDecryptUtil.encrypt(query, key);
m = JianshuiInvoiceDecryptUtil.encrypt(query, key);
System.out.println(m);
System.out.println("------------------------------------------------");
@ -431,17 +431,17 @@ public class QdEleInvoiceTest {
"\"invoiceCode\": \"150000020026\"," +
"\"invoiceNum\": \"94579496\"" +
"}]}";
m = AisinoInvoiceDecryptUtil.encrypt(query, key);
m = JianshuiInvoiceDecryptUtil.encrypt(query, key);
System.out.println(m);
System.out.println("------------------------------------------------");
query = "";
m = AisinoInvoiceDecryptUtil.encrypt(query, key);
m = JianshuiInvoiceDecryptUtil.encrypt(query, key);
System.out.println(m);
System.out.println("------------------------------------------------");
order = "{\"identity\":\"1131\",\"order\":{\"buye rname\":\"山东爱信诺\",\"taxnum\":\"124511234993295177\",\"phone\":\"0\",\"address\":\"山东省济南市华信路 10\",\"account\":\"\",\"telephone\":\"0\",\"orderno\":\"nuonuo12345631\",\"invoicedate\":\"2018-10 -31 19:16:51\",\"clerk\":\"黄芝\",\"saleaccount\":\"宇宙行 442612010103507108\",\"salephone\":\"0774-7893911\",\"saleaddress\":\"富川瑶族自治县新 永 路 138 号 \",\"saletaxnum\":\"339901999999142\",\"kptype\":\"1\",\"message\":\"\",\"invoiceNow\":\"1\",\"payee\":\"林莉苏\",\"checker\":\"林莉苏\",\"tsfs\":\"-1\",\"email\":\"502192347@qq.com\",\"qdbz\":\"0\",\"qdxmmc\":\"\",\"dkbz\":\" 0\",\"deptid\":\"\",\"clerkid\":\"\",\"invoiceLine\":\"p\",\"cpybz\":\"\",\"detail\":[{\"goodsname\":\"苹果\",\"num\":\"1\",\"price\":\"1\",\"hsbz\":\"1\",\"taxrate\":\"0.13\",\"spec\":\"\",\"unit\":\"吨 \",\"spbm\":\"10101150101\",\"zsbm\":\"\",\"fphxz\":\"0\",\"yhzcbs\":\"0\",\"zzstsgl\":\"\",\"lsl bs\":\"\",\"kce\":\"\"}]}}";
// order="{\"identity\":\"1132\",\"order\":[{\"buyername\":\"浙江爱信诺\",\"taxnum\":\"334511234993295178\",\"phone\":\"0\",\"address\":\" 浙江省杭州市万塘路 \",\"account\":\"\",\"telephone\":\"0\",\"orderno\":\"nuonuo243451234\",\"invoicedate\":\"2018-10-31 19:16:51\",\"clerk\":\"黄芝\",\"saleaccount\":\"宇宙行 442612010103507108\",\"salephone\":\"0774-7893911\",\"saleaddress\":\"富川瑶族自治县新 永路 138 号 \",\"saletaxnum\":\"150301199811285326\",\"kptype\":\"1\",\"message\":\"1\",\"invoiceNow\":\"1\",\"payee\":\"林莉苏 \",\"checker\":\"林莉苏 \",\"tsfs\":\"-1\",\"email\":\"502192347@qq.com\",\"qdbz\":\"0\",\"qdxmmc\":\"\",\"dkbz\":\"0\",\"deptid\":\"\",\"clerkid\":\"\",\"invoiceLine\":\"c\",\"cpybz\":\"\",\"detail\":[{\"goodsname\":\"苹果\",\"num\":\"1\",\"price\":\"1\",\"hsbz\":\"1\",\"taxrate\":\"0.13\",\"spec\":\"111\",\"unit\":\"吨 \",\"spbm\":\"10101150101\",\"zsbm\":\"111\",\"fphxz\":\"0\",\"yhzcbs\":\"0\",\"zzstsgl\":\"1\",\"lslbs\":\"1\",\"kce\":\"0\",\"tax\":\"1.20\",\"spbm\":\"112\",\"taxamt\":\"112\"}]},{\"buyername\":\"浙江爱信诺\",\"taxnum\":\"393511234993295177\",\"phone\":\"0\",\"address\":\" 浙江省杭州市万塘路 \",\"account\":\"\",\"telephone\":\"0\",\"orderno\":\"nuonuo243451243\",\"invoicedate\":\"2018-10-31 19:16:51\",\"clerk\":\"黄芝\",\"saleaccount\":\"宇宙行 442612010103507108\",\"salephone\":\"0774-7893911\",\"saleaddress\":\"富川瑶族自治县新 永路 138 号 \",\"saletaxnum\":\"150301199811285326\",\"kptype\":\"1\",\"message\":\"1\",\"invoiceNow\":\"1\",\"payee\":\"林莉苏 \",\"checker\":\"林莉苏 \",\"tsfs\":\"-1\",\"email\":\"502192347@qq.com\",\"qdbz\":\"0\",\"qdxmmc\":\"\",\"dkbz\":\"0\",\"deptid\":\"\",\"clerkid\":\"\",\"invoiceLine\":\"c\",\"cpybz\":\"\",\"detail\":[{\"goodsname\":\"苹果\",\"num\":\"1\",\"price\":\"1\",\"hsbz\":\"1\",\"taxrate\":\"0.13\",\"spec\":\"111\",\"unit\":\"吨 \",\"spbm\":\"10101150101\",\"zsbm\":\"111\",\"fphxz\":\"0\",\"yhzcbs\":\"0\",\"zzstsgl\":\"1\",\"lslbs\":\"1\",\"kce\":\"0\",\"tax\":\"1.20\",\"spbm\":\"112\",\"taxamt\":\"112\"}]}]}";
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println(m);
@ -449,7 +449,7 @@ public class QdEleInvoiceTest {
query = "{\"FP\":{\"GMFDZDH\":\"山东省潍坊市奎文区胜利东街4778号中央商务区2号楼301号\",\"XHFSBH\":\"91370703334376454N\",\"QDXMMC\":\"销售货物或者提供应税劳务、服务清单\",\"KPRQ\":\"20230331163347\",\"SGBZ\":\"\",\"XHFDZDH\":\"山东省潍坊市寒亭区白云路9号3号楼1-9 15165614885\",\"KPR\":\"庄莹莹\",\"QDBZ\":0,\"FHR\":\"于艺娇\",\"KPLX\":0,\"FPMX\":[{\"XMMC\":\"*设计服务*物料制作费\",\"ZXBM\":\"\",\"DJ\":\"128.712871\",\"ZZSTSGL\":\"\",\"KCE\":\"\",\"SPBM\":\"3040301990000000000\",\"SPSL\":\"1\",\"GGXH\":\"\",\"SE\":\"1.29\",\"DW\":\"批\",\"YHZCBS\":\"0\",\"SL\":\"0.01\",\"JE\":\"128.71\",\"FPHXZ\":0}],\"XHFMC\":\"山东达飞文化传播有限公司\",\"XHFYHZH\":\"潍坊农村商业银行股份有限公司寒亭支行 9070107120142050010911\",\"BZ\":\"\",\"EWM\":\"01,10,037002000311,66223914,128.71,20230331,05834122603484774628,2C6E,\",\"HJJE\":\"128.71\",\"FWM\":\"03-17-*>>1/062*89538-9/2265>975>20477<-/2-149-+4503*/6+3-/<>2+>90523-8><<7*8545668<276-503+9150181/-194>21</587*\",\"GMFYHZH\":\"中信银行潍坊分行8110601012700778796\",\"JYM\":\"05834122603484774628\",\"QZID\":\"4169455300053b94000000040003fb18\",\"JSHJ\":\"130.00\",\"BMBBBH\":\"48.0\",\"YFPDM\":\"\",\"FPHM\":\"66223914\",\"JQBH\":\"539902787121\",\"YFPHM\":\"\",\"FPDM\":\"037002000311\",\"GMFYX\":\"\",\"HJSE\":\"1.29\",\"GMFMC\":\"潍坊圣希门诊部有限公司\",\"MBDM\":\"3700\",\"SKR\":\"张海英\",\"GMFSJ\":\"\",\"GMFSBH\":\"91370700MA3MNWGFXD\",\"DKBZ\":0}}";
// query = "{}";
m = AisinoInvoiceDecryptUtil.encrypt(query, key);
m = JianshuiInvoiceDecryptUtil.encrypt(query, key);
System.out.println(m);
System.out.println("-------------------红字信息表申请-----------------------------");
// String redapply = "{\n" +
@ -519,29 +519,29 @@ public class QdEleInvoiceTest {
" \"fphxz\": \"0\"\n" +
" }]\n" +
" }";
String redapplyDecrypt = AisinoInvoiceDecryptUtil.encrypt(redapply, key);
String redapplyDecrypt = JianshuiInvoiceDecryptUtil.encrypt(redapply, key);
System.out.println(redapplyDecrypt);
System.out.println("------------------------------------------------");
System.out.println("-------------------红字信息表结果查询-----------------------------");
// redapply = "{\"buyerTaxNo\":\"91120116741399389F\",\"invoiceLine\":\"s\"}";
redapply = "{\"SQBXZQQPCH\":\"FSFP001-00000017\",\"NSRSBH\":\"366557441212122\",\"FPLXDM\":\"s\",\"XXBFW\":\"1\",\"billNo\":\"661545026858220629144108\"}";
redapplyDecrypt = AisinoInvoiceDecryptUtil.encrypt(redapply, key);
redapplyDecrypt = JianshuiInvoiceDecryptUtil.encrypt(redapply, key);
System.out.println(redapplyDecrypt);
System.out.println("------------------------------------------------");
System.out.println("-------------------月汇总信息查询-----------------------------");
// redapply = "{\"nsrsbh\":\"91370124163533637H\",\"fjh\":\"1\",\"ssyf\":\"202106\"}";
redapply = "{\"nsrsbh\":\"92370102MA3LDY427Q\",\"fjh\":\"587001605138\",\"ssyf\":\"202106\"}";
redapplyDecrypt = AisinoInvoiceDecryptUtil.encrypt(redapply, key);
redapplyDecrypt = JianshuiInvoiceDecryptUtil.encrypt(redapply, key);
System.out.println(redapplyDecrypt);
System.out.println("------------------------------------------------");
System.out.println("-------------------红字信息表撤销-----------------------------");
redapply = "{\"nsrsbh\":\"91370124163533637H\",\"fjh\":\"1\",\"xxbbh\":\"321321\"}";
redapplyDecrypt = AisinoInvoiceDecryptUtil.encrypt(redapply, key);
redapplyDecrypt = JianshuiInvoiceDecryptUtil.encrypt(redapply, key);
System.out.println(redapplyDecrypt);
System.out.println("------------------------------------------------");
System.out.println("-------------------库存查询-----------------------------");
redapply = "{}";
redapplyDecrypt = AisinoInvoiceDecryptUtil.encrypt(redapply, key);
redapplyDecrypt = JianshuiInvoiceDecryptUtil.encrypt(redapply, key);
System.out.println(redapplyDecrypt);
System.out.println("------------------------------------------------");
System.out.println("-------------------发票专用章生成-----------------------------");
@ -551,7 +551,7 @@ public class QdEleInvoiceTest {
" \"FPZYZHPHM\": \"132123131312312312\",\n" +
" \"FPZYZSXBM\": \"\"\n" +
"}";
redapplyDecrypt = AisinoInvoiceDecryptUtil.encrypt(redapply, key);
redapplyDecrypt = JianshuiInvoiceDecryptUtil.encrypt(redapply, key);
System.out.println(redapplyDecrypt);
System.out.println("------------------------------------------------");
@ -669,7 +669,7 @@ public class QdEleInvoiceTest {
" }\n" +
"}";
System.out.println(order);
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("-------------------用户登记-----------------------------");
System.out.println(m);
System.out.println("------------------------------------------------");
@ -778,7 +778,7 @@ public class QdEleInvoiceTest {
" \"serviceId\": \"lzfpkj\"\n" +
"}";
System.out.println(order);
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("-------------------蓝字发票开具-----------------------------");
System.out.println(m);
System.out.println("------------------------------------------------");
@ -794,7 +794,7 @@ public class QdEleInvoiceTest {
"}";
order = "{\"async\":false,\"nsrsbh\":\"51440300502682056B\",\"bsrysfzjhm\":\"450981198703130942\",\"requestId\":\"20230913@ca426816-7a79-416a-8e9b-59f8b4e80982\",\"dqbm\":\"shenzhen\",\"appkey\":\"+yBB13/8JybLGc+p1Pr8jw==\",\"serviceId\":\"tycxjk\"}";
System.out.println(order);
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("-------------------通用发票查询-----------------------------");
System.out.println(m);
System.out.println("------------------------------------------------");
@ -809,7 +809,7 @@ public class QdEleInvoiceTest {
" \"serviceId\": \"hqrlsbewm\"\n" +
"}";
System.out.println(order);
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("-------------------获取人脸识别二维码-----------------------------");
System.out.println(m);
System.out.println("------------------------------------------------");
@ -915,7 +915,7 @@ public class QdEleInvoiceTest {
"}";
System.out.println(order);
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("-------------------红字申请表上传-控制台-----------------------------");
System.out.println(m);
System.out.println("------------------------------------------------");
@ -931,7 +931,7 @@ public class QdEleInvoiceTest {
order = "{\"identity\":\"1260\",\"SQBXZQQPCH\":\"230324155308\",\"NSRSBH\":\"9137010096471813XB\",\"FPLXDM\":\"s\",\"XXBFW\":0}";
System.out.println(order);
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("-------------------红字申请表下载-控制台-----------------------------");
System.out.println(m);
System.out.println("------------------------------------------------");
@ -1029,7 +1029,7 @@ public class QdEleInvoiceTest {
order = "{\"async\":true,\"nsrsbh\":\"51440300502682056B\",\"jsonData\":{\"kprq\":\"20230905000000\",\"wjgs\":\"PDF\",\"fphm\":\"23952000000015068928\"},\"bsrysfzjhm\":\"450981198703130942\",\"dqbm\":\"shenzhen\",\"appkey\":\"+yBB13/8JybLGc+p1Pr8jw==\",\"serviceId\":\"qdfpwjhq\"}";
System.out.println(order);
m = AisinoInvoiceDecryptUtil.encrypt(order, key);
m = JianshuiInvoiceDecryptUtil.encrypt(order, key);
System.out.println("-------------------发票查询-数科-----------------------------");
System.out.println(m);
System.out.println("------------------------------------------------");
@ -1037,7 +1037,7 @@ public class QdEleInvoiceTest {
// order = "Afepz1WAiJb1NSFa55EWPgW7dTwjzt4VVx21H17XyPe+i3I1XABxOmzCJ+DOZGO4iATVfrgz7nDk/w/JB79AVKSBmTMCobqpDEXfSaO9yyanVTvZqndxfCrDuuCLhTTYlEMzUcswaeCaFkI1O9T7ab\\ngQElxC/4QEh6E2IxbTHrZO5seOr4zZdDhG8FUZ1rl0s7tDY15d0=";
m = AisinoInvoiceDecryptUtil.decrypt(m, key);
m = JianshuiInvoiceDecryptUtil.decrypt(m, key);
System.out.println(m);

Loading…
Cancel
Save