|
@@ -1,5 +1,7 @@
|
|
|
package info.aspirecn.iov.yysj.check.info.common;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import info.aspirecn.cloud.yysj.commons.lang.Constants;
|
|
|
import info.aspirecn.iov.yysj.paramtransfer.inter.common.Constant;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -84,9 +86,12 @@ public class TransferParam {
|
|
|
if ("13".equals(productId)) {// 司机上下线
|
|
|
|
|
|
customBody = sjsxx(paramMap, emptyList, errorList);
|
|
|
- }if ("15".equals(productId)) {//装卸货点车辆定位验证
|
|
|
-
|
|
|
+ }
|
|
|
+ if ("15".equals(productId) || "14".equals(productId)) {// 15 装卸货点车辆定位验证; 14车辆历史轨迹核验(车辆线上线下一致性验证)
|
|
|
customBody=zxhdwyz(paramMap, emptyList, errorList);
|
|
|
+ }
|
|
|
+ if ("16".equals(productId)) {
|
|
|
+ customBody = waybillHistoryPosition(paramMap, emptyList, errorList);
|
|
|
} else if (Constants.OtherRquestUrl.IDLENTITYVERIFICATION.getValue().equals(productId)) {// 身份核验
|
|
|
String req_id = paramMap.get(Constants.req_id);
|
|
|
if (StringUtils.isEmpty(req_id)) {
|
|
@@ -840,62 +845,64 @@ public class TransferParam {
|
|
|
|
|
|
if (vehicleNumber == null || StringUtils.isEmpty(vehicleNumber)) {
|
|
|
emptyList.add(Constants.bill_vehicleNumber);
|
|
|
- }
|
|
|
- if (!checkPlateNumber(vehicleNumber)) {
|
|
|
- errorList.add(Constants.bill_vehicleNumber);
|
|
|
+ } else {
|
|
|
+ if (!checkPlateNumber(vehicleNumber)) {
|
|
|
+ errorList.add(Constants.bill_vehicleNumber);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (vehiclePlateColorCode == null || StringUtils.isEmpty(vehiclePlateColorCode)) {
|
|
|
emptyList.add(Constants.bill_vehiclePlateColorCode);
|
|
|
- }
|
|
|
- if (!checkPlateColor(vehiclePlateColorCode)) {
|
|
|
- errorList.add(Constants.bill_vehiclePlateColorCode);
|
|
|
+ } else {
|
|
|
+ if (!checkPlateColor(vehiclePlateColorCode)) {
|
|
|
+ errorList.add(Constants.bill_vehiclePlateColorCode);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (receiptCountrySubdivisionCode == null || StringUtils.isEmpty(receiptCountrySubdivisionCode)) {
|
|
|
emptyList.add(Constants.bill_receipt_country_subdivision_code);
|
|
|
- }
|
|
|
- if (!checkNumber(receiptCountrySubdivisionCode)) {
|
|
|
- errorList.add(Constants.bill_receipt_country_subdivision_code);
|
|
|
+ } else {
|
|
|
+ if (!checkNumber(receiptCountrySubdivisionCode)) {
|
|
|
+ errorList.add(Constants.bill_receipt_country_subdivision_code);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (goodsReceiptDateTime == null || StringUtils.isEmpty(goodsReceiptDateTime)) {
|
|
|
emptyList.add(Constants.bill_goodsReceiptDateTime);
|
|
|
- }
|
|
|
- if(!checkDateTime(goodsReceiptDateTime,"yyyyMMddHHmmss")){
|
|
|
- errorList.add(Constants.bill_goodsReceiptDateTime);
|
|
|
+ } else {
|
|
|
+ if(!checkDateTime(goodsReceiptDateTime,"yyyyMMddHHmmss")){
|
|
|
+ errorList.add(Constants.bill_goodsReceiptDateTime);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (loadingCountrySubdivisionCode == null || StringUtils.isEmpty(loadingCountrySubdivisionCode)) {
|
|
|
emptyList.add(Constants.bill_loading_country_subdivision_code);
|
|
|
- }
|
|
|
- if (!checkNumber(loadingCountrySubdivisionCode)) {
|
|
|
- errorList.add(Constants.bill_loading_country_subdivision_code);
|
|
|
+ } else {
|
|
|
+ if (!checkNumber(loadingCountrySubdivisionCode)) {
|
|
|
+ errorList.add(Constants.bill_loading_country_subdivision_code);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (despatchActualDateTime == null || StringUtils.isEmpty(despatchActualDateTime)) {
|
|
|
emptyList.add(Constants.bill_despatchActualDateTime);
|
|
|
- }
|
|
|
- if(!checkDateTime(despatchActualDateTime,"yyyyMMddHHmmss")){
|
|
|
- errorList.add(Constants.bill_despatchActualDateTime);
|
|
|
+ } else {
|
|
|
+ if(!checkDateTime(despatchActualDateTime,"yyyyMMddHHmmss")){
|
|
|
+ errorList.add(Constants.bill_despatchActualDateTime);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (shippingNoteNumber == null || StringUtils.isEmpty(shippingNoteNumber)) {
|
|
|
emptyList.add(Constants.bill_shipping_note_number);
|
|
|
}
|
|
|
-
|
|
|
if (placeOfLoading == null || StringUtils.isEmpty(placeOfLoading)) {
|
|
|
emptyList.add(Constants.bill_place_of_loading);
|
|
|
}
|
|
|
-
|
|
|
if (goodsReceiptPlace == null || StringUtils.isEmpty(goodsReceiptPlace)) {
|
|
|
emptyList.add(Constants.bill_goods_receipt_place);
|
|
|
}
|
|
|
-
|
|
|
if (verificationTimeRadius == null || StringUtils.isEmpty(verificationTimeRadius)) {
|
|
|
emptyList.add(Constants.bill_verification_time_radius);
|
|
|
}
|
|
|
-
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
if(emptyList.size() == 0 && errorList.size() == 0) {
|
|
|
resultMap.put(Constants.zxh_vehicleNumber,vehicleNumber);
|
|
@@ -907,7 +914,97 @@ public class TransferParam {
|
|
|
return resultMap;
|
|
|
}
|
|
|
return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 校验项 车辆历史轨迹核验(运单详版)
|
|
|
+ public Map<String, Object> waybillHistoryPosition(Map<String, String> requestMap, Set<String> emptyList, Set<String> errorList){
|
|
|
+ log.info("requestMap:{}", requestMap);
|
|
|
+ // 车牌号校验
|
|
|
+ Object vehicleInfo = requestMap.get(Constants.bill_vehicleInfo);
|
|
|
+ log.info("vehicleInfo:{}", vehicleInfo);
|
|
|
+ JSONObject vehicleInfoObject = new JSONObject();
|
|
|
+ Map<String, Object> resultMap = new HashMap<String, Object>();
|
|
|
+ if (vehicleInfo == null) {
|
|
|
+ emptyList.add(Constants.bill_vehicleInfo);
|
|
|
+ } else {
|
|
|
+ vehicleInfoObject = JSON.parseObject(JSON.toJSONString(vehicleInfo));
|
|
|
+ }
|
|
|
+ log.info("vehicleInfoObject:{}", vehicleInfoObject);
|
|
|
+ // 车牌号
|
|
|
+ String vehicleNumber = vehicleInfoObject.getString(Constants.bill_vehicleNumber);
|
|
|
+ // 车牌颜色
|
|
|
+ String vehiclePlateColorCode = vehicleInfoObject.getString(Constants.bill_vehiclePlateColorCode);
|
|
|
+ // 收货地址的国家行政区划代码
|
|
|
+ String receiptCountrySubdivisionCode = vehicleInfoObject.getString(Constants.bill_receipt_country_subdivision_code);
|
|
|
+ // 收货日期时间
|
|
|
+ String goodsReceiptDateTime = requestMap.get(Constants.bill_goodsReceiptDateTime);
|
|
|
+ // 装货地址的国家行政区划代码
|
|
|
+ String loadingCountrySubdivisionCode = vehicleInfoObject.getString(Constants.bill_loading_country_subdivision_code);
|
|
|
+ // 发货日期时间
|
|
|
+ String despatchActualDateTime = requestMap.get(Constants.bill_despatchActualDateTime);
|
|
|
|
|
|
+ log.info("获取参数");
|
|
|
+ if (vehicleNumber == null || StringUtils.isEmpty(vehicleNumber)) {
|
|
|
+ emptyList.add(Constants.bill_vehicleInfo + "." + Constants.bill_vehicleNumber);
|
|
|
+ } else {
|
|
|
+ if (!checkPlateNumber(vehicleNumber)) {
|
|
|
+ errorList.add(Constants.bill_vehicleInfo + "." + Constants.bill_vehicleNumber);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (vehiclePlateColorCode == null || StringUtils.isEmpty(vehiclePlateColorCode)) {
|
|
|
+ emptyList.add(Constants.bill_vehicleInfo + "." + Constants.bill_vehiclePlateColorCode);
|
|
|
+ } else {
|
|
|
+ if (!checkPlateColor(vehiclePlateColorCode)) {
|
|
|
+ errorList.add(Constants.bill_vehicleInfo + "." + Constants.bill_vehiclePlateColorCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (receiptCountrySubdivisionCode == null || StringUtils.isEmpty(receiptCountrySubdivisionCode)) {
|
|
|
+ emptyList.add(Constants.bill_vehicleInfo + "." + Constants.bill_receipt_country_subdivision_code);
|
|
|
+ } else {
|
|
|
+ if (!checkNumber(receiptCountrySubdivisionCode)) {
|
|
|
+ errorList.add(Constants.bill_vehicleInfo + "." + Constants.bill_receipt_country_subdivision_code);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (goodsReceiptDateTime == null || StringUtils.isEmpty(goodsReceiptDateTime)) {
|
|
|
+ emptyList.add(Constants.bill_goodsReceiptDateTime);
|
|
|
+ } else {
|
|
|
+ if(!checkDateTime(goodsReceiptDateTime,"yyyyMMddHHmmss")){
|
|
|
+ errorList.add(Constants.bill_goodsReceiptDateTime);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (loadingCountrySubdivisionCode == null || StringUtils.isEmpty(loadingCountrySubdivisionCode)) {
|
|
|
+ emptyList.add(Constants.bill_vehicleInfo + "." + Constants.bill_loading_country_subdivision_code);
|
|
|
+ } else {
|
|
|
+ if (!checkNumber(loadingCountrySubdivisionCode)) {
|
|
|
+ errorList.add(Constants.bill_vehicleInfo + "." + Constants.bill_loading_country_subdivision_code);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (despatchActualDateTime == null || StringUtils.isEmpty(despatchActualDateTime)) {
|
|
|
+ emptyList.add(Constants.bill_despatchActualDateTime);
|
|
|
+ } else {
|
|
|
+ if(!checkDateTime(despatchActualDateTime,"yyyyMMddHHmmss")){
|
|
|
+ errorList.add(Constants.bill_despatchActualDateTime);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ log.info("参数校验");
|
|
|
+
|
|
|
+ if (emptyList.size() == 0 && errorList.size() == 0) {
|
|
|
+ resultMap.put(Constants.zxh_vehicleNumber,vehicleNumber);
|
|
|
+ resultMap.put(Constants.zxh_vehiclePlateColorCode,vehiclePlateColorCode);
|
|
|
+ resultMap.put(Constants.zxh_receiptCountrySubdivisionCode, receiptCountrySubdivisionCode);
|
|
|
+ resultMap.put(Constants.zxh_goodsReceiptDateTime, goodsReceiptDateTime);
|
|
|
+ resultMap.put(Constants.zxh_loadingCountrySubdivisionCode, loadingCountrySubdivisionCode);
|
|
|
+ resultMap.put(Constants.zxh_despatchActualDateTime, despatchActualDateTime);
|
|
|
+ log.info("参数拼接");
|
|
|
+ return resultMap;
|
|
|
+ }
|
|
|
+ log.info("参数校验失败");
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
public static boolean checkPlateColor(String plateColor) {
|