Merge branch 'susu' into dev

This commit is contained in:
주수현
2025-07-28 13:22:27 +09:00
14 changed files with 126 additions and 3 deletions

View File

@@ -42,6 +42,11 @@ public final class CommonConstants {
*/
public static final String VALID_CODE_NOTBLANK = "valid.common.required";
/**
* Validator NotBlank errorCode
*/
public static final String VALID_CODE_NOTZERO = "valid.common.notZero";
/**
* 핸드폰 번호 규칙
*/

View File

@@ -25,6 +25,10 @@ public class CreateDailyExpenseValidator implements Validator {
errors.rejectValue(
"quantity", CommonConstants.VALID_CODE_NOTBLANK,
"수량을 입력해 주세요.");
} else if(vo.getQuantity() != null && vo.getQuantity() <= 0){
errors.rejectValue(
"quantity", CommonConstants.VALID_CODE_NOTZERO,
"입력값은 0보다 커야 합니다.");
}
if (vo.getQuantity() != null && StringUtils.isBlank(vo.getUnitCode())) {
@@ -46,6 +50,14 @@ public class CreateDailyExpenseValidator implements Validator {
errors.rejectValue(
"estimatedValue", CommonConstants.VALID_CODE_NOTBLANK,
"현금 또는 현물평가액을 입력해 주세요.");
} else if(vo.getPrice() != null && vo.getPrice() <= 0 ){
errors.rejectValue(
"price", CommonConstants.VALID_CODE_NOTZERO,
"입력값은 0보다 커야 합니다.");
} else if(vo.getEstimatedValue() != null && vo.getEstimatedValue() <= 0 ){
errors.rejectValue(
"estimatedValue", CommonConstants.VALID_CODE_NOTZERO,
"입력값은 0보다 커야 합니다.");
}
}
}

View File

@@ -31,6 +31,10 @@ public class CreateDailyFarmingValidator implements Validator {
errors.rejectValue(
"quantity", CommonConstants.VALID_CODE_NOTBLANK,
"수량을 입력해 주세요.");
} else if(vo.getQuantity() != null && vo.getQuantity() <= 0){
errors.rejectValue(
"quantity", CommonConstants.VALID_CODE_NOTZERO,
"입력값은 0보다 커야 합니다.");
}
if (vo.getQuantity() != null && StringUtils.isBlank(vo.getUnitCode())) {
@@ -49,6 +53,10 @@ public class CreateDailyFarmingValidator implements Validator {
errors.rejectValue(
"estimatedValue", CommonConstants.VALID_CODE_NOTBLANK,
"현물평가액을 입력해 주세요.");
} else if(vo.getEstimatedValue() <= 0 ){
errors.rejectValue(
"estimatedValue", CommonConstants.VALID_CODE_NOTZERO,
"입력값은 0보다 커야 합니다.");
}
}
}

View File

@@ -25,6 +25,10 @@ public class CreateDailyForestryValidator implements Validator {
errors.rejectValue(
"quantity", CommonConstants.VALID_CODE_NOTBLANK,
"수량을 입력해 주세요.");
} else if(vo.getQuantity() != null && vo.getQuantity() <= 0){
errors.rejectValue(
"quantity", CommonConstants.VALID_CODE_NOTZERO,
"입력값은 0보다 커야 합니다.");
}
if (vo.getQuantity() != null && StringUtils.isBlank(vo.getUnitCode())) {
@@ -43,6 +47,10 @@ public class CreateDailyForestryValidator implements Validator {
errors.rejectValue(
"estimatedValue", CommonConstants.VALID_CODE_NOTBLANK,
"현물평가액을 입력해 주세요.");
} else if(vo.getEstimatedValue() <= 0 ){
errors.rejectValue(
"estimatedValue", CommonConstants.VALID_CODE_NOTZERO,
"입력값은 0보다 커야 합니다.");
}
}
}

View File

