Ver código fonte

交易时判断畜种是否属于卖家

Newspaper 2 anos atrás
pai
commit
761c092c31

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

@@ -164,11 +164,13 @@ public class BillBuyInfoServiceImpl extends ServiceImpl<BillBuyInfoMapper, BillB
                         BaseAnimal baseAnimal = baseAnimalMapper.selectOne(new QueryWrapper<BaseAnimal>().eq("earatg_no", number).eq("inspection_num",inspectionNum));
                         if (ObjectUtil.isEmpty(baseAnimal)){
                             return new Result(10001,"耳标号"+number+"不存在",false);
-
                         }
                         if (baseAnimal.getIsDie() == 1){
                             return new Result(10001,"耳标号"+number+"畜种已死亡",false);
                         }
+                        if (!baseAnimal.getBelongToUser().equals(billLandingInspection.getCreateUser())){
+                            return new Result(10001,"耳标号"+number+"已交易,不属于此卖家!",false);
+                        }
                         if (baseAnimal.getIsLoated() == 1){
                             return new Result(10001,"耳标号"+number+"已申请补贴,无法交易!",false);
                         }
@@ -208,6 +210,9 @@ public class BillBuyInfoServiceImpl extends ServiceImpl<BillBuyInfoMapper, BillB
                     if (baseAnimal.getIsDie() == 1){
                         return new Result(10001,"耳标号"+input+"畜种已死亡",false);
                     }
+                    if (!baseAnimal.getBelongToUser().equals(billLandingInspection.getCreateUser())){
+                        return new Result(10001,"耳标号"+input+"已交易,不属于此卖家!",false);
+                    }
                     if (baseAnimal.getIsLoated() == 1){
                         return new Result(10001,"耳标号"+input+"已申请补贴,无法交易!",false);
                     }
@@ -261,6 +266,9 @@ public class BillBuyInfoServiceImpl extends ServiceImpl<BillBuyInfoMapper, BillB
                     if (baseAnimal.getIsDie() == 1){
                         return new Result(10001,"耳标号"+number+"畜种已死亡",false);
                     }
+                    if (!baseAnimal.getBelongToUser().equals(billLandingInspection.getCreateUser())){
+                        return new Result(10001,"耳标号"+number+"已交易,不属于此卖家!",false);
+                    }
                     if (baseAnimal.getIsLoated() == 1){
                         return new Result(10001,"耳标号"+number+"已申请补贴,无法交易!",false);
                     }
@@ -293,6 +301,9 @@ public class BillBuyInfoServiceImpl extends ServiceImpl<BillBuyInfoMapper, BillB
                 if (baseAnimal.getIsDie() == 1){
                     return new Result(10001,"耳标号"+eartags+"畜种已死亡",false);
                 }
+                if (!baseAnimal.getBelongToUser().equals(billLandingInspection.getCreateUser())){
+                    return new Result(10001,"耳标号"+eartags+"已交易,不属于此卖家!",false);
+                }
                 if (baseAnimal.getIsLoated() == 1){
                     return new Result(10001,"耳标号"+eartags+"已申请补贴,无法交易!",false);
                 }