浏览代码

后端代码提交

mashengyi 3 年之前
父节点
当前提交
b57979342b

+ 40 - 0
src/main/java/com/jkcredit/invoice/common/RequestApi.java

@@ -0,0 +1,40 @@
+package com.jkcredit.invoice.common;
+
+public class RequestApi {
+    String api = "";
+    String appKey = "";
+    String appSecret = "";
+    String data = "";
+
+    public String getApi() {
+        return api;
+    }
+
+    public void setApi(String api) {
+        this.api = api;
+    }
+
+    public String getAppKey() {
+        return appKey;
+    }
+
+    public void setAppKey(String appKey) {
+        this.appKey = appKey;
+    }
+
+    public String getAppSecret() {
+        return appSecret;
+    }
+
+    public void setAppSecret(String appSecret) {
+        this.appSecret = appSecret;
+    }
+
+    public String getData() {
+        return data;
+    }
+
+    public void setData(String data) {
+        this.data = data;
+    }
+}

+ 2 - 2
src/main/java/com/jkcredit/invoice/controller/localBussiness/NoCarController.java

@@ -331,12 +331,12 @@ public class NoCarController {
             if(!StringUtils.isEmpty(billInvoice.getInvoiceMakeTime()) && !"null".equals(billInvoice.getInvoiceMakeTime())){
                 String [] res =billInvoice.getInvoiceMakeTime().split(",");
                 billInvoice.setInvoiceMakeStart(res[0]);
-                billInvoice.setInvoiceMakeEnd(res[1]);
+                billInvoice.setInvoiceMakeEnd(res[1].replace("00:00:00","23:59:59"));
             }
             if(!StringUtils.isEmpty(billInvoice.getCalculateTime()) && !"null".equals(billInvoice.getCalculateTime())){
                 String [] res =billInvoice.getCalculateTime().split(",");
                 billInvoice.setCalculateTimeStart(res[0]);
-                billInvoice.setCalculateTimeEnd(res[1]);
+                billInvoice.setCalculateTimeEnd(res[1].replace("00:00:00","23:59:59"));
             }
             RespR respR = new RespR(nocarInvoiceService.findInvoiceStatics(billInvoice));
             return respR;

+ 16 - 15
src/main/java/com/jkcredit/invoice/credit/SimpleCORSFilter.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.jkcredit.invoice.common.ApiResult;
 import com.jkcredit.invoice.common.DataResult;
+import com.jkcredit.invoice.common.RequestApi;
 import com.jkcredit.invoice.common.ResponseCode;
 import com.jkcredit.invoice.model.entity.customer.Customer;
 import com.jkcredit.invoice.service.customer.CustomerService;
@@ -38,10 +39,7 @@ public class SimpleCORSFilter implements Filter {
     InterfaceCheckServer interfaceCheckServer;
 
 
-    String api = "";
-    String appKey = "";
-    String appSecret = "";
-    String data = "";
+
 
 
 
@@ -200,7 +198,6 @@ public class SimpleCORSFilter implements Filter {
 
     @Override
     public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
-
         HttpServletRequest httpRequest = (HttpServletRequest) servletRequest;
         HttpServletResponse httpResponse = (HttpServletResponse) servletResponse;
         // *表示允许所有域名跨域
@@ -234,8 +231,8 @@ public class SimpleCORSFilter implements Filter {
 
             long startTime = System.currentTimeMillis();
             String flagUuid = UUID.randomUUID().toString();
-
-            ResponseCode responseCode = checkToken(httpRequest, httpResponse,startTime,flagUuid);
+            RequestApi requestApi = new RequestApi();
+            ResponseCode responseCode = checkToken(httpRequest, httpResponse,startTime,flagUuid,requestApi);
             if (!Objects.equals(responseCode, ResponseCode.SUCCESS)) {
                 log.error("FILE - SimpleCORSFilterError = {}", responseCode + " ,requestURI = {" + httpRequest.getRequestURI() +"}");
                 //httpResponse.setStatus(HttpServletResponse.SC_BAD_REQUEST);
@@ -243,13 +240,13 @@ public class SimpleCORSFilter implements Filter {
                 httpResponse.setCharacterEncoding("utf-8");
                 PrintWriter writer = httpResponse.getWriter();
                 writer.write(new ObjectMapper().writeValueAsString(ApiResult.failure(responseCode,requestid)));
-                log.error("[FILE - SimpleCORSFilter-] return result=" + responseCode.toString() + " , param is api="+  api + " , data=" + data + " , appKey=" + appKey + " , appSecret=" + appSecret +  " ,timeCost=" +(System.currentTimeMillis()-startTime) + "ms" +" , flag=" + flagUuid);
+                log.error("[FILE - SimpleCORSFilter-] return result=" + responseCode.toString() + " , param is api="+  requestApi.getApi() + " , data=" + requestApi.getData() + " , appKey=" + requestApi.getAppKey() + " , appSecret=" + requestApi.getAppSecret() +  " ,timeCost=" +(System.currentTimeMillis()-startTime) + "ms" +" , flag=" + flagUuid);
                 return;
             }else{
                 log.info("SUCCESS - SimpleCORSFilterWarn = {}", responseCode + " ,requestURI = {" + httpRequest.getRequestURI() +"}");
 
 
-                DataResult dataResult =  interfaceCheckServer.doJumpHandler(appKey,api,data,requestid);
+                DataResult dataResult =  interfaceCheckServer.doJumpHandler(requestApi.getAppKey(),requestApi.getApi(),requestApi.getData(),requestid);
                 if(null == dataResult){
                     dataResult.setData(3);
                     dataResult.setCode(200);
@@ -261,7 +258,7 @@ public class SimpleCORSFilter implements Filter {
                 httpResponse.setCharacterEncoding("utf-8");
                 PrintWriter writer = httpResponse.getWriter();
                 writer.write(new ObjectMapper().writeValueAsString(ApiResult.failure(dataResult)));
-                log.info("[SUCCESS - SimpleCORSFilter-] return result=" + dataResult.toString() + " , param is api="+  api + " , data=" + data + " , appKey=" + appKey + " , appSecret=" + appSecret +  " ,timeCost=" +(System.currentTimeMillis()-startTime) + "ms" +" , flag=" + flagUuid);
+                log.info("[SUCCESS - SimpleCORSFilter-] return result=" + dataResult.toString() + " , param is api="+  requestApi.getApi() + " , data=" + requestApi.getData() + " , appKey=" + requestApi.getAppKey() + " , appSecret=" + requestApi.getAppSecret() +  " ,timeCost=" +(System.currentTimeMillis()-startTime) + "ms" +" , flag=" + flagUuid);
                 return;
             }
         }
@@ -339,7 +336,7 @@ public class SimpleCORSFilter implements Filter {
      * @param response
      * @return
      */
-    private ResponseCode checkToken(HttpServletRequest request, HttpServletResponse response,long startTime,String flag) {
+    private ResponseCode checkToken(HttpServletRequest request, HttpServletResponse response,long startTime,String flag,RequestApi requestApi) {
         try {
 
 
@@ -365,10 +362,14 @@ public class SimpleCORSFilter implements Filter {
             }
 
             String jsonObject1 = getOpenApiRequestData(request);
-            api = getApi(jsonObject1);
-            appKey = getAppKey(jsonObject1);
-            appSecret = getAppSecret(jsonObject1);
-            data = getData(jsonObject1);
+            String api = getApi(jsonObject1);
+            String appKey = getAppKey(jsonObject1);
+            String appSecret = getAppSecret(jsonObject1);
+            String data = getData(jsonObject1);
+            requestApi.setApi(api);
+            requestApi.setData(data);
+            requestApi.setAppSecret(appSecret);
+            requestApi.setAppKey(appKey);
             log.info("[-SimpleCORSFilter-] query param api=" + api + " , data=" + data + " , appKey=" + appKey + " , appSecret=" + appSecret + " , flag=" + flag);
             if (StringUtils.isEmpty(api) || StringUtils.isEmpty(data) || StringUtils.isEmpty(appKey) || StringUtils.isEmpty(appSecret)) {
                 return ResponseCode.UNKNOWN_ERROR;