满意v6红字查询接口开发

beta-enc
kane 2 years ago
parent e4823a970e
commit 6416dafe9d
  1. 83
      jianshui-admin/src/main/java/com/jianshui/api/controller/http/invoice/v1/InvoiceController.java
  2. 33
      jianshui-invoice/src/main/java/com/jianshui/invoice/domain/ele/DDMMessage.java
  3. 16
      jianshui-invoice/src/main/java/com/jianshui/invoice/domain/ele/EleNewMessage.java
  4. 17
      jianshui-invoice/src/main/java/com/jianshui/invoice/domain/ele/EleOuterMessage.java
  5. 15
      jianshui-invoice/src/main/java/com/jianshui/invoice/domain/ele/FindRedInfoDTO.java
  6. 15
      jianshui-invoice/src/main/java/com/jianshui/invoice/domain/ele/HZSQDMessage.java
  7. 35
      jianshui-invoice/src/main/java/com/jianshui/invoice/domain/ele/HZSQDXZTXXMessage.java
  8. 3
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/IInvoiceApiService.java
  9. 3
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/AisinoConsoleInvoiceApiServiceImpl.java
  10. 61
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/ElephantInvoiceApiServiceImpl.java
  11. 3
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/JcskInvoiceApiServiceImpl.java
  12. 40
      jianshui-invoice/src/main/java/com/jianshui/invoice/utils/elephant/ElephantUtils.java

