From 4495882e792bf7bbacf11cf3e783c24142316341 Mon Sep 17 00:00:00 2001 From: kangsunlee Date: Mon, 14 Jul 2025 14:33:42 +0900 Subject: [PATCH] =?UTF-8?q?[BO]=20=EC=88=98=EC=A0=95=20:=20=EC=9E=84?= =?UTF-8?q?=EC=82=B0=EB=AC=BC=20=ED=98=84=ED=99=A9,=20=EC=9D=80=ED=96=89?= =?UTF-8?q?=EC=9E=90=EB=8F=99=EC=9D=B4=EC=B2=B4=EB=82=B4=EC=97=AD,=20?= =?UTF-8?q?=EC=9E=84=EA=B0=80=EB=B0=A9=EB=AC=B8=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/GetForestProductStatus.java | 1 + .../SaveHouseholdVisitInfoValidator.java | 10 +++++----- .../GetForestProductStatusMapper.xml | 1 + admin/src/main/resources/static/ui/uiUtil.js | 3 ++- .../modal-bank-auto-transfer-expense.html | 6 +++--- .../modal-bank-auto-transfer-income.html | 6 +++--- .../modal/modal-forest-product.html | 12 ++++++------ .../households/tab/bank-auto-transfer.html | 4 ++-- .../households/tab/forest-product.html | 19 +++++++++++++------ 9 files changed, 36 insertions(+), 26 deletions(-) diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/getForestProductStatus/ports/application/domain/GetForestProductStatus.java b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/getForestProductStatus/ports/application/domain/GetForestProductStatus.java index d17d6006..e8ce029c 100644 --- a/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/getForestProductStatus/ports/application/domain/GetForestProductStatus.java +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/getForestProductStatus/ports/application/domain/GetForestProductStatus.java @@ -14,6 +14,7 @@ public class GetForestProductStatus { private String streetNum; private String landType; private String town; + private String availableArea; private String cropName; private String landArea; private String mainYield; diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/householdVisit/saveHouseholdVisitInfo/adapters/web/validator/SaveHouseholdVisitInfoValidator.java b/admin/src/main/java/app/module/admin/usecase/household/tab/householdVisit/saveHouseholdVisitInfo/adapters/web/validator/SaveHouseholdVisitInfoValidator.java index 20d7dcfb..5d223c09 100644 --- a/admin/src/main/java/app/module/admin/usecase/household/tab/householdVisit/saveHouseholdVisitInfo/adapters/web/validator/SaveHouseholdVisitInfoValidator.java +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/householdVisit/saveHouseholdVisitInfo/adapters/web/validator/SaveHouseholdVisitInfoValidator.java @@ -20,26 +20,26 @@ public class SaveHouseholdVisitInfoValidator implements Validator { SaveHouseholdVisitInfoReqVO vo = (SaveHouseholdVisitInfoReqVO) target; if (vo.getHouseholdSeq() == null) { - errors.reject("householdSeq", "임가 정보가 없습니다."); + errors.rejectValue("householdSeq", "error.householdSeq", "임가 정보가 없습니다."); return; } if (vo.getVisitDate() == null) { - errors.reject("visitDate", "방문일자를 입력해 주세요."); + errors.rejectValue("visitDate", "error.visitDate","방문일자를 입력해 주세요."); return; } if (vo.getVisitDate().after(new Date())) { - errors.reject("visitDate", "미래 날짜는 입력할 수 없습니다."); + errors.rejectValue("visitDate", "error.visitDate","미래 날짜는 입력할 수 없습니다."); return; } if (vo.getManagementType() == null) { - errors.reject("managementType", "방문조사 유형을 선택해 주세요."); + errors.rejectValue("managementType", "error.managementType","방문조사 유형을 선택해 주세요."); } if (!StringUtils.hasText(vo.getContent())) { - errors.reject("content", "내용을 입력해 주세요."); + errors.rejectValue("content", "error.content","내용을 입력해 주세요."); } } } \ No newline at end of file diff --git a/admin/src/main/resources/mappers/household/GetForestProductStatusMapper.xml b/admin/src/main/resources/mappers/household/GetForestProductStatusMapper.xml index 2cd9e713..600c8908 100644 --- a/admin/src/main/resources/mappers/household/GetForestProductStatusMapper.xml +++ b/admin/src/main/resources/mappers/household/GetForestProductStatusMapper.xml @@ -10,6 +10,7 @@ street_num, land_type, town, + available_area, crop_name, land_area, main_yield, diff --git a/admin/src/main/resources/static/ui/uiUtil.js b/admin/src/main/resources/static/ui/uiUtil.js index bfa70c65..3d681c70 100644 --- a/admin/src/main/resources/static/ui/uiUtil.js +++ b/admin/src/main/resources/static/ui/uiUtil.js @@ -461,7 +461,8 @@ const ifNullHyphen = (value, fallback = '-') => { } const formatNumberWithComma = (value) => { - if (value == null || isNaN(value)) return '-'; + if (value == null || value === '' || Number(value) === 0) return '-'; + if (isNaN(value)) return '-'; return Number(value).toLocaleString(); } diff --git a/admin/src/main/resources/templates/households/modal/modal-bank-auto-transfer-expense.html b/admin/src/main/resources/templates/households/modal/modal-bank-auto-transfer-expense.html index a26775bb..5461e6a2 100644 --- a/admin/src/main/resources/templates/households/modal/modal-bank-auto-transfer-expense.html +++ b/admin/src/main/resources/templates/households/modal/modal-bank-auto-transfer-expense.html @@ -49,7 +49,7 @@
- +
@@ -91,7 +91,7 @@
- +
@@ -104,7 +104,7 @@
+ maxlength="10" inputmode="numeric" oninput="limitMaxLength(this);">
diff --git a/admin/src/main/resources/templates/households/modal/modal-bank-auto-transfer-income.html b/admin/src/main/resources/templates/households/modal/modal-bank-auto-transfer-income.html index c3ee339f..78869818 100644 --- a/admin/src/main/resources/templates/households/modal/modal-bank-auto-transfer-income.html +++ b/admin/src/main/resources/templates/households/modal/modal-bank-auto-transfer-income.html @@ -66,7 +66,7 @@
- +
@@ -119,7 +119,7 @@
- +
@@ -132,7 +132,7 @@
+ maxlength="10" inputmode="numeric" oninput="limitMaxLength(this);">
diff --git a/admin/src/main/resources/templates/households/modal/modal-forest-product.html b/admin/src/main/resources/templates/households/modal/modal-forest-product.html index a8f63ae9..cbfd6521 100644 --- a/admin/src/main/resources/templates/households/modal/modal-forest-product.html +++ b/admin/src/main/resources/templates/households/modal/modal-forest-product.html @@ -38,7 +38,7 @@
- +
@@ -47,7 +47,7 @@
- +
@@ -56,7 +56,7 @@
- +
@@ -67,7 +67,7 @@
- +
@@ -77,7 +77,7 @@
+ maxlength="10" inputmode="numeric" oninput="limitMaxLength(this);">
@@ -87,7 +87,7 @@
+ maxlength="10" inputmode="numeric" oninput="limitMaxLength(this);">
diff --git a/admin/src/main/resources/templates/households/tab/bank-auto-transfer.html b/admin/src/main/resources/templates/households/tab/bank-auto-transfer.html index 7879b84c..7462d3c1 100644 --- a/admin/src/main/resources/templates/households/tab/bank-auto-transfer.html +++ b/admin/src/main/resources/templates/households/tab/bank-auto-transfer.html @@ -126,7 +126,7 @@ ${ifNullHyphen(item.categoryText)} ${ifNullHyphen(item.target)} ${ifNullHyphen(item.sourcePurpose)} - ${ifNullHyphen(item.count)} + ${formatNumberWithComma(item.count)} ${ifNullHyphen(item.unitText)} ${formatNumberWithComma(item.price)} @@ -161,7 +161,7 @@ ${ifNullHyphen(item.categoryText)} ${ifNullHyphen(item.sourcePurpose)} - ${ifNullHyphen(item.count)} + ${formatNumberWithComma(item.count)} ${ifNullHyphen(item.unitText)} ${formatNumberWithComma(item.price)} 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 4d26cce5..a0f5778d 100644 --- a/admin/src/main/resources/templates/households/tab/forest-product.html +++ b/admin/src/main/resources/templates/households/tab/forest-product.html @@ -114,18 +114,18 @@ ${ifNullHyphen(item.streetNum)} ${ifNullHyphen(item.landType)} ${ifNullHyphen(item.town)} - ${ifNullHyphen(item.availableArea)} + ${formatNumberWithComma(item.availableArea)} ${ifNullHyphen(item.cropName)} - ${ifNullHyphen(item.landArea)} - ${ifNullHyphen(item.mainYield)} + ${formatNumberWithComma(item.landArea)} + ${formatNumberWithComma(item.mainYield)} ${ifNullHyphen(item.mainYieldUnitText)} - ${ifNullHyphen(item.mainSaleAmount)} + ${formatNumberWithComma(item.mainSaleAmount)} ${ifNullHyphen(item.mainSaleAmountUnitText)} - ${ifNullHyphen(item.subYield)} + ${formatNumberWithComma(item.subYield)} ${ifNullHyphen(item.subYieldUnitText)} - ${ifNullHyphen(item.subSaleAmount)} + ${formatNumberWithComma(item.subSaleAmount)} ${ifNullHyphen(item.subSaleAmountUnitText)} `; @@ -218,11 +218,18 @@ document.querySelectorAll('input[name="forestRemoveIds"]:checked') ).map(el => Number(el.value)); + const totalRows = document.querySelectorAll('input[name="forestRemoveIds"]').length; + if(checkedIds.length <= 0) { alert("임산물을 선택해주세요."); return } + if (checkedIds.length === totalRows) { + alert("등록내용은 최소 1건이 남아있어야 합니다."); + return; + } + etUI.dialog.confirm({ title: '삭제 안내', message: '선택하신 내용을 삭제하시겠습니까?
삭제한 항목은 복구할 수 없습니다.',