From 5818316e658dcbd6f4e9b99528f56e7ee46d183f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A3=BC=EC=88=98=ED=98=84?= Date: Thu, 26 Jun 2025 09:31:26 +0900 Subject: [PATCH 01/13] =?UTF-8?q?=EC=A1=B0=EC=82=AC=EC=9B=90=20=ED=98=84?= =?UTF-8?q?=ED=99=A9=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapters/web/AdminUpdatePostController.java | 3 --- .../web/model/ResearchersVisitDetailReqVO.java | 7 ++++--- .../resources/mappers/researcher/ResearcherMapper.xml | 11 +++++++++-- .../main/resources/templates/researcher/detail.html | 8 ++++++++ 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/AdminUpdatePostController.java b/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/AdminUpdatePostController.java index b2d154af..b3289ea4 100644 --- a/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/AdminUpdatePostController.java +++ b/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/AdminUpdatePostController.java @@ -27,10 +27,7 @@ import java.util.stream.Collectors; class AdminUpdatePostController { private final AdminUpdateValidator adminUpdateValidator; - private final RoleListPortIn roleListPortIn; - private final UICodeListPortIn uiCodeListPortIn; private final SaveAdminPortIn saveAdminPortIn; - private final MessageUtil messageUtil; @PostMapping(path = "/api/settings/admin/update") ResponseEntity operate( @RequestBody AdminUpdateBindingVO bindingVO, BindingResult bindingResult) { diff --git a/admin/src/main/java/app/module/admin/usecase/researcher/adpaters/web/model/ResearchersVisitDetailReqVO.java b/admin/src/main/java/app/module/admin/usecase/researcher/adpaters/web/model/ResearchersVisitDetailReqVO.java index 0c411ee9..0aef8900 100644 --- a/admin/src/main/java/app/module/admin/usecase/researcher/adpaters/web/model/ResearchersVisitDetailReqVO.java +++ b/admin/src/main/java/app/module/admin/usecase/researcher/adpaters/web/model/ResearchersVisitDetailReqVO.java @@ -5,13 +5,14 @@ import app.module.core.config.adapters.persistence.component.AuditCommand; import lombok.Getter; import lombok.Setter; +import java.time.LocalDate; import java.time.LocalDateTime; @Getter @Setter -public class ResearchersVisitDetailReqVO { - private String id; - private String visitDate; +public class ResearchersVisitDetailReqVO extends AuditCommand { + private Integer id; + private LocalDate visitDate; private ManagementType managementType; private String content; private String isGiftSent; diff --git a/admin/src/main/resources/mappers/researcher/ResearcherMapper.xml b/admin/src/main/resources/mappers/researcher/ResearcherMapper.xml index 15751c66..38a44745 100644 --- a/admin/src/main/resources/mappers/researcher/ResearcherMapper.xml +++ b/admin/src/main/resources/mappers/researcher/ResearcherMapper.xml @@ -225,8 +225,15 @@ set visit_date = #{visitDate}, content = #{content}, management_type = #{managementType}, - is_gift_sent = #{isGiftSent}, - + + + is_gift_sent = true, + + + is_gift_sent = false, + + + where id = #{id} diff --git a/admin/src/main/resources/templates/researcher/detail.html b/admin/src/main/resources/templates/researcher/detail.html index c920931a..74a065ff 100644 --- a/admin/src/main/resources/templates/researcher/detail.html +++ b/admin/src/main/resources/templates/researcher/detail.html @@ -5,6 +5,14 @@
+ + + + + + + + From fcc1b868b710fb6534d594256d55f08a47a50e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A3=BC=EC=88=98=ED=98=84?= Date: Thu, 26 Jun 2025 10:31:11 +0900 Subject: [PATCH 02/13] =?UTF-8?q?=EC=A1=B0=EC=82=AC=EC=9B=90=20=ED=98=84?= =?UTF-8?q?=ED=99=A9=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/security/AdminAuthSuccessEvent.java | 6 +++--- .../adapters/persistence/UpdateNoticeDao.java | 1 - .../loggedinuser/save/ports/LoggedInUserSavePortIn.java | 8 -------- .../loggedinuser/save/ports/LoggedInUserSavePortOut.java | 8 -------- .../main/resources/mappers/notice/UpdateNoticeMapper.xml | 1 + .../save/adapter/persistence/LoggedInUserSaveDao.java | 6 +++--- .../save/adapter/persistence/LoggedInUserSaveMapper.java | 2 +- .../loggedinuser/save/ports/LoggedInUserSavePortIn.java | 8 ++++++++ .../loggedinuser/save/ports/LoggedInUserSavePortOut.java | 8 ++++++++ .../save/ports/application/LoggedInUserSaveService.java | 8 ++++---- .../ports/application/domain/LoggedInUserIdSaveCmd.java | 8 ++------ .../ports/application/domain/LoggedInUserSaveCmd.java | 9 +++------ .../uicode/view/adapters/persistence/UICodeViewDao.java | 1 - .../mappers/loggedinuser/LoggedInUserSaveMapper.xml | 2 +- 14 files changed, 34 insertions(+), 42 deletions(-) delete mode 100644 admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/LoggedInUserSavePortIn.java delete mode 100644 admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/LoggedInUserSavePortOut.java rename {admin/src/main/java/app/module/admin => core/src/main/java/app/module/core}/usecase/loggedinuser/save/adapter/persistence/LoggedInUserSaveDao.java (73%) rename {admin/src/main/java/app/module/admin => core/src/main/java/app/module/core}/usecase/loggedinuser/save/adapter/persistence/LoggedInUserSaveMapper.java (78%) create mode 100644 core/src/main/java/app/module/core/usecase/loggedinuser/save/ports/LoggedInUserSavePortIn.java create mode 100644 core/src/main/java/app/module/core/usecase/loggedinuser/save/ports/LoggedInUserSavePortOut.java rename {admin/src/main/java/app/module/admin => core/src/main/java/app/module/core}/usecase/loggedinuser/save/ports/application/LoggedInUserSaveService.java (53%) rename {admin/src/main/java/app/module/admin => core/src/main/java/app/module/core}/usecase/loggedinuser/save/ports/application/domain/LoggedInUserIdSaveCmd.java (50%) rename {admin/src/main/java/app/module/admin => core/src/main/java/app/module/core}/usecase/loggedinuser/save/ports/application/domain/LoggedInUserSaveCmd.java (54%) rename {admin => core}/src/main/resources/mappers/loggedinuser/LoggedInUserSaveMapper.xml (89%) diff --git a/admin/src/main/java/app/module/admin/config/application/security/AdminAuthSuccessEvent.java b/admin/src/main/java/app/module/admin/config/application/security/AdminAuthSuccessEvent.java index c308fcdb..61c61a2b 100644 --- a/admin/src/main/java/app/module/admin/config/application/security/AdminAuthSuccessEvent.java +++ b/admin/src/main/java/app/module/admin/config/application/security/AdminAuthSuccessEvent.java @@ -1,8 +1,8 @@ package app.module.admin.config.application.security; -import app.module.admin.usecase.loggedinuser.save.ports.LoggedInUserSavePortIn; -import app.module.admin.usecase.loggedinuser.save.ports.application.domain.LoggedInUserIdSaveCmd; -import app.module.admin.usecase.loggedinuser.save.ports.application.domain.LoggedInUserSaveCmd; +import app.module.core.usecase.loggedinuser.save.ports.LoggedInUserSavePortIn; +import app.module.core.usecase.loggedinuser.save.ports.application.domain.LoggedInUserIdSaveCmd; +import app.module.core.usecase.loggedinuser.save.ports.application.domain.LoggedInUserSaveCmd; import app.module.core.config.application.enums.AppType; import app.module.core.config.application.util.CommonUtil; import app.module.core.config.application.util.MessageUtil; diff --git a/admin/src/main/java/app/module/admin/usecase/communication/notice/updateNotice/adapters/persistence/UpdateNoticeDao.java b/admin/src/main/java/app/module/admin/usecase/communication/notice/updateNotice/adapters/persistence/UpdateNoticeDao.java index f5276435..e4ed8ee0 100644 --- a/admin/src/main/java/app/module/admin/usecase/communication/notice/updateNotice/adapters/persistence/UpdateNoticeDao.java +++ b/admin/src/main/java/app/module/admin/usecase/communication/notice/updateNotice/adapters/persistence/UpdateNoticeDao.java @@ -21,7 +21,6 @@ class UpdateNoticeDao implements UpdateNoticePortOut { @Override public void operate(UpdateNoticeCmd command) { mapper.updateNotice( - new UpdateNoticeDto( command.getId(), command.getTitle(), diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/LoggedInUserSavePortIn.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/LoggedInUserSavePortIn.java deleted file mode 100644 index d410403c..00000000 --- a/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/LoggedInUserSavePortIn.java +++ /dev/null @@ -1,8 +0,0 @@ -package app.module.admin.usecase.loggedinuser.save.ports; - -import app.module.admin.usecase.loggedinuser.save.ports.application.domain.LoggedInUserSaveCmd; - -public interface LoggedInUserSavePortIn { - - void connect(LoggedInUserSaveCmd loggedInUserSaveCmd); -} diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/LoggedInUserSavePortOut.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/LoggedInUserSavePortOut.java deleted file mode 100644 index 8da77957..00000000 --- a/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/LoggedInUserSavePortOut.java +++ /dev/null @@ -1,8 +0,0 @@ -package app.module.admin.usecase.loggedinuser.save.ports; - -import app.module.admin.usecase.loggedinuser.save.ports.application.domain.LoggedInUserSaveCmd; - -public interface LoggedInUserSavePortOut { - - void connect(LoggedInUserSaveCmd loggedInUser); -} diff --git a/admin/src/main/resources/mappers/notice/UpdateNoticeMapper.xml b/admin/src/main/resources/mappers/notice/UpdateNoticeMapper.xml index fa705ec4..974a53f3 100644 --- a/admin/src/main/resources/mappers/notice/UpdateNoticeMapper.xml +++ b/admin/src/main/resources/mappers/notice/UpdateNoticeMapper.xml @@ -42,4 +42,5 @@ WHERE id = #{id} + \ No newline at end of file diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/adapter/persistence/LoggedInUserSaveDao.java b/core/src/main/java/app/module/core/usecase/loggedinuser/save/adapter/persistence/LoggedInUserSaveDao.java similarity index 73% rename from admin/src/main/java/app/module/admin/usecase/loggedinuser/save/adapter/persistence/LoggedInUserSaveDao.java rename to core/src/main/java/app/module/core/usecase/loggedinuser/save/adapter/persistence/LoggedInUserSaveDao.java index 116fa136..9239302a 100644 --- a/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/adapter/persistence/LoggedInUserSaveDao.java +++ b/core/src/main/java/app/module/core/usecase/loggedinuser/save/adapter/persistence/LoggedInUserSaveDao.java @@ -1,7 +1,7 @@ -package app.module.admin.usecase.loggedinuser.save.adapter.persistence; +package app.module.core.usecase.loggedinuser.save.adapter.persistence; -import app.module.admin.usecase.loggedinuser.save.ports.LoggedInUserSavePortOut; -import app.module.admin.usecase.loggedinuser.save.ports.application.domain.LoggedInUserSaveCmd; +import app.module.core.usecase.loggedinuser.save.ports.LoggedInUserSavePortOut; +import app.module.core.usecase.loggedinuser.save.ports.application.domain.LoggedInUserSaveCmd; import app.module.core.config.adapters.persistence.entity.LoggedInUser; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Repository; diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/adapter/persistence/LoggedInUserSaveMapper.java b/core/src/main/java/app/module/core/usecase/loggedinuser/save/adapter/persistence/LoggedInUserSaveMapper.java similarity index 78% rename from admin/src/main/java/app/module/admin/usecase/loggedinuser/save/adapter/persistence/LoggedInUserSaveMapper.java rename to core/src/main/java/app/module/core/usecase/loggedinuser/save/adapter/persistence/LoggedInUserSaveMapper.java index fc3cc9e8..2a8732a4 100644 --- a/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/adapter/persistence/LoggedInUserSaveMapper.java +++ b/core/src/main/java/app/module/core/usecase/loggedinuser/save/adapter/persistence/LoggedInUserSaveMapper.java @@ -1,4 +1,4 @@ -package app.module.admin.usecase.loggedinuser.save.adapter.persistence; +package app.module.core.usecase.loggedinuser.save.adapter.persistence; import app.module.core.config.adapters.persistence.entity.LoggedInUser; import org.apache.ibatis.annotations.Mapper; diff --git a/core/src/main/java/app/module/core/usecase/loggedinuser/save/ports/LoggedInUserSavePortIn.java b/core/src/main/java/app/module/core/usecase/loggedinuser/save/ports/LoggedInUserSavePortIn.java new file mode 100644 index 00000000..8cc8192a --- /dev/null +++ b/core/src/main/java/app/module/core/usecase/loggedinuser/save/ports/LoggedInUserSavePortIn.java @@ -0,0 +1,8 @@ +package app.module.core.usecase.loggedinuser.save.ports; + +import app.module.core.usecase.loggedinuser.save.ports.application.domain.LoggedInUserSaveCmd; + +public interface LoggedInUserSavePortIn { + + void connect(LoggedInUserSaveCmd loggedInUserSaveCmd); +} diff --git a/core/src/main/java/app/module/core/usecase/loggedinuser/save/ports/LoggedInUserSavePortOut.java b/core/src/main/java/app/module/core/usecase/loggedinuser/save/ports/LoggedInUserSavePortOut.java new file mode 100644 index 00000000..0fbd2387 --- /dev/null +++ b/core/src/main/java/app/module/core/usecase/loggedinuser/save/ports/LoggedInUserSavePortOut.java @@ -0,0 +1,8 @@ +package app.module.core.usecase.loggedinuser.save.ports; + +import app.module.core.usecase.loggedinuser.save.ports.application.domain.LoggedInUserSaveCmd; + +public interface LoggedInUserSavePortOut { + + void connect(LoggedInUserSaveCmd loggedInUser); +} diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/application/LoggedInUserSaveService.java b/core/src/main/java/app/module/core/usecase/loggedinuser/save/ports/application/LoggedInUserSaveService.java similarity index 53% rename from admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/application/LoggedInUserSaveService.java rename to core/src/main/java/app/module/core/usecase/loggedinuser/save/ports/application/LoggedInUserSaveService.java index 0dc5b3ec..fbae28c6 100644 --- a/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/application/LoggedInUserSaveService.java +++ b/core/src/main/java/app/module/core/usecase/loggedinuser/save/ports/application/LoggedInUserSaveService.java @@ -1,8 +1,8 @@ -package app.module.admin.usecase.loggedinuser.save.ports.application; +package app.module.core.usecase.loggedinuser.save.ports.application; -import app.module.admin.usecase.loggedinuser.save.ports.LoggedInUserSavePortIn; -import app.module.admin.usecase.loggedinuser.save.ports.LoggedInUserSavePortOut; -import app.module.admin.usecase.loggedinuser.save.ports.application.domain.LoggedInUserSaveCmd; +import app.module.core.usecase.loggedinuser.save.ports.LoggedInUserSavePortIn; +import app.module.core.usecase.loggedinuser.save.ports.LoggedInUserSavePortOut; +import app.module.core.usecase.loggedinuser.save.ports.application.domain.LoggedInUserSaveCmd; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/application/domain/LoggedInUserIdSaveCmd.java b/core/src/main/java/app/module/core/usecase/loggedinuser/save/ports/application/domain/LoggedInUserIdSaveCmd.java similarity index 50% rename from admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/application/domain/LoggedInUserIdSaveCmd.java rename to core/src/main/java/app/module/core/usecase/loggedinuser/save/ports/application/domain/LoggedInUserIdSaveCmd.java index 37b2318b..f8427c5b 100644 --- a/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/application/domain/LoggedInUserIdSaveCmd.java +++ b/core/src/main/java/app/module/core/usecase/loggedinuser/save/ports/application/domain/LoggedInUserIdSaveCmd.java @@ -1,11 +1,7 @@ -package app.module.admin.usecase.loggedinuser.save.ports.application.domain; +package app.module.core.usecase.loggedinuser.save.ports.application.domain; import app.module.core.config.application.enums.AppType; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; +import lombok.*; @Getter @Setter diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/application/domain/LoggedInUserSaveCmd.java b/core/src/main/java/app/module/core/usecase/loggedinuser/save/ports/application/domain/LoggedInUserSaveCmd.java similarity index 54% rename from admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/application/domain/LoggedInUserSaveCmd.java rename to core/src/main/java/app/module/core/usecase/loggedinuser/save/ports/application/domain/LoggedInUserSaveCmd.java index b18198bd..56e473fd 100644 --- a/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/application/domain/LoggedInUserSaveCmd.java +++ b/core/src/main/java/app/module/core/usecase/loggedinuser/save/ports/application/domain/LoggedInUserSaveCmd.java @@ -1,11 +1,8 @@ -package app.module.admin.usecase.loggedinuser.save.ports.application.domain; +package app.module.core.usecase.loggedinuser.save.ports.application.domain; + +import lombok.*; import java.time.LocalDateTime; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; @Builder @Getter diff --git a/core/src/main/java/app/module/core/usecase/uicode/view/adapters/persistence/UICodeViewDao.java b/core/src/main/java/app/module/core/usecase/uicode/view/adapters/persistence/UICodeViewDao.java index 526af2eb..41523801 100644 --- a/core/src/main/java/app/module/core/usecase/uicode/view/adapters/persistence/UICodeViewDao.java +++ b/core/src/main/java/app/module/core/usecase/uicode/view/adapters/persistence/UICodeViewDao.java @@ -1,6 +1,5 @@ package app.module.core.usecase.uicode.view.adapters.persistence; -import app.module.core.config.adapters.persistence.repository.UICodeRepo; import app.module.core.usecase.uicode.view.ports.UICodeViewPortOut; import app.module.core.usecase.uicode.view.ports.application.domain.UICodeView; import lombok.RequiredArgsConstructor; diff --git a/admin/src/main/resources/mappers/loggedinuser/LoggedInUserSaveMapper.xml b/core/src/main/resources/mappers/loggedinuser/LoggedInUserSaveMapper.xml similarity index 89% rename from admin/src/main/resources/mappers/loggedinuser/LoggedInUserSaveMapper.xml rename to core/src/main/resources/mappers/loggedinuser/LoggedInUserSaveMapper.xml index a21fd09b..655bafe3 100644 --- a/admin/src/main/resources/mappers/loggedinuser/LoggedInUserSaveMapper.xml +++ b/core/src/main/resources/mappers/loggedinuser/LoggedInUserSaveMapper.xml @@ -2,7 +2,7 @@ + namespace="app.module.core.usecase.loggedinuser.save.adapter.persistence.LoggedInUserSaveMapper"> INSERT INTO logged_in_user From 063c9018e421f4ae8726f527b6568318f6533436 Mon Sep 17 00:00:00 2001 From: kangsunlee Date: Thu, 26 Jun 2025 11:19:36 +0900 Subject: [PATCH 03/13] =?UTF-8?q?[BO]=20=EC=9E=84=EA=B0=80=ED=98=84?= =?UTF-8?q?=ED=99=A9=20-=20=EA=B2=80=EC=83=89=20=EC=88=98=EC=A0=95,=20?= =?UTF-8?q?=EC=A1=B0=EC=82=AC=EC=9B=90=ED=98=84=ED=99=A9=20-=20=EC=9E=84?= =?UTF-8?q?=EA=B0=80=EC=83=81=EC=84=B8=EB=A1=9C=20=EC=9D=B4=EB=8F=99=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../household/GetHouseholdsStatusMapper.xml | 16 ++++++++++++++-- .../resources/templates/researcher/detail.html | 7 ++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/admin/src/main/resources/mappers/household/GetHouseholdsStatusMapper.xml b/admin/src/main/resources/mappers/household/GetHouseholdsStatusMapper.xml index 7c7dff51..270c1f79 100644 --- a/admin/src/main/resources/mappers/household/GetHouseholdsStatusMapper.xml +++ b/admin/src/main/resources/mappers/household/GetHouseholdsStatusMapper.xml @@ -83,9 +83,15 @@ 1=1 - + /* 경영주 검색 */ + + AND ( + hvr.householdName ILIKE '%' || #{cmd.ownerValue} || '%' + OR hvr.householdPhone ILIKE '%' || #{cmd.ownerValue} || '%' + ) + AND hvr.householdName ILIKE '%' || #{cmd.ownerValue} || '%' @@ -95,9 +101,15 @@ - + /* 조사원 검색 */ + + AND ( + hvr.researcherName ILIKE '%' || #{cmd.researcherValue} || '%' + OR hvr.researcherPhone ILIKE '%' || #{cmd.researcherValue} || '%' + ) + AND hvr.researcherName ILIKE '%' || #{cmd.researcherValue} || '%' diff --git a/admin/src/main/resources/templates/researcher/detail.html b/admin/src/main/resources/templates/researcher/detail.html index c920931a..6c7a201f 100644 --- a/admin/src/main/resources/templates/researcher/detail.html +++ b/admin/src/main/resources/templates/researcher/detail.html @@ -42,6 +42,8 @@
+ +
@@ -218,8 +220,8 @@ tbody.append( `
- - + + @@ -231,7 +233,6 @@ ` ); }); - // TODO 임가번호 OR 경영주명 선택시 임가현황 상세화면으로 이동 if (!$(response.content).length) { tbody.append(` From 34f97cee240b09febcb548ba299b5a5ce9f4d6e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A3=BC=EC=88=98=ED=98=84?= Date: Thu, 26 Jun 2025 12:03:08 +0900 Subject: [PATCH 04/13] =?UTF-8?q?=ED=94=84=EB=A1=A0=ED=8A=B8=20=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=EC=9D=B8=20=EC=9D=B4=EB=A0=A5=20=EC=8C=93=EA=B8=B0=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../security/FrontAuthSuccessEvent.java | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 front/src/main/java/app/module/front/config/application/security/FrontAuthSuccessEvent.java diff --git a/front/src/main/java/app/module/front/config/application/security/FrontAuthSuccessEvent.java b/front/src/main/java/app/module/front/config/application/security/FrontAuthSuccessEvent.java new file mode 100644 index 00000000..721c451c --- /dev/null +++ b/front/src/main/java/app/module/front/config/application/security/FrontAuthSuccessEvent.java @@ -0,0 +1,56 @@ +package app.module.front.config.application.security; + +import app.module.core.config.application.enums.AppType; +import app.module.core.config.application.util.CommonUtil; +import app.module.core.usecase.loggedinuser.save.ports.LoggedInUserSavePortIn; +import app.module.core.usecase.loggedinuser.save.ports.application.domain.LoggedInUserIdSaveCmd; +import app.module.core.usecase.loggedinuser.save.ports.application.domain.LoggedInUserSaveCmd; +import jakarta.servlet.http.HttpServletRequest; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.event.EventListener; +import org.springframework.security.authentication.event.AbstractAuthenticationFailureEvent; +import org.springframework.security.authentication.event.AuthenticationSuccessEvent; +import org.springframework.security.core.Authentication; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import java.time.LocalDateTime; + +@Component +@RequiredArgsConstructor +@Slf4j +public class FrontAuthSuccessEvent { + + private final LoggedInUserSavePortIn loggedInUserSavePortIn; + + + @EventListener + public void handleAuthenticationSuccessEvent(AuthenticationSuccessEvent event) { + Authentication authentication = event.getAuthentication(); + FrontHouseholdUser householdUser = (FrontHouseholdUser) authentication.getPrincipal(); + + HttpServletRequest request = + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + // 로그인 이력 쌓기 + loggedInUserSavePortIn.connect( + LoggedInUserSaveCmd.builder() + .loggedInUserId( + LoggedInUserIdSaveCmd.builder() + .appType(AppType.FRONT) + .id(authentication.getName()) + .build()) + .clientIP(CommonUtil.getClientIP(request)) + .lastLoggedInAt(LocalDateTime.now()) + .build()); + + } + + @EventListener + public void handleAuthenticationFailureEvent(AbstractAuthenticationFailureEvent event) { + Exception e = event.getException(); + Authentication authentication = event.getAuthentication(); + log.warn("Unsuccessful authentication result: {}", authentication, e); + } +} From 6b54f605c8ed5d5605ee5a763e5ec7928d539cec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A3=BC=EC=88=98=ED=98=84?= Date: Thu, 26 Jun 2025 13:33:57 +0900 Subject: [PATCH 05/13] =?UTF-8?q?=EA=B3=B5=EC=8B=9D=EA=B0=80=EC=9E=85?= =?UTF-8?q?=EC=84=BC=ED=84=B0=20=EB=B0=94=EB=A1=9C=EA=B0=80=EA=B8=B0=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/src/main/resources/templates/security/login.html | 3 --- 1 file changed, 3 deletions(-) diff --git a/admin/src/main/resources/templates/security/login.html b/admin/src/main/resources/templates/security/login.html index 6cde9987..0c6104a7 100644 --- a/admin/src/main/resources/templates/security/login.html +++ b/admin/src/main/resources/templates/security/login.html @@ -40,9 +40,6 @@ 로그인 -
    From 1f689376de48470a37a914544de185347254fe10 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 13:49:24 +0900 Subject: [PATCH 06/13] =?UTF-8?q?[BO]=20=EC=9D=BC=EA=B3=84=EB=B6=80=20?= =?UTF-8?q?=EB=93=B1=EB=A1=9D=20=ED=98=84=ED=99=A9=EC=9D=98=20=EA=B8=88?= =?UTF-8?q?=EC=9D=BC=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=97=86=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/GetDailyRecordsStatus.java | 1 + .../persistence/UpdateDailyNoneDao.java | 47 ++++ .../persistence/UpdateDailyNoneMapper.java | 51 ++++ .../web/UpdateDailyNoneController.java | 27 ++ .../web/modal/UpdateDailyNoneReqVO.java | 24 ++ .../ports/UpdateDailyNonePortIn.java | 12 + .../ports/UpdateDailyNonePortOut.java | 12 + .../application/UpdateDailyNoneService.java | 33 +++ .../domain/UpdateDailyNoneCmd.java | 30 +++ .../household/GetDailyRecordsStatusMapper.xml | 1 + .../household/UpdateDailyNoneMapper.xml | 68 +++++ .../households/tab/daily-record.html | 240 +++++++++++++++--- .../persistence/component/AuditCommand.java | 2 + .../adapters/persistence/DailyRecordDao.java | 5 + .../daily/record/ports/DailyRecordPortIn.java | 6 +- .../domain/UpdateDailyRecordStatusCmd.java | 9 + .../mappers/daily/DailyRecordMapper.xml | 1 - .../adapters/web/DailyRecordController.java | 1 - 18 files changed, 537 insertions(+), 33 deletions(-) create mode 100644 admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/adapters/persistence/UpdateDailyNoneDao.java create mode 100644 admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/adapters/persistence/UpdateDailyNoneMapper.java create mode 100644 admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/adapters/web/UpdateDailyNoneController.java create mode 100644 admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/adapters/web/modal/UpdateDailyNoneReqVO.java create mode 100644 admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/ports/UpdateDailyNonePortIn.java create mode 100644 admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/ports/UpdateDailyNonePortOut.java create mode 100644 admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/ports/application/UpdateDailyNoneService.java create mode 100644 admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/ports/application/domain/UpdateDailyNoneCmd.java create mode 100644 admin/src/main/resources/mappers/household/UpdateDailyNoneMapper.xml diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/getDailyRecordsStatus/ports/application/domain/GetDailyRecordsStatus.java b/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/getDailyRecordsStatus/ports/application/domain/GetDailyRecordsStatus.java index 4ca9f925..1b6f419a 100644 --- a/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/getDailyRecordsStatus/ports/application/domain/GetDailyRecordsStatus.java +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/getDailyRecordsStatus/ports/application/domain/GetDailyRecordsStatus.java @@ -11,6 +11,7 @@ import lombok.Setter; @EqualsAndHashCode public class GetDailyRecordsStatus { private Long id; + private Integer dayGroupNo; private String dayGroup; private RecordStatusType allStatusType; private String incomeStatus; diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/adapters/persistence/UpdateDailyNoneDao.java b/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/adapters/persistence/UpdateDailyNoneDao.java new file mode 100644 index 00000000..3a3fc5c5 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/adapters/persistence/UpdateDailyNoneDao.java @@ -0,0 +1,47 @@ +package app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.adapters.persistence; + +import app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports.UpdateDailyNonePortOut; +import app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports.application.domain.UpdateDailyNoneCmd; +import app.module.core.config.application.enums.DailySort; +import app.module.core.config.application.enums.DailyTargetStatus; +import app.module.core.usecase.daily.record.ports.DailyRecordPortIn; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Repository; + +@Slf4j +@Repository +@RequiredArgsConstructor +class UpdateDailyNoneDao implements UpdateDailyNonePortOut { + private final UpdateDailyNoneMapper mapper; + private final DailyRecordPortIn dailyRecordPortIn; + + @Override + public void create(UpdateDailyNoneCmd command) { + command.setDailyRecordSeq(mapper.getDailyRecordSeq(command)); + + if (command.getCurrentStep() != null) { + if (DailyTargetStatus.TODAY_NONE.equals(command.getCurrentStatus())) { + // 등록된 데이터 일괄 삭제 + if (DailySort.INCOME.equals(command.getCurrentStep())) { + mapper.removeDailyIncome(command); + } else if (DailySort.WORK.equals(command.getCurrentStep())) { + mapper.removeDailyWork(command); + } else if (DailySort.EXPENSE.equals(command.getCurrentStep())) { + mapper.removeDailyExpense(command); + } else if (DailySort.POWER.equals(command.getCurrentStep())) { + mapper.removeDailyPower(command); + } else if (DailySort.FORESTRY.equals(command.getCurrentStep())) { + mapper.removeDailyForestry(command); + } else if (DailySort.FARMING.equals(command.getCurrentStep())) { + mapper.removeDailyFarming(command); + } + } + + dailyRecordPortIn.updateByStatus(command.getSearchMonth(), command.getGroupNo(), command.getHouseholdSeq(), command.getCurrentStep().name(), command.getCurrentStatus().name()); + + } else { + log.error("[CreateDailyNone] Current step is null. cmd:{}", command); + } + } +} \ No newline at end of file diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/adapters/persistence/UpdateDailyNoneMapper.java b/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/adapters/persistence/UpdateDailyNoneMapper.java new file mode 100644 index 00000000..54d4bd4e --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/adapters/persistence/UpdateDailyNoneMapper.java @@ -0,0 +1,51 @@ +package app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.adapters.persistence; + +import app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports.application.domain.UpdateDailyNoneCmd; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface UpdateDailyNoneMapper { + /** + * 일계부 항목 일련번호 조회 + * + * @param command 검색 조건 + * @return 일계부 항목 일련번호 + */ + Long getDailyRecordSeq(UpdateDailyNoneCmd command); + + /** + * 특정일의 수입 전체 삭제 + * @param command 검색 조건 + */ + void removeDailyIncome(UpdateDailyNoneCmd command); + + /** + * 특정일의 임업노동 투입 전체 삭제 + * @param command 검색 조건 + */ + void removeDailyWork(UpdateDailyNoneCmd command); + + /** + * 특정일의 지출 전체 삭제 + * @param command 검색 조건 + */ + void removeDailyExpense(UpdateDailyNoneCmd command); + + /** + * 동력 사용시간 전체 삭제 + * @param command 검색 조건 + */ + void removeDailyPower(UpdateDailyNoneCmd command); + + /** + * 자가임업 생산물 중 자가소비량 전체 삭제 + * @param command 검색 조건 + */ + void removeDailyForestry(UpdateDailyNoneCmd command); + + /** + * 자가농업 생산물 중 자가소비량 전체 삭제 + * @param command 검색 조건 + */ + void removeDailyFarming(UpdateDailyNoneCmd command); +} diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/adapters/web/UpdateDailyNoneController.java b/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/adapters/web/UpdateDailyNoneController.java new file mode 100644 index 00000000..1ca788d5 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/adapters/web/UpdateDailyNoneController.java @@ -0,0 +1,27 @@ +package app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.adapters.web; + +import app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.adapters.web.modal.UpdateDailyNoneReqVO; +import app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports.UpdateDailyNonePortIn; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@Slf4j +@RestController +@RequiredArgsConstructor +class UpdateDailyNoneController { + private final UpdateDailyNonePortIn updateDailyNonePortIn; + + @PostMapping(path = "/api/household/daily/today-none") + ResponseEntity create(@RequestBody UpdateDailyNoneReqVO formVO) { + log.debug("formVO: {}", formVO); + + updateDailyNonePortIn.create(formVO); + + return ResponseEntity.status(HttpStatus.OK).body(formVO); + } +} \ No newline at end of file diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/adapters/web/modal/UpdateDailyNoneReqVO.java b/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/adapters/web/modal/UpdateDailyNoneReqVO.java new file mode 100644 index 00000000..2d66431c --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/adapters/web/modal/UpdateDailyNoneReqVO.java @@ -0,0 +1,24 @@ +package app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.adapters.web.modal; + +import app.module.core.config.application.enums.DailySort; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +@Getter +@Setter +@ToString +public class UpdateDailyNoneReqVO { + private String recordMonth; + private Integer groupNo; + private Long householdSeq; + + /** + * 현재 단계 + */ + private DailySort currentStep; + /** + * 금일 데이터 없음 여부 (Y/N) + */ + private String todayNone; +} diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/ports/UpdateDailyNonePortIn.java b/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/ports/UpdateDailyNonePortIn.java new file mode 100644 index 00000000..9576ded4 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/ports/UpdateDailyNonePortIn.java @@ -0,0 +1,12 @@ +package app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports; + +import app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.adapters.web.modal.UpdateDailyNoneReqVO; + +public interface UpdateDailyNonePortIn { + /** + * 일계부 금일 데이터 없음 등록 + * + * @param formVO 입력 데이터 + */ + void create(UpdateDailyNoneReqVO formVO); +} diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/ports/UpdateDailyNonePortOut.java b/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/ports/UpdateDailyNonePortOut.java new file mode 100644 index 00000000..79a21f7b --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/ports/UpdateDailyNonePortOut.java @@ -0,0 +1,12 @@ +package app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports; + +import app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports.application.domain.UpdateDailyNoneCmd; + +public interface UpdateDailyNonePortOut { + /** + * 일계부 금일 데이터 없음 등록 + * + * @param command 입력 데이터 + */ + void create(UpdateDailyNoneCmd command); +} diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/ports/application/UpdateDailyNoneService.java b/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/ports/application/UpdateDailyNoneService.java new file mode 100644 index 00000000..f8a953fa --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/ports/application/UpdateDailyNoneService.java @@ -0,0 +1,33 @@ +package app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports.application; + +import app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.adapters.web.modal.UpdateDailyNoneReqVO; +import app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports.UpdateDailyNonePortIn; +import app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports.UpdateDailyNonePortOut; +import app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports.application.domain.UpdateDailyNoneCmd; +import app.module.core.config.application.enums.DailyTargetStatus; +import app.module.core.config.application.util.AuditUtil; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor +public class UpdateDailyNoneService implements UpdateDailyNonePortIn { + private final UpdateDailyNonePortOut portOut; + + @Override + public void create(UpdateDailyNoneReqVO formVO) { + DailyTargetStatus currentStatus = "Y".equals(formVO.getTodayNone()) ? DailyTargetStatus.TODAY_NONE : DailyTargetStatus.TARGET; + + UpdateDailyNoneCmd command = AuditUtil.update( + new UpdateDailyNoneCmd( + formVO.getRecordMonth(), + formVO.getGroupNo(), + formVO.getHouseholdSeq(), + formVO.getCurrentStep(), + currentStatus, + null) + ); + + portOut.create(command); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/ports/application/domain/UpdateDailyNoneCmd.java b/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/ports/application/domain/UpdateDailyNoneCmd.java new file mode 100644 index 00000000..2f509722 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/dailyRecord/updateDailyNone/ports/application/domain/UpdateDailyNoneCmd.java @@ -0,0 +1,30 @@ +package app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports.application.domain; + +import app.module.core.config.adapters.persistence.component.AuditCommand; +import app.module.core.config.application.enums.DailySort; +import app.module.core.config.application.enums.DailyTargetStatus; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class UpdateDailyNoneCmd extends AuditCommand { + private String searchMonth; + private Integer groupNo; + private Long householdSeq; + + /** + * 현재 단계 + */ + private DailySort currentStep; + /** + * 현재 입력상태 + */ + private DailyTargetStatus currentStatus; + /** + * 일계부 항목 일련번호 + */ + private Long dailyRecordSeq; +} diff --git a/admin/src/main/resources/mappers/household/GetDailyRecordsStatusMapper.xml b/admin/src/main/resources/mappers/household/GetDailyRecordsStatusMapper.xml index 67e8b6a4..d5aa2325 100644 --- a/admin/src/main/resources/mappers/household/GetDailyRecordsStatusMapper.xml +++ b/admin/src/main/resources/mappers/household/GetDailyRecordsStatusMapper.xml @@ -34,6 +34,7 @@ ) SELECT dr.id AS id, + ddg.group_no AS day_group_no, /* 해당 월의 말일을 기준으로 종료일을 제한하여 일자 그룹 표시 */ ddg.start_day || CASE diff --git a/admin/src/main/resources/mappers/household/UpdateDailyNoneMapper.xml b/admin/src/main/resources/mappers/household/UpdateDailyNoneMapper.xml new file mode 100644 index 00000000..c6257320 --- /dev/null +++ b/admin/src/main/resources/mappers/household/UpdateDailyNoneMapper.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/admin/src/main/resources/templates/households/tab/daily-record.html b/admin/src/main/resources/templates/households/tab/daily-record.html index ef1dfb18..faf8afe0 100644 --- a/admin/src/main/resources/templates/households/tab/daily-record.html +++ b/admin/src/main/resources/templates/households/tab/daily-record.html @@ -4,6 +4,10 @@
    + + + +
    @@ -11,23 +15,23 @@
    • 작성완료

      - 6건 + 0건
    • 미작성

      - 6건 + 0건
    • 미완료

      - 6건 + 0건
    • 대기

      - 6건 + 0건
    • 완료율

      - 56.12% + 0%
    @@ -53,8 +57,21 @@
    -
      @@ -145,7 +145,7 @@
    - 원 diff --git a/front/src/main/resources/templates/info/monthly/form.html b/front/src/main/resources/templates/info/monthly/form.html index 9fa49dfe..201d76f4 100644 --- a/front/src/main/resources/templates/info/monthly/form.html +++ b/front/src/main/resources/templates/info/monthly/form.html @@ -62,7 +62,7 @@
    @@ -96,7 +96,7 @@
      @@ -117,7 +117,7 @@
    @@ -176,7 +176,7 @@
    @@ -235,7 +235,7 @@
    @@ -294,7 +294,7 @@
    diff --git a/front/src/main/resources/templates/info/user/user.html b/front/src/main/resources/templates/info/user/user.html index f8ed1474..61f3b182 100644 --- a/front/src/main/resources/templates/info/user/user.html +++ b/front/src/main/resources/templates/info/user/user.html @@ -85,13 +85,13 @@
    -
    -
    @@ -113,13 +113,13 @@
    -
    -
    diff --git a/front/src/main/resources/templates/record/expense/form.html b/front/src/main/resources/templates/record/expense/form.html index a17be087..a357fb6b 100644 --- a/front/src/main/resources/templates/record/expense/form.html +++ b/front/src/main/resources/templates/record/expense/form.html @@ -79,7 +79,7 @@
    -
      @@ -134,7 +134,7 @@
      - 원
      @@ -151,7 +151,7 @@
      - 원
      diff --git a/front/src/main/resources/templates/record/farming/form.html b/front/src/main/resources/templates/record/farming/form.html index c14ba8ab..cddd721a 100644 --- a/front/src/main/resources/templates/record/farming/form.html +++ b/front/src/main/resources/templates/record/farming/form.html @@ -66,7 +66,7 @@
      -
        @@ -121,7 +121,7 @@
        - 원
        diff --git a/front/src/main/resources/templates/record/forestry/form.html b/front/src/main/resources/templates/record/forestry/form.html index 0596d1a4..132578f4 100644 --- a/front/src/main/resources/templates/record/forestry/form.html +++ b/front/src/main/resources/templates/record/forestry/form.html @@ -41,7 +41,7 @@
        -
          @@ -96,7 +96,7 @@
          - 원
          diff --git a/front/src/main/resources/templates/record/income/form.html b/front/src/main/resources/templates/record/income/form.html index a04258ff..2a0959f9 100644 --- a/front/src/main/resources/templates/record/income/form.html +++ b/front/src/main/resources/templates/record/income/form.html @@ -109,7 +109,7 @@
          -
            @@ -164,7 +164,7 @@
            - 원
            @@ -181,7 +181,7 @@
            - 원
            diff --git a/front/src/main/resources/templates/record/power/form.html b/front/src/main/resources/templates/record/power/form.html index 5adb16cd..c81c81ad 100644 --- a/front/src/main/resources/templates/record/power/form.html +++ b/front/src/main/resources/templates/record/power/form.html @@ -45,7 +45,7 @@
            - 시간
            @@ -58,7 +58,7 @@
            - 시간
            diff --git a/front/src/main/resources/templates/record/work/form.html b/front/src/main/resources/templates/record/work/form.html index d83cbc1e..2822b89f 100644 --- a/front/src/main/resources/templates/record/work/form.html +++ b/front/src/main/resources/templates/record/work/form.html @@ -51,7 +51,7 @@
            -
              @@ -108,7 +108,7 @@
              -
              @@ -173,7 +173,7 @@
              - 시간
              @@ -186,7 +186,7 @@
              - 시간
              @@ -201,7 +201,7 @@
              남 - 시간
              @@ -209,7 +209,7 @@
              여 - 시간
              @@ -226,7 +226,7 @@
              남 - 시간
              @@ -234,7 +234,7 @@
              여 - 시간
              @@ -251,7 +251,7 @@
              남 - 시간
              @@ -259,7 +259,7 @@
              여 - 시간
              @@ -276,7 +276,7 @@
              남 - 시간
              @@ -284,7 +284,7 @@
              여 - 시간
              From f1aad02b70abd9b0ce582a673a79cc4e5df582bb Mon Sep 17 00:00:00 2001 From: kangsunlee Date: Thu, 26 Jun 2025 14:24:12 +0900 Subject: [PATCH 08/13] =?UTF-8?q?[BO]=20=EC=9E=84=EC=82=B0=EB=AC=BC?= =?UTF-8?q?=ED=98=84=ED=99=A9=20=EB=93=B1=EB=A1=9D=20=EC=9E=91=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GetForestProductsStatusDao.java | 3 +- .../GetForestProductsStatusMapper.java | 3 +- .../domain/GetForestProductsStatusResult.java | 2 +- .../GetMonthlyForestProductsStatus.java | 15 ++++ .../persistence/SaveForestProductDao.java | 24 +++++ .../persistence/SaveForestProductMapper.java | 10 +++ .../web/SaveForestProductController.java | 61 +++++++++++++ .../web/model/SaveForestProductReqVO.java | 37 ++++++++ .../web/model/SaveForestProductResVO.java | 14 +++ .../validator/SaveForestProductValidator.java | 25 ++++++ .../ports/SaveForestProductPortIn.java | 7 ++ .../ports/SaveForestProductPortOut.java | 7 ++ .../application/SaveForestProductService.java | 18 ++++ .../domain/SaveForestProductCmd.java | 35 ++++++++ .../web/SaveHouseholdVisitInfoController.java | 2 +- .../GetForestProductsStatusMapper.xml | 5 +- .../household/SaveForestProductMapper.xml | 88 +++++++++++++++++++ .../modal/modal-forest-product.html | 58 +++++++++--- .../households/modal/modal-visit-info.html | 2 +- .../households/tab/forest-product.html | 7 +- .../resources/templates/households/{seq}.html | 3 - 21 files changed, 401 insertions(+), 25 deletions(-) create mode 100644 admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/getForestProductsStatus/ports/application/domain/GetMonthlyForestProductsStatus.java create mode 100644 admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/persistence/SaveForestProductDao.java create mode 100644 admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/persistence/SaveForestProductMapper.java create mode 100644 admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/web/SaveForestProductController.java create mode 100644 admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/web/model/SaveForestProductReqVO.java create mode 100644 admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/web/model/SaveForestProductResVO.java create mode 100644 admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/web/validator/SaveForestProductValidator.java create mode 100644 admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/ports/SaveForestProductPortIn.java create mode 100644 admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/ports/SaveForestProductPortOut.java create mode 100644 admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/ports/application/SaveForestProductService.java create mode 100644 admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/ports/application/domain/SaveForestProductCmd.java create mode 100644 admin/src/main/resources/mappers/household/SaveForestProductMapper.xml diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/getForestProductsStatus/adapters/persistence/GetForestProductsStatusDao.java b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/getForestProductsStatus/adapters/persistence/GetForestProductsStatusDao.java index 5f327c74..e3951a04 100644 --- a/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/getForestProductsStatus/adapters/persistence/GetForestProductsStatusDao.java +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/getForestProductsStatus/adapters/persistence/GetForestProductsStatusDao.java @@ -4,6 +4,7 @@ import app.module.admin.usecase.household.tab.forestProduct.getForestProductsSta import app.module.admin.usecase.household.tab.forestProduct.getForestProductsStatus.ports.application.domain.GetForestProductsStatus; import app.module.admin.usecase.household.tab.forestProduct.getForestProductsStatus.ports.application.domain.GetForestProductsStatusCmd; import app.module.admin.usecase.household.tab.forestProduct.getForestProductsStatus.ports.application.domain.GetForestProductsStatusResult; +import app.module.admin.usecase.household.tab.forestProduct.getForestProductsStatus.ports.application.domain.GetMonthlyForestProductsStatus; import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Repository; @@ -17,7 +18,7 @@ class GetForestProductsStatusDao implements GetForestProductsStatusPortOut { public GetForestProductsStatusResult operate(GetForestProductsStatusCmd cmd) { // 임산물 등록 상태 조회 - String monthlyStatus = mapper.getMonthlyStatus(cmd); + GetMonthlyForestProductsStatus monthlyStatus = mapper.getMonthlyStatus(cmd); // 임산물 목록 조회 List forestProducts = mapper.getForestProductsStatus(cmd); diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/getForestProductsStatus/adapters/persistence/GetForestProductsStatusMapper.java b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/getForestProductsStatus/adapters/persistence/GetForestProductsStatusMapper.java index 87fb4f25..aeec235d 100644 --- a/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/getForestProductsStatus/adapters/persistence/GetForestProductsStatusMapper.java +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/getForestProductsStatus/adapters/persistence/GetForestProductsStatusMapper.java @@ -2,11 +2,12 @@ package app.module.admin.usecase.household.tab.forestProduct.getForestProductsSt import app.module.admin.usecase.household.tab.forestProduct.getForestProductsStatus.ports.application.domain.GetForestProductsStatus; import app.module.admin.usecase.household.tab.forestProduct.getForestProductsStatus.ports.application.domain.GetForestProductsStatusCmd; +import app.module.admin.usecase.household.tab.forestProduct.getForestProductsStatus.ports.application.domain.GetMonthlyForestProductsStatus; import java.util.List; import org.apache.ibatis.annotations.Mapper; @Mapper public interface GetForestProductsStatusMapper { - String getMonthlyStatus(GetForestProductsStatusCmd cmd); + GetMonthlyForestProductsStatus getMonthlyStatus(GetForestProductsStatusCmd cmd); List getForestProductsStatus(GetForestProductsStatusCmd cmd); } diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/getForestProductsStatus/ports/application/domain/GetForestProductsStatusResult.java b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/getForestProductsStatus/ports/application/domain/GetForestProductsStatusResult.java index 873bc0ff..54c89130 100644 --- a/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/getForestProductsStatus/ports/application/domain/GetForestProductsStatusResult.java +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/getForestProductsStatus/ports/application/domain/GetForestProductsStatusResult.java @@ -11,6 +11,6 @@ import lombok.Setter; @AllArgsConstructor @EqualsAndHashCode public class GetForestProductsStatusResult { - private String monthlyStatus; + private GetMonthlyForestProductsStatus monthlyStatus; private List forestProducts; } diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/getForestProductsStatus/ports/application/domain/GetMonthlyForestProductsStatus.java b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/getForestProductsStatus/ports/application/domain/GetMonthlyForestProductsStatus.java new file mode 100644 index 00000000..1174e369 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/getForestProductsStatus/ports/application/domain/GetMonthlyForestProductsStatus.java @@ -0,0 +1,15 @@ +package app.module.admin.usecase.household.tab.forestProduct.getForestProductsStatus.ports.application.domain; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class GetMonthlyForestProductsStatus { + private Long id; + private String forestStatus; +} diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/persistence/SaveForestProductDao.java b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/persistence/SaveForestProductDao.java new file mode 100644 index 00000000..28b77e34 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/persistence/SaveForestProductDao.java @@ -0,0 +1,24 @@ +package app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.adapters.persistence; + +import app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.ports.SaveForestProductPortOut; +import app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.ports.application.domain.SaveForestProductCmd; +import app.module.core.config.application.util.AuditUtil; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Repository; +import org.springframework.transaction.annotation.Transactional; + +@Repository +@RequiredArgsConstructor +class SaveForestProductDao implements SaveForestProductPortOut { + private final SaveForestProductMapper mapper; + + @Override + @Transactional + public void operate(SaveForestProductCmd inCmd) { + if (inCmd.getForestProductId() == null) { + mapper.createForestProduct(AuditUtil.create(inCmd)); + } else { + mapper.updateForestProduct(AuditUtil.update(inCmd)); + } + } +} \ No newline at end of file diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/persistence/SaveForestProductMapper.java b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/persistence/SaveForestProductMapper.java new file mode 100644 index 00000000..95eb3adf --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/persistence/SaveForestProductMapper.java @@ -0,0 +1,10 @@ +package app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.adapters.persistence; + +import app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.ports.application.domain.SaveForestProductCmd; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface SaveForestProductMapper { + void createForestProduct(SaveForestProductCmd cmd); + void updateForestProduct(SaveForestProductCmd cmd); +} diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/web/SaveForestProductController.java b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/web/SaveForestProductController.java new file mode 100644 index 00000000..6076b034 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/web/SaveForestProductController.java @@ -0,0 +1,61 @@ +package app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.adapters.web; + +import app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.ports.SaveForestProductPortIn; +import app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.ports.application.domain.SaveForestProductCmd; +import app.module.core.config.application.util.MessageUtil; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.validation.BindingResult; +import app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.adapters.web.model.SaveForestProductReqVO; +import app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.adapters.web.model.SaveForestProductResVO; +import app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.adapters.web.validator.SaveForestProductValidator; + +@RestController +@RequiredArgsConstructor +class SaveForestProductController { + private final SaveForestProductValidator validator; + private final SaveForestProductPortIn portIn; + private final MessageUtil messageUtil; + + @PostMapping(path = "/api/forestProduct/save") + ResponseEntity operate(@Valid @RequestBody SaveForestProductReqVO reqVO, + BindingResult bindingResult) { + validator.validate(reqVO, bindingResult); + if (bindingResult.hasErrors()) { + return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY) + .body(bindingResult.getFieldErrors()); + } + + portIn.operate(new SaveForestProductCmd( + reqVO.getForestProductId(), + reqVO.getHouseholdSeq(), + reqVO.getMonthlyInputStatusId(), + reqVO.getRecordMonth(), + reqVO.getStreetNum(), + reqVO.getLandType(), + reqVO.getTown(), + reqVO.getCropName(), + reqVO.getLandArea(), + reqVO.getAvailableArea(), + reqVO.getMainYield(), + reqVO.getMainYieldUnitCode(), + reqVO.getMainYieldUnit(), + reqVO.getMainSaleAmount(), + reqVO.getMainSaleUnitCode(), + reqVO.getMainSaleUnit(), + reqVO.getSubYield(), + reqVO.getSubYieldUnitCode(), + reqVO.getSubYieldUnit(), + reqVO.getSubSaleAmount(), + reqVO.getSubSaleUnitCode(), + reqVO.getSubSaleUnit())); + + return ResponseEntity.status(HttpStatus.OK).body( + new SaveForestProductResVO(messageUtil.getMessage("operation.common.save.done"))); + } +} \ No newline at end of file diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/web/model/SaveForestProductReqVO.java b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/web/model/SaveForestProductReqVO.java new file mode 100644 index 00000000..673d718e --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/web/model/SaveForestProductReqVO.java @@ -0,0 +1,37 @@ +package app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.adapters.web.model; + +import jakarta.validation.constraints.NotBlank; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@NoArgsConstructor +@EqualsAndHashCode +public class SaveForestProductReqVO { + private Long forestProductId; + private Long householdSeq; + private Long monthlyInputStatusId; + private String recordMonth; + private String streetNum; + private String landType; + private String town; + private String cropName; + private String landArea; + private String availableArea; + private String mainYield; + private String mainYieldUnitCode; + private String mainYieldUnit; + private String mainSaleAmount; + private String mainSaleUnitCode; + private String mainSaleUnit; + private String subYield; + private String subYieldUnitCode; + private String subYieldUnit; + private String subSaleAmount; + private String subSaleUnitCode; + private String subSaleUnit; +} diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/web/model/SaveForestProductResVO.java b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/web/model/SaveForestProductResVO.java new file mode 100644 index 00000000..decd5dc5 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/web/model/SaveForestProductResVO.java @@ -0,0 +1,14 @@ +package app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class SaveForestProductResVO { + private String message; +} diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/web/validator/SaveForestProductValidator.java b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/web/validator/SaveForestProductValidator.java new file mode 100644 index 00000000..fb55563a --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/adapters/web/validator/SaveForestProductValidator.java @@ -0,0 +1,25 @@ +package app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.adapters.web.validator; + +import app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.adapters.web.model.SaveForestProductReqVO; +import org.springframework.stereotype.Component; +import org.springframework.util.StringUtils; +import org.springframework.validation.Errors; +import org.springframework.validation.Validator; + +@Component +public class SaveForestProductValidator implements Validator { + + @Override + public boolean supports(Class clazz) { + return SaveForestProductReqVO.class.equals(clazz); + } + + @Override + public void validate(Object target, Errors errors) { + SaveForestProductReqVO vo = (SaveForestProductReqVO) target; + + if (!StringUtils.hasText(vo.getCropName())) { + errors.rejectValue("cropName", "error.cropName", "재배 작물명을 입력해주세요."); + } + } +} \ No newline at end of file diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/ports/SaveForestProductPortIn.java b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/ports/SaveForestProductPortIn.java new file mode 100644 index 00000000..8bbe77ed --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/ports/SaveForestProductPortIn.java @@ -0,0 +1,7 @@ +package app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.ports; + +import app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.ports.application.domain.SaveForestProductCmd; + +public interface SaveForestProductPortIn { + void operate(SaveForestProductCmd inCmd); +} \ No newline at end of file diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/ports/SaveForestProductPortOut.java b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/ports/SaveForestProductPortOut.java new file mode 100644 index 00000000..220db4aa --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/ports/SaveForestProductPortOut.java @@ -0,0 +1,7 @@ +package app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.ports; + +import app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.ports.application.domain.SaveForestProductCmd; + +public interface SaveForestProductPortOut { + void operate(SaveForestProductCmd inCmd); +} \ No newline at end of file diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/ports/application/SaveForestProductService.java b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/ports/application/SaveForestProductService.java new file mode 100644 index 00000000..0d9c4d41 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/ports/application/SaveForestProductService.java @@ -0,0 +1,18 @@ +package app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.ports.application; + +import app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.ports.SaveForestProductPortIn; +import app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.ports.SaveForestProductPortOut; +import app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.ports.application.domain.SaveForestProductCmd; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor +class SaveForestProductService implements SaveForestProductPortIn { + private final SaveForestProductPortOut portOut; + + @Override + public void operate(SaveForestProductCmd cmd) { + portOut.operate(cmd); + } +} \ No newline at end of file diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/ports/application/domain/SaveForestProductCmd.java b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/ports/application/domain/SaveForestProductCmd.java new file mode 100644 index 00000000..208ada31 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/forestProduct/saveForestProduct/ports/application/domain/SaveForestProductCmd.java @@ -0,0 +1,35 @@ +package app.module.admin.usecase.household.tab.forestProduct.saveForestProduct.ports.application.domain; + +import app.module.core.config.adapters.persistence.component.AuditCommand; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class SaveForestProductCmd extends AuditCommand { + private Long forestProductId; + private Long householdSeq; + private Long monthlyInputStatusId; + private String recordMonth; + private String streetNum; + private String landType; + private String town; + private String cropName; + private String landArea; + private String availableArea; + private String mainYield; + private String mainYieldUnitCode; + private String mainYieldUnit; + private String mainSaleAmount; + private String mainSaleUnitCode; + private String mainSaleUnit; + private String subYield; + private String subYieldUnitCode; + private String subYieldUnit; + private String subSaleAmount; + private String subSaleUnitCode; + private String subSaleUnit; +} diff --git a/admin/src/main/java/app/module/admin/usecase/household/tab/householdVisit/saveHouseholdVisitInfo/adapters/web/SaveHouseholdVisitInfoController.java b/admin/src/main/java/app/module/admin/usecase/household/tab/householdVisit/saveHouseholdVisitInfo/adapters/web/SaveHouseholdVisitInfoController.java index c3284314..e46cefe4 100644 --- a/admin/src/main/java/app/module/admin/usecase/household/tab/householdVisit/saveHouseholdVisitInfo/adapters/web/SaveHouseholdVisitInfoController.java +++ b/admin/src/main/java/app/module/admin/usecase/household/tab/householdVisit/saveHouseholdVisitInfo/adapters/web/SaveHouseholdVisitInfoController.java @@ -30,7 +30,7 @@ class SaveHouseholdVisitInfoController { if (bindingResult.hasErrors()) { return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY) - .body(bindingResult.getAllErrors().get(0).getDefaultMessage()); + .body(bindingResult.getFieldErrors()); } portIn.operate(new SaveHouseholdVisitInfoCmd( diff --git a/admin/src/main/resources/mappers/household/GetForestProductsStatusMapper.xml b/admin/src/main/resources/mappers/household/GetForestProductsStatusMapper.xml index 98d5c62b..6af17c80 100644 --- a/admin/src/main/resources/mappers/household/GetForestProductsStatusMapper.xml +++ b/admin/src/main/resources/mappers/household/GetForestProductsStatusMapper.xml @@ -4,9 +4,10 @@ - /* getMonthlyStatus : 임산물 현황 등록 상태 조회 */ - SELECT forest_product_status + SELECT id, + forest_product_status FROM monthly_input_status mis WHERE household_seq = #{householdSeq} AND month = #{recordMonth} diff --git a/admin/src/main/resources/mappers/household/SaveForestProductMapper.xml b/admin/src/main/resources/mappers/household/SaveForestProductMapper.xml new file mode 100644 index 00000000..477198a2 --- /dev/null +++ b/admin/src/main/resources/mappers/household/SaveForestProductMapper.xml @@ -0,0 +1,88 @@ + + + + + /* createForestProduct : 임산물 현황 등록 */ + INSERT INTO forest_product + ( + household_seq, + month, + street_num, + land_type, + town, + crop_name, + land_area, + available_area, + main_yield, + main_yield_unit_code, + main_yield_unit, + main_sale_amount, + main_sale_unit_code, + main_sale_unit, + sub_yield, + sub_yield_unit_code, + sub_yield_unit, + sub_sale_amount, + sub_sale_unit_code, + sub_sale_unit, + monthly_input_status_id, + + ) + VALUES + ( + #{householdSeq}, + #{recordMonth}, + #{streetNum}, + #{landType}, + #{town}, + #{cropName}, + #{landArea}, + #{availableArea}, + #{mainYield}, + #{mainYieldUnitCode}, + #{mainYieldUnit}, + #{mainSaleAmount}, + #{mainSaleUnitCode}, + #{mainSaleUnit}, + #{subYield}, + #{subYieldUnitCode}, + #{subYieldUnit}, + #{subSaleAmount}, + #{subSaleUnitCode}, + #{subSaleUnit}, + #{monthlyInputStatusId}, + + ) + + + + /* updateForestProduct : 임산물 현황 수정 */ + UPDATE forest_product + SET + household_seq = #{householdSeq}, + street_num = #{streetNum}, + land_type = #{landType}, + town = #{town}, + available_area = #{availableArea}, + crop_name = #{cropName}, + land_area = #{landArea}, + month = #{recordMonth}, + main_yield = #{mainYield}, + main_yield_unit_code = #{mainYieldUnitCode}, + main_yield_unit = #{mainYieldUnit}, + main_sale_amount = #{mainSaleAmount}, + main_sale_unit_code = #{mainSaleUnitCode}, + main_sale_unit = #{mainSaleUnit}, + sub_yield = #{subYield}, + sub_yield_unit_code = #{subYieldUnitCode}, + sub_yield_unit = #{subYieldUnit}, + sub_sale_amount = #{subSaleAmount}, + sub_sale_unit_code = #{subSaleUnitCode}, + sub_sale_unit = #{subSaleUnit}, + monthly_input_status_id = #{monthlyInputStatusId}, + + WHERE id = #{forestProductId} + + \ No newline at end of file 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 70447288..6393ddb7 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 @@ -8,6 +8,7 @@ +
            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 @@
            • 자가 사용시간

              - 0시간 + 0시간
            • 임차 사용시간

              - 0시간 + 0시간
            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 @@
          • 작업 면적

            - +
          • 수확량

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

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

            - +
          • 가족노동(남)

            - +
          • 가족노동(여)

            - +
          • 고용노동(남)

            - +
          • 고용노동(여)

            - +
          • 품앗이(남)

            - +
          • 품앗이(여)

            - +
          • 일손돕기(남)

            - +
          • 일손돕기(여)

            - +
          From e90505d1901f8d4c13706ba45d1aa212b751e7ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A3=BC=EC=9A=B0=EC=84=B1?= Date: Thu, 26 Jun 2025 15:22:37 +0900 Subject: [PATCH 10/13] =?UTF-8?q?Excel=EB=8B=A4=EC=9A=B4=EB=A1=9C=EB=93=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/util/ExcelWriterUtil.java | 134 ++++++++++++++++++ .../application/util/model/ExcelSheetDto.java | 45 ++++++ .../web/GetExcelMultiSheetController.java | 124 ++++++++++++++++ 3 files changed, 303 insertions(+) create mode 100644 admin/src/main/java/app/module/admin/config/application/util/ExcelWriterUtil.java create mode 100644 admin/src/main/java/app/module/admin/config/application/util/model/ExcelSheetDto.java create mode 100644 admin/src/main/java/app/module/admin/usecase/excel/getExcelMultilSheet/adapters/web/GetExcelMultiSheetController.java diff --git a/admin/src/main/java/app/module/admin/config/application/util/ExcelWriterUtil.java b/admin/src/main/java/app/module/admin/config/application/util/ExcelWriterUtil.java new file mode 100644 index 00000000..032070d4 --- /dev/null +++ b/admin/src/main/java/app/module/admin/config/application/util/ExcelWriterUtil.java @@ -0,0 +1,134 @@ +package app.module.admin.config.application.util; + +import app.module.admin.config.application.util.model.ExcelSheetDto; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.stereotype.Component; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.List; + + +@Component +public class ExcelWriterUtil { + public static byte[] writeExcel(List sheets) { + try (Workbook workbook = new XSSFWorkbook()) { + CellStyle bodyStyle = createBodyStyle(workbook); + CellStyle commaStyle = createCommaStyle(workbook); + + for (ExcelSheetDto sheetDto : sheets) { + Sheet sheet = workbook.createSheet(sheetDto.getSheetName()); + List headers = sheetDto.getHeaders(); + List> dataRows = sheetDto.getData(); + + // 헤더 작성 + Row headerRow = sheet.createRow(0); + for (int col = 0; col < headers.size(); col++) { + String headerText = headers.get(col); + + IndexedColors bgColor = sheetDto.getHeaderBgColors() != null + ? sheetDto.getHeaderBgColors().getOrDefault(col, IndexedColors.GREY_25_PERCENT) + : IndexedColors.GREY_25_PERCENT; + + CellStyle headerStyle = createHeaderStyle(workbook, bgColor); + + Cell cell = headerRow.createCell(col); + cell.setCellValue(headerText); + cell.setCellStyle(headerStyle); + } + + // 데이터 작성 + for (int r = 0; r < dataRows.size(); r++) { + Row row = sheet.createRow(r + 1); + List rowData = dataRows.get(r); + for (int c = 0; c < rowData.size(); c++) { + Cell cell = row.createCell(c); + String value = rowData.get(c); + if (sheetDto.getCommaColumns() != null && + sheetDto.getCommaColumns().contains(c) && + isNumeric(value)) { + cell.setCellValue(Double.parseDouble(value)); + cell.setCellStyle(commaStyle); + } else { + cell.setCellValue(value); + cell.setCellStyle(bodyStyle); + } + } + } + + // 컬럼 너비 수동 계산 + for (int col = 0; col < headers.size(); col++) { + int maxLength = getByteLength(headers.get(col)); + for (List rowData : dataRows) { + if (col < rowData.size()) { + int length = getByteLength(rowData.get(col)); + if (length > maxLength) { + maxLength = length; + } + } + } + sheet.setColumnWidth(col, (maxLength + 2) * 256); + } + } + + ByteArrayOutputStream out = new ByteArrayOutputStream(); + workbook.write(out); + return out.toByteArray(); + + } catch (IOException e) { + throw new RuntimeException("엑셀 생성 실패", e); + } + } + + private static boolean isNumeric(String value) { + if (value == null) return false; + try { + Double.parseDouble(value); + return true; + } catch (NumberFormatException e) { + return false; + } + } + + private static int getByteLength(String value) { + return value == null ? 0 : value.getBytes().length; + } + + private static CellStyle createHeaderStyle(Workbook workbook, IndexedColors bgColor) { + CellStyle style = workbook.createCellStyle(); + Font font = workbook.createFont(); + font.setBold(true); + style.setFont(font); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setFillForegroundColor(bgColor.getIndex()); + style.setFillPattern(FillPatternType.SOLID_FOREGROUND); + setBorder(style); + return style; + } + + private static CellStyle createBodyStyle(Workbook workbook) { + CellStyle style = workbook.createCellStyle(); + style.setAlignment(HorizontalAlignment.LEFT); + style.setVerticalAlignment(VerticalAlignment.CENTER); + setBorder(style); + return style; + } + + private static CellStyle createCommaStyle(Workbook workbook) { + CellStyle style = workbook.createCellStyle(); + style.setAlignment(HorizontalAlignment.RIGHT); + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setDataFormat(workbook.createDataFormat().getFormat("#,##0")); + setBorder(style); + return style; + } + + private static void setBorder(CellStyle style) { + style.setBorderTop(BorderStyle.THIN); + style.setBorderBottom(BorderStyle.THIN); + style.setBorderLeft(BorderStyle.THIN); + style.setBorderRight(BorderStyle.THIN); + } +} diff --git a/admin/src/main/java/app/module/admin/config/application/util/model/ExcelSheetDto.java b/admin/src/main/java/app/module/admin/config/application/util/model/ExcelSheetDto.java new file mode 100644 index 00000000..176d6ba7 --- /dev/null +++ b/admin/src/main/java/app/module/admin/config/application/util/model/ExcelSheetDto.java @@ -0,0 +1,45 @@ +package app.module.admin.config.application.util.model; + +import org.apache.poi.ss.usermodel.IndexedColors; +import java.util.List; +import java.util.Set; + +import java.util.Map; + +public class ExcelSheetDto { + /** + * 시트명 + */ + private String sheetName; + /** + * 테이블 해더 리스트 + */ + private List headers; + /** + * 데이터 리스트 (해더와 같아야 한다. 값이 없다면 null이라도 넣어줘야해요.) + */ + private List> data; + /** + * 입력한 데이터 중 comma가 필요한 라인 선택 0 부터 + */ + private Set commaColumns; + /** + * 해더의 배경색 지정 : 0부터 시작 + */ + private Map headerBgColors; // 💡 추가: 컬럼별 배경색 + + public ExcelSheetDto(String sheetName, List headers, List> data, + Set commaColumns, Map headerBgColors) { + this.sheetName = sheetName; + this.headers = headers; + this.data = data; + this.commaColumns = commaColumns; + this.headerBgColors = headerBgColors; + } + + public String getSheetName() { return sheetName; } + public List getHeaders() { return headers; } + public List> getData() { return data; } + public Set getCommaColumns() { return commaColumns; } + public Map getHeaderBgColors() { return headerBgColors; } +} diff --git a/admin/src/main/java/app/module/admin/usecase/excel/getExcelMultilSheet/adapters/web/GetExcelMultiSheetController.java b/admin/src/main/java/app/module/admin/usecase/excel/getExcelMultilSheet/adapters/web/GetExcelMultiSheetController.java new file mode 100644 index 00000000..9f909e84 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/excel/getExcelMultilSheet/adapters/web/GetExcelMultiSheetController.java @@ -0,0 +1,124 @@ +package app.module.admin.usecase.excel.getExcelMultilSheet.adapters.web; + +import app.module.admin.config.application.util.model.ExcelSheetDto; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import app.module.admin.config.application.util.ExcelWriterUtil; +import java.util.List; +import java.util.Set; +import org.apache.poi.ss.usermodel.IndexedColors; +import java.util.Map; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; + +@RestController +@RequiredArgsConstructor +class GetExcelMultiSheetController { + + @GetMapping("/api/admin/excel/multisheet") + public ResponseEntity exportHouseholdExcel() { + + // 시트 1: 조사 대상 목록 (타이틀 10개) + ExcelSheetDto sheet1 = new ExcelSheetDto( + "조사 대상", + List.of("ID", "이름", "성별", "나이", "주소", "전화번호", "이메일", "등록일", "상태", "비고"), + List.of( + List.of("1", "홍길동", "남", "30", "서울", "010-1234-5678", "hong@example.com", "2024-01-01", "완료", ""), + List.of("2", "김영희", "여", "28", "부산", "010-2222-3333", "kim@example.com", "2024-01-02", "미완료", "응답 거부") + ), + Set.of(3), // 나이 컬럼에 콤마 포맷 적용 (예시용) + Map.of( + 0, IndexedColors.LIGHT_CORNFLOWER_BLUE, + 3, IndexedColors.LIGHT_YELLOW, + 7, IndexedColors.LIGHT_ORANGE + ) + ); + + /* + + 취득 데이터는 변환해서 넣어줘도 됩니다. + List rawList = ... // List를 캐스팅 or 변환 + List> excelData = rawList.stream() + .map(dto -> List.of( + String.valueOf(dto.getId()), + dto.getName(), + dto.getGender(), + String.valueOf(dto.getAge()), + dto.getAddress(), + dto.getPhone(), + dto.getEmail(), + dto.getRegDate().toString(), + dto.getStatus(), + dto.getNote() + )) + .toList(); + + + ExcelSheetDto sheet = new ExcelSheetDto( + "조사 대상", + List.of("ID", "이름", "성별", "나이", "주소", "전화번호", "이메일", "등록일", "상태", "비고"), + excelData, // <----------------------------------@@@@@@@@@@@@@@@@ + Set.of(3), + Map.of( + 0, IndexedColors.LIGHT_CORNFLOWER_BLUE, + 3, IndexedColors.LIGHT_YELLOW, + 7, IndexedColors.LIGHT_ORANGE + ) + ); + */ + + // 시트 2: 응답 통계 (타이틀 7개) + ExcelSheetDto sheet2 = new ExcelSheetDto( + "응답 통계", + List.of("구분", "총건수", "응답수", "미응답", "응답률", "평균시간", "비고"), + List.of( + List.of("전체", "1000", "850", "150", "85%", "5분", ""), + List.of("서울", "400", "360", "40", "90%", "4분", "") + ), + Set.of(1, 2, 3), // 숫자열에 콤마 포맷 적용 + Map.of( + 1, IndexedColors.LIGHT_GREEN, + 2, IndexedColors.LIGHT_GREEN, + 3, IndexedColors.LIGHT_YELLOW + ) + ); + + // 시트 3: 조사자별 실적 (타이틀 5개) + ExcelSheetDto sheet3 = new ExcelSheetDto( + "조사자 실적", + List.of("조사자명", "조사건수", "완료건수", "진행률", "비고"), + List.of( + List.of("박조사", "200", "180", "90%", ""), + List.of("이조사", "150", "100", "66.6%", "") + ), + Set.of(1, 2), // 조사건수, 완료건수에 콤마 포맷 + Map.of( + 0, IndexedColors.LIGHT_TURQUOISE, + 1, IndexedColors.LIGHT_ORANGE, + 2, IndexedColors.LIGHT_ORANGE + ) + ); + + // 시트 모음 + List sheets = List.of(sheet1, sheet2, sheet3); + + byte[] excel = ExcelWriterUtil.writeExcel(sheets); + + + String rawFileName = "조사결과_" + LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")) + ".xlsx"; + String encodedFileName = URLEncoder.encode(rawFileName, StandardCharsets.UTF_8).replaceAll("\\+", "%20"); + + return ResponseEntity.ok() + .contentType(MediaType.APPLICATION_OCTET_STREAM) + .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename*=UTF-8''" + encodedFileName) + .body(excel); + } +} \ No newline at end of file From dea45f467f87edaabdd70989a1b7a78132616823 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:53:30 +0900 Subject: [PATCH 11/13] =?UTF-8?q?[FO]=20kri.form.maxlength=20=EB=B0=A9?= =?UTF-8?q?=EC=8B=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/static/ui/commonUtil.js | 17 ++++++++----- .../templates/info/bank/inputForm.html | 4 ++-- .../templates/info/bank/outputForm.html | 4 ++-- .../templates/info/monthly/form.html | 12 +++++----- .../resources/templates/info/user/user.html | 8 +++---- .../templates/record/expense/form.html | 6 ++--- .../templates/record/farming/form.html | 4 ++-- .../templates/record/forestry/form.html | 4 ++-- .../templates/record/income/form.html | 10 ++++---- .../templates/record/power/form.html | 4 ++-- .../resources/templates/record/work/form.html | 24 +++++++++---------- 11 files changed, 51 insertions(+), 46 deletions(-) diff --git a/front/src/main/resources/static/ui/commonUtil.js b/front/src/main/resources/static/ui/commonUtil.js index 7e60c2b7..6506dcfe 100644 --- a/front/src/main/resources/static/ui/commonUtil.js +++ b/front/src/main/resources/static/ui/commonUtil.js @@ -246,10 +246,15 @@ kri.form.error = function(errorList){ } } -kri.form.maxlength = function(object){ - if (object.value.length > object.maxLength) { - object.value = object.value.slice(0, object.maxLength); - } -} - +$(function() { + $('body').on('input', 'input[type="number"]', function() { + let $el = $(this); + if ($el.val().length > $el.attr('maxlength')) { + $el.val($el.val().slice(0, $el.attr('maxlength'))); + } + if ($el.attr('inputmode') === 'numeric') { + $el.val($el.val().replace('.', '')); + } + }) +}) \ No newline at end of file diff --git a/front/src/main/resources/templates/info/bank/inputForm.html b/front/src/main/resources/templates/info/bank/inputForm.html index 525cde1a..ae59b020 100644 --- a/front/src/main/resources/templates/info/bank/inputForm.html +++ b/front/src/main/resources/templates/info/bank/inputForm.html @@ -121,7 +121,7 @@
          + inputmode="decimal" pattern="[0-9]*" maxlength="10" >
          • 예 : 2, 2.5
          • @@ -182,7 +182,7 @@
            + maxlength="10" inputmode="numeric" pattern="[0-9]*" > 원
아이디
${ct.householdNum}${ct.ownerName || '-'}${ct.householdNum}${ct.ownerName || '-'} ${ct.phone || '-'} ${ct.regionMainCodeName || '-'} ${ct.regionSubCodeName || '-'}