中交建-销项合并测试:用户登记接口处理

beta-enc
dongxiaoke 2 years ago
parent 3288b0d7c1
commit 63857fd37a
  1. 16
      jianshui-admin/src/main/java/com/jianshui/api/controller/http/invoice/v1/InvoiceController.java
  2. 37
      jianshui-common/src/main/java/com/jianshui/common/utils/HutoolUtilsPro.java
  3. 11
      jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/service/impl/InvoiceAllImpl.java
  4. 3
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/adapter/request/AisinoInvoiceRequestAdapterImpl.java
  5. 228
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/adapter/request/JcskInvoiceRequestAdapterImpl.java
  6. 246
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/adapter/response/JcskInvoiceResponseAdapterImpl.java
  7. 33
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/JcskInvoiceApiServiceImpl.java
  8. 2
      jianshui-invoice/src/main/java/com/jianshui/invoice/utils/JcskTest.java

@ -167,7 +167,21 @@ public class InvoiceController {
IInvoiceRequestService invoiceRequestService = invoiceRequestFactory.getService(requestAdapterKey);
JSONObject decryptResult = invoiceRequestService.decrypt(request, companyservice, "add");
HXResponse result = preHandleDecryptResult(decryptResult, "add", companyservice);
// 报文处理
BillInfo billInfo = decryptResult.toJavaObject(BillInfo.class);
if (billInfo == null) {
throw new JianshuiParamErrorException(ErrorCode.ERROR_PARAMS, companyservice, "invoice");
}
billInfo.setSource("2");
// 获得请求实例,并且进行扣费
String serviceKey = serviceManageService.getCompanyServiceSupplier("invoice", companyservice.getCompanyid());
serviceManageService.companyConsume("invoice", companyservice.getCompanyid());
billInfo.setServiceSupplierKey(serviceKey);
IInvoiceApiService invoiceService = invoiceServiceFactory.getService(serviceKey);
HXResponse result = invoiceService.addInvoice(billInfo, companyservice);
// HXResponse result = preHandleDecryptResult(decryptResult, "add", companyservice);
String responseAdapterKey = serviceManageService.getResponseAdapterKey("invoice", companyservice.getCompanyid());
IInvoiceResponseService invoiceResponseService = invoiceResponseFactory.getService(responseAdapterKey);

@ -0,0 +1,37 @@
package com.jianshui.common.utils;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import java.util.HashSet;
import java.util.Set;
/**
* hutool工具类处理
* kk
*/
public class HutoolUtilsPro {
/**
* 修改BeanUtils.copy null属性覆盖的问题判断null属性加入忽略列表
* @param source
* @return
*/
public static String[] getNullPropertyNames (Object source) {
final BeanWrapper src = new BeanWrapperImpl(source);
java.beans.PropertyDescriptor[] pds = src.getPropertyDescriptors();
Set<String> emptyNames = new HashSet<String>();
for(java.beans.PropertyDescriptor pd : pds) {
Object srcValue = src.getPropertyValue(pd.getName());
if (srcValue == null) emptyNames.add(pd.getName());
}
String[] result = new String[emptyNames.size()];
return emptyNames.toArray(result);
}
}

@ -1,6 +1,7 @@
package com.jianshui.invoiceall.service.impl;
import java.util.Date;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.date.DateUtil;
import java.math.BigDecimal;
@ -17,6 +18,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.utils.HutoolUtilsPro;
import com.jianshui.common.utils.StringUtils;
import com.jianshui.common.utils.ValidateUtils;
import com.jianshui.common.utils.uuid.IdUtils;
@ -89,7 +91,9 @@ public class InvoiceAllImpl implements IInvoiceAll {
ValidateUtils.validate(yhdjDetailDTOList);
yhdjDTO.setJsonData(yhdjDetailDTOList);
JSONObject result = null;
// JSONObject result = null;
JSONObject result = new JSONObject();
try {
result = ApiHttp.request(WebServiceConstant.YHDJ, WebServiceConstant.URL, yhdjDTO, companyservice);
@ -98,14 +102,15 @@ public class InvoiceAllImpl implements IInvoiceAll {
String data = result.get("data") != null ? result.get("data").toString() : "";
if ("0000".equals(code)) {
InvoiceAllYhdj yhdj = BeanUtil.copyProperties(yhdjDTO.getJsonData(), InvoiceAllYhdj.class);
InvoiceAllYhdj yhdj = BeanUtil.copyProperties(yhdjDTO, InvoiceAllYhdj.class);
QueryWrapper<InvoiceAllYhdj> yhdjQueryWrapper = new QueryWrapper<>();
yhdjQueryWrapper.eq("nsrsbh", yhdj.getNsrsbh());
yhdjQueryWrapper.eq("identity", companyservice.getIdentity());
InvoiceAllYhdj yhdjTemp = yhdjMapper.selectOne(yhdjQueryWrapper);
if (BeanUtil.isNotEmpty(yhdjTemp)) {
yhdjTemp = BeanUtil.copyProperties(yhdj, InvoiceAllYhdj.class);
BeanUtil.copyProperties(yhdj,yhdjTemp,CopyOptions.create().setIgnoreNullValue(true)) ;
yhdjTemp.setUpdateTime(new Date());
yhdjMapper.updateInvoiceAllYhdj(yhdjTemp);
} else {

@ -101,7 +101,8 @@ public class AisinoInvoiceRequestAdapterImpl implements IInvoiceRequestService {
// 平台解密
try {
order = AisinoInvoiceDecryptUtil.decrypt(order, JKey);
// TODO: 2023/4/23 调试屏蔽
// order = AisinoInvoiceDecryptUtil.decrypt(order, JKey);
} catch (Exception e) {
e.printStackTrace();
throw new JianshuiParamErrorException(ErrorCode.DECRYPT_ERROR, companyservice, "invoice");

@ -1,228 +0,0 @@
package com.jianshui.invoice.service.impl.adapter.request;
import com.alibaba.fastjson.JSONObject;
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.IdcardUtils;
import com.jianshui.common.utils.StringUtils;
import com.jianshui.common.utils.encrypt.AisinoInvoiceDecryptUtil;
import com.jianshui.invoice.domain.BillDetail;
import com.jianshui.invoice.domain.BillInfo;
import com.jianshui.invoice.domain.Redinfo;
import com.jianshui.invoice.domain.Redinfodetail;
import com.jianshui.invoice.domain.dto.DownloadRedInfoDTO;
import com.jianshui.invoice.domain.dto.adapter.request.aisino_jn.HxBillDetailDTO;
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.system.service.ICompanyserviceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
/**
* @Description 航信入口报文适配器
* @Author 巩权林
* @Date 2022/3/19 21:28
**/
@Slf4j
@Component("jn_jcsk_invoice_request_adapter")
public class JcskInvoiceRequestAdapterImpl implements IInvoiceRequestService {
@Autowired
private ICompanyserviceService companyserviceService;
/**
* 解密函数
*
* @param request
* @param companyservice
* @return
*/
@Override
public JSONObject decrypt(HttpServletRequest request, Companyservice companyservice, String serviceKey) {
// 根据servletRequest获取原始请求报文
// String rawInput = HttpHelper.getBodyString(request);
// if (StringUtils.isEmpty(rawInput)) {
// throw new JianshuiParamErrorException(ErrorCode.EMPTY_PARAMS,"invoice);
// }
// JSONObject rawJson = JSONObject.parseObject(rawInput);
// 因为航信的报文都是Form,所以这里要按form的来
//方式一:getParameterMap(),获得请求参数map
Map<String, String[]> map = request.getParameterMap();
//参数名称
Set<String> key = map.keySet();
//参数迭代器
Iterator<String> iterator = key.iterator();
// JSONObject rawJson = JSONObject.parseObject(JSONObject.toJSONString(params));
JSONObject rawJson = new JSONObject();
while (iterator.hasNext()) {
String k = iterator.next();
rawJson.put(k, map.get(k)[0]);
}
if (StringUtils.isEmpty(rawJson)) {
throw new JianshuiParamErrorException(ErrorCode.ERROR_PARAMS, companyservice, "invoice");
}
String order = rawJson.getString("order");
String identity = rawJson.getString("identity");
log.info("【航信转invoice请求适配器】客户请求报文原始数据:{},销方id:{},serviceKey:{}", rawJson, companyservice.getCompanyid(), serviceKey);
// 开始解析报文
if (order == null || "".equals(order.trim())) {
throw new JianshuiParamErrorException(ErrorCode.ERROR_PARAMS, companyservice, "invoice");
}
String JKey = companyservice.getSecret(); // 解密用的secret
if (StringUtils.isEmpty(JKey)) {
throw new JianshuiParamErrorException(ErrorCode.IDENTITY_NOT_SET, companyservice, "jcsk");
}
// 平台解密
try {
order = AisinoInvoiceDecryptUtil.decrypt(order, JKey);
} catch (Exception e) {
e.printStackTrace();
throw new JianshuiParamErrorException(ErrorCode.DECRYPT_ERROR, companyservice, "jcsk");
}
log.info("销项报文:identity=" + identity + ",order=" + order);
// 报文内容体
JSONObject json = new JSONObject();
try {
// 根据用户封装参数进行区别处理
JSONObject orderJson = JSONObject.parseObject(order);
String myIdentity = orderJson.getString("identity");
if (myIdentity != null) {
// order里面有identity的情况,取出来order
JSONObject tempJson = new JSONObject();
tempJson = orderJson.getJSONObject("order");
if (tempJson != null) {
orderJson = tempJson;
}
}
json = orderJson;
// 如果是开票或者查询
if (StringUtils.equals(serviceKey, "add") || StringUtils.equals(serviceKey, "query")) {
// 开始把航信报文转成billInfo
HxBillInfoDTO hxBillInfo = json.toJavaObject(HxBillInfoDTO.class);
BillInfo billInfo = new BillInfo();
BeanUtils.copyProperties(hxBillInfo, billInfo);
if(StringUtils.isNotEmpty(hxBillInfo.getEmail())){
billInfo.setBuyerEmail(hxBillInfo.getEmail());
}
if (StringUtils.isEmpty(billInfo.getBuyerBank()) && StringUtils.isNotEmpty(billInfo.getBuyerAccount())) {
String bankNo = IdcardUtils.getBankNo(billInfo.getBuyerAccount());
if (StringUtils.isNotEmpty(bankNo)) {
String raw = billInfo.getBuyerAccount();
billInfo.setBuyerAccount(bankNo);
billInfo.setBuyerBank(raw.replace(bankNo, ""));
}
}
// 处理detail
List<HxBillDetailDTO> hxBillDetailList = hxBillInfo.getDetail();
List<BillDetail> detailList = new ArrayList<>();
if (hxBillDetailList != null && hxBillDetailList.size() > 0) {
for (HxBillDetailDTO detial : hxBillDetailList) {
BillDetail temp = new BillDetail();
BeanUtils.copyProperties(detial, temp);
detailList.add(temp);
}
billInfo.setBillDetailList(detailList);
}
if (StringUtils.isEmpty(billInfo.getBuyerBank()) && StringUtils.isNotEmpty(billInfo.getBuyerAccount())) {
String bankNo = IdcardUtils.getBankNo(billInfo.getBuyerAccount());
if (StringUtils.isNotEmpty(bankNo)) {
String raw = billInfo.getBuyerAccount();
billInfo.setBuyerAccount(bankNo);
billInfo.setBuyerBank(raw.replace(bankNo, ""));
}
}
// 处理销方信息
if (StringUtils.isEmpty(billInfo.getSellerBank()) && StringUtils.isNotEmpty(billInfo.getSellerAccount())) {
String bankNo = IdcardUtils.getBankNo(billInfo.getSellerAccount());
if (StringUtils.isNotEmpty(bankNo)) {
String raw = billInfo.getSellerAccount();
billInfo.setSellerAccount(bankNo);
billInfo.setSellerBank(raw.replace(bankNo, ""));
}
}
json = (JSONObject) JSONObject.toJSON(billInfo);
}
// 如果是redinfo
if (StringUtils.equals(serviceKey, "add_redinfo")) {
// 开始把航信报文转成billInfo
HxRedInfoDTO hxBillInfo = json.toJavaObject(HxRedInfoDTO.class);
Redinfo billInfo = new Redinfo();
BeanUtils.copyProperties(hxBillInfo, billInfo);
// 处理detail
List<HxRedInfoDetailsDTO> hxBillDetailList = hxBillInfo.getRedinfodetailList();
List<Redinfodetail> detailList = new ArrayList<>();
for (int i = 0; i < hxBillDetailList.size(); i++) {
HxRedInfoDetailsDTO detial = hxBillDetailList.get(i);
Redinfodetail temp = new Redinfodetail();
BeanUtils.copyProperties(detial, temp);
temp.setIndex(i);
detailList.add(temp);
}
billInfo.setRedinfodetailList(detailList);
json = (JSONObject) JSONObject.toJSON(billInfo);
}
// 如果是发票作废
if (StringUtils.equals(serviceKey, "deprecate")) {
return json;
}
// 如果是红字信息表下载
if (StringUtils.equals(serviceKey, "download_redinfo")) {
DownloadRedInfoDTO downloadRedInfoDTO = json.toJavaObject(DownloadRedInfoDTO.class);
json = (JSONObject) JSONObject.toJSON(downloadRedInfoDTO);
return json;
}
// 如果是发票打印
if (StringUtils.equals(serviceKey, "batch_print")) {
// JSONArray detail = json.getJSONArray("dyfpxx");
// for (int i = 0; i < detail.size(); i++) {
// JSONObject temp = (JSONObject) detail.get(i);
// String fplxdm = ElephantUtils.transElephantType(temp.getString("fpzldm"), 1);
// temp.put("fpzldm", fplxdm);
// detail.set(i, temp);
// }
return json;
}
} catch (JianshuiParamErrorException e) {
throw e;
} catch (Exception e) {
e.printStackTrace();
throw new JianshuiParamErrorException(ErrorCode.DECRYPT_ERROR, companyservice, "invoice");
}
return json;
}
@Override
public String covertMethodName(String method) {
return null;
}
}

@ -1,246 +0,0 @@
package com.jianshui.invoice.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.exception.jianshui.JianshuiParamErrorException;
import com.jianshui.common.utils.DictUtils;
import com.jianshui.common.utils.StringUtils;
import com.jianshui.common.utils.bean.BeanUtils;
import com.jianshui.invoice.domain.BillInfo;
import com.jianshui.invoice.domain.Invoice;
import com.jianshui.invoice.domain.InvoiceDetail;
import com.jianshui.invoice.domain.Redinfo;
import com.jianshui.invoice.domain.dto.HXResponse;
import com.jianshui.invoice.domain.dto.adapter.response.aisino_jn.AisinoJnInvoiceDetailResponse;
import com.jianshui.invoice.domain.dto.adapter.response.aisino_jn.AisinoJnInvoiceResponse;
import com.jianshui.invoice.service.IInvoiceResponseService;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
/**
* @Description 航信出口报文适配器
* @Author 巩权林
* @Date 2022/3/19 21:28
**/
@Component("jn_jcsk_invoice_response_adapter")
public class JcskInvoiceResponseAdapterImpl implements IInvoiceResponseService {
@Override
public JSONObject response(HXResponse result, Companyservice companyservice, String query) {
// 如果是开具
if (StringUtils.equals("add", query)) {
return result;
}
// 如果是发票查询
if (StringUtils.equals("query", query)) {
// 判断有无data
Object datas = result.getData();
// 如果datas不为Null
if (datas != null) {
// 如果返回将诶过为invioce
List<AisinoJnInvoiceResponse> responses = new ArrayList<>();
if (datas instanceof List) {
for (int ij = 0; ij < ((List<?>) datas).size(); ij++) {
Object data = ((List<?>) datas).get(ij);
// 转为HxInvoice
Invoice invoice = (Invoice) data;
if (invoice == null) {
continue;
}
AisinoJnInvoiceResponse invoiceResponse = new AisinoJnInvoiceResponse();
BeanUtils.copyProperties(invoice, invoiceResponse);
String invoiceType = DictUtils.getDictLabel("invoice_type", invoice.getInvoiceType());
if (invoiceType != null) {
invoiceResponse.setInvoiceType(invoiceType);
}
// 处理发票状态
// 处理Detail
List<InvoiceDetail> detailList = invoice.getInvoiceDetailList();
if (detailList != null) {
List<AisinoJnInvoiceDetailResponse> invoiceDetailResponses = new ArrayList<>();
for (int i = 0; i < detailList.size(); i++) {
AisinoJnInvoiceDetailResponse response = new AisinoJnInvoiceDetailResponse();
InvoiceDetail tempDetail = detailList.get(i);
BeanUtils.copyProperties(tempDetail, response);
Integer hsbz = tempDetail.getHsbz();
if (hsbz == 0) {
response.setHsbz("false");
response.setTaxamt(null);
// 如果不含税
} else {
// 如果含税
response.setHsbz("true");
response.setTaxfreeamt(response.getTaxamt());
}
invoiceDetailResponses.add(response);
}
invoiceResponse.setInvoiceDetailList(invoiceDetailResponses);
}
responses.add(invoiceResponse);
}
JSONObject queryResult = new JSONObject();
queryResult.put("result", result.getMessage());
queryResult.put("list", responses);
return queryResult;
}
}
JSONObject queryResult = new JSONObject();
queryResult.put("result", result.getMessage());
queryResult.put("list", new ArrayList<>());
}
// 如果是开具红票
if (StringUtils.equals("add_redinfo", query)) {
return result;
}
// 如果是下载红票
if (StringUtils.equals("download_redinfo", query)) {
Object datas = result.getData();
// 如果datas不为Null
if (datas != null) {
// 如果返回将诶过为invioce
// List<AisinoJnInvoiceResponse> responses = new ArrayList<>();
// if (datas instanceof List) {
// }
}
return result;
}
// 如果是打印
if (StringUtils.equals("printer", query)) {
Object datas = result.getData();
// 如果datas不为Null
if (datas != null) {
// 如果返回将诶过为invioce
// List<AisinoJnInvoiceResponse> responses = new ArrayList<>();
// if (datas instanceof List) {
// }
}
return result;
}
// 作废查询
if (StringUtils.equals("deprecate_query", query)) {
Object datas = result.getData();
if (datas != null) {
JSONObject dataJson = (JSONObject) datas;
// String status = dataJson.getString("status");
JSONObject result2 = new JSONObject();
result2.put("message", "操作完成");
result2.put("status", "0000");
result2.put("data", dataJson);
// if (StringUtils.equals(status, "3")) {
// result2.put("code", "0000");
// result2.put("msg", "作废成功");
// } else if (StringUtils.equals(status, "1")) {
// result2.put("code", "9998");
// result2.put("msg", "作废中");
// } else {
// result2.put("code", "9998");
// result2.put("msg", "作废失败");
// }
return result2;
}
}
if (StringUtils.equals("sign_e_seal", query)) {
AjaxResult resp = AjaxResult.success();
Object data = result.getData();
if (!StringUtils.equals("0000", result.getStatus())) {
resp = AjaxResult.error(result.getMessage());
return JSONObject.parseObject(JSONObject.toJSONString(resp));
}
JSONObject dataJson = (JSONObject) data;
if (StringUtils.equals("0000", dataJson.getString("CODE"))) {
// result.put("code", "200");
// result.put("data", dataJson.getJSONObject("data"));
resp.put("data", dataJson.getJSONObject("DATA"));
return JSONObject.parseObject(JSONObject.toJSONString(resp));
}else{
// result.put("code", dataJson.getString("CODE"));
// result.put("message", dataJson.getJSONObject("MESSAGE"));
resp.put("code", dataJson.getString("CODE"));
resp.put("message", dataJson.getString("MESSAGE"));
return JSONObject.parseObject(JSONObject.toJSONString(resp));
}
}
if (StringUtils.equals("register_e_seal", query)) {
AjaxResult resp = AjaxResult.success();
Object data = result.getData();
if (!StringUtils.equals("0000", result.getStatus())) {
resp = AjaxResult.error(result.getMessage());
return JSONObject.parseObject(JSONObject.toJSONString(resp));
}
JSONObject dataJson = (JSONObject) data;
if (StringUtils.equals("0000", dataJson.getString("CODE"))) {
// result.put("code", "200");
// result.put("data", dataJson.getJSONObject("data"));
resp.put("data", dataJson.getJSONObject("DATA"));
return JSONObject.parseObject(JSONObject.toJSONString(resp));
}else{
// result.put("code", dataJson.getString("CODE"));
// result.put("message", dataJson.getJSONObject("MESSAGE"));
resp.put("code", dataJson.getString("CODE"));
resp.put("message", dataJson.getString("MESSAGE"));
return JSONObject.parseObject(JSONObject.toJSONString(resp));
}
}
if (StringUtils.equals("create_e_seal", query)) {
AjaxResult resp = AjaxResult.success();
Object data = result.getData();
if (!StringUtils.equals("0000", result.getStatus())) {
resp = AjaxResult.error(result.getMessage());
return JSONObject.parseObject(JSONObject.toJSONString(resp));
}
JSONObject dataJson = (JSONObject) data;
if (StringUtils.equals("0000", dataJson.getString("CODE"))) {
// result.put("code", "200");
// result.put("data", dataJson.getJSONObject("data"));
resp.put("data", dataJson.getJSONObject("DATA"));
return JSONObject.parseObject(JSONObject.toJSONString(resp));
}else{
// result.put("code", dataJson.getString("CODE"));
// result.put("message", dataJson.getJSONObject("MESSAGE"));
resp.put("code", dataJson.getString("CODE"));
resp.put("message", dataJson.getString("MESSAGE"));
return JSONObject.parseObject(JSONObject.toJSONString(resp));
}
}
return result;
}
@Override
public Object response(JianshuiParamErrorException result, Companyservice companyservice) {
// JSONObject myResult = new JSONObject();
// myResult.put("status", result.getErrorCode());
// myResult.put("message", result.getMsg());
// return myResult;
AjaxResult resp = AjaxResult.error(result.getErrorCode(), null);
resp.put("msg", result.getMsg());
return resp;
}
@Override
public AjaxResult callback(BillInfo billInfo, Invoice invoice, Redinfo redinfo, Companyservice companyservice, String src) {
return null;
}
}

@ -91,8 +91,33 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
String kpType = billInfo.getKptype();
if ("1".equals(kpType)) {
// 查询用户登记参数
QueryWrapper<InvoiceAllYhdj> yhdjQueryWrapper = new QueryWrapper<>();
yhdjQueryWrapper.eq("nsrsbh", companyservice.getSellertax());
yhdjQueryWrapper.eq("identity", companyservice.getIdentity());
InvoiceAllYhdj invoiceAllYhdj = yhdjMapper.selectOne(yhdjQueryWrapper);
if (BeanUtil.isEmpty(invoiceAllYhdj)) {
return new HXResponse("用户未登记!");
}
QueryTwoDTO queryDTO = new QueryTwoDTO();
queryDTO.setDqbm(invoiceAllYhdj.getDqbm());
queryDTO.setAsync("false");
queryDTO.setBsrysfzjhm(invoiceAllYhdj.getBsrysfzjhm());
queryDTO.setNsrsbh(invoiceAllYhdj.getNsrsbh());
queryDTO.setRequestId("tycxjk");
ValidateUtils.validate(queryDTO);
// 开票实体转换,校验
InvoiceAllAddTwoDTO invoiceAllAddTwoDTO = BeanUtil.copyProperties(billInfo, InvoiceAllAddTwoDTO.class);
invoiceAllAddTwoDTO.setDqbm(queryDTO.getDqbm());
invoiceAllAddTwoDTO.setBsrysfzjhm(queryDTO.getBsrysfzjhm());
invoiceAllAddTwoDTO.setNsrsbh(queryDTO.getNsrsbh());
ValidateUtils.validate(invoiceAllAddTwoDTO);
InvoiceAllAddInfoTwoDTO invoiceAllAddInfoTwoDTO = BeanUtil.copyProperties(billInfo, InvoiceAllAddInfoTwoDTO.class);
@ -130,8 +155,12 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
}
cn.hutool.json.JSONObject result = null;
try {
// TODO: 2023/4/23 调试
log.info("金财数科蓝字请求报文打印=",JSONUtil.parse(invoiceAllAddTwoDTO));
return null;
/*try {
result = ApiHttp.request(WebServiceConstant.LZFPKJ, WebServiceConstant.URL, invoiceAllAddTwoDTO, companyservice);
String code = result.get("code") != null ? result.get("code").toString() : "";
@ -175,7 +204,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
} catch (Exception e) {
log.error("【金四服务类】【金财数科】【蓝字发票开具】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage());
return new HXResponse("蓝字发票开具异常");
}
}*/
} else if ("2".equals(kpType)) {

@ -74,7 +74,7 @@ public class JcskTest {
" \"async\": false,\n" +
" \"bsrysfzjhm\":\"37028519930620441X\",\n" +
" \"serviceId\": \"yhdj\",\n" +
" \"dqbm\": \"guangdong\",\n" +
" \"dqbm\": \"qingdao\",\n" +
" \"nsrsbh\": \"92370214MACAAEK16E\",\n" +
" \"jsonData\": {\n" +
" \"bsryxm\": \"贾宁\",\n" +

Loading…
Cancel
Save