|
@@ -54,12 +54,18 @@ public class BillIsolatedServiceImpl extends ServiceImpl<BillIsolatedMapper, Bil
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
|
- public Result addIsolation(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) throws ParseException {
|
|
|
+ public synchronized Result addIsolation(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) throws ParseException {
|
|
|
String inspectionNum = paramsMap.get("inspectionNum");
|
|
|
String isolatedPosition = paramsMap.get("isolatedPosition");
|
|
|
String strIsolated = paramsMap.get("strIsolated");
|
|
|
String dayIsolated = paramsMap.get("dayIsolated");
|
|
|
-
|
|
|
+ int dayIsolate = Integer.parseInt(dayIsolated);
|
|
|
+ if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isBlank(inspectionNum) || inspectionNum.length()!=10){
|
|
|
+ return new Result(10001,"检疫证号不符合规范!",false);
|
|
|
+ }
|
|
|
+ if (dayIsolate > 20 || dayIsolate <15){
|
|
|
+ return new Result(10001,"隔离天数请在15-20天!",false);
|
|
|
+ }
|
|
|
Integer integer = this.count(new QueryWrapper<BillIsolated>().eq("inspection_num", inspectionNum));
|
|
|
if (integer != 0){
|
|
|
return new Result(10001,"检疫证号重复!",false);
|
|
@@ -69,7 +75,7 @@ public class BillIsolatedServiceImpl extends ServiceImpl<BillIsolatedMapper, Bil
|
|
|
Date startTime = dateFormat.parse(strIsolated);
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.setTime(startTime);
|
|
|
- calendar.add(Calendar.DATE, Integer.valueOf(dayIsolated));
|
|
|
+ calendar.add(Calendar.DATE, dayIsolate);
|
|
|
Date endTime = calendar.getTime();
|
|
|
String userName = landingInspectionMapper.selectOne(new QueryWrapper<BillLandingInspection>().eq("inspection_num", inspectionNum)).getCargoOwner();
|
|
|
billIsolated.setInspectionName(userName+"的隔离信息");
|
|
@@ -106,7 +112,7 @@ public class BillIsolatedServiceImpl extends ServiceImpl<BillIsolatedMapper, Bil
|
|
|
if (Integer.parseInt(substring1) >Integer.parseInt(end) ){
|
|
|
return new Result(10001,"耳标号"+input+"格式错误,包含-号耳标号需递增",false);
|
|
|
}
|
|
|
- for (int i = Integer.parseInt(substring1); i <= Integer.valueOf(end); i++){
|
|
|
+ for (int i = Integer.parseInt(substring1); i <= Integer.parseInt(end); i++){
|
|
|
eartagNos.add(substring+i);
|
|
|
}
|
|
|
for (String eartagNo : eartagNos) {
|
|
@@ -200,7 +206,6 @@ public class BillIsolatedServiceImpl extends ServiceImpl<BillIsolatedMapper, Bil
|
|
|
this.save(billIsolated);
|
|
|
return Result.SUCCESS();
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
@@ -339,6 +344,7 @@ public class BillIsolatedServiceImpl extends ServiceImpl<BillIsolatedMapper, Bil
|
|
|
eartagNos.add(substring+i);
|
|
|
}
|
|
|
for (String number : eartagNos) {
|
|
|
+ // TODO
|
|
|
BaseAnimal animal = baseAnimalMapper.selectOne(new QueryWrapper<BaseAnimal>().eq("earatg_no", number));
|
|
|
if (ObjectUtil.isEmpty(animal)){
|
|
|
return new Result(10001,"耳标号"+number+"不存在",false);
|