|
@@ -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;
|
|
|
|
|
|
|
|
|
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":
|
|
|
- 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":
|
|
|
- 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);
|