@@ -25,6 +25,10 @@ public class CreateDailyIncomeValidator implements Validator {
errors.rejectValue(
"quantity", CommonConstants.VALID_CODE_NOTBLANK,
"수량을 입력해 주세요.");
} else if(vo.getQuantity() != null && vo.getQuantity() <= 0){
errors.rejectValue(
"quantity", CommonConstants.VALID_CODE_NOTZERO,
"입력값은 0보다 커야 합니다.");
}
if (vo.getQuantity() != null && StringUtils.isBlank(vo.getUnitCode())) {
@@ -46,6 +50,14 @@ public class CreateDailyIncomeValidator implements Validator {
errors.rejectValue(
"estimatedValue", CommonConstants.VALID_CODE_NOTBLANK,
"현금 또는 현물평가액을 입력해 주세요.");
} else if(vo.getPrice() != null && vo.getPrice() <= 0 ){
errors.rejectValue(
"price", CommonConstants.VALID_CODE_NOTZERO,
"입력값은 0보다 커야 합니다.");
} else if(vo.getEstimatedValue() != null && vo.getEstimatedValue() <= 0 ){
errors.rejectValue(
"estimatedValue", CommonConstants.VALID_CODE_NOTZERO,
"입력값은 0보다 커야 합니다.");
}
}
}

View File

@@ -27,6 +27,14 @@ public class CreateDailyPowerValidator implements Validator {
errors.rejectValue(
"leasedHours", CommonConstants.VALID_CODE_NOTBLANK,
"자가 사용시간 또는 임차 사용시간을 입력해 주세요.");
} else if(vo.getOwnedHours() != null && vo.getOwnedHours() <= 0 ){
errors.rejectValue(
"ownedHours", CommonConstants.VALID_CODE_NOTZERO,
"자가 사용시간은 0보다 커야 합니다.");
} else if(vo.getLeasedHours() != null && vo.getLeasedHours() <= 0 ){
errors.rejectValue(
"leasedHours", CommonConstants.VALID_CODE_NOTZERO,
"임차 사용시간은 0보다 커야 합니다.");
}
}
}

View File

