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

beta-enc
dongxiaoke 2 years ago
commit f06488784a
  1. 81
      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. 69
      jianshui-invoice/src/main/java/com/jianshui/invoice/utils/elephant/ElephantUtils.java

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

@ -9,6 +9,8 @@ import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
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.constant.Constants;
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.api.*;
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.InvoiceMapper;
import com.jianshui.invoice.mapper.RedinfoMapper;
@ -728,40 +733,66 @@ public class ElephantInvoiceApiServiceImpl implements IInvoiceApiService {
return new HXResponse("0000", "查询成功", result);
}
/**
* 功能描述: 红字信息查询
*
* @param findRedInfo
* @param companyservice
* @return : java.lang.Object
*/
@Override
public HXResponse findRedInfo(FindRedInfo findRedInfo, Companyservice companyservice) {
public EleNewMessage findRedInfo(FindRedInfo findRedInfo, Companyservice companyservice) {
log.info("传入信息", JSONUtil.toJsonStr(findRedInfo));
if (StringUtils.isEmpty(findRedInfo.getSQBQQPCH()) || StringUtils.isEmpty(findRedInfo.getNSRSBH())) {
log.error("传入信息为空");
return new HXResponse("9999","传入信息为空");
EleNewMessage eleNewMessage = new EleNewMessage();
eleNewMessage.setStatus("9999");
eleNewMessage.setMessage("接口请求失败");
return eleNewMessage;
}
AjaxResult queryResult = null;
DxhyInterfaceResponse dxhyInterfaceResponse = null;
try {
queryResult = ElephantUtils.sendRequestWithoutTokenV6(ElephantConstants.REDINFO_FIND_LOCALHOST, ElephantConstants.REDINFO_FIND_METHOD, JSONUtil.parse(findRedInfo), companyservice);
dxhyInterfaceResponse = ElephantUtils.sendRequestWithoutTokenV6(ElephantConstants.REDINFO_FIND_LOCALHOST, ElephantConstants.REDINFO_FIND_METHOD, JSONUtil.parse(findRedInfo), companyservice);
} catch (UnsupportedEncodingException | InvalidKeyException | NoSuchAlgorithmException e) {
log.error("【销项发票】【大象接口】【红字信息表查询】发票请求异常,请求报文{},销方信息{}", JSONUtil.parse(findRedInfo).toString(), JSONObject.toJSONString(companyservice));
e.printStackTrace();
throw new JianshuiServiceException("系统异常!");
}
log.info("【销项发票】【大象发票】红字信息表查询请求结果{}", queryResult.toString());
JSONObject jsonData = queryResult.getJsonData();
String ztdm = jsonData.getString("ZTDM");
log.info("外层状态码{}",ztdm);
if ("000000".equals(ztdm)){
return new HXResponse(jsonData.toJSONString());
}else if ("009999".equals(ztdm)){
return new HXResponse("9999","接口请求失败(展示具体错误信息)");
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 inMsgInfo = "";
List<HZSQDMessage> hzsqdxzzxx = eleOuterMessage.getHZSQDXZZXX();
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 {
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.setRedInfoMessage(contentJson.getString("ZTXX"));
redinfoMapper.updateRedinfo(redinfo);
return new HXResponse("8888","数据上传成功,请调用信息下载接口查询审核状态!");
return new HXResponse("8888", "数据上传成功,请调用查询接口,查询审核状态!");
}
if (!StringUtils.equals("0000", ztdm)) {
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.InvoiceAllAddmxListTwoDTO;
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.mapper.*;
import com.jianshui.invoice.service.IInvoiceApiService;
@ -1568,7 +1569,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
}
@Override
public HXResponse findRedInfo(FindRedInfo findRedInfo, Companyservice companyservice) {
public EleNewMessage findRedInfo(FindRedInfo findRedInfo, Companyservice companyservice) {
return null;
}

@ -1,19 +1,15 @@
package com.jianshui.invoice.utils.elephant;
import cn.hutool.core.codec.Base64Decoder;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.ContentType;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSON;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.dxhy.order.InvokeDxhyApi;
import com.dxhy.order.ReceiveDxhyApi;
import com.dxhy.order.protocol.invoke.DxhyInterfaceRequest;
import com.dxhy.order.protocol.invoke.DxhyInterfaceResponse;
import com.jianshui.common.core.domain.AjaxResult;
@ -23,19 +19,16 @@ import com.jianshui.common.exception.jianshui.JianshuiParamErrorException;
import com.jianshui.common.exception.jianshui.JianshuiServiceConfigErrorException;
import com.jianshui.common.exception.jianshui.JianshuiServiceException;
import com.jianshui.common.utils.StringUtils;
import com.jianshui.common.utils.TimeUtil;
import com.jianshui.common.utils.http.HttpUtils;
import com.jianshui.common.utils.jianshui.CommonUtils;
import com.jianshui.common.utils.spring.SpringUtils;
import com.jianshui.invoice.constant.elephant.ElephantConstants;
import com.jianshui.invoice.domain.dto.HXResponse;
import com.jianshui.system.domain.CompanyserviceProp;
import com.jianshui.system.service.ICompanyservicePropService;
import com.jianshui.system.service.ISysConfigService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.auth.AuthScope;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.RequestEntity;
import org.apache.commons.httpclient.methods.StringRequestEntity;
@ -345,43 +338,57 @@ public class ElephantUtils {
* @param companyservice companyservice
* @return
*/
public static AjaxResult sendRequestWithoutTokenV6(String uri, String methodName, JSON data, Companyservice companyservice) throws UnsupportedEncodingException, NoSuchAlgorithmException, InvalidKeyException {
// ICompanyservicePropService companyserviceProp = SpringUtils.getBean(ICompanyservicePropService.class);
// CompanyserviceProp secretIdProp = companyserviceProp.selectPropByKey(companyservice.getCompanyid(), "elephant_secret_id");
// if (secretIdProp == null) {
// throw new JianshuiServiceException("企业未配置属性,请联系管理员!");
// }
// String secretId = secretIdProp.getValue();
// CompanyserviceProp sercretKeyProp = companyserviceProp.selectPropByKey(companyservice.getCompanyid(), "elephant_secret_key");
// if (sercretKeyProp == null) {
// throw new JianshuiServiceException("企业未配置属性,请联系管理员!");
// }
// String sercretKey = sercretKeyProp.getValue();
BASE64Encoder encoder = new BASE64Encoder();
byte[] contentByte = JSONUtil.toJsonStr(data).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);
public static DxhyInterfaceResponse sendRequestWithoutTokenV6(String uri, String methodName, JSON data, Companyservice companyservice) throws UnsupportedEncodingException, NoSuchAlgorithmException, InvalidKeyException {
// v4的考过来的 没变
ICompanyservicePropService companyserviceProp = SpringUtils.getBean(ICompanyservicePropService.class);
CompanyserviceProp secretIdProp = companyserviceProp.selectPropByKey(companyservice.getCompanyid(), "elephant_secret_id");
if (secretIdProp == null) {
throw new JianshuiServiceException("企业未配置属性,请联系管理员!");
}
// appid
String secretId = secretIdProp.getValue();
CompanyserviceProp sercretKeyProp = companyserviceProp.selectPropByKey(companyservice.getCompanyid(), "elephant_secret_key");
if (sercretKeyProp == null) {
throw new JianshuiServiceException("企业未配置属性,请联系管理员!");
}
// appkey
String sercretKey = sercretKeyProp.getValue();
// 调用v6请求内容(content字段)
String str = JSONUtil.toJsonStr(data);
boolean isDevMode = CommonUtils.isDevMode();
// 主机名(京东云地址)
String host = ElephantConstants.PROD_HOST_LOCAL;
if (isDevMode) {
host = ElephantConstants.DEV_HOST_LOCAL;
}
//kk TODO : 2023/9/5 大象接口迁京东云
//https://js.ele12.com/
host = "https://js.ele12.com/order-api";
// 最终接口地址
String url = host + uri;
// 封装大象v6调用类
// TODO 注意调整这里
DxhyInterfaceRequest dxhyInterfaceRequest = new DxhyInterfaceRequest();
// 地址
dxhyInterfaceRequest.setRequestUrl(url);
// 请求方式
dxhyInterfaceRequest.setRequestType("POST");
// 超时时间(毫秒值)
dxhyInterfaceRequest.setHttpTimeOut("100000");
// 流水号(拷贝的接口文档的)
dxhyInterfaceRequest.setDataExchangeId("1617954341800234234234552");
dxhyInterfaceRequest.setSecretId("e1de400c3aba4ed4b50b8c55885caf19");
dxhyInterfaceRequest.setSecretKey("8877d2d2b7d240cdb103cfae0f49491e");
dxhyInterfaceRequest.setContent(byteContent);
// appid
dxhyInterfaceRequest.setSecretId(secretId);
// appkey
dxhyInterfaceRequest.setSecretKey(sercretKey);
// 内容字段(content请求体)
dxhyInterfaceRequest.setContent(str);
// 不打包
dxhyInterfaceRequest.setZipCode("0");
// 不加密
dxhyInterfaceRequest.setEncryptCode("0");
// 大象v6调用方法(获取结果处理)
DxhyInterfaceResponse dxhyInterfaceResponse = InvokeDxhyApi.dxhyInterfaceInvoke(dxhyInterfaceRequest);
log.info("请求成功,结果{}",JSONUtil.toJsonStr(dxhyInterfaceResponse));
String code = dxhyInterfaceResponse.getCode();
return AjaxResult.error("请求失败");
return dxhyInterfaceResponse;
}
@ -415,7 +422,7 @@ public class ElephantUtils {
}
//kk TODO : 2023/9/5 大象接口迁京东云
//https://js.ele12.com/
host = "https://js.ele12.com/order-api";
// host = "https://js.ele12.com/order-api";
String url = host + uri;
// String token = getToken();

Loading…
Cancel
Save