음수 입력 막기

This commit is contained in:
주수현
2025-07-28 16:20:18 +09:00
parent 8279ccec55
commit b474a6afe0
9 changed files with 34 additions and 34 deletions

View File

@@ -35,7 +35,7 @@ public class SaveBankAutoTransferExpenseValidator implements Validator {
}
// 수량 0 이상 입력
if (StringUtils.hasText(vo.getCount()) && Integer.parseInt(vo.getCount()) == 0) {
if (StringUtils.hasText(vo.getCount()) && Integer.parseInt(vo.getCount()) <= 0) {
errors.rejectValue(
"count", CommonConstants.VALID_CODE_INVALID_ZERO,
"수량은 0 이상 입력해 주세요.");
@@ -68,7 +68,7 @@ public class SaveBankAutoTransferExpenseValidator implements Validator {
"현금(원)을 입력해주세요.");
}
if (vo.getPrice() != null && vo.getPrice() == 0) {
if (vo.getPrice() != null && vo.getPrice() <= 0) {
errors.rejectValue(
"price", CommonConstants.VALID_CODE_INVALID_ZERO,
"현금(원)은 0 이상 입력해 주세요.");

View File

@@ -44,7 +44,7 @@ public class SaveBankAutoTransferIncomeValidator implements Validator {
}
// 수량 0 이상 입력
if (StringUtils.hasText(vo.getCount()) && Integer.parseInt(vo.getCount()) == 0) {
if (StringUtils.hasText(vo.getCount()) && Integer.parseInt(vo.getCount()) <= 0) {
errors.rejectValue(
"count", CommonConstants.VALID_CODE_INVALID_ZERO,
"수량은 0 이상 입력해 주세요.");
@@ -77,7 +77,7 @@ public class SaveBankAutoTransferIncomeValidator implements Validator {
"현금(원)을 입력해주세요.");
}
if (vo.getPrice() != null && vo.getPrice() == 0) {
if (vo.getPrice() != null && vo.getPrice() <= 0) {
errors.rejectValue(
"price", CommonConstants.VALID_CODE_INVALID_ZERO,
"현금(원)은 0 이상 입력해 주세요.");

View File

@@ -27,7 +27,7 @@ public class SaveDailyExpenseValidator implements Validator {
"수량을 입력해 주세요.");
}
if (vo.getQuantity() != null && vo.getQuantity() == 0) {
if (vo.getQuantity() != null && vo.getQuantity() <= 0) {
errors.rejectValue(
"quantity", CommonConstants.VALID_CODE_INVALID_ZERO,
"수량은 0 이상 입력해 주세요.");
@@ -54,8 +54,8 @@ public class SaveDailyExpenseValidator implements Validator {
"현금 또는 현물평가액을 입력해 주세요.");
}
if ((vo.getPrice() != null && vo.getPrice() == 0)
|| (vo.getEstimatedValue() != null && vo.getEstimatedValue() == 0)) {
if ((vo.getPrice() != null && vo.getPrice() <= 0)
|| (vo.getEstimatedValue() != null && vo.getEstimatedValue() <= 0)) {
errors.rejectValue(
"price", CommonConstants.VALID_CODE_INVALID_ZERO,
"현금 또는 현물평가액은 0 이상 입력해 주세요.");

View File

@@ -32,7 +32,7 @@ public class SaveDailyFarmingValidator implements Validator {
"수량을 입력해 주세요.");
}
if (vo.getQuantity() != null && vo.getQuantity() == 0) {
if (vo.getQuantity() != null && vo.getQuantity() <= 0) {
errors.rejectValue(
"quantity", CommonConstants.VALID_CODE_INVALID_ZERO,
"수량은 0 이상 입력해 주세요.");
@@ -56,7 +56,7 @@ public class SaveDailyFarmingValidator implements Validator {
"현물평가액을 입력해 주세요.");
}
if (vo.getEstimatedValue() != null && vo.getEstimatedValue() == 0) {
if (vo.getEstimatedValue() != null && vo.getEstimatedValue() <= 0) {
errors.rejectValue(
"estimatedValue", CommonConstants.VALID_CODE_INVALID_ZERO,
"현물평가액은 0 이상 입력해 주세요.");

View File

@@ -26,7 +26,7 @@ public class SaveDailyForestryValidator implements Validator {
"수량을 입력해 주세요.");
}
if (vo.getQuantity() != null && vo.getQuantity() == 0) {
if (vo.getQuantity() != null && vo.getQuantity() <= 0) {
errors.rejectValue(
"quantity", CommonConstants.VALID_CODE_INVALID_ZERO,
"수량은 0 이상 입력해 주세요.");
@@ -50,7 +50,7 @@ public class SaveDailyForestryValidator implements Validator {
"현물평가액을 입력해 주세요.");
}
if (vo.getEstimatedValue() != null && vo.getEstimatedValue() == 0) {
if (vo.getEstimatedValue() != null && vo.getEstimatedValue() <= 0) {
errors.rejectValue(
"estimatedValue", CommonConstants.VALID_CODE_INVALID_ZERO,
"현물평가액은 0 이상 입력해 주세요.");

View File

@@ -27,7 +27,7 @@ public class SaveDailyIncomeValidator implements Validator {
"수량을 입력해 주세요.");
}
if (vo.getQuantity() != null && vo.getQuantity() == 0) {
if (vo.getQuantity() != null && vo.getQuantity() <= 0) {
errors.rejectValue(
"quantity", CommonConstants.VALID_CODE_INVALID_ZERO,
"수량은 0 이상 입력해 주세요.");
@@ -54,8 +54,8 @@ public class SaveDailyIncomeValidator implements Validator {
"현금 또는 현물평가액을 입력해 주세요.");
}
if ((vo.getPrice() != null && vo.getPrice() == 0)
|| (vo.getEstimatedValue() != null && vo.getEstimatedValue() == 0)) {
if ((vo.getPrice() != null && vo.getPrice() <= 0)
|| (vo.getEstimatedValue() != null && vo.getEstimatedValue() <= 0)) {
errors.rejectValue(
"price", CommonConstants.VALID_CODE_INVALID_ZERO,
"현금 또는 현물평가액은 0 이상 입력해 주세요.");

View File

@@ -28,8 +28,8 @@ public class SaveDailyPowerValidator implements Validator {
"자가 사용시간 또는 임차 사용시간을 입력해 주세요.");
}
if ((vo.getOwnedHours() != null && vo.getOwnedHours() == 0)
|| (vo.getLeasedHours() != null && vo.getLeasedHours() == 0)) {
if ((vo.getOwnedHours() != null && vo.getOwnedHours() <= 0)
|| (vo.getLeasedHours() != null && vo.getLeasedHours() <= 0)) {
errors.rejectValue(
"ownedHours", CommonConstants.VALID_CODE_INVALID_ZERO,
"자가 사용시간 또는 임차 사용시간은 0 이상 입력해 주세요.");

View File

@@ -25,7 +25,7 @@ public class SaveDailyWorkValidator implements Validator {
"workLandArea", CommonConstants.VALID_CODE_NOTBLANK,
"작업 면적을 입력해 주세요.");
}
if (vo.getWorkLandArea() != null && vo.getWorkLandArea() == 0) {
if (vo.getWorkLandArea() != null && vo.getWorkLandArea() <= 0) {
errors.rejectValue(
"workLandArea", CommonConstants.VALID_CODE_INVALID_ZERO,
"작업 면적은 0 이상 입력해 주세요.");
@@ -48,7 +48,7 @@ public class SaveDailyWorkValidator implements Validator {
"수확량을 입력해 주세요.");
}
if (vo.getHarvestQuantity() != null && vo.getHarvestQuantity() == 0) {
if (vo.getHarvestQuantity() != null && vo.getHarvestQuantity() <= 0) {
errors.rejectValue(
"harvestQuantity", CommonConstants.VALID_CODE_INVALID_ZERO,
"수확량은 0 이상 입력해 주세요.");
@@ -83,16 +83,16 @@ public class SaveDailyWorkValidator implements Validator {
errors.rejectValue("volunteerFHours", CommonConstants.VALID_CODE_NOTBLANK);
}
if ((vo.getOwnerTime() != null && vo.getOwnerTime() == 0)
|| (vo.getSpouseTime() != null && vo.getSpouseTime() == 0)
|| (vo.getFamilyMHours() != null && vo.getFamilyMHours() == 0)
|| (vo.getFamilyFHours() != null && vo.getFamilyFHours() == 0)
|| (vo.getHiredMHours() != null && vo.getHiredMHours() == 0)
|| (vo.getHiredFHours() != null && vo.getHiredFHours() == 0)
|| (vo.getSharedMHours() != null && vo.getSharedMHours() == 0)
|| (vo.getSharedFHours() != null && vo.getSharedFHours() == 0)
|| (vo.getVolunteerMHours() != null && vo.getVolunteerMHours() == 0)
|| (vo.getVolunteerFHours() != null && vo.getVolunteerFHours() == 0)) {
if ((vo.getOwnerTime() != null && vo.getOwnerTime() <= 0)
|| (vo.getSpouseTime() != null && vo.getSpouseTime() <= 0)
|| (vo.getFamilyMHours() != null && vo.getFamilyMHours() <= 0)
|| (vo.getFamilyFHours() != null && vo.getFamilyFHours() <= 0)
|| (vo.getHiredMHours() != null && vo.getHiredMHours() <= 0)
|| (vo.getHiredFHours() != null && vo.getHiredFHours() <= 0)
|| (vo.getSharedMHours() != null && vo.getSharedMHours() <= 0)
|| (vo.getSharedFHours() != null && vo.getSharedFHours() <= 0)
|| (vo.getVolunteerMHours() != null && vo.getVolunteerMHours() <= 0)
|| (vo.getVolunteerFHours() != null && vo.getVolunteerFHours() <= 0)) {
errors.rejectValue("ownerTime", CommonConstants.VALID_CODE_INVALID_ZERO, "노동투입시간은 0 이상 입력해 주세요.");
errors.rejectValue("spouseTime", CommonConstants.VALID_CODE_INVALID_ZERO);
errors.rejectValue("familyMHours", CommonConstants.VALID_CODE_INVALID_ZERO);

View File

@@ -23,20 +23,20 @@ public class SaveForestProductValidator implements Validator {
errors.rejectValue("cropName", "error.cropName", "재배 작물명을 입력해주세요.");
}
if (StringUtils.hasText(vo.getLandArea()) && Integer.parseInt(vo.getLandArea()) == 0) {
if (StringUtils.hasText(vo.getLandArea()) && Integer.parseInt(vo.getLandArea()) <= 0) {
errors.rejectValue(
"landArea", CommonConstants.VALID_CODE_INVALID_ZERO,
"면적(평)은 0 이상 입력해 주세요.");
}
if (StringUtils.hasText(vo.getAvailableArea()) && Integer.parseInt(vo.getAvailableArea()) == 0) {
if (StringUtils.hasText(vo.getAvailableArea()) && Integer.parseInt(vo.getAvailableArea()) <= 0) {
errors.rejectValue(
"availableArea", CommonConstants.VALID_CODE_INVALID_ZERO,
"가능면적(평)은 0 이상 입력해 주세요.");
}
// 주생산물 수확량
if (StringUtils.hasText(vo.getMainYield()) && Integer.parseInt(vo.getMainYield()) == 0) {
if (StringUtils.hasText(vo.getMainYield()) && Integer.parseInt(vo.getMainYield()) <= 0) {
errors.rejectValue(
"mainYield", CommonConstants.VALID_CODE_INVALID_ZERO,
"주생산물 수확량은 0 이상 입력해 주세요.");
@@ -55,7 +55,7 @@ public class SaveForestProductValidator implements Validator {
}
// 주생산물 판매량
if (StringUtils.hasText(vo.getMainSaleAmount()) && Integer.parseInt(vo.getMainSaleAmount()) == 0) {
if (StringUtils.hasText(vo.getMainSaleAmount()) && Integer.parseInt(vo.getMainSaleAmount()) <= 0) {
errors.rejectValue(
"mainSaleAmount", CommonConstants.VALID_CODE_INVALID_ZERO,
"주생산물 판매량은 0 이상 입력해 주세요.");
@@ -74,7 +74,7 @@ public class SaveForestProductValidator implements Validator {
}
// 부생산물 수확량
if (StringUtils.hasText(vo.getSubYield()) && Integer.parseInt(vo.getSubYield()) == 0) {
if (StringUtils.hasText(vo.getSubYield()) && Integer.parseInt(vo.getSubYield()) <= 0) {
errors.rejectValue(
"subYield", CommonConstants.VALID_CODE_INVALID_ZERO,
"부생산물 수확량은 0 이상 입력해 주세요.");
@@ -93,7 +93,7 @@ public class SaveForestProductValidator implements Validator {
}
// 부생산물 판매량
if (StringUtils.hasText(vo.getSubSaleAmount()) && Integer.parseInt(vo.getSubSaleAmount()) == 0) {
if (StringUtils.hasText(vo.getSubSaleAmount()) && Integer.parseInt(vo.getSubSaleAmount()) <= 0) {
errors.rejectValue(
"subSaleAmount", CommonConstants.VALID_CODE_INVALID_ZERO,
"부생산물 판매량은 0 이상 입력해 주세요.");