@@ -25,6 +25,10 @@ public class CreateDailyWorkValidator implements Validator {
errors.rejectValue(
"workLandArea", CommonConstants.VALID_CODE_NOTBLANK,
"작업 면적을 입력해 주세요.");
} else if(vo.getWorkLandArea() != null && vo.getWorkLandArea() <= 0){
errors.rejectValue(
"workLandArea", CommonConstants.VALID_CODE_NOTZERO,
"입력값은 0보다 커야 합니다.");
}
if (vo.getWorkLandArea() != null && StringUtils.isBlank(vo.getAreaUnitCode())) {
@@ -43,6 +47,10 @@ public class CreateDailyWorkValidator implements Validator {
errors.rejectValue(
"harvestQuantity", CommonConstants.VALID_CODE_NOTBLANK,
"수확량을 입력해 주세요.");
} else if(vo.getHarvestQuantity() != null && vo.getHarvestQuantity() <= 0){
errors.rejectValue(
"harvestQuantity", CommonConstants.VALID_CODE_NOTZERO,
"입력값은 0보다 커야 합니다.");
}
if (vo.getHarvestQuantity() != null && StringUtils.isBlank(vo.getHarvestUnitCode())) {
@@ -73,5 +81,45 @@ public class CreateDailyWorkValidator implements Validator {
errors.rejectValue("volunteerMHours", "valid.common.required");
errors.rejectValue("volunteerFHours", "valid.common.required");
}
if(vo.getOwnerTime() != null && vo.getOwnerTime() <= 0){
errors.rejectValue("ownerTime", CommonConstants.VALID_CODE_NOTZERO,
"입력값은 0보다 커야 합니다.");
}
if(vo.getSpouseTime() != null && vo.getSpouseTime() <= 0){
errors.rejectValue("spouseTime", CommonConstants.VALID_CODE_NOTZERO,
"입력값은 0보다 커야 합니다.");
}
if(vo.getFamilyMHours() != null && vo.getFamilyMHours() <= 0){
errors.rejectValue("familyMHours", CommonConstants.VALID_CODE_NOTZERO,
"입력값은 0보다 커야 합니다.");
}
if(vo.getFamilyFHours() != null && vo.getFamilyFHours() <= 0){
errors.rejectValue("familyFHours", CommonConstants.VALID_CODE_NOTZERO,
"입력값은 0보다 커야 합니다.");
}
if(vo.getHiredMHours() != null && vo.getHiredMHours() <= 0){
errors.rejectValue("hiredMHours", CommonConstants.VALID_CODE_NOTZERO,
"입력값은 0보다 커야 합니다.");
}
if(vo.getHiredFHours() != null && vo.getHiredFHours() <= 0){
errors.rejectValue("hiredFHours", CommonConstants.VALID_CODE_NOTZERO,
"입력값은 0보다 커야 합니다.");
}
if(vo.getSharedMHours() != null && vo.getSharedMHours() <= 0){
errors.rejectValue("sharedMHours", CommonConstants.VALID_CODE_NOTZERO,
"입력값은 0보다 커야 합니다.");
}
if(vo.getSharedFHours() != null && vo.getSharedFHours() <= 0){
errors.rejectValue("sharedFHours", CommonConstants.VALID_CODE_NOTZERO,
"입력값은 0보다 커야 합니다.");
}
if(vo.getVolunteerMHours() != null && vo.getVolunteerMHours() <= 0){
errors.rejectValue("volunteerMHours", CommonConstants.VALID_CODE_NOTZERO,
"입력값은 0보다 커야 합니다.");
}
if(vo.getVolunteerFHours() != null && vo.getVolunteerFHours() <= 0){
errors.rejectValue("volunteerFHours", CommonConstants.VALID_CODE_NOTZERO,
"입력값은 0보다 커야 합니다.");
}
}
}

View File

@@ -2,6 +2,7 @@ valid.common.required=\uD544\uC218\uC785\uB825 \uD56D\uBAA9\uC785\uB2C8\uB2E4.
valid.common.required.size={0} \uAC1C \uD56D\uBAA9\uC774 \uB2F4\uACA8\uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4.
valid.common.required.size.min={0} \uAC1C \uC774\uC0C1 \uD56D\uBAA9\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
valid.common.required.remove.item=\uC0AD\uC81C\uD560 \uC544\uC774\uD15C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.
valid.common.notZero=\uC785\uB825\uAC12\uC740 0\uBCF4\uB2E4 \uCEE4\uC57C \uD569\uB2C8\uB2E4.
valid.common.id.wrong=\uC601\uBB38 \uB300\uC18C\uBB38\uC790(a-zA-Z), \uC22B\uC790(0-9), \uD558\uC774\uD508(-), \uC5B8\uB354\uBC14(_)\uC744 \uC774\uC6A9\uD574 6\uC790 \uC774\uC0C1 12\uC790 \uC774\uD558\uC778 \uC544\uC774\uB514\uB97C \uAE30\uC785\uD574\uC8FC\uC138\uC694.
valid.common.email.wrong=\uC774\uBA54\uC77C \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
valid.common.nickname.wrong=\uB2C9\uB124\uC784(2-10\uAE00\uC790)\uC740 \uD55C\uAE00,\uC601\uC5B4 \uB300\uC18C\uBB38\uC790, -, _ \uB9CC \uC785\uB825\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 210 KiB

After

Width:  |  Height:  |  Size: 210 KiB

View File

