zhaohui преди 3 години
родител
ревизия
7f8b240296
променени са 1 файла, в които са добавени 25 реда и са изтрити 10 реда
  1. 25 10
      src/main/java/info/aspirecn/iov/sjjh/service/impl/VehicleServiceImpl.java

+ 25 - 10
src/main/java/info/aspirecn/iov/sjjh/service/impl/VehicleServiceImpl.java

@@ -175,6 +175,8 @@ public class VehicleServiceImpl implements VehicleService {
         ChannelTypeHandleResponseObject retB = new ChannelTypeHandleResponseObject();
         String upstreamCodeA = "";
         String upstreamCodeB = "";
+        String errMsgA = "loadingCountrySubdivisionCode";
+        String errMsgB = "receiptCountrySubdivisionCode";
         /**
          * 1、云雁分调取A-到A+和B-到B+的轨迹,并取这两段轨迹中的每个点的行政区划代码合集X和合集Y
          * 2、将合集X分别与A点行政区划进行比对,只要有一点比对一致则视为此点核验通过
@@ -230,12 +232,14 @@ public class VehicleServiceImpl implements VehicleService {
                         retA.setResultDesc(Constant.QUERY_SUCCESS);
                     }
                 } else {
+                    errList.add(errMsgA);
                     retA.setResultCode(Constant.UN_FIND_NUM_CODE);
                     retA.setResultBody(Constants.NO_RESULT);
                     retA.setResultDesc(Constants.NO_RESULT);
                 }
                 retA.setIsCharge(Constant.IS_CHARGE);
             } else if (positionResponseA.getResultCode().equals(Constants.RESULT_CODE_110000)) {
+                errList.add(errMsgA);
                 retA.setResultCode(Constant.UN_FIND_NUM_CODE);
                 retA.setResultBody(Constants.NO_RESULT);
                 retA.setResultDesc(Constants.NO_RESULT);
@@ -289,12 +293,14 @@ public class VehicleServiceImpl implements VehicleService {
                         retB.setResultDesc(Constant.QUERY_SUCCESS);
                     }
                 } else {
+                    errList.add(errMsgB);
                     retB.setResultCode(Constant.UN_FIND_NUM_CODE);
                     retB.setResultBody(Constants.NO_RESULT);
                     retB.setResultDesc(Constants.NO_RESULT);
                 }
                 ret.setIsCharge(Constant.IS_CHARGE);
             } else if (positionResponseB.getResultCode().equals(Constants.RESULT_CODE_110000)) {
+                errList.add(errMsgB);
                 retB.setResultCode(Constant.UN_FIND_NUM_CODE);
                 retB.setResultBody(Constants.NO_RESULT);
                 retB.setResultDesc(Constants.NO_RESULT);
@@ -310,26 +316,35 @@ public class VehicleServiceImpl implements VehicleService {
             upstreamCodeB = Integer.toString(responseA.getStatusCode());
         }
 
+        // A、B两点都比对通过
         if(retA.getResultCode()==Constant.MATCH_CODE&&retB.getResultCode()==Constant.MATCH_CODE){
             return upstreamCodeA;
         }
-        if(errList.size()>0){
-            ret.setResultCode(Constant.UN_MATCH_CODE);
-            ret.setResultBody(errList);
-            ret.setResultDesc(Constant.QUERY_SUCCESS);
-            return upstreamCodeA;
-        }
-        if(retA.getResultCode()>=retB.getResultCode()){
+
+        // A点其他错误,直接返回A点错误
+        if(retA.getResultCode()==Constant.OTHER_ERROR_CODE){
             ret.setResultCode(retA.getResultCode());
             ret.setResultDesc(retA.getResultDesc());
-            ret.setResultBody("loadingCountrySubdivisionCode");
+            ret.setResultBody(retA.getResultBody());
             return upstreamCodeA;
-        }else{
+        }
+        
+        // B点其他错误,直接返回B点错误
+        if(retB.getResultCode()==Constant.OTHER_ERROR_CODE){
             ret.setResultCode(retB.getResultCode());
             ret.setResultDesc(retB.getResultDesc());
-            ret.setResultBody("receiptCountrySubdivisionCode");
+            ret.setResultBody(retB.getResultBody());
             return upstreamCodeB;
         }
+
+        // errList有数据时,状态值2
+        if(errList.size()>0){
+            ret.setResultCode(Constant.UN_MATCH_CODE);
+            ret.setResultBody(errList);
+            ret.setResultDesc(Constant.QUERY_SUCCESS);
+            return upstreamCodeA;
+        }
+        return "";
     }
 
     private String vehiclePositionConsistencyACheck(List<VehicleHistoryPositionResponse.Data> positionList,