|
@@ -23,6 +23,7 @@ import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.io.IOException;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.HashSet;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -175,11 +176,13 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
|
eartags = eartags.replace(",",",");
|
|
|
eartags = eartags.replace(", ",",");
|
|
|
eartags = eartags.replace(", ",",");
|
|
|
+ List eartagList = new ArrayList();
|
|
|
if (eartags.contains(",")){
|
|
|
String[] eartag = eartags.split(",");
|
|
|
for (String input : eartag) {
|
|
|
if (input.contains("-")){
|
|
|
String start = input.substring(0, input.indexOf("-"));
|
|
|
+ String base = eartags.substring(0, eartags.indexOf("-")-3);
|
|
|
System.out.println("落地检耳标号:"+start);
|
|
|
if (start.length() != 15){
|
|
|
return new Result(10001,"耳标号"+input+"格式错误需输入15位数字",false);
|
|
@@ -193,18 +196,26 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
|
return new Result(10001,"耳标号"+input+"格式错误,包含-号耳标号需递增",false);
|
|
|
}
|
|
|
for (int i = Integer.valueOf(substring1) ; i <= Integer.valueOf(end); i++){
|
|
|
+ String s = String.valueOf(i);
|
|
|
+ while (s.length() < 3) {
|
|
|
+ s = "0".concat(s);
|
|
|
+ }
|
|
|
+ s = base.concat(s);
|
|
|
+ eartagList.add(s);
|
|
|
sum++;
|
|
|
}
|
|
|
}else {
|
|
|
if (input.length() != 15){
|
|
|
return new Result(10001,"耳标号"+input+"格式错误需输入15位数字",false);
|
|
|
}
|
|
|
+ eartagList.add(input);
|
|
|
sum++;
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
if (eartags.contains("-")){
|
|
|
String start = eartags.substring(0, eartags.indexOf("-"));
|
|
|
+ String base = eartags.substring(0, eartags.indexOf("-")-3);
|
|
|
System.out.println("落地检耳标号:"+start);
|
|
|
if (start.length() != 15){
|
|
|
return new Result(10001,"耳标号"+eartags+"格式错误需输入15位数字",false);
|
|
@@ -218,6 +229,12 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
|
return new Result(10001,"耳标号"+eartags+"格式错误,包含-号耳标号需递增",false);
|
|
|
}
|
|
|
for (int i = Integer.valueOf(substring1) ; i <= Integer.valueOf(end); i++){
|
|
|
+ String s = String.valueOf(i);
|
|
|
+ while (s.length() < 3) {
|
|
|
+ s = "0".concat(s);
|
|
|
+ }
|
|
|
+ s = base.concat(s);
|
|
|
+ eartagList.add(s);
|
|
|
sum++;
|
|
|
}
|
|
|
}else {
|
|
@@ -225,9 +242,14 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
|
if (eartags.length() != 15){
|
|
|
return new Result(10001,"耳标号"+eartags+"格式错误需输入15位数字",false);
|
|
|
}
|
|
|
+ eartagList.add(eartags);
|
|
|
sum++;
|
|
|
}
|
|
|
}
|
|
|
+ HashSet set = new HashSet(eartagList);
|
|
|
+ if (set.size() != eartagList.size()){
|
|
|
+ return new Result(10001,"存在重复耳标号!",false);
|
|
|
+ }
|
|
|
if (sum != total){
|
|
|
return new Result(10001,"实际耳标数量和填写数量不符!",false);
|
|
|
}
|
|
@@ -262,7 +284,17 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ @Override
|
|
|
+ public Result listReadyApplication() {
|
|
|
+ List<BillLandingInspection> inspectionNumList = billLandingInspectionMapper.listReadyApplication();
|
|
|
+ if (ObjectUtil.isNotEmpty(inspectionNumList)){
|
|
|
+ return new Result(ResultCode.SUCCESS,inspectionNumList);
|
|
|
+ }else {
|
|
|
+ return new Result(10001,"无符合要求的检疫证号!",false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
public String getUrl(String content, MultipartFile image) throws IOException {
|
|
|
if (ObjectUtil.isNotEmpty(image)){
|
|
|
if ( !"".equals(content)){
|