Newspaper пре 1 година
родитељ
комит
11b537a0b2

+ 12 - 0
admin/src/main/java/com/huimv/farm/damsubsidy/service/impl/BillBuyInfoServiceImpl.java

@@ -56,6 +56,18 @@ public class BillBuyInfoServiceImpl extends ServiceImpl<BillBuyInfoMapper, BillB
         int total = Integer.parseInt(animalNumberUp);
         SysUser sysUser = sysUserMapper.selectOne(new QueryWrapper<SysUser>().eq("id", userId));
 
+        QueryWrapper<BillLandingInspection> landingInspectionQueryWrapper = new QueryWrapper<>();
+        landingInspectionQueryWrapper.eq("inspection_num", inspectionNum);
+        if (billLandingInspectionMapper.selectCount(landingInspectionQueryWrapper) != 0) {
+            return new Result(10001, "存在相同检疫证号!", false);
+        }
+        if (inspectionNum.length() != 10) {
+            return new Result(10001, "检疫证号应该为10位!", false);
+        }
+        if (!IntegerUtil.isInteger(animalNumberUp)){
+            return new Result(10001, "头数应为整数!", false);
+        }
+
         EartagResult eartagResult = EartagUtil.getEartagCollection(eartags);
         if (!eartagResult.getSuccess()){
             return new Result(10001,eartagResult.getMsg(),false);