|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.huimv.farm.damsubsidy.common.token.TokenSign;
|
|
|
import com.huimv.farm.damsubsidy.common.utils.Result;
|
|
@@ -154,6 +155,15 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
|
return new Result(ResultCode.SUCCESS,subsidyMapper.selectById(id));
|
|
|
}
|
|
|
|
|
|
+ public static boolean isInteger(String str) {
|
|
|
+ for (int i = str.length(); --i >= 0;) {
|
|
|
+ if (!Character.isDigit(str.charAt(i))) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Result addApplication(HttpServletRequest httpServletRequest, String inspectionNum, String cargoOwner, String ownerPhone, String animalType, String animalNumberUp, String useTo, String startTran, String reachTran, String veter, String eartags, MultipartFile image) throws IOException {
|
|
|
QueryWrapper<BillLandingInspection> landingInspectionQueryWrapper = new QueryWrapper<>();
|
|
@@ -164,6 +174,9 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
|
if (inspectionNum.length() != 10) {
|
|
|
return new Result(10001, "检疫证号应该为10位!", false);
|
|
|
}
|
|
|
+ if (!isInteger(animalNumberUp)) {
|
|
|
+ return new Result(10001, "头数应是整数!", false);
|
|
|
+ }
|
|
|
int total = Integer.parseInt(animalNumberUp);
|
|
|
int sum = 0;
|
|
|
eartags = eartags.replace(",",",");
|