|
@@ -261,17 +261,10 @@ public class VehicleServiceImpl implements VehicleService {
|
|
|
ret.setIsCharge(Constant.IS_CHARGE);
|
|
|
return upstreamCode;
|
|
|
}
|
|
|
- List<String> errorList = new ArrayList<>();
|
|
|
|
|
|
- if (loadingCountryResult == Constant.UN_MATCH_CODE && receiptCountryResult == Constant.UN_MATCH_CODE) {
|
|
|
- // 装货点(A点)结果为空 且 卸货点(B点)结果为空;返回查无
|
|
|
- errorList.add("loadingCountrySubdivisionCode");
|
|
|
- errorList.add("receiptCountrySubdivisionCode");
|
|
|
- ret.setResultCode(Constant.UN_MATCH_CODE);
|
|
|
- ret.setResultBody(errorList);
|
|
|
- ret.setResultDesc(Constant.QUERY_SUCCESS);
|
|
|
- return upstreamCode;
|
|
|
- }
|
|
|
+ String errorMsg = "";
|
|
|
+ List<String> errorList = new ArrayList<>();
|
|
|
+ List<String> emptyList = new ArrayList<>();
|
|
|
if (loadingCountryResult == Constant.UN_MATCH_CODE) {
|
|
|
// 装货点(A点)不一致
|
|
|
errorList.add("loadingCountrySubdivisionCode");
|
|
@@ -280,27 +273,51 @@ public class VehicleServiceImpl implements VehicleService {
|
|
|
// 卸货点(B点)不一致
|
|
|
errorList.add("receiptCountrySubdivisionCode");
|
|
|
}
|
|
|
- if (errorList.size() > 0) {
|
|
|
- // 装货点(A点)一致 或 卸货点(B点)不一致;返回不一致
|
|
|
+ if (loadingCountryResult == Constant.UN_FIND_NUM_CODE) {
|
|
|
+ // 装货点(A点)为空
|
|
|
+ emptyList.add("loadingCountrySubdivisionCode");
|
|
|
+ }
|
|
|
+ if (receiptCountryResult == Constant.UN_FIND_NUM_CODE) {
|
|
|
+ // 卸货点(B点)为空
|
|
|
+ emptyList.add("receiptCountrySubdivisionCode");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (emptyList.size() == 2) {
|
|
|
+ // 装货点(A点)结果为空 且 卸货点(B点)结果为空;返回查无
|
|
|
+ errorMsg = "数据源loadingCountrySubdivisionCode,receiptCountrySubdivisionCode为空";
|
|
|
ret.setResultCode(Constant.UN_MATCH_CODE);
|
|
|
- ret.setResultBody(errorList);
|
|
|
+ ret.setResultBody(errorMsg);
|
|
|
ret.setResultDesc(Constant.QUERY_SUCCESS);
|
|
|
- ret.setIsCharge(Constant.IS_CHARGE);
|
|
|
return upstreamCode;
|
|
|
}
|
|
|
|
|
|
- if (loadingCountryResult == Constant.UN_FIND_NUM_CODE) {
|
|
|
- // 装货点(A点)为空
|
|
|
- errorList.add("loadingCountrySubdivisionCode");
|
|
|
+ if (errorList.size() == 2) {
|
|
|
+ // 装货点(A点)结果不一致 且 卸货点(B点)结果不一致;返回不一致
|
|
|
+ errorMsg = "数据源loadingCountrySubdivisionCode,receiptCountrySubdivisionCode不一致";
|
|
|
+ ret.setResultCode(Constant.UN_MATCH_CODE);
|
|
|
+ ret.setResultBody(errorMsg);
|
|
|
+ ret.setResultDesc(Constant.QUERY_SUCCESS);
|
|
|
+ return upstreamCode;
|
|
|
}
|
|
|
- if (receiptCountryResult == Constant.UN_FIND_NUM_CODE) {
|
|
|
- // 卸货点(B点)为空
|
|
|
- errorList.add("receiptCountrySubdivisionCode");
|
|
|
+ if (errorList.size() == 1 && emptyList.size() ==1) {
|
|
|
+ errorMsg = "数据源" + org.apache.commons.lang3.StringUtils.join(emptyList, ",") + "为空,";
|
|
|
+ errorMsg += org.apache.commons.lang3.StringUtils.join(errorList, ",") + "为不一致";
|
|
|
+ ret.setResultCode(Constant.UN_MATCH_CODE);
|
|
|
+ ret.setResultBody(errorMsg);
|
|
|
+ ret.setResultDesc(Constant.QUERY_SUCCESS);
|
|
|
+ return upstreamCode;
|
|
|
+ }
|
|
|
+ if (errorList.size() == 1) {
|
|
|
+ errorMsg = "数据源" + org.apache.commons.lang3.StringUtils.join(errorList, ",") + "为不一致";
|
|
|
+ ret.setResultCode(Constant.UN_MATCH_CODE);
|
|
|
+ ret.setResultBody(errorMsg);
|
|
|
+ ret.setResultDesc(Constant.QUERY_SUCCESS);
|
|
|
+ return upstreamCode;
|
|
|
}
|
|
|
- if (errorList.size() > 0) {
|
|
|
- // 装货点(A点)为空 或 卸货点(B点)为空;返回不一致
|
|
|
+ if (emptyList.size() == 1) {
|
|
|
+ errorMsg = "数据源" + org.apache.commons.lang3.StringUtils.join(emptyList, ",") + "为空";
|
|
|
ret.setResultCode(Constant.UN_MATCH_CODE);
|
|
|
- ret.setResultBody(errorList);
|
|
|
+ ret.setResultBody(errorMsg);
|
|
|
ret.setResultDesc(Constant.QUERY_SUCCESS);
|
|
|
return upstreamCode;
|
|
|
}
|