|
@@ -2,6 +2,7 @@ package info.aspirecn.iov.sjjh.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.fasterxml.jackson.databind.DeserializationFeature;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import info.aspirecn.iov.sjjh.commons.lang.ChannelTypeHandleResponseObject;
|
|
import info.aspirecn.iov.sjjh.commons.lang.ChannelTypeHandleResponseObject;
|
|
import info.aspirecn.iov.sjjh.commons.lang.Constant;
|
|
import info.aspirecn.iov.sjjh.commons.lang.Constant;
|
|
@@ -54,6 +55,7 @@ public class VehicleServiceImpl implements VehicleService {
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
VehicleHistoryPositionRequestParam requestParam;
|
|
VehicleHistoryPositionRequestParam requestParam;
|
|
try {
|
|
try {
|
|
|
|
+ objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
|
requestParam = objectMapper.readValue(customBody, VehicleHistoryPositionRequestParam.class);
|
|
requestParam = objectMapper.readValue(customBody, VehicleHistoryPositionRequestParam.class);
|
|
} catch (IOException ioe) {
|
|
} catch (IOException ioe) {
|
|
log.info("supplier-vehicle.vehicleHistoryPositionQuery-解析参数Exception:{}", ioe);
|
|
log.info("supplier-vehicle.vehicleHistoryPositionQuery-解析参数Exception:{}", ioe);
|
|
@@ -73,39 +75,281 @@ public class VehicleServiceImpl implements VehicleService {
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
- // 接口调用
|
|
|
|
- Response response = new Response();
|
|
|
|
|
|
+ if (type.equals(VehicleHistoryPositionQueryType.VEHICLE_HISTORY_POSITION_QUERY.getValue())) {
|
|
|
|
+ // 车辆轨迹核验
|
|
|
|
+ upstreamCode = setVehicleHistoryPositionQueryResponse(ret, outTime, requestParam);
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ // 车辆线上线下一致性验证
|
|
|
|
+ upstreamCode = setVehiclePositionConsistencyTwoCheckResponse(ret, outTime, requestParam);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ request.setAttribute(Constant.LOG_UPSTREAM_RESPONSE_CODE, upstreamCode);
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /*----------------------------------------------------新增开始----------------------------------------------------*/
|
|
|
|
+
|
|
|
|
+ private String setVehicleHistoryPositionQueryResponse(ChannelTypeHandleResponseObject ret, int outTime,
|
|
|
|
+ VehicleHistoryPositionRequestParam requestParam){
|
|
|
|
+ String upstreamCode = "";
|
|
|
|
+ String result = vehiclePositionConsistencyTwoCheck(ret, outTime, requestParam);
|
|
|
|
+ if (Constants.RESULT_CODE_0.equals(result)) {
|
|
|
|
+ // 接口调用
|
|
|
|
+ Response response = new Response();
|
|
|
|
+ try {
|
|
|
|
+ RequestObject requestObject = new RequestObject();
|
|
|
|
+ requestObject.setVehicleNumber(requestParam.getPlateNumber());
|
|
|
|
+ requestObject.setLicensePlateTypeCode(requestParam.getPlateColor());
|
|
|
|
+ requestObject.setStartTime(DateUtil.addHours(requestParam.getStartTime(), supplierConfig.getReduceHours()));
|
|
|
|
+ requestObject.setEndTime(DateUtil.addHours(requestParam.getEndTime(), supplierConfig.getAddHours()));
|
|
|
|
+ requestObject.setPartyFunctionCode(supplierConfig.getPartyFunctionCode());
|
|
|
|
+ response = PostUtil.postString(supplierConfig.getHistoryPositionUrl(), JSON.toJSONString(requestObject),
|
|
|
|
+ supplierConfig.getAppKey(), supplierConfig.getAppSecret(), outTime);
|
|
|
|
+ log.info("supplier-vehicle.vehicleHistoryPositionQuery-responseStatus:{}", response.getStatusCode());
|
|
|
|
+ log.info("supplier-vehicle.vehicleHistoryPositionQuery-responseBody:{}", response.getBody());
|
|
|
|
+ if (response.getStatusCode() == Constants.STATUS_CODE_200) {
|
|
|
|
+ VehicleHistoryPositionResponse positionResponse = JSON.toJavaObject(JSON.parseObject(response.getBody()),
|
|
|
|
+ VehicleHistoryPositionResponse.class);
|
|
|
|
+ upstreamCode = positionResponse.getResultCode();
|
|
|
|
+ if (positionResponse.getResultCode().equals(Constants.RESULT_CODE_0)) {
|
|
|
|
+ if (positionResponse.getData() != null && positionResponse.getData().size() > 0) {
|
|
|
|
+ JSONObject vehicleLocationInfo = new JSONObject();
|
|
|
|
+ vehicleLocationInfo.put("vehicleLocationInfo", positionResponse.getData());
|
|
|
|
+ ret.setResultCode(Constant.MATCH_CODE);
|
|
|
|
+ ret.setResultBody(vehicleLocationInfo);
|
|
|
|
+ ret.setResultDesc(Constant.QUERY_SUCCESS);
|
|
|
|
+ } else {
|
|
|
|
+ ret.setResultCode(Constant.UN_FIND_NUM_CODE);
|
|
|
|
+ ret.setResultBody(Constants.NO_RESULT);
|
|
|
|
+ ret.setResultDesc(Constants.NO_RESULT);
|
|
|
|
+ }
|
|
|
|
+ ret.setIsCharge(Constant.IS_CHARGE);
|
|
|
|
+ } else if (positionResponse.getResultCode().equals(Constants.RESULT_CODE_110000)) {
|
|
|
|
+ ret.setResultCode(Constant.UN_FIND_NUM_CODE);
|
|
|
|
+ ret.setResultBody(Constants.NO_RESULT);
|
|
|
|
+ ret.setResultDesc(Constants.NO_RESULT);
|
|
|
|
+ } else {
|
|
|
|
+ ret.setResultCode(Constant.OTHER_ERROR_CODE);
|
|
|
|
+ ret.setResultBody(Constant.OTHER_ERROR);
|
|
|
|
+ ret.setResultDesc(Constant.OTHER_ERROR);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ ret.setResultCode(Constant.OTHER_ERROR_CODE);
|
|
|
|
+ ret.setResultBody(Constant.OTHER_ERROR);
|
|
|
|
+ ret.setResultDesc(Constant.OTHER_ERROR);
|
|
|
|
+ upstreamCode += response.getStatusCode();
|
|
|
|
+ }
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
+ log.info("supplier-vehicle.vehicleHistoryPositionQuery-IOException:{}", e);
|
|
|
|
+ ErrorUtils.captureException(e);
|
|
|
|
+ ret.setCode(Constant.REQUEST_TIMEOUT);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.info("supplier-vehicle.vehicleHistoryPositionQuery-Exception:{}", e);
|
|
|
|
+ ErrorUtils.captureException(e);
|
|
|
|
+ ret.setCode(Constant.FAIL);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ ret.setResultCode(Constant.UN_MATCH_CODE);
|
|
|
|
+ ret.setResultBody(result);
|
|
|
|
+ ret.setResultDesc(Constant.QUERY_SUCCESS);
|
|
|
|
+ }
|
|
|
|
+ return upstreamCode;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private String setVehiclePositionConsistencyTwoCheckResponse(ChannelTypeHandleResponseObject ret, int outTime,
|
|
|
|
+ VehicleHistoryPositionRequestParam requestParam){
|
|
|
|
+ String upstreamCode = "";
|
|
|
|
+ String result = vehiclePositionConsistencyTwoCheck(ret, outTime, requestParam);
|
|
|
|
+ if (StringUtils.isBlank(result)) {
|
|
|
|
+ ret.setResultCode(Constant.MATCH_CODE);
|
|
|
|
+ ret.setResultBody(Constant.MATCH);
|
|
|
|
+ ret.setResultDesc(Constant.QUERY_SUCCESS);
|
|
|
|
+ } else {
|
|
|
|
+ ret.setResultCode(Constant.UN_MATCH_CODE);
|
|
|
|
+ ret.setResultBody(result);
|
|
|
|
+ ret.setResultDesc(Constant.QUERY_SUCCESS);
|
|
|
|
+ }
|
|
|
|
+ return upstreamCode;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private String vehiclePositionConsistencyTwoCheck(ChannelTypeHandleResponseObject ret, int outTime,
|
|
|
|
+ VehicleHistoryPositionRequestParam requestParam){
|
|
|
|
+ String upstreamCode = "";
|
|
|
|
+ /**
|
|
|
|
+ * 1、云雁分调取A-到A+和B-到B+的轨迹,并取这两段轨迹中的每个点的行政区划代码合集X和合集Y
|
|
|
|
+ * 2、将合集X分别与A点行政区划进行比对,只要有一点比对一致则视为此点核验通过
|
|
|
|
+ * 3、将合集Y分别与B点行政区划进行比对,只要有一点比对一致则视为此点核验通过
|
|
|
|
+ * 4、A点和B点均核验通过视为此核验项通过
|
|
|
|
+ */
|
|
|
|
+ // A-
|
|
|
|
+ String startTimeA = DateUtil.addHours(requestParam.getStartTime(), supplierConfig.getReduceHours());
|
|
|
|
+ // A+
|
|
|
|
+ String endTimeA = DateUtil.addHours(requestParam.getStartTime(), supplierConfig.getAddHours());
|
|
|
|
+
|
|
|
|
+ // B-
|
|
|
|
+ String startTimeB = DateUtil.addHours(requestParam.getEndTime(), supplierConfig.getReduceHours());
|
|
|
|
+ // B+
|
|
|
|
+ String endTimeB = DateUtil.addHours(requestParam.getEndTime(), supplierConfig.getAddHours());
|
|
|
|
+
|
|
|
|
+ // A段接口调用
|
|
|
|
+ Response responseA = new Response();
|
|
try {
|
|
try {
|
|
RequestObject requestObject = new RequestObject();
|
|
RequestObject requestObject = new RequestObject();
|
|
requestObject.setVehicleNumber(requestParam.getPlateNumber());
|
|
requestObject.setVehicleNumber(requestParam.getPlateNumber());
|
|
requestObject.setLicensePlateTypeCode(requestParam.getPlateColor());
|
|
requestObject.setLicensePlateTypeCode(requestParam.getPlateColor());
|
|
- requestObject.setStartTime(DateUtil.addHours(requestParam.getStartTime(), supplierConfig.getReduceHours()));
|
|
|
|
- requestObject.setEndTime(DateUtil.addHours(requestParam.getEndTime(), supplierConfig.getAddHours()));
|
|
|
|
|
|
+ requestObject.setStartTime(startTimeA);
|
|
|
|
+ requestObject.setEndTime(endTimeA);
|
|
requestObject.setPartyFunctionCode(supplierConfig.getPartyFunctionCode());
|
|
requestObject.setPartyFunctionCode(supplierConfig.getPartyFunctionCode());
|
|
- response = PostUtil.postString(supplierConfig.getHistoryPositionUrl(), JSON.toJSONString(requestObject),
|
|
|
|
|
|
+ responseA = PostUtil.postString(supplierConfig.getHistoryPositionUrl(), JSON.toJSONString(requestObject),
|
|
supplierConfig.getAppKey(), supplierConfig.getAppSecret(), outTime);
|
|
supplierConfig.getAppKey(), supplierConfig.getAppSecret(), outTime);
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
- log.info("supplier-vehicle.vehicleHistoryPositionQuery-IOException:{}", e);
|
|
|
|
|
|
+ log.info("supplier-vehicle.vehicleHistoryAPositionQuery-IOException:{}", e);
|
|
ErrorUtils.captureException(e);
|
|
ErrorUtils.captureException(e);
|
|
ret.setCode(Constant.REQUEST_TIMEOUT);
|
|
ret.setCode(Constant.REQUEST_TIMEOUT);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.info("supplier-vehicle.vehicleHistoryPositionQuery-Exception:{}", e);
|
|
|
|
|
|
+ log.info("supplier-vehicle.vehicleHistoryAPositionQuery-Exception:{}", e);
|
|
ErrorUtils.captureException(e);
|
|
ErrorUtils.captureException(e);
|
|
ret.setCode(Constant.FAIL);
|
|
ret.setCode(Constant.FAIL);
|
|
}
|
|
}
|
|
- if (type.equals(VehicleHistoryPositionQueryType.VEHICLE_HISTORY_POSITION_QUERY.getValue())) {
|
|
|
|
- // 车辆轨迹核验
|
|
|
|
- upstreamCode = setVehicleHistoryPositionQueryResponse(ret, response, requestParam);
|
|
|
|
|
|
+
|
|
|
|
+ if (responseA.getStatusCode() == Constants.STATUS_CODE_200) {
|
|
|
|
+ VehicleHistoryPositionResponse positionResponseA = JSON.toJavaObject(JSON.parseObject(responseA.getBody()),
|
|
|
|
+ VehicleHistoryPositionResponse.class);
|
|
|
|
+ upstreamCode = positionResponseA.getResultCode();
|
|
|
|
+ if (positionResponseA.getResultCode().equals(Constants.RESULT_CODE_0)) {
|
|
|
|
+ if (positionResponseA.getData() != null && positionResponseA.getData().size() > 0) {
|
|
|
|
+ String resultA = vehiclePositionConsistencyACheck(positionResponseA.getData(), requestParam);
|
|
|
|
+ if (StringUtils.isBlank(resultA)) {
|
|
|
|
+ ret.setResultCode(Constant.MATCH_CODE);
|
|
|
|
+ ret.setResultBody(Constant.MATCH);
|
|
|
|
+ ret.setResultDesc(Constant.QUERY_SUCCESS);
|
|
|
|
+ } else {
|
|
|
|
+ ret.setResultCode(Constant.UN_MATCH_CODE);
|
|
|
|
+ ret.setResultBody(resultA);
|
|
|
|
+ ret.setResultDesc(Constant.QUERY_SUCCESS);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ ret.setResultCode(Constant.UN_FIND_NUM_CODE);
|
|
|
|
+ ret.setResultBody(Constants.NO_RESULT);
|
|
|
|
+ ret.setResultDesc(Constants.NO_RESULT);
|
|
|
|
+ }
|
|
|
|
+ ret.setIsCharge(Constant.IS_CHARGE);
|
|
|
|
+ } else if (positionResponseA.getResultCode().equals(Constants.RESULT_CODE_110000)) {
|
|
|
|
+ ret.setResultCode(Constant.UN_FIND_NUM_CODE);
|
|
|
|
+ ret.setResultBody(Constants.NO_RESULT);
|
|
|
|
+ ret.setResultDesc(Constants.NO_RESULT);
|
|
|
|
+ } else {
|
|
|
|
+ ret.setResultCode(Constant.OTHER_ERROR_CODE);
|
|
|
|
+ ret.setResultBody(Constant.OTHER_ERROR);
|
|
|
|
+ ret.setResultDesc(Constant.OTHER_ERROR);
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
- // 车辆线上线下一致性验证
|
|
|
|
- upstreamCode = setVehiclePositionConsistencyCheckResponse(ret, response, requestParam);
|
|
|
|
|
|
+ ret.setResultCode(Constant.OTHER_ERROR_CODE);
|
|
|
|
+ ret.setResultBody(Constant.OTHER_ERROR);
|
|
|
|
+ ret.setResultDesc(Constant.OTHER_ERROR);
|
|
|
|
+ upstreamCode = Integer.toString(responseA.getStatusCode());
|
|
|
|
+ }
|
|
|
|
+ //A段成功
|
|
|
|
+ if(ret.getResultCode()==Constant.MATCH_CODE){
|
|
|
|
+ // B段接口调用
|
|
|
|
+ Response responseB = new Response();
|
|
|
|
+ try {
|
|
|
|
+ RequestObject requestObject = new RequestObject();
|
|
|
|
+ requestObject.setVehicleNumber(requestParam.getPlateNumber());
|
|
|
|
+ requestObject.setLicensePlateTypeCode(requestParam.getPlateColor());
|
|
|
|
+ requestObject.setStartTime(startTimeB);
|
|
|
|
+ requestObject.setEndTime(endTimeB);
|
|
|
|
+ requestObject.setPartyFunctionCode(supplierConfig.getPartyFunctionCode());
|
|
|
|
+ responseB = PostUtil.postString(supplierConfig.getHistoryPositionUrl(), JSON.toJSONString(requestObject),
|
|
|
|
+ supplierConfig.getAppKey(), supplierConfig.getAppSecret(), outTime);
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
+ log.info("supplier-vehicle.vehicleHistoryAPositionQuery-IOException:{}", e);
|
|
|
|
+ ErrorUtils.captureException(e);
|
|
|
|
+ ret.setCode(Constant.REQUEST_TIMEOUT);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.info("supplier-vehicle.vehicleHistoryAPositionQuery-Exception:{}", e);
|
|
|
|
+ ErrorUtils.captureException(e);
|
|
|
|
+ ret.setCode(Constant.FAIL);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (responseB.getStatusCode() == Constants.STATUS_CODE_200) {
|
|
|
|
+ VehicleHistoryPositionResponse positionResponseB = JSON.toJavaObject(JSON.parseObject(responseB.getBody()),
|
|
|
|
+ VehicleHistoryPositionResponse.class);
|
|
|
|
+ upstreamCode = positionResponseB.getResultCode();
|
|
|
|
+ if (positionResponseB.getResultCode().equals(Constants.RESULT_CODE_0)) {
|
|
|
|
+ if (positionResponseB.getData() != null && positionResponseB.getData().size() > 0) {
|
|
|
|
+ String resultB = vehiclePositionConsistencyBCheck(positionResponseB.getData(), requestParam);
|
|
|
|
+ if (StringUtils.isBlank(resultB)) {
|
|
|
|
+ ret.setResultCode(Constant.MATCH_CODE);
|
|
|
|
+ ret.setResultBody(Constant.MATCH);
|
|
|
|
+ ret.setResultDesc(Constant.QUERY_SUCCESS);
|
|
|
|
+ } else {
|
|
|
|
+ ret.setResultCode(Constant.UN_MATCH_CODE);
|
|
|
|
+ ret.setResultBody(resultB);
|
|
|
|
+ ret.setResultDesc(Constant.QUERY_SUCCESS);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ ret.setResultCode(Constant.UN_FIND_NUM_CODE);
|
|
|
|
+ ret.setResultBody(Constants.NO_RESULT);
|
|
|
|
+ ret.setResultDesc(Constants.NO_RESULT);
|
|
|
|
+ }
|
|
|
|
+ ret.setIsCharge(Constant.IS_CHARGE);
|
|
|
|
+ } else if (positionResponseB.getResultCode().equals(Constants.RESULT_CODE_110000)) {
|
|
|
|
+ ret.setResultCode(Constant.UN_FIND_NUM_CODE);
|
|
|
|
+ ret.setResultBody(Constants.NO_RESULT);
|
|
|
|
+ ret.setResultDesc(Constants.NO_RESULT);
|
|
|
|
+ } else {
|
|
|
|
+ ret.setResultCode(Constant.OTHER_ERROR_CODE);
|
|
|
|
+ ret.setResultBody(Constant.OTHER_ERROR);
|
|
|
|
+ ret.setResultDesc(Constant.OTHER_ERROR);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ ret.setResultCode(Constant.OTHER_ERROR_CODE);
|
|
|
|
+ ret.setResultBody(Constant.OTHER_ERROR);
|
|
|
|
+ ret.setResultDesc(Constant.OTHER_ERROR);
|
|
|
|
+ upstreamCode = Integer.toString(responseA.getStatusCode());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ return upstreamCode;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ private String vehiclePositionConsistencyACheck(List<VehicleHistoryPositionResponse.Data> positionList,
|
|
|
|
+ VehicleHistoryPositionRequestParam requestParam) {
|
|
|
|
+ boolean checkResultA = false;
|
|
|
|
+ for (VehicleHistoryPositionResponse.Data position : positionList) {
|
|
|
|
+ if (!requestParam.getLoadingCountrySubdivisionCode().equals(position.getPositionDescribe())) {
|
|
|
|
+ checkResultA = true;
|
|
|
|
+ }
|
|
|
|
+ if (checkResultA) {
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (!checkResultA) {
|
|
|
|
+ return "loadingCountrySubdivisionCode与数据源不一致";
|
|
|
|
+ }
|
|
|
|
+ return "";
|
|
|
|
+ }
|
|
|
|
|
|
- request.setAttribute(Constant.LOG_UPSTREAM_RESPONSE_CODE, upstreamCode);
|
|
|
|
- return ret;
|
|
|
|
|
|
+ private String vehiclePositionConsistencyBCheck(List<VehicleHistoryPositionResponse.Data> positionList,
|
|
|
|
+ VehicleHistoryPositionRequestParam requestParam) {
|
|
|
|
+ boolean checkResultB = false;
|
|
|
|
+ for (VehicleHistoryPositionResponse.Data position : positionList) {
|
|
|
|
+ if (!requestParam.getReceiptCountrySubdivisionCode().equals(position.getPositionDescribe())) {
|
|
|
|
+ checkResultB = true;
|
|
|
|
+ }
|
|
|
|
+ if (checkResultB) {
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (!checkResultB) {
|
|
|
|
+ return "receiptCountrySubdivisionCode与数据源不一致";
|
|
|
|
+ }
|
|
|
|
+ return "";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /*----------------------------------------------------新增结束----------------------------------------------------*/
|
|
|
|
+
|
|
private String setVehicleHistoryPositionQueryResponse(ChannelTypeHandleResponseObject ret, Response response,
|
|
private String setVehicleHistoryPositionQueryResponse(ChannelTypeHandleResponseObject ret, Response response,
|
|
VehicleHistoryPositionRequestParam requestParam) {
|
|
VehicleHistoryPositionRequestParam requestParam) {
|
|
String upstreamCode = "";
|
|
String upstreamCode = "";
|
|
@@ -154,7 +398,7 @@ public class VehicleServiceImpl implements VehicleService {
|
|
}
|
|
}
|
|
|
|
|
|
private String vehicleHistoryPositionQuery(List<VehicleHistoryPositionResponse.Data> positionList,
|
|
private String vehicleHistoryPositionQuery(List<VehicleHistoryPositionResponse.Data> positionList,
|
|
- VehicleHistoryPositionRequestParam requestParam) {
|
|
|
|
|
|
+ VehicleHistoryPositionRequestParam requestParam) {
|
|
/**
|
|
/**
|
|
* 1、云雁调取A-到B+之间所有的车辆轨迹(每30秒有一个经纬度数据)。
|
|
* 1、云雁调取A-到B+之间所有的车辆轨迹(每30秒有一个经纬度数据)。
|
|
* 2、从A-到A+时间区间中每半个小时抽取一个点位信息的行政区划代码集合,将此集合与A点(起点)行政区划代码进行比对,只要有一点比对一致则视为此点核验通过。
|
|
* 2、从A-到A+时间区间中每半个小时抽取一个点位信息的行政区划代码集合,将此集合与A点(起点)行政区划代码进行比对,只要有一点比对一致则视为此点核验通过。
|
|
@@ -176,6 +420,9 @@ public class VehicleServiceImpl implements VehicleService {
|
|
// 4小时*2=8小时(A-A+间隔),8小时*2=16个点(每半个小时取1个点)
|
|
// 4小时*2=8小时(A-A+间隔),8小时*2=16个点(每半个小时取1个点)
|
|
int pointNumber = supplierConfig.getAddHours()*2*2;
|
|
int pointNumber = supplierConfig.getAddHours()*2*2;
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * A点,装货点,8小时16个点,进行处理各个点的时间点
|
|
|
|
+ */
|
|
List<String> checkTimeListA = new ArrayList<>();
|
|
List<String> checkTimeListA = new ArrayList<>();
|
|
String tempStartTime = startTimeA;
|
|
String tempStartTime = startTimeA;
|
|
for (int i = 0; i < pointNumber+1; i++) {
|
|
for (int i = 0; i < pointNumber+1; i++) {
|
|
@@ -239,7 +486,7 @@ public class VehicleServiceImpl implements VehicleService {
|
|
}
|
|
}
|
|
|
|
|
|
private String setVehiclePositionConsistencyCheckResponse(ChannelTypeHandleResponseObject ret, Response response,
|
|
private String setVehiclePositionConsistencyCheckResponse(ChannelTypeHandleResponseObject ret, Response response,
|
|
- VehicleHistoryPositionRequestParam requestParam) {
|
|
|
|
|
|
+ VehicleHistoryPositionRequestParam requestParam) {
|
|
String upstreamCode = "";
|
|
String upstreamCode = "";
|
|
log.info("supplier-vehicle.vehicleHistoryPositionCheck-responseStatus:{}", response.getStatusCode());
|
|
log.info("supplier-vehicle.vehicleHistoryPositionCheck-responseStatus:{}", response.getStatusCode());
|
|
log.info("supplier-vehicle.vehicleHistoryPositionCheck-responseBody:{}", response.getBody());
|
|
log.info("supplier-vehicle.vehicleHistoryPositionCheck-responseBody:{}", response.getBody());
|
|
@@ -249,7 +496,7 @@ public class VehicleServiceImpl implements VehicleService {
|
|
upstreamCode = positionResponse.getResultCode();
|
|
upstreamCode = positionResponse.getResultCode();
|
|
if (positionResponse.getResultCode().equals(Constants.RESULT_CODE_0)) {
|
|
if (positionResponse.getResultCode().equals(Constants.RESULT_CODE_0)) {
|
|
if (positionResponse.getData() != null && positionResponse.getData().size() > 0) {
|
|
if (positionResponse.getData() != null && positionResponse.getData().size() > 0) {
|
|
- String result = vehicleHistoryPositionQuery(positionResponse.getData(), requestParam);
|
|
|
|
|
|
+ String result = vehiclePositionConsistencyCheck(positionResponse.getData(), requestParam);
|
|
if (StringUtils.isBlank(result)) {
|
|
if (StringUtils.isBlank(result)) {
|
|
ret.setResultCode(Constant.MATCH_CODE);
|
|
ret.setResultCode(Constant.MATCH_CODE);
|
|
ret.setResultBody(Constant.MATCH);
|
|
ret.setResultBody(Constant.MATCH);
|
|
@@ -284,7 +531,7 @@ public class VehicleServiceImpl implements VehicleService {
|
|
}
|
|
}
|
|
|
|
|
|
private String vehiclePositionConsistencyCheck(List<VehicleHistoryPositionResponse.Data> positionList,
|
|
private String vehiclePositionConsistencyCheck(List<VehicleHistoryPositionResponse.Data> positionList,
|
|
- VehicleHistoryPositionRequestParam requestParam) {
|
|
|
|
|
|
+ VehicleHistoryPositionRequestParam requestParam) {
|
|
/**
|
|
/**
|
|
* 1、云雁调取A-到B+之间的车辆轨迹
|
|
* 1、云雁调取A-到B+之间的车辆轨迹
|
|
* 2、将B点与B-到B+时间点内的行政区划代码做对比,得出比对结果一
|
|
* 2、将B点与B-到B+时间点内的行政区划代码做对比,得出比对结果一
|
|
@@ -429,16 +676,16 @@ public class VehicleServiceImpl implements VehicleService {
|
|
} else {
|
|
} else {
|
|
// 不一致,返回具体不一致项
|
|
// 不一致,返回具体不一致项
|
|
String errorInfo = responseObject.getData().getVerifyResultSet().get(0).getErrorInfo();
|
|
String errorInfo = responseObject.getData().getVerifyResultSet().get(0).getErrorInfo();
|
|
- if (errorInfo.contains(Constants.UN_MATCH_VEHICLE_NUMBER)) {
|
|
|
|
|
|
+ if (errorInfo.equals(Constants.UN_MATCH_VEHICLE_NUMBER)) {
|
|
errorList.add("vehicleNumber");
|
|
errorList.add("vehicleNumber");
|
|
}
|
|
}
|
|
- if (errorInfo.contains(Constants.UN_MATCH_ROAD_TRANSPORT_CERTIFICATE_NUMBER)) {
|
|
|
|
|
|
+ if (errorInfo.equals(Constants.UN_MATCH_ROAD_TRANSPORT_CERTIFICATE_NUMBER)) {
|
|
errorList.add("roadTransportCertificateNumber");
|
|
errorList.add("roadTransportCertificateNumber");
|
|
}
|
|
}
|
|
- if (errorInfo.contains(Constants.UN_MATCH_CERTIFICATE_VALID_PERIOD_FROM)) {
|
|
|
|
|
|
+ if (errorInfo.equals(Constants.UN_MATCH_CERTIFICATE_VALID_PERIOD_FROM)) {
|
|
errorList.add("roadTransportCertificateValidPeriodFrom");
|
|
errorList.add("roadTransportCertificateValidPeriodFrom");
|
|
}
|
|
}
|
|
- if (errorInfo.contains(Constants.UN_MATCH_CERTIFICATE_VALID_PERIOD_TO)){
|
|
|
|
|
|
+ if (errorInfo.equals(Constants.UN_MATCH_CERTIFICATE_VALID_PERIOD_TO)){
|
|
errorList.add("roadTransportCertificateValidPeriodTo");
|
|
errorList.add("roadTransportCertificateValidPeriodTo");
|
|
}
|
|
}
|
|
ret.setResultCode(Constant.UN_MATCH_CODE);
|
|
ret.setResultCode(Constant.UN_MATCH_CODE);
|
|
@@ -484,7 +731,6 @@ public class VehicleServiceImpl implements VehicleService {
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
PersonQualificationCertificateRequestParam requestParam;
|
|
PersonQualificationCertificateRequestParam requestParam;
|
|
try {
|
|
try {
|
|
- PersonQualificationCertificateRequestParam jsonObject = JSON.toJavaObject(JSON.parseObject(customBody), PersonQualificationCertificateRequestParam.class);
|
|
|
|
requestParam = objectMapper.readValue(customBody, PersonQualificationCertificateRequestParam.class);
|
|
requestParam = objectMapper.readValue(customBody, PersonQualificationCertificateRequestParam.class);
|
|
} catch (IOException ioe) {
|
|
} catch (IOException ioe) {
|
|
log.info("supplier-vehicle.checkPersonQualificationCertificate-解析参数Exception:{}", ioe);
|
|
log.info("supplier-vehicle.checkPersonQualificationCertificate-解析参数Exception:{}", ioe);
|
|
@@ -552,22 +798,22 @@ public class VehicleServiceImpl implements VehicleService {
|
|
} else {
|
|
} else {
|
|
// 不一致,返回具体不一致项
|
|
// 不一致,返回具体不一致项
|
|
String errorInfo = responseObject.getData().getVerifyResultSet().get(0).getErrorInfo();
|
|
String errorInfo = responseObject.getData().getVerifyResultSet().get(0).getErrorInfo();
|
|
- if (errorInfo.contains(Constants.UN_MATCH_DRIVER_NAME)) {
|
|
|
|
|
|
+ if (errorInfo.equals(Constants.UN_MATCH_DRIVER_NAME)) {
|
|
errorList.add("driverName");
|
|
errorList.add("driverName");
|
|
}
|
|
}
|
|
- if (errorInfo.contains(Constants.UN_MATCH_DRIVING_LICENSE)) {
|
|
|
|
|
|
+ if (errorInfo.equals(Constants.UN_MATCH_DRIVING_LICENSE)) {
|
|
errorList.add("drivingLicense");
|
|
errorList.add("drivingLicense");
|
|
}
|
|
}
|
|
- if (errorInfo.contains(Constants.UN_MATCH_PROVINCE_CODE)) {
|
|
|
|
|
|
+ if (errorInfo.equals(Constants.UN_MATCH_PROVINCE_CODE)) {
|
|
errorList.add("provinceCode");
|
|
errorList.add("provinceCode");
|
|
}
|
|
}
|
|
- if (errorInfo.contains(Constants.UN_MATCH_QUALIFICATION_CERTIFICATE)){
|
|
|
|
|
|
+ if (errorInfo.equals(Constants.UN_MATCH_QUALIFICATION_CERTIFICATE)){
|
|
errorList.add("qualificationCertificate");
|
|
errorList.add("qualificationCertificate");
|
|
}
|
|
}
|
|
- if (errorInfo.contains(Constants.UN_MATCH_QUALIFICATION_CERTIFICATE_FROM)){
|
|
|
|
|
|
+ if (errorInfo.equals(Constants.UN_MATCH_QUALIFICATION_CERTIFICATE_FROM)){
|
|
errorList.add("qualificationCertificateValidPeriodFrom");
|
|
errorList.add("qualificationCertificateValidPeriodFrom");
|
|
}
|
|
}
|
|
- if (errorInfo.contains(Constants.UN_MATCH_QUALIFICATION_CERTIFICATE_TO)){
|
|
|
|
|
|
+ if (errorInfo.equals(Constants.UN_MATCH_QUALIFICATION_CERTIFICATE_TO)){
|
|
errorList.add("qualificationCertificateValidPeriodTo");
|
|
errorList.add("qualificationCertificateValidPeriodTo");
|
|
}
|
|
}
|
|
ret.setResultCode(Constant.UN_MATCH_CODE);
|
|
ret.setResultCode(Constant.UN_MATCH_CODE);
|
|
@@ -680,16 +926,16 @@ public class VehicleServiceImpl implements VehicleService {
|
|
} else {
|
|
} else {
|
|
// 不一致,返回具体不一致项
|
|
// 不一致,返回具体不一致项
|
|
String errorInfo = responseObject.getData().getVerifyResultSet().get(0).getErrorInfo();
|
|
String errorInfo = responseObject.getData().getVerifyResultSet().get(0).getErrorInfo();
|
|
- if (errorInfo.contains(Constants.UN_MATCH_CARRIER)) {
|
|
|
|
|
|
+ if (errorInfo.equals(Constants.UN_MATCH_CARRIER)) {
|
|
errorList.add("carrier");
|
|
errorList.add("carrier");
|
|
}
|
|
}
|
|
- if (errorInfo.contains(Constants.UN_MATCH_PERMIT_NUMBER)) {
|
|
|
|
|
|
+ if (errorInfo.equals(Constants.UN_MATCH_PERMIT_NUMBER)) {
|
|
errorList.add("permitNumber");
|
|
errorList.add("permitNumber");
|
|
}
|
|
}
|
|
- if (errorInfo.contains(Constants.UN_MATCH_PERMIT_VALID_PERIOD_FROM)) {
|
|
|
|
|
|
+ if (errorInfo.equals(Constants.UN_MATCH_PERMIT_VALID_PERIOD_FROM)) {
|
|
errorList.add("permitValidPeriodFrom");
|
|
errorList.add("permitValidPeriodFrom");
|
|
}
|
|
}
|
|
- if (errorInfo.contains(Constants.UN_MATCH_PERMIT_VALID_PERIOD_TO)){
|
|
|
|
|
|
+ if (errorInfo.equals(Constants.UN_MATCH_PERMIT_VALID_PERIOD_TO)){
|
|
errorList.add("permitValidPeriodTo");
|
|
errorList.add("permitValidPeriodTo");
|
|
}
|
|
}
|
|
ret.setResultCode(Constant.UN_MATCH_CODE);
|
|
ret.setResultCode(Constant.UN_MATCH_CODE);
|