@@ -415,6 +415,8 @@
}
}
if (form.count.value && form.count.value <= 0) errors.push({field: 'count', message: '입력값은 0보다 커야 합니다. '});
if(form.count.value){
if(!form.unitCode.value){
errors.push({
@@ -430,6 +432,8 @@
}
}
if (!form.price.value) errors.push({field: 'price', message: '금액을 입력해주세요.'});
else if (form.price.value && form.price.value <= 0) errors.push({field: 'price', message: '입력값은 0보다 커야 합니다. '});
console.log(errors) //////////////////////////
kri.form.error(errors);
if (errors.length > 0) {

View File

@@ -406,6 +406,8 @@
}
}
if (form.count.value && form.count.value <= 0) errors.push({field: 'count', message: '입력값은 0보다 커야 합니다. '});
if(form.count.value){
if(!form.unitCode.value){
errors.push({
@@ -424,6 +426,8 @@
if (!form.price.value) errors.push({field: 'price', message: '금액을 입력해주세요.'});
else if (form.price.value && form.price.value <= 0) errors.push({field: 'price', message: '입력값은 0보다 커야 합니다. '});
console.log(errors) //////////////////////////
kri.form.error(errors);
if (errors.length > 0) {

View File

@@ -378,10 +378,14 @@
});
const errors = [];
if (form.availableArea.value && form.availableArea.value <= 0) errors.push({field: 'availableArea', message: '입력값은 0보다 커야 합니다. '});
if (!form.cropName.value) errors.push({field: 'cropName', message: '재배 작물명을 입력해주세요.'});
if (form.landArea.value && form.landArea.value <= 0) errors.push({field: 'landArea', message: '입력값은 0보다 커야 합니다. '});
if(form.mainYield.value){
if (form.mainYield.value <= 0) errors.push({field: 'mainYield', message: '입력값은 0보다 커야 합니다. '});
if(!form.mainYieldUnitCode.value){
errors.push({
field: 'mainYieldUnitCode',
@@ -397,6 +401,7 @@
}
if(form.mainSaleAmount.value){
if (form.mainSaleAmount.value <= 0) errors.push({field: 'mainSaleAmount', message: '입력값은 0보다 커야 합니다. '});
if(!form.mainSaleUnitCode.value){
errors.push({
field: 'mainSaleUnitCode',
@@ -413,6 +418,7 @@
if(form.subYield.value){
if (form.subYield.value <= 0) errors.push({field: 'subYield', message: '입력값은 0보다 커야 합니다. '});
if(!form.subYieldUnitCode.value){
errors.push({
field: 'subYieldUnitCode',
@@ -429,6 +435,7 @@
if(form.subSaleAmount.value){
if (form.subSaleAmount.value <= 0) errors.push({field: 'subSaleAmount', message: '입력값은 0보다 커야 합니다. '});
if(!form.subSaleUnitCode.value){
errors.push({
field: 'subSaleUnitCode',

View File

@@ -168,7 +168,6 @@
<div class="input-label">
<label for="ownerTime" class="label-txt">
경영주
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
</label>
</div>
<div class="input-field type-hour">
@@ -181,7 +180,6 @@
<div class="input-label">
<label for="spouseTime" class="label-txt">
배우자
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
</label>
</div>
<div class="input-field type-hour">

View File

@@ -261,7 +261,15 @@
},
function () {
// 노동투입시간 invalid reset
$('.segment-label .guide-info li').eq(2).addClass('invalid');
if($('.type-sub').find('.input-info').length > 0 && $('.type-sub').find('.input-info').first().text() === "필수입력 항목입니다."){
$('.segment-label .guide-info li').eq(2).text("최소 1개의 노동투입시간을 입력해 주세요.");
$('.segment-label .guide-info li').eq(2).addClass('invalid');
}else if($('.type-sub').find('.input-info').length > 0 ){
$('.segment-label .guide-info li').eq(2).text("입력값은 0보다 커야 합니다.");
$('.segment-label .guide-info li').eq(2).addClass('invalid');
}else{
$('.segment-label .guide-info li').eq(2).removeClass('invalid');
}
$('.type-sub').find('.input-info').remove();
$('.input-flex-group').find('.input-info').remove();
}