Sfoglia il codice sorgente

增加车牌限制

xsl 2 mesi fa
parent
commit
deae7000b9

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>com.jkcredit.location</groupId>
     <artifactId>location-info</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
+    <version>1.0.1</version>
     <name>location-info</name>
     <description>location-info</description>
     <properties>

+ 6 - 0
src/main/java/com/jkcredit/location/service/impl/LocationServiceImpl.java

@@ -45,6 +45,8 @@ public class LocationServiceImpl implements LocationService {
     private String key;
     @Value("${supplier.vehicleTrajectoryQueryOneUrl}")
     private String vehicleTrajectoryQueryOneUrl;
+    @Value("${forbidden.plateNum}")
+    private String forbiddenPlateNum;
 
     private OkHttpClient okHttpClient = new OkHttpClient.Builder().build();
     private static final Log CLIENT_CHARGE_LOGGER = LogFactory.getLog("CLIENT_CHARGE_LOGGER");
@@ -254,6 +256,10 @@ public class LocationServiceImpl implements LocationService {
             ret.setResultCode(CommonConstant.JK_RETURN_CODE_INVALID_PARAMETER);
             ret.setResultBody(CommonConstant.INVALID_PARAMETER);
             return false;
+        } else if (forbiddenPlateNum.equals(requestObject.getCustomBody().getPlateNum())) {
+            ret.setResultCode(CommonConstant.JK_RETURN_CODE_OTHER_ERROR);
+            ret.setResultBody(CommonConstant.OTHER_ERROR);
+            return false;
         } else {
             return true;
         }

+ 2 - 0
src/main/resources/application.yml

@@ -13,3 +13,5 @@ supplier:
   key: ecb35b9550704b848a243af1f0b2c740
   vehicleTrajectoryQueryOneUrl: https://openapi.huoyancredit.com/yunwei/openapi/vehicleTrajectoryQueryOne
 userInfoPath: /usr/local/app/track/location/user.json
+forbidden:
+  plateNum: 冀E5476W