|
@@ -1,6 +1,7 @@
|
|
|
package com.jkcredit.invoice.credit;
|
|
|
|
|
|
import com.jkcredit.invoice.common.DataResult;
|
|
|
+import com.jkcredit.invoice.component.StatisRequestIdTimeComp;
|
|
|
import com.jkcredit.invoice.credit.custInterface.CustomerInterLowerService;
|
|
|
import com.jkcredit.invoice.credit.custInterface.NoCarInterService;
|
|
|
import com.jkcredit.invoice.credit.custInterface.SelfCarInterService;
|
|
@@ -19,12 +20,19 @@ public class InterfaceCheckServer {
|
|
|
SelfCarInterService selfCarInterService;
|
|
|
@Autowired
|
|
|
NoCarInterService noCarInterService;
|
|
|
+ @Autowired
|
|
|
+ StatisRequestIdTimeComp statisRequestIdTimeComp;
|
|
|
|
|
|
//跳转到对应的Service服务处理逻辑
|
|
|
public DataResult doJumpHandler(String appKey, String api, String data,String requestid ) {
|
|
|
|
|
|
log.info("[-InterfaceCheckServer.doJumpHandler-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data + " ,requestid=" +requestid);
|
|
|
|
|
|
+ DataResult resultTimeOut = new DataResult();
|
|
|
+ resultTimeOut.setData(3);
|
|
|
+ resultTimeOut.setCode(200);
|
|
|
+ resultTimeOut.setRequestid(requestid);
|
|
|
+ resultTimeOut.setMsg("网络异常");
|
|
|
|
|
|
DataResult result;
|
|
|
switch (api){
|
|
@@ -56,13 +64,31 @@ public class InterfaceCheckServer {
|
|
|
result = selfCarInterService.customerETCRecValid(appKey,api,data,requestid);
|
|
|
break;
|
|
|
case "CARD_TRADE_V1"://自有车 交易查询接口 渠道通过此接口可以查询单张卡连续90天内的交易(待开票、开票中、已开票)
|
|
|
- result = selfCarInterService.getTradeList(appKey,api,data,requestid);
|
|
|
+ if(StatisRequestIdTimeComp.isLimit){
|
|
|
+ result = resultTimeOut;
|
|
|
+ }else{
|
|
|
+ statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
|
|
|
+ result = selfCarInterService.getTradeList(appKey,api,data,requestid);
|
|
|
+ statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
|
|
|
+ }
|
|
|
break;
|
|
|
case "B2B_INVOICE_APPLY_V1"://自有车 申请开票接口 渠道通过此接口可以对该公司绑定的单张卡连续90天内的交易进行开票。
|
|
|
- result = selfCarInterService.applInvoice(appKey,api,data,requestid);
|
|
|
+ if(StatisRequestIdTimeComp.isLimit){
|
|
|
+ result = resultTimeOut;
|
|
|
+ }else{
|
|
|
+ statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
|
|
|
+ result = selfCarInterService.applInvoice(appKey,api,data,requestid);
|
|
|
+ statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
|
|
|
+ }
|
|
|
break;
|
|
|
case "B2B_INVOICE_QUERY_V1"://自有车 已开发票查询接口 渠道通过此接口可以根据该公司绑定的单张卡查询此卡在某个月开具的发票。
|
|
|
- result = selfCarInterService.getSelfCarInvoicesByTime(appKey,api,data,requestid);
|
|
|
+ if(StatisRequestIdTimeComp.isLimit){
|
|
|
+ result = resultTimeOut;
|
|
|
+ }else{
|
|
|
+ statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
|
|
|
+ result = selfCarInterService.getSelfCarInvoicesByTime(appKey,api,data,requestid);
|
|
|
+ statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
|
|
|
+ }
|
|
|
break;
|
|
|
case "B2B_INVOICE_PACKAGE_V1"://自有车 发票下载 渠道通过此接口可以下载某公司某个月份开具的发票。
|
|
|
result = selfCarInterService.getSelfCarInvoicePackage(appKey,api,data,requestid);
|
|
@@ -82,16 +108,40 @@ public class InterfaceCheckServer {
|
|
|
result = noCarInterService.customeRecUpperQuery(appKey,api,data,requestid);
|
|
|
break;
|
|
|
case "WAY_BILL_START"://无车 实时运单开始指令
|
|
|
- result = noCarInterService.noCarBillStart(appKey,api,data,requestid);
|
|
|
+ if(StatisRequestIdTimeComp.isLimit){
|
|
|
+ result = resultTimeOut;
|
|
|
+ }else{
|
|
|
+ statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
|
|
|
+ result = noCarInterService.noCarBillStart(appKey,api,data,requestid);
|
|
|
+ statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
|
|
|
+ }
|
|
|
break;
|
|
|
case "WAY_BILL_END"://无车 实时运单结束指令
|
|
|
- result = noCarInterService.noCarBillEnd(appKey,api,data,requestid);
|
|
|
+ if(StatisRequestIdTimeComp.isLimit){
|
|
|
+ result = resultTimeOut;
|
|
|
+ }else{
|
|
|
+ statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
|
|
|
+ result = noCarInterService.noCarBillEnd(appKey,api,data,requestid);
|
|
|
+ statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
|
|
|
+ }
|
|
|
break;
|
|
|
case "WAY_BILL_HISTORY_START"://无车 历史运单开始指令
|
|
|
- result = noCarInterService.noCarHisWaybillStart(appKey,api,data,requestid);
|
|
|
+ if(StatisRequestIdTimeComp.isLimit){
|
|
|
+ result = resultTimeOut;
|
|
|
+ }else{
|
|
|
+ statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
|
|
|
+ result = noCarInterService.noCarHisWaybillStart(appKey,api,data,requestid);
|
|
|
+ statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
|
|
|
+ }
|
|
|
break;
|
|
|
case "WAY_BILL_HISTORY_END"://无车 历史运单结束指令
|
|
|
- result = noCarInterService.noCarHisWaybillEnd(appKey,api,data,requestid);
|
|
|
+ if(StatisRequestIdTimeComp.isLimit){
|
|
|
+ result = resultTimeOut;
|
|
|
+ }else{
|
|
|
+ statisRequestIdTimeComp.putReQuestIdAndTime(requestid);
|
|
|
+ result = noCarInterService.noCarHisWaybillEnd(appKey,api,data,requestid);
|
|
|
+ statisRequestIdTimeComp.removeReQuestIdAndTime(requestid);
|
|
|
+ }
|
|
|
break;
|
|
|
case "WAY_BILL_NUM_FIND_INVOICE"://无车 运单号查询发票数据
|
|
|
result = noCarInterService.noCarVoiceQuery(appKey,api,data,requestid);
|