|
@@ -342,19 +342,29 @@ public class SimpleCORSFilter implements Filter {
|
|
customer.setCustomerName(appKey);
|
|
customer.setCustomerName(appKey);
|
|
customer.setAppSecret(appSecret);
|
|
customer.setAppSecret(appSecret);
|
|
Customer customer1 = customerService.getCustomerByAppKeyAndAppSecret(customer);
|
|
Customer customer1 = customerService.getCustomerByAppKeyAndAppSecret(customer);
|
|
-
|
|
|
|
if (null == customer1 || customer1.getAccstatus() != 0) {
|
|
if (null == customer1 || customer1.getAccstatus() != 0) {
|
|
return ResponseCode.ACCOUNT_NOT_EXIST;
|
|
return ResponseCode.ACCOUNT_NOT_EXIST;
|
|
}
|
|
}
|
|
if(null != customer1 && ! appSecret.equals(customer1.getAppSecret())){
|
|
if(null != customer1 && ! appSecret.equals(customer1.getAppSecret())){
|
|
return ResponseCode.SIGN_ERROR;
|
|
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)){
|
|
if(!API_MAPS.containsKey(api)){
|
|
return ResponseCode.CUSTOMER_QUERY_ERROR;
|
|
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) {
|
|
} catch (Exception e) {
|
|
log.error("Token 校验失败,{}:{}", e.getClass().getName(), e.getMessage());
|
|
log.error("Token 校验失败,{}:{}", e.getClass().getName(), e.getMessage());
|