@ -3,6 +3,10 @@ package com.jianshui.api.controller.http.invoice.v1;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.dxhy.order.protocol.invoke.DxhyInterfaceResponse;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.Gson;
import com.jianshui.common.core.domain.AjaxResult; import com.jianshui.common.core.domain.AjaxResult;
import com.jianshui.common.core.domain.entity.Companyservice; import com.jianshui.common.core.domain.entity.Companyservice;
import com.jianshui.common.enums.ErrorCode; import com.jianshui.common.enums.ErrorCode;
@ -13,6 +17,10 @@ import com.jianshui.common.utils.http.HttpHelper;
import com.jianshui.invoice.constant.elephant.ElephantConstants; import com.jianshui.invoice.constant.elephant.ElephantConstants;
import com.jianshui.invoice.domain.BillInfo; import com.jianshui.invoice.domain.BillInfo;
import com.jianshui.invoice.domain.FindRedInfo; import com.jianshui.invoice.domain.FindRedInfo;
import com.jianshui.invoice.domain.ele.EleNewMessage;
import com.jianshui.invoice.domain.ele.EleOuterMessage;
import com.jianshui.invoice.domain.ele.FindRedInfoDTO;
import com.jianshui.invoice.domain.ele.HZSQDMessage;
import com.jianshui.invoice.utils.elephant.ElephantUtils; import com.jianshui.invoice.utils.elephant.ElephantUtils;
import com.jianshui.platform.dto.InvoiceAdd.BillInfoPDTO; import com.jianshui.platform.dto.InvoiceAdd.BillInfoPDTO;
import com.jianshui.invoice.domain.Redinfo; import com.jianshui.invoice.domain.Redinfo;
@ -38,6 +46,7 @@ import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException; import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.util.List;
/** /**
* @Description * @Description
@ -69,53 +78,91 @@ public class InvoiceController {
private InvoiceAddPService addService; private InvoiceAddPService addService;
@GetMapping("/api/v1/test") @GetMapping("/api/v1/test")
public Object test(){ public EleNewMessage test() {
Companyservice companyservice = new Companyservice(); Companyservice companyservice = new Companyservice();
FindRedInfo findRedInfo = new FindRedInfo(); FindRedInfo findRedInfo = new FindRedInfo();
findRedInfo.setSQBQQPCH("127021937706230911155203"); findRedInfo.setSQBQQPCH("127021937706230911155203");
findRedInfo.setNSRSBH("91370921MACWQ1520M"); findRedInfo.setNSRSBH("91370921MACWQ1520M");
AjaxResult queryResult = null; DxhyInterfaceResponse dxhyInterfaceResponse = null;
try { try {
queryResult = ElephantUtils.sendRequestWithoutTokenV6(ElephantConstants.REDINFO_FIND_LOCALHOST, ElephantConstants.REDINFO_FIND_METHOD, JSONUtil.parse(findRedInfo), companyservice); dxhyInterfaceResponse = ElephantUtils.sendRequestWithoutTokenV6(ElephantConstants.REDINFO_FIND_LOCALHOST,
ElephantConstants.REDINFO_FIND_METHOD, JSONUtil.parse(findRedInfo), companyservice);
} catch (UnsupportedEncodingException | InvalidKeyException | NoSuchAlgorithmException e) { } catch (UnsupportedEncodingException | InvalidKeyException | NoSuchAlgorithmException e) {
log.error("【销项发票】【大象接口】【红字信息表查询】发票请求异常,请求报文{},销方信息{}", JSONUtil.parse(findRedInfo).toString(), JSONObject.toJSONString(companyservice)); log.error("【销项发票】【大象接口】【红字信息表查询】发票请求异常,请求报文{},销方信息{}",
JSONUtil.parse(findRedInfo).toString(), JSONObject.toJSONString(companyservice));
e.printStackTrace(); e.printStackTrace();
throw new JianshuiServiceException("系统异常!"); throw new JianshuiServiceException("系统异常!");
} }
return null; String data = dxhyInterfaceResponse.getData();
cn.hutool.json.JSONObject dataStr = new cn.hutool.json.JSONObject(data);
if ("000000".equals(dataStr.getStr("ZTDM"))) {
Gson gson = new Gson();
EleOuterMessage eleOuterMessage = gson.fromJson(data, EleOuterMessage.class);
String inMsg = "";
String inMsgInfo = "";
List<HZSQDMessage> hzsqdxzzxx = eleOuterMessage.getHZSQDXZZXX();
for (HZSQDMessage hzsqdMessage : hzsqdxzzxx) {
inMsg = hzsqdMessage.getHZSQDXZTXX().getZTDM();
inMsgInfo = hzsqdMessage.getHZSQDXZTXX().getZTXX();
hzsqdMessage.getHZSQDXZTXX().setBillNo(findRedInfo.getSQBQQPCH());
}
EleNewMessage eleNewMessage = new EleNewMessage();
BeanUtil.copyProperties(eleOuterMessage, eleNewMessage);
eleNewMessage.setStatus(eleOuterMessage.getZTDM().substring(eleOuterMessage.getZTDM().length() - 4));
if ("060000".equals(inMsg)) {
eleNewMessage.setMessage(inMsgInfo);
eleNewMessage.setData(eleOuterMessage.getHZSQDXZZXX());
return eleNewMessage;
} else {
eleNewMessage.setMessage(inMsgInfo);
eleNewMessage.setData(eleOuterMessage.getHZSQDXZZXX());
return eleNewMessage;
}
} else {
EleNewMessage eleNewMessage = new EleNewMessage();
eleNewMessage.setStatus("9999");
eleNewMessage.setMessage("接口请求失败");
return eleNewMessage;
}
} }
/** /**
* 功能描述: 红字查询接口 * 功能描述: 红字查询接口
*
* @param identity * @param identity
* @return : com.jianshui.invoice.domain.dto.HXResponse * @return : com.jianshui.invoice.domain.dto.HXResponse
*/ */
@PostMapping({"/api/invoice/v1/findRedInfo", "/api/invoice/v1/findRedInfo/{identity}", "/invoice/findRedInfo"}) @PostMapping({"/api/invoice/v1/findRedInfo", "/api/invoice/v1/findRedInfo/{identity}", "/invoice/findRedInfo"})
public Object findRedInfo(HttpServletRequest request,String identity) throws Exception { public EleNewMessage findRedInfo(HttpServletRequest request, String identity) throws Exception {
log.info("开始执行"); log.info("开始执行");
if (StringUtils.isEmpty(identity)) { if (StringUtils.isEmpty(identity)) {
return AjaxResult.error(ErrorCode.EMPTY_IDENTITY); EleNewMessage eleNewMessage = new EleNewMessage();
eleNewMessage.setStatus("9999");
eleNewMessage.setMessage("身份认证参数为空");
return eleNewMessage;
} }
Companyservice companyservice = iCompanyserviceService.selectCompanyserviceByIdentity(identity); Companyservice companyservice = iCompanyserviceService.selectCompanyserviceByIdentity(identity);
if (companyservice == null) { if (companyservice == null) {
return AjaxResult.error(ErrorCode.COMPANY_NOT_FOUND); EleNewMessage eleNewMessage = new EleNewMessage();
eleNewMessage.setStatus("9999");
eleNewMessage.setMessage("企业信息不存在");
return eleNewMessage;
} }
String requestAdapterKey = serviceManageService.getRequestAdapterKey("invoice", companyservice.getCompanyid()); String requestAdapterKey = serviceManageService.getRequestAdapterKey("invoice", companyservice.getCompanyid());
IInvoiceRequestService invoiceRequestService = invoiceRequestFactory.getService(requestAdapterKey); IInvoiceRequestService invoiceRequestService = invoiceRequestFactory.getService(requestAdapterKey);
JSONObject decryptResult = invoiceRequestService.decrypt(request, companyservice, "find_redinfo"); JSONObject decryptResult = invoiceRequestService.decrypt(request, companyservice, "find_redinfo");
// 获得请求实例,并且进行扣费 // 获得请求实例,并且进行扣费
log.info("解密数据{}", decryptResult); log.info("解密数据{}", decryptResult);
FindRedInfo findRedInfo = decryptResult.toJavaObject(FindRedInfo.class); FindRedInfoDTO findRedInfoDTO = decryptResult.toJavaObject(FindRedInfoDTO.class);
FindRedInfo findRedInfo = new FindRedInfo();
findRedInfo.setSQBQQPCH(findRedInfoDTO.getBillNo());
findRedInfo.setNSRSBH(findRedInfoDTO.getNSRSBH());
log.info("转换数据{}", JSONUtil.toJsonStr(findRedInfo)); log.info("转换数据{}", JSONUtil.toJsonStr(findRedInfo));
String serviceKey = serviceManageService.getCompanyServiceSupplier("invoice", companyservice.getCompanyid()); String serviceKey = serviceManageService.getCompanyServiceSupplier("invoice", companyservice.getCompanyid());
serviceManageService.companyConsume("invoice", companyservice.getCompanyid()); serviceManageService.companyConsume("invoice", companyservice.getCompanyid());
IInvoiceApiService invoiceService = invoiceServiceFactory.getService(serviceKey); IInvoiceApiService invoiceService = invoiceServiceFactory.getService(serviceKey);
HXResponse result = invoiceService.findRedInfo(findRedInfo, companyservice); EleNewMessage result = invoiceService.findRedInfo(findRedInfo, companyservice);
return result;
String responseAdapterKey = serviceManageService.getResponseAdapterKey("invoice", companyservice.getCompanyid());
IInvoiceResponseService invoiceResponseService = invoiceResponseFactory.getService(responseAdapterKey);
return invoiceResponseService.response(result, companyservice, "find_redinfo");
} }
@ -404,7 +451,9 @@ public class InvoiceController {
} }
/** 红字信息表上传*/ /**
* 红字信息表上传
*/
@Validated @Validated
// @ApiOperation("红字信息表上传") // @ApiOperation("红字信息表上传")
@ApiImplicitParams({ @ApiImplicitParams({
@ -1366,6 +1415,4 @@ public class InvoiceController {
} }
} }

@ -0,0 +1,33 @@
package com.jianshui.invoice.domain.ele;
import lombok.Data;
/**
* @author xingze
* @date 2023/9/12
*/
@Data
public class DDMMessage {
private String BYZD1;
private String BYZD2;
private String BYZD3;
private String DJ;
private String DW;
private String DYLZFPMXXH;
private String FPHXZ;
private String GGXH;
private String HSBZ;
private String JE;
private String KCE;
private String LSLBS;
private String SE;
private String SL;
private String SPBM;
private String SPID;
private String SPSL;
private String XH;
private String XMMC;
private String YHZCBS;
private String ZXBM;
private String ZZSTSGL;
}

@ -0,0 +1,16 @@
package com.jianshui.invoice.domain.ele;
import lombok.Data;
import java.util.List;
/**
* @author xingze
* @date 2023/9/12
*/
@Data
public class EleNewMessage {
private List<HZSQDMessage> data;
private String status;
private String message;
}

@ -0,0 +1,17 @@
package com.jianshui.invoice.domain.ele;
import lombok.Data;
import java.util.List;
/**
* @author xingze
* @date 2023/9/12
*/
@Data
public class EleOuterMessage {
private List<HZSQDMessage> HZSQDXZZXX;
private String SQBQQPCH;
private String ZTDM;
private String ZTXX;
}

@ -0,0 +1,15 @@
package com.jianshui.invoice.domain.ele;
import lombok.Data;
/**
* @author xingze
* @date 2023/9/12
*/
@Data
public class FindRedInfoDTO {
// 请求批次号
private String billNo;
// 申请方纳税人识别号
private String NSRSBH;
}

@ -0,0 +1,15 @@
package com.jianshui.invoice.domain.ele;
import lombok.Data;
import java.util.List;
/**
* @author xingze
* @date 2023/9/12
*/
@Data
public class HZSQDMessage {
private List<DDMMessage> DDMXXX;
private HZSQDXZTXXMessage HZSQDXZTXX;
}

@ -0,0 +1,35 @@
package com.jianshui.invoice.domain.ele;
import lombok.Data;
/**
* @author xingze
* @date 2023/9/12
*/
@Data
public class HZSQDXZTXXMessage {
private String BMBBBH;
private String DSLBZ;
private String FPLXDM;
private String GMFDZDH;
private String GMFMC;
private String GMFSBH;
private String GMFYHZH;
private String HJJE;
private String HJSE;
private String billNo;
private String SQSM;
private String TKSJ;
private String XHFDZDH;
private String XHFMC;
private String XHFSBH;
private String XHFYHZH;
private String XXBBH;
private String XXBLX;
private String XXBTSBS;
private String YFPDM;
private String YFPHM;
private String YYSBZ;
private String ZTDM;
private String ZTXX;
}

@ -9,6 +9,7 @@ import com.jianshui.invoice.domain.Invoice;
import com.jianshui.invoice.domain.Redinfo; import com.jianshui.invoice.domain.Redinfo;
import com.jianshui.invoice.domain.dto.*; import com.jianshui.invoice.domain.dto.*;
import com.jianshui.invoice.domain.dto.api.*; import com.jianshui.invoice.domain.dto.api.*;
import com.jianshui.invoice.domain.ele.EleNewMessage;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@ -277,5 +278,5 @@ public interface IInvoiceApiService {
* @param companyservice * @param companyservice
* @return : java.lang.Object * @return : java.lang.Object
*/ */
HXResponse findRedInfo(FindRedInfo findRedInfo, Companyservice companyservice); EleNewMessage findRedInfo(FindRedInfo findRedInfo, Companyservice companyservice);
} }

