Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

Administrator 2 vuotta sitten
vanhempi
commit
571fcbd095
1 muutettua tiedostoa jossa 14 lisäystä ja 4 poistoa
  1. 14 4
      src/main/java/com/jkcredit/invoice/credit/SimpleCORSFilter.java

+ 14 - 4
src/main/java/com/jkcredit/invoice/credit/SimpleCORSFilter.java

@@ -342,19 +342,29 @@ public class SimpleCORSFilter implements Filter {
             customer.setCustomerName(appKey);
             customer.setAppSecret(appSecret);
             Customer customer1 = customerService.getCustomerByAppKeyAndAppSecret(customer);
-
             if (null == customer1 || customer1.getAccstatus() != 0) {
                 return ResponseCode.ACCOUNT_NOT_EXIST;
             }
             if(null != customer1 && ! appSecret.equals(customer1.getAppSecret())){
                 return ResponseCode.SIGN_ERROR;
             }
-            if (0 >= new BigDecimal(customer1.getAccountBalance()).compareTo(new BigDecimal(0.0))) {
-                return ResponseCode.BALANCE_QUERY_ERROR;
-            }
             if(!API_MAPS.containsKey(api)){
                 return ResponseCode.CUSTOMER_QUERY_ERROR;
             }
+            boolean flags = false;
+
+            if (0 >= new BigDecimal(customer1.getAccountBalance()).compareTo(new BigDecimal(0.0))) {
+                flags =  true;
+            }
+            if (0 == new BigDecimal(customer1.getAccountBalance()).compareTo(new BigDecimal(0.0))
+
+                    &&  (api.equals("WAY_BILL_NUM_FIND_INVOICE") || api.equals("B2B_INVOICE_QUERY_V1"))) {
+                flags =  false;
+            }
+            if(flags){
+                return ResponseCode.BALANCE_QUERY_ERROR;
+            }
+
 
         } catch (Exception e) {
             log.error("Token 校验失败,{}:{}", e.getClass().getName(), e.getMessage());