Browse Source

奖补金额条件判断

Newspaper 1 year ago
parent
commit
8bbe73e6d4

+ 12 - 0
admin/src/main/java/com/huimv/farm/damsubsidy/controller/BaseFarmerTypeInfoController.java

@@ -2,9 +2,11 @@ package com.huimv.farm.damsubsidy.controller;
 
 
 import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.druid.util.StringUtils;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.huimv.farm.damsubsidy.common.utils.IntegerUtil;
 import com.huimv.farm.damsubsidy.common.utils.PageUtils;
 import com.huimv.farm.damsubsidy.common.utils.Result;
 import com.huimv.farm.damsubsidy.common.utils.ResultCode;
@@ -105,6 +107,16 @@ public class BaseFarmerTypeInfoController {
         String rewardNum = (String) map.get("rewardNum");
         Integer farmerType = (Integer) map.get("farmerType");
         Integer animalType = (Integer) map.get("animalType");
+
+        if (StringUtils.isEmpty(rewardNum)) {
+            return new Result(10001,"请填写奖补数量",false);
+        }
+        if (ObjectUtil.isEmpty(farmerType)) {
+            return new Result(10001,"请填写农户类型",false);
+        }
+        if (ObjectUtil.isEmpty(animalType)) {
+            return new Result(10001,"请填写奖补类型",false);
+        }
         BaseFarmerTypeInfo baseFarmerTypeInfo = baseFarmerTypeInfoService.getOne(new QueryWrapper<BaseFarmerTypeInfo>().eq("farmer_type", farmerType).eq("animal_type", animalType));
         if (ObjectUtil.isEmpty(baseFarmerTypeInfo)){
             return new Result(10001,"奖补类型不存在",false);