|
@@ -21,6 +21,8 @@ import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
@@ -155,6 +157,53 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
if (this.count(landingInspectionQueryWrapper) != 0) {
|
|
if (this.count(landingInspectionQueryWrapper) != 0) {
|
|
return new Result(10001, "存在相同检疫证号!", false);
|
|
return new Result(10001, "存在相同检疫证号!", false);
|
|
}
|
|
}
|
|
|
|
+ String eartags = billLandingInspection.getEartags();
|
|
|
|
+ if (eartags.contains(",")){
|
|
|
|
+ String[] eartag = eartags.split(",");
|
|
|
|
+ for (String input : eartag) {
|
|
|
|
+ if (input.contains("-")){
|
|
|
|
+ String start = input.substring(0, input.indexOf("-"));
|
|
|
|
+ if (start.length() != 15){
|
|
|
|
+ return new Result(10001,"耳标号格式错误需输入15位数字",false);
|
|
|
|
+ }
|
|
|
|
+ String end = input.substring(input.indexOf("-") + 1);
|
|
|
|
+ if (end.length() != 3){
|
|
|
|
+ return new Result(10001,"耳标号格式错误,-后需输入3位数字",false);
|
|
|
|
+ }
|
|
|
|
+ String substring1 = input.substring(start.length() - end.length(), start.length());
|
|
|
|
+ String substring = start.substring(0, start.length() - end.length());
|
|
|
|
+ System.out.println(substring);
|
|
|
|
+ List<String> eartagNos = new ArrayList<>();
|
|
|
|
+ if (Integer.parseInt(substring1) >Integer.parseInt(end) ){
|
|
|
|
+ return new Result(10001,"耳标号格式错误,包含-号耳标号需递增",false);
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ if (input.length() != 15){
|
|
|
|
+ return new Result(10001,"耳标号格式错误需输入15位数字",false);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ if (eartags.contains("-")){
|
|
|
|
+ String start = eartags.substring(0, eartags.indexOf("-"));
|
|
|
|
+ if (start.length() != 15){
|
|
|
|
+ return new Result(10001,"耳标号格式错误需输入15位数字",false);
|
|
|
|
+ }
|
|
|
|
+ String end = eartags.substring(eartags.indexOf("-") + 1);
|
|
|
|
+ if (end.length() != 3){
|
|
|
|
+ return new Result(10001,"耳标号格式错误,-后需输入3位数字",false);
|
|
|
|
+ }
|
|
|
|
+ String substring1 = eartags.substring(start.length() - end.length(), start.length());
|
|
|
|
+ String substring = start.substring(0, start.length() - end.length());
|
|
|
|
+ if (Integer.parseInt(substring1) >Integer.parseInt(end)){
|
|
|
|
+ return new Result(10001,"耳标号格式错误,包含-号耳标号需递增",false);
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ if (eartags.length() != 15){
|
|
|
|
+ return new Result(10001,"耳标号格式错误需输入15位数字",false);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
billLandingInspection.setCargoOwner(TokenSign.getUserName(httpServletRequest));
|
|
billLandingInspection.setCargoOwner(TokenSign.getUserName(httpServletRequest));
|
|
billLandingInspection.setOwnerPhone(TokenSign.getPhone(httpServletRequest));
|
|
billLandingInspection.setOwnerPhone(TokenSign.getPhone(httpServletRequest));
|
|
billLandingInspection.setInspectionName(billLandingInspection.getCargoOwner() + "的落地检疫申请");
|
|
billLandingInspection.setInspectionName(billLandingInspection.getCargoOwner() + "的落地检疫申请");
|