@ -20,6 +20,7 @@ import com.jianshui.invoice.domain.*;
import com.jianshui.invoice.domain.dto.*; import com.jianshui.invoice.domain.dto.*;
import com.jianshui.invoice.domain.dto.api.*; import com.jianshui.invoice.domain.dto.api.*;
import com.jianshui.invoice.domain.dto.api.aisino.console.*; import com.jianshui.invoice.domain.dto.api.aisino.console.*;
import com.jianshui.invoice.domain.ele.EleNewMessage;
import com.jianshui.invoice.domain.vo.api.aisino.console.AisinoConsoleInvoiceAddVO; import com.jianshui.invoice.domain.vo.api.aisino.console.AisinoConsoleInvoiceAddVO;
import com.jianshui.invoice.mapper.BillInfoMapper; import com.jianshui.invoice.mapper.BillInfoMapper;
import com.jianshui.invoice.mapper.InvoiceMapper; import com.jianshui.invoice.mapper.InvoiceMapper;
@ -1019,7 +1020,7 @@ public class AisinoConsoleInvoiceApiServiceImpl implements IInvoiceApiService {
} }
@Override @Override
public HXResponse findRedInfo(FindRedInfo findRedInfo, Companyservice companyservice) { public EleNewMessage findRedInfo(FindRedInfo findRedInfo, Companyservice companyservice) {
return null; return null;
} }

