|
@@ -7,6 +7,7 @@ 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.IntegerUtil;
|
|
|
import com.huimv.farm.damsubsidy.common.utils.Result;
|
|
|
import com.huimv.farm.damsubsidy.common.utils.ResultCode;
|
|
|
import com.huimv.farm.damsubsidy.common.utils.UploadImage;
|
|
@@ -155,15 +156,6 @@ 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<>();
|
|
@@ -174,8 +166,8 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
|
if (inspectionNum.length() != 10) {
|
|
|
return new Result(10001, "检疫证号应该为10位!", false);
|
|
|
}
|
|
|
- if (!isInteger(animalNumberUp)) {
|
|
|
- return new Result(10001, "头数应是整数!", false);
|
|
|
+ if (!IntegerUtil.isInteger(animalNumberUp)){
|
|
|
+ return new Result(10001, "头数应为整数!", false);
|
|
|
}
|
|
|
int total = Integer.parseInt(animalNumberUp);
|
|
|
int sum = 0;
|