|
@@ -84,14 +84,15 @@ public class BillIsolatedServiceImpl extends ServiceImpl<BillIsolatedMapper, Bil
|
|
|
|
|
|
BillLandingInspection billLandingInspection = landingInspectionMapper.selectOne(new QueryWrapper<BillLandingInspection>().eq("inspection_num", inspectionNum).ne("inspection_sch", 5));
|
|
|
String eartags = billLandingInspection.getEartags();
|
|
|
- if (eartags.length() != 15){
|
|
|
- return new Result(10001,"耳标号格式错误",false);
|
|
|
- }
|
|
|
+
|
|
|
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,"耳标号格式错误",false);
|
|
|
+ }
|
|
|
String end = input.substring(input.indexOf("-") + 1);
|
|
|
if (end.length() != 3){
|
|
|
return new Result(10001,"耳标号格式错误",false);
|
|
@@ -118,6 +119,9 @@ public class BillIsolatedServiceImpl extends ServiceImpl<BillIsolatedMapper, Bil
|
|
|
baseAnimalMapper.insert(baseAnimal);
|
|
|
}
|
|
|
}else {
|
|
|
+ if (input.length() != 15){
|
|
|
+ return new Result(10001,"耳标号格式错误",false);
|
|
|
+ }
|
|
|
Integer num = baseAnimalMapper.selectCount(new QueryWrapper<BaseAnimal>().eq("earatg_no", input));
|
|
|
if (num != 0){
|
|
|
return new Result(10001,"耳标号重复",false);
|
|
@@ -135,6 +139,9 @@ public class BillIsolatedServiceImpl extends ServiceImpl<BillIsolatedMapper, Bil
|
|
|
}else {
|
|
|
if (eartags.contains("-")){
|
|
|
String start = eartags.substring(0, eartags.indexOf("-"));
|
|
|
+ if (start.length() != 15){
|
|
|
+ return new Result(10001,"耳标号格式错误",false);
|
|
|
+ }
|
|
|
String end = eartags.substring(eartags.indexOf("-") + 1);
|
|
|
if (end.length() != 3){
|
|
|
return new Result(10001,"耳标号格式错误",false);
|
|
@@ -161,6 +168,9 @@ public class BillIsolatedServiceImpl extends ServiceImpl<BillIsolatedMapper, Bil
|
|
|
baseAnimalMapper.insert(baseAnimal);
|
|
|
}
|
|
|
}else {
|
|
|
+ if (eartags.length() != 15){
|
|
|
+ return new Result(10001,"耳标号格式错误",false);
|
|
|
+ }
|
|
|
Integer num = baseAnimalMapper.selectCount(new QueryWrapper<BaseAnimal>().eq("earatg_no", eartags));
|
|
|
if (num != 0){
|
|
|
return new Result(10001,"耳标号重复",false);
|