diff --git a/admin/src/main/resources/templates/households/modal/modal-visit-info.html b/admin/src/main/resources/templates/households/modal/modal-visit-info.html index 1420a0af..5f5f997e 100644 --- a/admin/src/main/resources/templates/households/modal/modal-visit-info.html +++ b/admin/src/main/resources/templates/households/modal/modal-visit-info.html @@ -145,6 +145,7 @@ (response) => { console.log("임가방문정보 상세 응답값 : ", response); setVisitFormData(response); + document.querySelector(".modal-visit-info").ui.open(); }, function (code, rstData) { console.log("error : ", code); @@ -152,9 +153,9 @@ 'get', 'json' ); + } else { + document.querySelector(".modal-visit-info").ui.open(); } - - document.querySelector(".modal-visit-info").ui.open(); } // 임가방문정보 상세 값 set diff --git a/admin/src/main/resources/templates/households/tab/forest-product.html b/admin/src/main/resources/templates/households/tab/forest-product.html index 0e8bc902..7d54dc4c 100644 --- a/admin/src/main/resources/templates/households/tab/forest-product.html +++ b/admin/src/main/resources/templates/households/tab/forest-product.html @@ -222,9 +222,6 @@ etUI.dialog.confirm({ title: '삭제 안내', message: '선택하신 내용을 삭제하시겠습니까?
삭제한 항목은 복구할 수 없습니다.', - negativeCallback: function () { - - }, positiveCallback: function () { goDeleteForestProduct(checkedIds); }, @@ -234,7 +231,6 @@ // 임산물현황 삭제 const goDeleteForestProduct = (checkedIds) => { const f = document.reqForm; - console.log("f.monthlyInputStatusId.value", f.monthlyInputStatusId.value); ajaxUtil._ajaxMethod( '/api/household/forestProducts/delete', diff --git a/admin/src/main/resources/templates/households/tab/household-visit.html b/admin/src/main/resources/templates/households/tab/household-visit.html index e7545c37..f286fb36 100644 --- a/admin/src/main/resources/templates/households/tab/household-visit.html +++ b/admin/src/main/resources/templates/households/tab/household-visit.html @@ -10,7 +10,7 @@