@ -9,6 +9,8 @@ import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dxhy.order.protocol.invoke.DxhyInterfaceResponse;
import com.google.gson.Gson;
import com.jianshui.common.config.JianshuiConfig; import com.jianshui.common.config.JianshuiConfig;
import com.jianshui.common.constant.Constants; import com.jianshui.common.constant.Constants;
import com.jianshui.common.core.domain.AjaxResult; import com.jianshui.common.core.domain.AjaxResult;
@ -29,6 +31,9 @@ import com.jianshui.invoice.domain.dto.adapter.response.RedInfoDTO;
import com.jianshui.invoice.domain.dto.adapter.response.RedInfoDetailDTO; import com.jianshui.invoice.domain.dto.adapter.response.RedInfoDetailDTO;
import com.jianshui.invoice.domain.dto.api.*; import com.jianshui.invoice.domain.dto.api.*;
import com.jianshui.invoice.domain.dto.api.elephant.*; import com.jianshui.invoice.domain.dto.api.elephant.*;
import com.jianshui.invoice.domain.ele.EleNewMessage;
import com.jianshui.invoice.domain.ele.EleOuterMessage;
import com.jianshui.invoice.domain.ele.HZSQDMessage;
import com.jianshui.invoice.mapper.BillInfoMapper; import com.jianshui.invoice.mapper.BillInfoMapper;
import com.jianshui.invoice.mapper.InvoiceMapper; import com.jianshui.invoice.mapper.InvoiceMapper;
import com.jianshui.invoice.mapper.RedinfoMapper; import com.jianshui.invoice.mapper.RedinfoMapper;
@ -728,40 +733,66 @@ public class ElephantInvoiceApiServiceImpl implements IInvoiceApiService {
return new HXResponse("0000", "查询成功", result); return new HXResponse("0000", "查询成功", result);
} }
/** /**
* 功能描述: 红字信息查询 * 功能描述: 红字信息查询
*
* @param findRedInfo * @param findRedInfo
* @param companyservice * @param companyservice
* @return : java.lang.Object * @return : java.lang.Object
*/ */
@Override @Override
public HXResponse findRedInfo(FindRedInfo findRedInfo, Companyservice companyservice) { public EleNewMessage findRedInfo(FindRedInfo findRedInfo, Companyservice companyservice) {
log.info("传入信息", JSONUtil.toJsonStr(findRedInfo)); log.info("传入信息", JSONUtil.toJsonStr(findRedInfo));
if (StringUtils.isEmpty(findRedInfo.getSQBQQPCH()) || StringUtils.isEmpty(findRedInfo.getNSRSBH())) { if (StringUtils.isEmpty(findRedInfo.getSQBQQPCH()) || StringUtils.isEmpty(findRedInfo.getNSRSBH())) {
log.error("传入信息为空"); log.error("传入信息为空");
return new HXResponse("9999","传入信息为空"); EleNewMessage eleNewMessage = new EleNewMessage();
eleNewMessage.setStatus("9999");
eleNewMessage.setMessage("接口请求失败");
return eleNewMessage;
} }
AjaxResult queryResult = null; DxhyInterfaceResponse dxhyInterfaceResponse = null;
try { try {
queryResult = ElephantUtils.sendRequestWithoutTokenV6(ElephantConstants.REDINFO_FIND_LOCALHOST, ElephantConstants.REDINFO_FIND_METHOD, JSONUtil.parse(findRedInfo), companyservice); dxhyInterfaceResponse = ElephantUtils.sendRequestWithoutTokenV6(ElephantConstants.REDINFO_FIND_LOCALHOST, ElephantConstants.REDINFO_FIND_METHOD, JSONUtil.parse(findRedInfo), companyservice);
} catch (UnsupportedEncodingException | InvalidKeyException | NoSuchAlgorithmException e) { } catch (UnsupportedEncodingException | InvalidKeyException | NoSuchAlgorithmException e) {
log.error("【销项发票】【大象接口】【红字信息表查询】发票请求异常,请求报文{},销方信息{}", JSONUtil.parse(findRedInfo).toString(), JSONObject.toJSONString(companyservice)); log.error("【销项发票】【大象接口】【红字信息表查询】发票请求异常,请求报文{},销方信息{}", JSONUtil.parse(findRedInfo).toString(), JSONObject.toJSONString(companyservice));
e.printStackTrace(); e.printStackTrace();
throw new JianshuiServiceException("系统异常!"); throw new JianshuiServiceException("系统异常!");
} }
log.info("【销项发票】【大象发票】红字信息表查询请求结果{}", queryResult.toString()); String data = dxhyInterfaceResponse.getData();
JSONObject jsonData = queryResult.getJsonData(); cn.hutool.json.JSONObject dataStr = new cn.hutool.json.JSONObject(data);
String ztdm = jsonData.getString("ZTDM"); if ("000000".equals(dataStr.getStr("ZTDM"))) {
log.info("外层状态码{}",ztdm); Gson gson = new Gson();
if ("000000".equals(ztdm)){ EleOuterMessage eleOuterMessage = gson.fromJson(data, EleOuterMessage.class);
return new HXResponse(jsonData.toJSONString()); String inMsgInfo = "";
}else if ("009999".equals(ztdm)){ List<HZSQDMessage> hzsqdxzzxx = eleOuterMessage.getHZSQDXZZXX();
return new HXResponse("9999","接口请求失败(展示具体错误信息)"); for (HZSQDMessage hzsqdMessage : hzsqdxzzxx) {
hzsqdMessage.getHZSQDXZTXX().setZTDM(hzsqdMessage.getHZSQDXZTXX().getZTDM().substring(hzsqdMessage.getHZSQDXZTXX().getZTDM().length() - 4));
inMsgInfo = hzsqdMessage.getHZSQDXZTXX().getZTXX();
hzsqdMessage.getHZSQDXZTXX().setBillNo(findRedInfo.getSQBQQPCH());
}
EleNewMessage eleNewMessage = new EleNewMessage();
BeanUtil.copyProperties(eleOuterMessage, eleNewMessage);
eleNewMessage.setStatus(eleOuterMessage.getZTDM().substring(eleOuterMessage.getZTDM().length() - 4));
if ("审核通过".equals(inMsgInfo)) {
eleNewMessage.setMessage(eleOuterMessage.getZTXX());
eleNewMessage.setData(eleOuterMessage.getHZSQDXZZXX());
return eleNewMessage;
} else { } else {
return new HXResponse("9999","数据查询失败"); for (HZSQDMessage hzsqdMessage : hzsqdxzzxx) {
hzsqdMessage.getHZSQDXZTXX().setZTDM("1999");
}
eleNewMessage.setMessage(eleOuterMessage.getZTXX());
eleNewMessage.setData(eleOuterMessage.getHZSQDXZZXX());
return eleNewMessage;
}
} else {
EleNewMessage eleNewMessage = new EleNewMessage();
eleNewMessage.setStatus("9999");
eleNewMessage.setMessage("接口请求失败");
return eleNewMessage;
} }
} }
/** /**
@ -901,7 +932,7 @@ public class ElephantInvoiceApiServiceImpl implements IInvoiceApiService {
redinfo.setRedInfoStatus("0"); redinfo.setRedInfoStatus("0");
redinfo.setRedInfoMessage(contentJson.getString("ZTXX")); redinfo.setRedInfoMessage(contentJson.getString("ZTXX"));
redinfoMapper.updateRedinfo(redinfo); redinfoMapper.updateRedinfo(redinfo);
return new HXResponse("8888","数据上传成功,请调用信息下载接口查询审核状态!"); return new HXResponse("8888", "数据上传成功,请调用查询接口,查询审核状态!");
} }
if (!StringUtils.equals("0000", ztdm)) { if (!StringUtils.equals("0000", ztdm)) {
redinfo.setRedInfoStatus("2"); redinfo.setRedInfoStatus("2");

@ -31,6 +31,7 @@ import com.jianshui.invoice.domain.dto.api.jcsk.add.InvoiceAllAddInfoTwoDTO;
import com.jianshui.invoice.domain.dto.api.jcsk.add.InvoiceAllAddTwoDTO; import com.jianshui.invoice.domain.dto.api.jcsk.add.InvoiceAllAddTwoDTO;
import com.jianshui.invoice.domain.dto.api.jcsk.add.InvoiceAllAddmxListTwoDTO; import com.jianshui.invoice.domain.dto.api.jcsk.add.InvoiceAllAddmxListTwoDTO;
import com.jianshui.invoice.domain.dto.api.jcsk.red.AddRedInvoiceTwoDTO; import com.jianshui.invoice.domain.dto.api.jcsk.red.AddRedInvoiceTwoDTO;
import com.jianshui.invoice.domain.ele.EleNewMessage;
import com.jianshui.invoice.domain.vo.jcsk.*; import com.jianshui.invoice.domain.vo.jcsk.*;
import com.jianshui.invoice.mapper.*; import com.jianshui.invoice.mapper.*;
import com.jianshui.invoice.service.IInvoiceApiService; import com.jianshui.invoice.service.IInvoiceApiService;
@ -1568,7 +1569,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
} }
@Override @Override
public HXResponse findRedInfo(FindRedInfo findRedInfo, Companyservice companyservice) { public EleNewMessage findRedInfo(FindRedInfo findRedInfo, Companyservice companyservice) {
return null; return null;
} }

@ -345,22 +345,23 @@ public class ElephantUtils {
* @param companyservice companyservice * @param companyservice companyservice
* @return * @return
*/ */
public static AjaxResult sendRequestWithoutTokenV6(String uri, String methodName, JSON data, Companyservice companyservice) throws UnsupportedEncodingException, NoSuchAlgorithmException, InvalidKeyException { public static DxhyInterfaceResponse sendRequestWithoutTokenV6(String uri, String methodName, JSON data, Companyservice companyservice) throws UnsupportedEncodingException, NoSuchAlgorithmException, InvalidKeyException {
// ICompanyservicePropService companyserviceProp = SpringUtils.getBean(ICompanyservicePropService.class); ICompanyservicePropService companyserviceProp = SpringUtils.getBean(ICompanyservicePropService.class);
// CompanyserviceProp secretIdProp = companyserviceProp.selectPropByKey(companyservice.getCompanyid(), "elephant_secret_id"); CompanyserviceProp secretIdProp = companyserviceProp.selectPropByKey(companyservice.getCompanyid(), "elephant_secret_id");
// if (secretIdProp == null) { if (secretIdProp == null) {
// throw new JianshuiServiceException("企业未配置属性,请联系管理员!"); throw new JianshuiServiceException("企业未配置属性,请联系管理员!");
// } }
// String secretId = secretIdProp.getValue(); String secretId = secretIdProp.getValue();
// CompanyserviceProp sercretKeyProp = companyserviceProp.selectPropByKey(companyservice.getCompanyid(), "elephant_secret_key"); CompanyserviceProp sercretKeyProp = companyserviceProp.selectPropByKey(companyservice.getCompanyid(), "elephant_secret_key");
// if (sercretKeyProp == null) { if (sercretKeyProp == null) {
// throw new JianshuiServiceException("企业未配置属性,请联系管理员!"); throw new JianshuiServiceException("企业未配置属性,请联系管理员!");
// } }
// String sercretKey = sercretKeyProp.getValue(); String sercretKey = sercretKeyProp.getValue();
BASE64Encoder encoder = new BASE64Encoder(); BASE64Encoder encoder = new BASE64Encoder();
byte[] contentByte = JSONUtil.toJsonStr(data).getBytes(); String str = JSONUtil.toJsonStr(data);
byte[] contentByte = str.getBytes();
// byte[] contentByte = "{\"DDPCXX\":{\"DDQQPCH\":\"5767e3e0907c4e3c848c3f459b68394b\",\"NSRSBH\":\"110101MYJ2GPQQ4\",\"FPLXDM\":\"004\"},\"DDZXX\":[{\"DDTXX\":{\"DDQQLSH\":\"4767e3e0907c4e3c848c3f459b68394b\",\"NSRSBH\":\"110101MYJ2GPQQ4\",\"NSRMC\":\"测试 localhost\",\"KPLX\":\"0\",\"XHFSBH\":\"110101MYJ2GPQQ4\",\"XHFMC\":\"测试 localhost\",\"XHFDZ\":\"山东省济南市济微路141号中铁物流园1楼\",\"XHFDH\":\"1\",\"XHFYH\":\"齐鲁银行济南王官庄支行 1170 8140 0000 0016 252\",\"XHFZH\":\"1170814000000016252\",\"GMFSBH\":\"91320700774687205M\",\"GMFMC\":\"连云港天邦科技开发有限公司\",\"GMFDZ\":\"江苏省连云港市海州开发区新浦工业园振兴路\",\"GMFDH\":\"0518-85287867\",\"GMFYH\":\"江苏银行连云港浦中支行 \",\"GMFZH\":\"70300101314068535\",\"GMFLX\":\"01\",\"KPR\":\"test1\",\"QDBZ\":\"0\",\"JSHJ\":\"7475.76\",\"HJJE\":\"6615.72\",\"HJSE\":\"860.04\",\"DDH\":\"4767e3e0907c4e3c848c3f459b68394b\",\"DDSJ\":\"2022-05-17 10:09:33\"},\"DDMXXX\":[{\"XH\":\"1\",\"FPHXZ\":\"0\",\"SPBM\":\"108020799\",\"YHZCBS\":\"0\",\"XMMC\":\"圆钢\",\"GGXH\":\"60\",\"DW\":\"吨\",\"SPSL\":1.014,\"DJ\":\"4991.15\",\"JE\":\"5061.03\",\"HSBZ\":\"0\",\"SL\":\"0.13\",\"SE\":\"657.93\",\"BYZD1\":\"\",\"BYZD2\":\"\",\"BYZD3\":\"\"},{\"XH\":\"2\",\"FPHXZ\":\"0\",\"SPBM\":\"108020799\",\"YHZCBS\":\"0\",\"XMMC\":\"圆钢\",\"GGXH\":\"55\",\"DW\":\"吨\",\"SPSL\":0.23,\"DJ\":\"4902.65\",\"JE\":\"1127.61\",\"HSBZ\":\"0\",\"SL\":\"0.13\",\"SE\":\"146.59\",\"BYZD1\":\"\",\"BYZD2\":\"\",\"BYZD3\":\"\"},{\"XH\":\"3\",\"FPHXZ\":\"0\",\"SPBM\":\"108020799\",\"YHZCBS\":\"0\",\"XMMC\":\"圆钢\",\"GGXH\":\"10\",\"DW\":\"吨\",\"SPSL\":0.076,\"DJ\":\"5619.47\",\"JE\":\"427.08\",\"HSBZ\":\"0\",\"SL\":\"0.13\",\"SE\":\"55.52\",\"BYZD1\":\"\",\"BYZD2\":\"\",\"BYZD3\":\"\"}]}]}".getBytes(); // byte[] contentByte = "{\"DDPCXX\":{\"DDQQPCH\":\"5767e3e0907c4e3c848c3f459b68394b\",\"NSRSBH\":\"110101MYJ2GPQQ4\",\"FPLXDM\":\"004\"},\"DDZXX\":[{\"DDTXX\":{\"DDQQLSH\":\"4767e3e0907c4e3c848c3f459b68394b\",\"NSRSBH\":\"110101MYJ2GPQQ4\",\"NSRMC\":\"测试 localhost\",\"KPLX\":\"0\",\"XHFSBH\":\"110101MYJ2GPQQ4\",\"XHFMC\":\"测试 localhost\",\"XHFDZ\":\"山东省济南市济微路141号中铁物流园1楼\",\"XHFDH\":\"1\",\"XHFYH\":\"齐鲁银行济南王官庄支行 1170 8140 0000 0016 252\",\"XHFZH\":\"1170814000000016252\",\"GMFSBH\":\"91320700774687205M\",\"GMFMC\":\"连云港天邦科技开发有限公司\",\"GMFDZ\":\"江苏省连云港市海州开发区新浦工业园振兴路\",\"GMFDH\":\"0518-85287867\",\"GMFYH\":\"江苏银行连云港浦中支行 \",\"GMFZH\":\"70300101314068535\",\"GMFLX\":\"01\",\"KPR\":\"test1\",\"QDBZ\":\"0\",\"JSHJ\":\"7475.76\",\"HJJE\":\"6615.72\",\"HJSE\":\"860.04\",\"DDH\":\"4767e3e0907c4e3c848c3f459b68394b\",\"DDSJ\":\"2022-05-17 10:09:33\"},\"DDMXXX\":[{\"XH\":\"1\",\"FPHXZ\":\"0\",\"SPBM\":\"108020799\",\"YHZCBS\":\"0\",\"XMMC\":\"圆钢\",\"GGXH\":\"60\",\"DW\":\"吨\",\"SPSL\":1.014,\"DJ\":\"4991.15\",\"JE\":\"5061.03\",\"HSBZ\":\"0\",\"SL\":\"0.13\",\"SE\":\"657.93\",\"BYZD1\":\"\",\"BYZD2\":\"\",\"BYZD3\":\"\"},{\"XH\":\"2\",\"FPHXZ\":\"0\",\"SPBM\":\"108020799\",\"YHZCBS\":\"0\",\"XMMC\":\"圆钢\",\"GGXH\":\"55\",\"DW\":\"吨\",\"SPSL\":0.23,\"DJ\":\"4902.65\",\"JE\":\"1127.61\",\"HSBZ\":\"0\",\"SL\":\"0.13\",\"SE\":\"146.59\",\"BYZD1\":\"\",\"BYZD2\":\"\",\"BYZD3\":\"\"},{\"XH\":\"3\",\"FPHXZ\":\"0\",\"SPBM\":\"108020799\",\"YHZCBS\":\"0\",\"XMMC\":\"圆钢\",\"GGXH\":\"10\",\"DW\":\"吨\",\"SPSL\":0.076,\"DJ\":\"5619.47\",\"JE\":\"427.08\",\"HSBZ\":\"0\",\"SL\":\"0.13\",\"SE\":\"55.52\",\"BYZD1\":\"\",\"BYZD2\":\"\",\"BYZD3\":\"\"}]}]}".getBytes();
String byteContent = encoder.encode(contentByte); // String byteContent = encoder.encode(contentByte);
boolean isDevMode = CommonUtils.isDevMode(); boolean isDevMode = CommonUtils.isDevMode();
String host = ElephantConstants.PROD_HOST_LOCAL; String host = ElephantConstants.PROD_HOST_LOCAL;
if (isDevMode) { if (isDevMode) {
@ -375,13 +376,14 @@ public class ElephantUtils {
dxhyInterfaceRequest.setRequestType("POST"); dxhyInterfaceRequest.setRequestType("POST");
dxhyInterfaceRequest.setHttpTimeOut("100000"); dxhyInterfaceRequest.setHttpTimeOut("100000");
dxhyInterfaceRequest.setDataExchangeId("1617954341800234234234552"); dxhyInterfaceRequest.setDataExchangeId("1617954341800234234234552");
dxhyInterfaceRequest.setSecretId("e1de400c3aba4ed4b50b8c55885caf19"); dxhyInterfaceRequest.setSecretId(secretId);
dxhyInterfaceRequest.setSecretKey("8877d2d2b7d240cdb103cfae0f49491e"); dxhyInterfaceRequest.setSecretKey(sercretKey);
dxhyInterfaceRequest.setContent(byteContent); dxhyInterfaceRequest.setContent(str);
dxhyInterfaceRequest.setZipCode("0");
dxhyInterfaceRequest.setEncryptCode("0");
DxhyInterfaceResponse dxhyInterfaceResponse = InvokeDxhyApi.dxhyInterfaceInvoke(dxhyInterfaceRequest); DxhyInterfaceResponse dxhyInterfaceResponse = InvokeDxhyApi.dxhyInterfaceInvoke(dxhyInterfaceRequest);
log.info("请求成功,结果{}",JSONUtil.toJsonStr(dxhyInterfaceResponse)); log.info("请求成功,结果{}",JSONUtil.toJsonStr(dxhyInterfaceResponse));
String code = dxhyInterfaceResponse.getCode(); return dxhyInterfaceResponse;
return AjaxResult.error("请求失败");
} }

Loading…
Cancel
Save