|
|
|
@ -105,6 +105,8 @@ public class InterfaceController extends AbstractController { |
|
|
|
|
private VoucherRecordService voucherRecordService; |
|
|
|
|
@Resource |
|
|
|
|
private BaseIReceiptInvoiceService baseIReceiptInvoiceService; |
|
|
|
|
@Value("${erp.ipUrl}") |
|
|
|
|
private String ipUrl; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* |
|
|
|
@ -119,7 +121,7 @@ public class InterfaceController extends AbstractController { |
|
|
|
|
@PathVariable("version") String version, |
|
|
|
|
@PathVariable("interfaceName") String interfaceName, |
|
|
|
|
@ApiParam(name = "requestParam", value = "业务报文", required = true) @RequestBody String content) { |
|
|
|
|
log.info("{} SDK对外接口请求,version:{},interfaceName:{},content:{}",LOGGER_MSG,version,interfaceName,content); |
|
|
|
|
log.info("{} SDK对外接口请求,version:{},interfaceName:{},content:{},请求url={}",LOGGER_MSG,version,interfaceName,content,request.getRequestURL().toString()); |
|
|
|
|
DxhyInterfaceResponse dxhyInterfaceResponse = new DxhyInterfaceResponse(RespStatusEnum.FAIL2); |
|
|
|
|
long startTime = System.currentTimeMillis(); |
|
|
|
|
try { |
|
|
|
@ -148,7 +150,7 @@ public class InterfaceController extends AbstractController { |
|
|
|
|
/** |
|
|
|
|
* 鉴权 |
|
|
|
|
*/ |
|
|
|
|
result = authV5(request, dxhyInterfaceRequest,secretKey); |
|
|
|
|
result = authV5(version+"/"+interfaceName,request, dxhyInterfaceRequest,secretKey); |
|
|
|
|
long end1 = System.currentTimeMillis(); |
|
|
|
|
log.debug("{}鉴权耗时{}毫秒", LOGGER_MSG, end1 - begin1); |
|
|
|
|
if (!ConfigurerInfo.SUCCSSCODE.equals(result.getCode())) { |
|
|
|
@ -293,14 +295,18 @@ public class InterfaceController extends AbstractController { |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private CheckResult authV5(HttpServletRequest request, DxhyInterfaceRequest dxhyInterfaceRequest,String secretKey) { |
|
|
|
|
private CheckResult authV5(String url,HttpServletRequest request, DxhyInterfaceRequest dxhyInterfaceRequest,String secretKey) { |
|
|
|
|
CheckResult checkResult = new CheckResult(RespStatusEnum.AUTHFAIL); |
|
|
|
|
String reqUrl = request.getRequestURL().toString(); |
|
|
|
|
if (reqUrl.contains(ConfigureConstant.STRING_WH)) { |
|
|
|
|
reqUrl = reqUrl.substring(ConfigureConstant.INT_0, reqUrl.indexOf(ConfigureConstant.STRING_WH)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
log.debug("{}请求路径:{}", LOGGER_MSG, reqUrl); |
|
|
|
|
|
|
|
|
|
//获取鉴权URL
|
|
|
|
|
String signUrl = getAuthUrl(reqUrl, request.getMethod()); |
|
|
|
|
// String signUrl = getAuthUrl(reqUrl, request.getMethod());
|
|
|
|
|
String signUrl = ipUrl+url+"?"; |
|
|
|
|
TreeMap<String, String> sortMap = new TreeMap<>(); |
|
|
|
|
sortMap.put(ConfigurerInfo.SECRETID, dxhyInterfaceRequest.getSecretId()); |
|
|
|
|
sortMap.put(ConfigurerInfo.DATA_EXCHANGE_ID, dxhyInterfaceRequest.getDataExchangeId()); |
|
|
|
@ -323,7 +329,6 @@ public class InterfaceController extends AbstractController { |
|
|
|
|
return checkResult; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String commonDecrypt(String zipCode, String encryptCode, String content,String secretKey) { |
|
|
|
|
String result = ""; |
|
|
|
|
byte[] de = content.getBytes(); |
|
|
|
|