From f1eb2cd3f97040778454fdee3f7590ad231565b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=ED=98=84=EC=A3=BC?= Date: Thu, 26 Jun 2025 15:06:11 +0900 Subject: [PATCH] =?UTF-8?q?[FO]=20=EC=9D=BC=EA=B3=84=EB=B6=80=20=EC=86=8C?= =?UTF-8?q?=EC=88=98=EC=A0=90=20=ED=8F=AC=ED=95=A8=EB=90=9C=20=EC=88=AB?= =?UTF-8?q?=EC=9E=90=20=EB=8D=B0=EC=9D=B4=ED=84=B0=EC=97=90=20getStringCom?= =?UTF-8?q?ma=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/application/util/DailyUtil.java | 25 +++++++++++++++++++ .../templates/record/daily/done.html | 6 ++--- .../templates/record/expense/index.html | 2 +- .../templates/record/farming/index.html | 2 +- .../templates/record/forestry/index.html | 2 +- .../templates/record/income/index.html | 2 +- .../templates/record/power/index.html | 4 +-- .../templates/record/work/index.html | 24 +++++++++--------- 8 files changed, 46 insertions(+), 21 deletions(-) diff --git a/core/src/main/java/app/module/core/config/application/util/DailyUtil.java b/core/src/main/java/app/module/core/config/application/util/DailyUtil.java index 259b1f20..c45216f9 100644 --- a/core/src/main/java/app/module/core/config/application/util/DailyUtil.java +++ b/core/src/main/java/app/module/core/config/application/util/DailyUtil.java @@ -1,8 +1,11 @@ package app.module.core.config.application.util; +import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; +import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.util.Date; @@ -10,6 +13,7 @@ import java.util.Locale; @Slf4j @Component +@RequiredArgsConstructor public class DailyUtil { /** @@ -103,4 +107,25 @@ public class DailyUtil { return (limitStart.isBefore(startDate) || limitStart.isEqual(startDate)); } + + /** + * 문자형 타입의 숫자에 콤마 적용 + * + * @param value 입력 데이터 + * @return 숫자(콤마, 도트) + */ + public String getStringComma(String value) { + if (StringUtils.isBlank(value)) { + return value; + } + + String[] values = value.split("\\."); + if (values.length > 1) { + Double input = Double.parseDouble(values[0]); + + return new DecimalFormat("###,###").format(input) + "." + values[1]; + } + + return value; + } } diff --git a/front/src/main/resources/templates/record/daily/done.html b/front/src/main/resources/templates/record/daily/done.html index 2860b5b4..21ecb7f5 100644 --- a/front/src/main/resources/templates/record/daily/done.html +++ b/front/src/main/resources/templates/record/daily/done.html @@ -91,7 +91,7 @@

[[${child.itemName}]]

[[${child.workName}]] - 총 [[${child.totalHour}]]시간 + 총 [[${@dailyUtil.getStringComma(child.totalHour)}]]시간 @@ -109,9 +109,9 @@
  • [[${child.equipmentName}]]

    총8시간 + th:text="|총 ${@dailyUtil.getStringComma(child.ownedHours)}시간|">총8시간 총8시간 + th:text="|총 ${@dailyUtil.getStringComma(child.leasedHours)}시간|">총8시간
  • diff --git a/front/src/main/resources/templates/record/expense/index.html b/front/src/main/resources/templates/record/expense/index.html index f7f43d49..a339c6d6 100644 --- a/front/src/main/resources/templates/record/expense/index.html +++ b/front/src/main/resources/templates/record/expense/index.html @@ -76,7 +76,7 @@
  • 수량

    - 500g + 500g
  • 현금

    diff --git a/front/src/main/resources/templates/record/farming/index.html b/front/src/main/resources/templates/record/farming/index.html index 3fc11289..3e272f2e 100644 --- a/front/src/main/resources/templates/record/farming/index.html +++ b/front/src/main/resources/templates/record/farming/index.html @@ -86,7 +86,7 @@
  • 수량

    - 500g + 500g
  • 현물평가액

    diff --git a/front/src/main/resources/templates/record/forestry/index.html b/front/src/main/resources/templates/record/forestry/index.html index bcbfca63..494b0b5d 100644 --- a/front/src/main/resources/templates/record/forestry/index.html +++ b/front/src/main/resources/templates/record/forestry/index.html @@ -78,7 +78,7 @@
  • 수량

    - 500g + 500g
  • 현물평가액

    diff --git a/front/src/main/resources/templates/record/income/index.html b/front/src/main/resources/templates/record/income/index.html index 6eb848bd..b1b76628 100644 --- a/front/src/main/resources/templates/record/income/index.html +++ b/front/src/main/resources/templates/record/income/index.html @@ -96,7 +96,7 @@
  • 수량

    - 500g + 500g
  • 현금

    diff --git a/front/src/main/resources/templates/record/power/index.html b/front/src/main/resources/templates/record/power/index.html index ad89449b..102e80c8 100644 --- a/front/src/main/resources/templates/record/power/index.html +++ b/front/src/main/resources/templates/record/power/index.html @@ -68,11 +68,11 @@ diff --git a/front/src/main/resources/templates/record/work/index.html b/front/src/main/resources/templates/record/work/index.html index 5ac0e88b..b821d725 100644 --- a/front/src/main/resources/templates/record/work/index.html +++ b/front/src/main/resources/templates/record/work/index.html @@ -80,51 +80,51 @@
  • 작업 면적

    - +
  • 수확량

    - +
  • 경영주 노동투입시간

    - +
  • 배우자 노동투입시간

    - +
  • 가족노동(남)

    - +
  • 가족노동(여)

    - +
  • 고용노동(남)

    - +
  • 고용노동(여)

    - +
  • 품앗이(남)

    - +
  • 품앗이(여)

    - +
  • 일손돕기(남)

    - +
  • 일손돕기(여)

    - +