-
diff --git a/front/src/main/java/app/module/front/config/constants/CommonConstants.java b/front/src/main/java/app/module/front/config/constants/CommonConstants.java index edb03e6a..d961abbb 100644 --- a/front/src/main/java/app/module/front/config/constants/CommonConstants.java +++ b/front/src/main/java/app/module/front/config/constants/CommonConstants.java @@ -9,4 +9,9 @@ public class CommonConstants { * 단위의 직접입력 코드 */ public static final String UNIT_CODE_SELF = "code.record.unit.self"; + + /** + * 작업 면적의 직접입력 코드 + */ + public static final String AREA_CODE_OTHER = "code.record.area.self"; } diff --git a/front/src/main/java/app/module/front/usecase/daily/expense/adapters/web/validator/CreateDailyExpenseValidator.java b/front/src/main/java/app/module/front/usecase/daily/expense/adapters/web/validator/CreateDailyExpenseValidator.java index 9bdfedc1..a67f79c1 100644 --- a/front/src/main/java/app/module/front/usecase/daily/expense/adapters/web/validator/CreateDailyExpenseValidator.java +++ b/front/src/main/java/app/module/front/usecase/daily/expense/adapters/web/validator/CreateDailyExpenseValidator.java @@ -21,6 +21,24 @@ public class CreateDailyExpenseValidator implements Validator { public void validate(Object target, Errors errors) { CreateDailyExpenseReqVO vo = (CreateDailyExpenseReqVO) target; + if (vo.getQuantity() == null && !StringUtils.isBlank(vo.getUnitCode())) { + errors.rejectValue( + "quantity", "valid.common.required", + "수량을 입력해 주세요."); + } + + if (vo.getQuantity() != null && StringUtils.isBlank(vo.getUnitCode())) { + errors.rejectValue( + "unitCode", "valid.common.required", + "단위를 선택해 주세요."); + } + + if (CommonConstants.UNIT_CODE_SELF.equals(vo.getUnitCode()) && StringUtils.isBlank(vo.getUnitSelf())) { + errors.rejectValue( + "unitSelf", "valid.common.required", + "단위를 입력해 주세요."); + } + if (vo.getPrice() == null && vo.getEstimatedValue() == null) { errors.rejectValue( "price", "valid.common.required", @@ -29,11 +47,5 @@ public class CreateDailyExpenseValidator implements Validator { "estimatedValue", "valid.common.required", "현금 또는 현물평가액을 입력해 주세요."); } - - if (CommonConstants.UNIT_CODE_SELF.equals(vo.getUnitCode()) && StringUtils.isBlank(vo.getUnitSelf())) { - errors.rejectValue( - "unitSelf", "valid.common.required", - "단위를 입력해 주세요."); - } } } diff --git a/front/src/main/java/app/module/front/usecase/daily/farming/adapters/web/validator/CreateDailyFarmingValidator.java b/front/src/main/java/app/module/front/usecase/daily/farming/adapters/web/validator/CreateDailyFarmingValidator.java index 4b6c7271..e112ce1f 100644 --- a/front/src/main/java/app/module/front/usecase/daily/farming/adapters/web/validator/CreateDailyFarmingValidator.java +++ b/front/src/main/java/app/module/front/usecase/daily/farming/adapters/web/validator/CreateDailyFarmingValidator.java @@ -1,5 +1,6 @@ package app.module.front.usecase.daily.farming.adapters.web.validator; +import app.module.front.config.constants.CommonConstants; import app.module.front.usecase.daily.farming.adapters.web.model.CreateDailyFarmingReqVO; import lombok.RequiredArgsConstructor; import org.apache.tika.utils.StringUtils; @@ -20,12 +21,30 @@ public class CreateDailyFarmingValidator implements Validator { public void validate(Object target, Errors errors) { CreateDailyFarmingReqVO vo = (CreateDailyFarmingReqVO) target; - if ("SELF".equals(vo.getProductCode()) && StringUtils.isBlank(vo.getProductSelf())) { + if (CommonConstants.UNIT_CODE_SELF.equals(vo.getProductCode()) && StringUtils.isBlank(vo.getProductSelf())) { errors.rejectValue( "categorySelf", "valid.common.required", "생산물을 입력해 주세요."); } + if (vo.getQuantity() == null && !StringUtils.isBlank(vo.getUnitCode())) { + errors.rejectValue( + "quantity", "valid.common.required", + "수량을 입력해 주세요."); + } + + if (vo.getQuantity() != null && StringUtils.isBlank(vo.getUnitCode())) { + errors.rejectValue( + "unitCode", "valid.common.required", + "단위를 선택해 주세요."); + } + + if (CommonConstants.UNIT_CODE_SELF.equals(vo.getUnitCode()) && StringUtils.isBlank(vo.getUnitSelf())) { + errors.rejectValue( + "unitSelf", "valid.common.required", + "단위를 입력해 주세요."); + } + if (vo.getEstimatedValue() == null) { errors.rejectValue( "estimatedValue", "valid.common.required", diff --git a/front/src/main/java/app/module/front/usecase/daily/forestry/adapters/web/validator/CreateDailyForestryValidator.java b/front/src/main/java/app/module/front/usecase/daily/forestry/adapters/web/validator/CreateDailyForestryValidator.java index 5d198bbd..1ca14c4a 100644 --- a/front/src/main/java/app/module/front/usecase/daily/forestry/adapters/web/validator/CreateDailyForestryValidator.java +++ b/front/src/main/java/app/module/front/usecase/daily/forestry/adapters/web/validator/CreateDailyForestryValidator.java @@ -1,5 +1,6 @@ package app.module.front.usecase.daily.forestry.adapters.web.validator; +import app.module.front.config.constants.CommonConstants; import app.module.front.usecase.daily.forestry.adapters.web.model.CreateDailyForestryReqVO; import lombok.RequiredArgsConstructor; import org.apache.tika.utils.StringUtils; @@ -20,6 +21,24 @@ public class CreateDailyForestryValidator implements Validator { public void validate(Object target, Errors errors) { CreateDailyForestryReqVO vo = (CreateDailyForestryReqVO) target; + if (vo.getQuantity() == null && !StringUtils.isBlank(vo.getUnitCode())) { + errors.rejectValue( + "quantity", "valid.common.required", + "수량을 입력해 주세요."); + } + + if (vo.getQuantity() != null && StringUtils.isBlank(vo.getUnitCode())) { + errors.rejectValue( + "unitCode", "valid.common.required", + "단위를 선택해 주세요."); + } + + if (CommonConstants.UNIT_CODE_SELF.equals(vo.getUnitCode()) && StringUtils.isBlank(vo.getUnitSelf())) { + errors.rejectValue( + "unitSelf", "valid.common.required", + "단위를 입력해 주세요."); + } + if (vo.getEstimatedValue() == null) { errors.rejectValue( "estimatedValue", "valid.common.required", diff --git a/front/src/main/java/app/module/front/usecase/daily/income/adapters/web/validator/CreateDailyIncomeValidator.java b/front/src/main/java/app/module/front/usecase/daily/income/adapters/web/validator/CreateDailyIncomeValidator.java index e8667e4f..8983829a 100644 --- a/front/src/main/java/app/module/front/usecase/daily/income/adapters/web/validator/CreateDailyIncomeValidator.java +++ b/front/src/main/java/app/module/front/usecase/daily/income/adapters/web/validator/CreateDailyIncomeValidator.java @@ -21,6 +21,24 @@ public class CreateDailyIncomeValidator implements Validator { public void validate(Object target, Errors errors) { CreateDailyIncomeReqVO vo = (CreateDailyIncomeReqVO) target; + if (vo.getQuantity() == null && !StringUtils.isBlank(vo.getUnitCode())) { + errors.rejectValue( + "quantity", "valid.common.required", + "수량을 입력해 주세요."); + } + + if (vo.getQuantity() != null && StringUtils.isBlank(vo.getUnitCode())) { + errors.rejectValue( + "unitCode", "valid.common.required", + "단위를 선택해 주세요."); + } + + if (CommonConstants.UNIT_CODE_SELF.equals(vo.getUnitCode()) && StringUtils.isBlank(vo.getUnitSelf())) { + errors.rejectValue( + "unitSelf", "valid.common.required", + "단위를 입력해 주세요."); + } + if (vo.getPrice() == null && vo.getEstimatedValue() == null) { errors.rejectValue( "price", "valid.common.required", @@ -29,11 +47,5 @@ public class CreateDailyIncomeValidator implements Validator { "estimatedValue", "valid.common.required", "현금 또는 현물평가액을 입력해 주세요."); } - - if (CommonConstants.UNIT_CODE_SELF.equals(vo.getUnitCode()) && StringUtils.isBlank(vo.getUnitSelf())) { - errors.rejectValue( - "unitSelf", "valid.common.required", - "단위를 입력해 주세요."); - } } } diff --git a/front/src/main/java/app/module/front/usecase/daily/work/adapters/web/validator/CreateDailyWorkValidator.java b/front/src/main/java/app/module/front/usecase/daily/work/adapters/web/validator/CreateDailyWorkValidator.java index 4cdce78c..1d01ff9d 100644 --- a/front/src/main/java/app/module/front/usecase/daily/work/adapters/web/validator/CreateDailyWorkValidator.java +++ b/front/src/main/java/app/module/front/usecase/daily/work/adapters/web/validator/CreateDailyWorkValidator.java @@ -1,5 +1,6 @@ package app.module.front.usecase.daily.work.adapters.web.validator; +import app.module.front.config.constants.CommonConstants; import app.module.front.usecase.daily.work.adapters.web.model.CreateDailyWorkReqVO; import lombok.RequiredArgsConstructor; import org.apache.tika.utils.StringUtils; @@ -20,19 +21,37 @@ public class CreateDailyWorkValidator implements Validator { public void validate(Object target, Errors errors) { CreateDailyWorkReqVO vo = (CreateDailyWorkReqVO) target; - if (vo.getHarvestQuantity() == null) { + if (vo.getWorkLandArea() == null && !StringUtils.isBlank(vo.getAreaUnitCode())) { errors.rejectValue( - "harvestQuantity", "valid.common.required", - "수확량을 입력해 주세요."); + "workLandArea", "valid.common.required", + "작업 면적을 입력해 주세요."); } - if ("SELF".equals(vo.getAreaUnitCode()) && StringUtils.isBlank(vo.getAreaUnitSelf())) { + if (vo.getWorkLandArea() != null && StringUtils.isBlank(vo.getAreaUnitCode())) { + errors.rejectValue( + "areaUnitCode", "valid.common.required", + "단위를 선택해 주세요."); + } + + if (CommonConstants.AREA_CODE_OTHER.equals(vo.getAreaUnitCode()) && StringUtils.isBlank(vo.getAreaUnitSelf())) { errors.rejectValue( "areaUnitSelf", "valid.common.required", "단위를 입력해 주세요."); } - if ("SELF".equals(vo.getHarvestUnitCode()) && StringUtils.isBlank(vo.getHarvestUnitSelf())) { + if (vo.getHarvestQuantity() == null && !StringUtils.isBlank(vo.getHarvestUnitCode())) { + errors.rejectValue( + "harvestQuantity", "valid.common.required", + "수확량을 입력해 주세요."); + } + + if (vo.getHarvestQuantity() != null && StringUtils.isBlank(vo.getHarvestUnitCode())) { + errors.rejectValue( + "harvestUnitCode", "valid.common.required", + "단위를 선택해 주세요."); + } + + if (CommonConstants.UNIT_CODE_SELF.equals(vo.getHarvestUnitCode()) && StringUtils.isBlank(vo.getHarvestUnitSelf())) { errors.rejectValue( "harvestUnitSelf", "valid.common.required", "단위를 입력해 주세요."); diff --git a/front/src/main/java/app/module/front/usecase/info/userUI/updateUserUI/adapters/web/model/UpdateUserReqVO.java b/front/src/main/java/app/module/front/usecase/info/userUI/updateUserUI/adapters/web/model/UpdateUserReqVO.java index 2a87c84c..041b0c64 100644 --- a/front/src/main/java/app/module/front/usecase/info/userUI/updateUserUI/adapters/web/model/UpdateUserReqVO.java +++ b/front/src/main/java/app/module/front/usecase/info/userUI/updateUserUI/adapters/web/model/UpdateUserReqVO.java @@ -11,7 +11,7 @@ import lombok.NoArgsConstructor; public class UpdateUserReqVO { @NotBlank(message = "이름을 입력해주세요.")//"이름은 필수 항목입니다.") - @Pattern(regexp = "^[가-힣]{2,10}$", message = "이름을 입력해주세요.")//"이름은 2~10자의 한글이어야 합니다.") + @Pattern(regexp = "^[가-힣0-9()]{2,10}$", message = "이름을 입력해주세요.")//"이름은 2~10자의 한글이어야 합니다.") private String ownerName; @NotNull(message = "나이를 입력해주세요.") @@ -19,13 +19,13 @@ public class UpdateUserReqVO { @Max(value = 120, message = "나이를 입력해주세요.")//"나이는 120세 이하이어야 합니다.") private Integer ownerAge; - @Pattern(regexp = "^\\d{2,3}$", message = "가구 연락처를 입력해주세요.")//"가구 연락처는 2~3자리 숫자여야 합니다.") + @Pattern(regexp = "^$|^\\d{2,3}$", message = "가구 연락처를 입력해주세요.")//"가구 연락처는 2~3자리 숫자여야 합니다.") private String tel1; - @Pattern(regexp = "^\\d{3,4}$", message = "가구 연락처를 입력해주세요.")//"가운데 번호는 3~4자리 숫자여야 합니다.") + @Pattern(regexp = "^$|^\\d{3,4}$", message = "가구 연락처를 입력해주세요.")//"가운데 번호는 3~4자리 숫자여야 합니다.") private String tel2; - @Pattern(regexp = "^\\d{4}$", message = "가구 연락처를 입력해주세요.")//"끝 번호는 4자리 숫자여야 합니다.") + @Pattern(regexp = "^$|^\\d{4}$", message = "가구 연락처를 입력해주세요.")//"끝 번호는 4자리 숫자여야 합니다.") private String tel3; @Pattern(regexp = "^\\d{2,3}$", message = "휴대폰 번호를 입력해주세요.")//"휴대폰 번호는 2~3자리 숫자여야 합니다.") diff --git a/front/src/main/resources/static/ui/ajaxUtil.js b/front/src/main/resources/static/ui/ajaxUtil.js index 87bbe7cb..65508942 100644 --- a/front/src/main/resources/static/ui/ajaxUtil.js +++ b/front/src/main/resources/static/ui/ajaxUtil.js @@ -180,7 +180,7 @@ var ajaxUtil = { if (formElement.length > 0) { $(formElement).find('.component-input').removeClass('input-invalid'); $(formElement).find('.input-flex-group').removeClass('invalid'); - $(formElement).find('.select-group').removeClass('input-invalid'); + $(formElement).find('.select-group').removeClass('select-invalid'); $(formElement).find('.input-info').each(function () { $(this).remove(); }); @@ -223,7 +223,7 @@ var ajaxUtil = { infoBox = $('').appendTo(component); } - infoBox.html('
  • ' + oj.message + '1111
  • '); + infoBox.html('
  • ' + oj.message + '
  • '); } } @@ -238,7 +238,10 @@ var ajaxUtil = { // 포커스 이동 if ($('.input-invalid').length != 0) { - $('.input-invalid').eq(0).find('input,select').focus(); + $('.input-invalid').eq(0).find('input').focus(); + } + if ($('.select-invalid').length != 0) { + $('.select-invalid').eq(0).find('button').focus(); } if (typeof errorCallback !== 'undefined') { diff --git a/front/src/main/resources/static/ui/page/daily-record.js b/front/src/main/resources/static/ui/page/daily-record.js index 353d3640..b5347fe0 100644 --- a/front/src/main/resources/static/ui/page/daily-record.js +++ b/front/src/main/resources/static/ui/page/daily-record.js @@ -95,8 +95,6 @@ krip.daily.baseBindUI = function() { //document.reqForm.todayNone.value = 'N'; $noneWrap.val('N'); } - // TODO 2번 이벤트 발생하는 원인 찾기 - console.log(1111) krip.daily.todayNone(ENV.month, ENV.groupNo, $noneWrap.data('type'), checked); }); diff --git a/front/src/main/resources/templates/common/components.html b/front/src/main/resources/templates/common/components.html index 3198b6d7..d58f61bc 100644 --- a/front/src/main/resources/templates/common/components.html +++ b/front/src/main/resources/templates/common/components.html @@ -26,16 +26,7 @@ - - - - - - - - - - + diff --git a/front/src/main/resources/templates/info/bank/input.html b/front/src/main/resources/templates/info/bank/input.html index 83002cc4..488a7b19 100644 --- a/front/src/main/resources/templates/info/bank/input.html +++ b/front/src/main/resources/templates/info/bank/input.html @@ -369,7 +369,6 @@ errors.push({field: form.transferCategoryCode.value+"_value", message: '수입대상을 입력해주세요.'}); } } - if (!form.sourcePurpose.value) errors.push({field: 'sourcePurpose', message: '수입원을 입력해주세요.'}); if(form.count.value){ if(!form.unitCode.value){ @@ -559,7 +558,9 @@
    diff --git a/front/src/main/resources/templates/info/bank/inputForm.html b/front/src/main/resources/templates/info/bank/inputForm.html index ae59b020..f4b0c739 100644 --- a/front/src/main/resources/templates/info/bank/inputForm.html +++ b/front/src/main/resources/templates/info/bank/inputForm.html @@ -86,12 +86,16 @@
    -
    - +
    +
    +
    +
    @@ -100,7 +104,6 @@
    diff --git a/front/src/main/resources/templates/info/bank/output.html b/front/src/main/resources/templates/info/bank/output.html index 7a6a27dd..b72e077b 100644 --- a/front/src/main/resources/templates/info/bank/output.html +++ b/front/src/main/resources/templates/info/bank/output.html @@ -361,7 +361,6 @@ } } - if (!form.sourcePurpose.value) errors.push({field: 'sourcePurpose', message: '용도 입력해주세요.'}); if(form.count.value){ if(!form.unitCode.value){ errors.push({ @@ -552,7 +551,9 @@ ${buttonGroupHtml}
    diff --git a/front/src/main/resources/templates/info/bank/outputForm.html b/front/src/main/resources/templates/info/bank/outputForm.html index 9b6461ff..7abf796c 100644 --- a/front/src/main/resources/templates/info/bank/outputForm.html +++ b/front/src/main/resources/templates/info/bank/outputForm.html @@ -63,7 +63,6 @@
    diff --git a/front/src/main/resources/templates/record/expense/form.html b/front/src/main/resources/templates/record/expense/form.html index a40636c3..b9d87fa9 100644 --- a/front/src/main/resources/templates/record/expense/form.html +++ b/front/src/main/resources/templates/record/expense/form.html @@ -93,7 +93,7 @@

    - + diff --git a/front/src/main/resources/templates/record/expense/index.html b/front/src/main/resources/templates/record/expense/index.html index a339c6d6..95b8b5c9 100644 --- a/front/src/main/resources/templates/record/expense/index.html +++ b/front/src/main/resources/templates/record/expense/index.html @@ -20,7 +20,7 @@ 지출 내역 [[${#lists.isEmpty(expenseList) ? 0 : #lists.size(expenseList)}]]건 등록
    되었습니다. -

    지출 내역을 등록해 주세요..

    +

    지출 내역을 등록해 주세요.

    등록 내용을 확인하거나 다음 단계로 이동하세요.

    @@ -140,10 +140,6 @@