|
@@ -84,27 +84,27 @@ 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();
|
|
|
- eartags.replace(",",",");
|
|
|
- eartags.replace(", ",",");
|
|
|
- eartags.replace(", ",",");
|
|
|
+ eartags = eartags.replace(",",",");
|
|
|
+ eartags = eartags.replace(", ",",");
|
|
|
+ eartags = eartags.replace(", ",",");
|
|
|
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);
|
|
|
+ return new Result(10001,"耳标号"+input+"格式错误需输入15位数字",false);
|
|
|
}
|
|
|
String end = input.substring(input.indexOf("-") + 1);
|
|
|
if (end.length() != 3){
|
|
|
- return new Result(10001,"耳标号格式错误",false);
|
|
|
+ return new Result(10001,"耳标号"+input+"格式错误,-后需输入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);
|
|
|
+ return new Result(10001,"耳标号"+input+"格式错误,包含-号耳标号需递增",false);
|
|
|
}
|
|
|
for (int i = Integer.parseInt(substring1); i <= Integer.valueOf(end); i++){
|
|
|
eartagNos.add(substring+i);
|
|
@@ -112,7 +112,7 @@ public class BillIsolatedServiceImpl extends ServiceImpl<BillIsolatedMapper, Bil
|
|
|
for (String eartagNo : eartagNos) {
|
|
|
Integer num = baseAnimalMapper.selectCount(new QueryWrapper<BaseAnimal>().eq("earatg_no", eartagNo));
|
|
|
if (num != 0){
|
|
|
- return new Result(10001,"耳标号重复",false);
|
|
|
+ return new Result(10001,"耳标号"+eartagNo+"重复",false);
|
|
|
}
|
|
|
BaseAnimal baseAnimal = new BaseAnimal();
|
|
|
baseAnimal.setEaratgNo(eartagNo);
|
|
@@ -125,11 +125,11 @@ public class BillIsolatedServiceImpl extends ServiceImpl<BillIsolatedMapper, Bil
|
|
|
}
|
|
|
}else {
|
|
|
if (input.length() != 15){
|
|
|
- return new Result(10001,"耳标号格式错误",false);
|
|
|
+ return new Result(10001,"耳标号"+input+"格式错误需输入15位数字",false);
|
|
|
}
|
|
|
Integer num = baseAnimalMapper.selectCount(new QueryWrapper<BaseAnimal>().eq("earatg_no", input));
|
|
|
if (num != 0){
|
|
|
- return new Result(10001,"耳标号重复",false);
|
|
|
+ return new Result(10001,"耳标号"+input+"重复",false);
|
|
|
}
|
|
|
BaseAnimal baseAnimal = new BaseAnimal();
|
|
|
baseAnimal.setEaratgNo(input);
|
|
@@ -145,18 +145,18 @@ public class BillIsolatedServiceImpl extends ServiceImpl<BillIsolatedMapper, Bil
|
|
|
if (eartags.contains("-")){
|
|
|
String start = eartags.substring(0, eartags.indexOf("-"));
|
|
|
if (start.length() != 15){
|
|
|
- return new Result(10001,"耳标号格式错误",false);
|
|
|
+ return new Result(10001,"耳标号"+eartags+"格式错误需输入15位数字",false);
|
|
|
}
|
|
|
String end = eartags.substring(eartags.indexOf("-") + 1);
|
|
|
if (end.length() != 3){
|
|
|
- return new Result(10001,"耳标号格式错误",false);
|
|
|
+ return new Result(10001,"耳标号"+eartags+"格式错误,-后需输入3位数字",false);
|
|
|
}
|
|
|
String substring1 = eartags.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);
|
|
|
+ return new Result(10001,"耳标号"+eartags+"格式错误,包含-号耳标号需递增",false);
|
|
|
}
|
|
|
for (int i = Integer.valueOf(substring1) ; i <= Integer.valueOf(end); i++){
|
|
|
eartagNos.add(substring+i);
|
|
@@ -164,7 +164,7 @@ public class BillIsolatedServiceImpl extends ServiceImpl<BillIsolatedMapper, Bil
|
|
|
for (String number : eartagNos) {
|
|
|
Integer num = baseAnimalMapper.selectCount(new QueryWrapper<BaseAnimal>().eq("earatg_no", number));
|
|
|
if (num != 0){
|
|
|
- return new Result(10001,"耳标号重复",false);
|
|
|
+ return new Result(10001,"耳标号"+number+"重复",false);
|
|
|
}
|
|
|
BaseAnimal baseAnimal = new BaseAnimal();
|
|
|
baseAnimal.setEaratgNo(number);
|
|
@@ -177,11 +177,11 @@ public class BillIsolatedServiceImpl extends ServiceImpl<BillIsolatedMapper, Bil
|
|
|
}
|
|
|
}else {
|
|
|
if (eartags.length() != 15){
|
|
|
- return new Result(10001,"耳标号格式错误",false);
|
|
|
+ return new Result(10001,"耳标号"+eartags+"格式错误需输入15位数字",false);
|
|
|
}
|
|
|
Integer num = baseAnimalMapper.selectCount(new QueryWrapper<BaseAnimal>().eq("earatg_no", eartags));
|
|
|
if (num != 0){
|
|
|
- return new Result(10001,"耳标号重复",false);
|
|
|
+ return new Result(10001,"耳标号"+eartags+"重复",false);
|
|
|
}
|
|
|
BaseAnimal baseAnimal = new BaseAnimal();
|
|
|
baseAnimal.setEaratgNo(eartags);
|
|
@@ -267,9 +267,9 @@ public class BillIsolatedServiceImpl extends ServiceImpl<BillIsolatedMapper, Bil
|
|
|
isolation.setIsolatedPicUrl(content);
|
|
|
isolation.setIsolatedSch(2);
|
|
|
|
|
|
- deaths.replace(",",",");
|
|
|
- deaths.replace(", ",",");
|
|
|
- deaths.replace(", ",",");
|
|
|
+ deaths = deaths.replace(",",",");
|
|
|
+ deaths = deaths.replace(", ",",");
|
|
|
+ deaths = deaths.replace(", ",",");
|
|
|
if ("1".equals(isDead)){
|
|
|
isolation.setIsDead(1);
|
|
|
isolation.setDeaths(deaths);
|
|
@@ -279,19 +279,25 @@ public class BillIsolatedServiceImpl extends ServiceImpl<BillIsolatedMapper, Bil
|
|
|
if (!s.contains("-")){
|
|
|
BaseAnimal baseAnimal = baseAnimalMapper.selectOne(new QueryWrapper<BaseAnimal>().eq("earatg_no", s));
|
|
|
if (ObjectUtil.isEmpty(baseAnimal)){
|
|
|
- return new Result(10001,"耳标号不存在",false);
|
|
|
+ return new Result(10001,"耳标号"+s+"不存在",false);
|
|
|
}
|
|
|
baseAnimal.setIsDie(1);
|
|
|
baseAnimalMapper.updateById(baseAnimal);
|
|
|
}else {
|
|
|
String start = s.substring(0, s.indexOf("-"));
|
|
|
+ if (start.length() != 15){
|
|
|
+ return new Result(10001,"耳标号"+s+"格式错误需输入15位数字",false);
|
|
|
+ }
|
|
|
String end = s.substring(s.indexOf("-") + 1);
|
|
|
if (end.length() != 3){
|
|
|
- return new Result(10001,"耳标号格式错误",false);
|
|
|
+ return new Result(10001,"耳标号"+s+"格式错误,-后需输入3位数字",false);
|
|
|
}
|
|
|
String substring1 = s.substring(start.length() - end.length(), start.length());
|
|
|
String substring = start.substring(0, start.length() - end.length());
|
|
|
System.out.println(substring);
|
|
|
+ if (Integer.parseInt(substring1) >Integer.parseInt(end) ){
|
|
|
+ return new Result(10001,"耳标号"+s+"格式错误,包含-号耳标号需递增",false);
|
|
|
+ }
|
|
|
List<String> eartagNos = new ArrayList<>();
|
|
|
for (int i = Integer.valueOf(substring1) ; i <= Integer.valueOf(end); i++){
|
|
|
eartagNos.add(substring+i);
|
|
@@ -299,7 +305,7 @@ public class BillIsolatedServiceImpl extends ServiceImpl<BillIsolatedMapper, Bil
|
|
|
for (String number : eartagNos) {
|
|
|
BaseAnimal animal = baseAnimalMapper.selectOne(new QueryWrapper<BaseAnimal>().eq("earatg_no", number));
|
|
|
if (ObjectUtil.isEmpty(animal)){
|
|
|
- return new Result(10001,"耳标号不存在",false);
|
|
|
+ return new Result(10001,"耳标号"+number+"不存在",false);
|
|
|
}
|
|
|
animal.setIsDie(1);
|
|
|
baseAnimalMapper.updateById(animal);
|
|
@@ -310,21 +316,23 @@ public class BillIsolatedServiceImpl extends ServiceImpl<BillIsolatedMapper, Bil
|
|
|
if (!deaths.contains("-")){
|
|
|
BaseAnimal baseAnimal = baseAnimalMapper.selectOne(new QueryWrapper<BaseAnimal>().eq("earatg_no", deaths));
|
|
|
if (ObjectUtil.isEmpty(baseAnimal)){
|
|
|
- return new Result(10001,"耳标号不存在",false);
|
|
|
+ return new Result(10001,"耳标号"+deaths+"不存在",false);
|
|
|
}
|
|
|
baseAnimal.setIsDie(1);
|
|
|
baseAnimalMapper.updateById(baseAnimal);
|
|
|
}else {
|
|
|
String start = deaths.substring(0, deaths.indexOf("-"));
|
|
|
+ if (start.length() != 15){
|
|
|
+ return new Result(10001,"耳标号"+deaths+"格式错误需输入15位数字",false);
|
|
|
+ }
|
|
|
String end = deaths.substring(deaths.indexOf("-") + 1);
|
|
|
if (end.length() != 3){
|
|
|
- return new Result(10001,"耳标号格式错误",false);
|
|
|
+ return new Result(10001,"耳标号"+deaths+"格式错误,-后需输入3位数字",false);
|
|
|
}
|
|
|
String substring1 = deaths.substring(start.length() - end.length(), start.length());
|
|
|
String substring = start.substring(0, start.length() - end.length());
|
|
|
- System.out.println(substring);
|
|
|
if (Integer.parseInt(substring1) >Integer.parseInt(end)){
|
|
|
- return new Result(10001,"耳标号格式错误",false);
|
|
|
+ return new Result(10001,"耳标号"+deaths+"格式错误,包含-号耳标号需递增",false);
|
|
|
}
|
|
|
List<String> eartagNos = new ArrayList<>();
|
|
|
for (int i = Integer.valueOf(substring1) ; i <= Integer.valueOf(end); i++){
|
|
@@ -333,7 +341,7 @@ public class BillIsolatedServiceImpl extends ServiceImpl<BillIsolatedMapper, Bil
|
|
|
for (String number : eartagNos) {
|
|
|
BaseAnimal animal = baseAnimalMapper.selectOne(new QueryWrapper<BaseAnimal>().eq("earatg_no", number));
|
|
|
if (ObjectUtil.isEmpty(animal)){
|
|
|
- return new Result(10001,"耳标号不存在",false);
|
|
|
+ return new Result(10001,"耳标号"+number+"不存在",false);
|
|
|
}
|
|
|
animal.setIsDie(1);
|
|
|
baseAnimalMapper.updateById(animal);
|