|
@@ -1,7 +1,9 @@
|
|
package info.aspirecn.iov.yysj.check.info.common;
|
|
package info.aspirecn.iov.yysj.check.info.common;
|
|
|
|
|
|
import info.aspirecn.cloud.yysj.commons.lang.Constants;
|
|
import info.aspirecn.cloud.yysj.commons.lang.Constants;
|
|
|
|
+import info.aspirecn.iov.yysj.paramtransfer.inter.common.Constant;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.apache.commons.lang.ArrayUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
@@ -82,6 +84,9 @@ public class TransferParam {
|
|
if ("13".equals(productId)) {// 司机上下线
|
|
if ("13".equals(productId)) {// 司机上下线
|
|
|
|
|
|
customBody = sjsxx(paramMap, emptyList, errorList);
|
|
customBody = sjsxx(paramMap, emptyList, errorList);
|
|
|
|
+ }if ("15".equals(productId)) {//装卸货点车辆定位验证
|
|
|
|
+
|
|
|
|
+ customBody=zxhdwyz(paramMap, emptyList, errorList);
|
|
} else if (Constants.OtherRquestUrl.IDLENTITYVERIFICATION.getValue().equals(productId)) {// 身份核验
|
|
} else if (Constants.OtherRquestUrl.IDLENTITYVERIFICATION.getValue().equals(productId)) {// 身份核验
|
|
String req_id = paramMap.get(Constants.req_id);
|
|
String req_id = paramMap.get(Constants.req_id);
|
|
if (StringUtils.isEmpty(req_id)) {
|
|
if (StringUtils.isEmpty(req_id)) {
|
|
@@ -133,7 +138,7 @@ public class TransferParam {
|
|
}else if(vehicleNumberPattern.matcher(vehicleNumber).matches()){
|
|
}else if(vehicleNumberPattern.matcher(vehicleNumber).matches()){
|
|
errorList.add(Constants.carck_vehicleNumber);
|
|
errorList.add(Constants.carck_vehicleNumber);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
String colorCode=paramMap.get(Constants.carck_colorCode);
|
|
String colorCode=paramMap.get(Constants.carck_colorCode);
|
|
if(StringUtils.isEmpty(colorCode)) {
|
|
if(StringUtils.isEmpty(colorCode)) {
|
|
emptyList.add(Constants.carck_colorCode);
|
|
emptyList.add(Constants.carck_colorCode);
|
|
@@ -141,7 +146,7 @@ public class TransferParam {
|
|
errorList.add(Constants.carck_colorCode);
|
|
errorList.add(Constants.carck_colorCode);
|
|
}
|
|
}
|
|
String certificateNumber=paramMap.get(Constants.carck_certificateNumber);
|
|
String certificateNumber=paramMap.get(Constants.carck_certificateNumber);
|
|
-
|
|
|
|
|
|
+
|
|
String vin=paramMap.get(Constants.carck_vin);
|
|
String vin=paramMap.get(Constants.carck_vin);
|
|
if(StringUtils.isEmpty(certificateNumber)&&StringUtils.isEmpty(vin)) {
|
|
if(StringUtils.isEmpty(certificateNumber)&&StringUtils.isEmpty(vin)) {
|
|
emptyList.add(Constants.carck_certificateNumber);
|
|
emptyList.add(Constants.carck_certificateNumber);
|
|
@@ -220,11 +225,11 @@ public class TransferParam {
|
|
|
|
|
|
|
|
|
|
String provinceCode=paramMap.get(Constants.perck_provinceCode);
|
|
String provinceCode=paramMap.get(Constants.perck_provinceCode);
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
if(StringUtils.isEmpty(provinceCode)) {
|
|
if(StringUtils.isEmpty(provinceCode)) {
|
|
emptyList.add(Constants.perck_provinceCode);
|
|
emptyList.add(Constants.perck_provinceCode);
|
|
-
|
|
|
|
|
|
+
|
|
}else if(provinceCode.replace(" ","").length()<1||provinceCode.length()>6||!checkProvince(provinceCode)){
|
|
}else if(provinceCode.replace(" ","").length()<1||provinceCode.length()>6||!checkProvince(provinceCode)){
|
|
errorList.add(Constants.perck_provinceCode);
|
|
errorList.add(Constants.perck_provinceCode);
|
|
}
|
|
}
|
|
@@ -245,21 +250,21 @@ public class TransferParam {
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
String permitNumber=paramMap.get(Constants.comck_permitNumber);
|
|
String permitNumber=paramMap.get(Constants.comck_permitNumber);
|
|
-
|
|
|
|
|
|
+
|
|
if(StringUtils.isEmpty(permitNumber)) {
|
|
if(StringUtils.isEmpty(permitNumber)) {
|
|
emptyList.add(Constants.comck_permitNumber);
|
|
emptyList.add(Constants.comck_permitNumber);
|
|
-
|
|
|
|
|
|
+
|
|
}else if(permitNumber.replace(" ","").length()<1||permitNumber.length()>50||allSpecialPattern.matcher(permitNumber).matches()){
|
|
}else if(permitNumber.replace(" ","").length()<1||permitNumber.length()>50||allSpecialPattern.matcher(permitNumber).matches()){
|
|
errorList.add(Constants.comck_permitNumber);
|
|
errorList.add(Constants.comck_permitNumber);
|
|
}
|
|
}
|
|
String provinceCode=paramMap.get(Constants.comck_provinceCode);
|
|
String provinceCode=paramMap.get(Constants.comck_provinceCode);
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
if(StringUtils.isEmpty(provinceCode)) {
|
|
if(StringUtils.isEmpty(provinceCode)) {
|
|
emptyList.add(Constants.comck_provinceCode);
|
|
emptyList.add(Constants.comck_provinceCode);
|
|
-
|
|
|
|
|
|
+
|
|
}else if(provinceCode.replace(" ","").length()<1||provinceCode.length()>6||!checkProvince(provinceCode)){
|
|
}else if(provinceCode.replace(" ","").length()<1||provinceCode.length()>6||!checkProvince(provinceCode)){
|
|
errorList.add(Constants.comck_provinceCode);
|
|
errorList.add(Constants.comck_provinceCode);
|
|
}
|
|
}
|
|
@@ -810,6 +815,119 @@ public class TransferParam {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //校验项十五 装卸货点车辆定位验证
|
|
|
|
+ public Map<String,Object> zxhdwyz(Map<String,String> requestMap, Set<String> emptyList,Set<String> errorList) throws IOException, ResultCodeException {
|
|
|
|
+ // 车牌号
|
|
|
|
+ String vehicleNumber = requestMap.get(Constants.bill_vehicleNumber);
|
|
|
|
+ // 车牌颜色
|
|
|
|
+ String vehiclePlateColorCode = requestMap.get(Constants.bill_vehiclePlateColorCode);
|
|
|
|
+ // 收货地址的国家行政区划代码
|
|
|
|
+ String receiptCountrySubdivisionCode = requestMap.get(Constants.bill_receipt_country_subdivision_code);
|
|
|
|
+ // 收货日期时间
|
|
|
|
+ String goodsReceiptDateTime = requestMap.get(Constants.bill_goodsReceiptDateTime);
|
|
|
|
+ // 装货地址的国家行政区划代码
|
|
|
|
+ String loadingCountrySubdivisionCode = requestMap.get(Constants.bill_loading_country_subdivision_code);
|
|
|
|
+ // 发货日期时间
|
|
|
|
+ String despatchActualDateTime = requestMap.get(Constants.bill_despatchActualDateTime);
|
|
|
|
+ // 运单号
|
|
|
|
+ String shippingNoteNumber = requestMap.get(Constants.bill_shipping_note_number);
|
|
|
|
+ // 装货地址
|
|
|
|
+ String placeOfLoading = requestMap.get(Constants.bill_place_of_loading);
|
|
|
|
+ // 收货地址
|
|
|
|
+ String goodsReceiptPlace = requestMap.get(Constants.bill_goods_receipt_place);
|
|
|
|
+ // 核验时间半径
|
|
|
|
+ String verificationTimeRadius = requestMap.get(Constants.bill_verification_time_radius);
|
|
|
|
+
|
|
|
|
+ if (vehicleNumber == null || StringUtils.isEmpty(vehicleNumber)) {
|
|
|
|
+ emptyList.add(Constants.bill_vehicleNumber);
|
|
|
|
+ }
|
|
|
|
+ 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);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ 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);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (goodsReceiptDateTime == null || StringUtils.isEmpty(goodsReceiptDateTime)) {
|
|
|
|
+ emptyList.add(Constants.bill_goodsReceiptDateTime);
|
|
|
|
+ }
|
|
|
|
+ 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);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (despatchActualDateTime == null || StringUtils.isEmpty(despatchActualDateTime)) {
|
|
|
|
+ emptyList.add(Constants.bill_despatchActualDateTime);
|
|
|
|
+ }
|
|
|
|
+ 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);
|
|
|
|
+ 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);
|
|
|
|
+ return resultMap;
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static boolean checkPlateColor(String plateColor) {
|
|
|
|
+ String[] vehiclePlateColorCodeArr = {"1", "2", "3", "4", "5", "9", "91", "92", "93", "94"};
|
|
|
|
+ return ArrayUtils.contains(vehiclePlateColorCodeArr, plateColor);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static boolean checkNumber(String number) {
|
|
|
|
+ String NUMBER_REGEX = "^(0|[1-9]\\d*)$";
|
|
|
|
+ Pattern numberPattern = Pattern.compile(NUMBER_REGEX);
|
|
|
|
+ return numberPattern.matcher(number).matches();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static boolean checkPlateNumber(String plateNumber) {
|
|
|
|
+ String CAR_NUMER_REGEX = "^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}" +
|
|
|
|
+ "[警京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼]{0,1}[A-Z0-9]{4,6}[A-Z0-9挂学警港澳]{1}$";
|
|
|
|
+ Pattern pattern = Pattern.compile(CAR_NUMER_REGEX);
|
|
|
|
+ return pattern.matcher(plateNumber).matches();
|
|
|
|
+ }
|
|
|
|
+
|
|
public static boolean checkDateTime(String str, String pattern) {
|
|
public static boolean checkDateTime(String str, String pattern) {
|
|
DateTimeFormatter dtf = DateTimeFormatter.ofPattern(pattern);
|
|
DateTimeFormatter dtf = DateTimeFormatter.ofPattern(pattern);
|
|
boolean flag = true;
|
|
boolean flag = true;
|
|
@@ -892,10 +1010,10 @@ public class TransferParam {
|
|
/*
|
|
/*
|
|
* if (Constants.clyyyz_periodStartDate.equals(param)) {
|
|
* if (Constants.clyyyz_periodStartDate.equals(param)) {
|
|
* result.add(Constants.bill_permitValidPeriodFrom);
|
|
* result.add(Constants.bill_permitValidPeriodFrom);
|
|
- *
|
|
|
|
|
|
+ *
|
|
* } if (Constants.clyyyz_periodEndDate.equals(param)) {
|
|
* } if (Constants.clyyyz_periodEndDate.equals(param)) {
|
|
* result.add(Constants.bill_permitValidPeriodTo);
|
|
* result.add(Constants.bill_permitValidPeriodTo);
|
|
- *
|
|
|
|
|
|
+ *
|
|
* }
|
|
* }
|
|
*/
|
|
*/
|
|
if (Constants.qyyyxkz_name.equals(param)) {
|
|
if (Constants.qyyyxkz_name.equals(param)) {
|