From ecf5b83bba7736579572656e3ec56a48ae0e3085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A3=BC=EC=9A=B0=EC=84=B1?= Date: Sun, 15 Jun 2025 12:55:33 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9E=84=EC=82=B0=EB=AC=BC=ED=98=84=ED=99=A9?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80=20=ED=8C=9D=EC=97=85=EA=B9=8C=EC=A7=80=20?= =?UTF-8?q?+=20=EA=B0=92=EC=B2=B4=ED=81=AC.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../persistence/GetMonthlyInputStatusDao.java | 4 +- .../GetMonthlyInputStatusMapper.java | 1 + .../ports/GetMonthlyInputStatusPortIn.java | 1 + .../ports/GetMonthlyInputStatusPortOut.java | 1 + .../domain/GetMonthlyInputStatus.java | 8 + .../domain/GetMonthlyInputStatusCmd.java | 1 + .../GetPrevMonthlyInputStatusDao.java | 28 + .../GetPrevMonthlyInputStatusMapper.java | 13 + .../GetPrevMonthlyInputStatusPortIn.java | 12 + .../GetPrevMonthlyInputStatusPortOut.java | 12 + .../GetPrevMonthlyInputStatusService.java | 22 + .../domain/GetPrevMonthlyInputStatus.java | 26 + .../domain/GetPrevMonthlyInputStatusCmd.java | 15 + .../persistence/GetForestProductsDao.java | 60 -- .../persistence/GetForestProductsMapper.java | 1 + .../ports/GetForestProductsPortIn.java | 1 - .../ports/GetForestProductsPortOut.java | 1 - .../application/GetForestProductsService.java | 4 - .../GetMonthlyForestProductsDao.java | 62 ++ .../GetMonthlyForestProductsMapper.java | 17 + .../model/GetMonthlyForestProductsDto.java | 47 ++ .../ports/GetMonthlyForestProductsPortIn.java | 12 + .../GetMonthlyForestProductsPortOut.java | 12 + .../GetMonthlyForestProductsService.java | 23 + .../domain/GetMonthlyForestProducts.java | 47 ++ .../domain/GetMonthlyForestProductsCmd.java | 16 + .../monthly/GetMonthlyInputStatusMapper.xml | 3 + .../GetPrevMonthlyInputStatusMapper.xml | 33 + .../product/GetForestProductsMapper.xml | 5 + .../GetMonthlyForestProductsMapper.xml | 71 +++ .../web/CreateMonthlyUIController.java | 94 +++ .../web/model/CreateMonthlyReqVO.java | 16 + ...ller.java => GetMonthlysUIController.java} | 12 +- ...ylyssReqVO.java => GetMonthlyssReqVO.java} | 2 +- .../main/resources/messages/uri.properties | 3 +- .../main/resources/static/ui/commonUtil.js | 64 +- .../templates/info/monthly/monthlys.html | 5 +- .../templates/info/monthly/{id}.html | 581 ++++++++++++++++++ .../resources/templates/info/user/user.html | 6 +- 39 files changed, 1257 insertions(+), 85 deletions(-) create mode 100644 core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/adapters/persistence/GetPrevMonthlyInputStatusDao.java create mode 100644 core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/adapters/persistence/GetPrevMonthlyInputStatusMapper.java create mode 100644 core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/ports/GetPrevMonthlyInputStatusPortIn.java create mode 100644 core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/ports/GetPrevMonthlyInputStatusPortOut.java create mode 100644 core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/ports/application/GetPrevMonthlyInputStatusService.java create mode 100644 core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/ports/application/domain/GetPrevMonthlyInputStatus.java create mode 100644 core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/ports/application/domain/GetPrevMonthlyInputStatusCmd.java create mode 100644 core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/adapters/persistence/GetMonthlyForestProductsDao.java create mode 100644 core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/adapters/persistence/GetMonthlyForestProductsMapper.java create mode 100644 core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/adapters/persistence/model/GetMonthlyForestProductsDto.java create mode 100644 core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/ports/GetMonthlyForestProductsPortIn.java create mode 100644 core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/ports/GetMonthlyForestProductsPortOut.java create mode 100644 core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/ports/application/GetMonthlyForestProductsService.java create mode 100644 core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/ports/application/domain/GetMonthlyForestProducts.java create mode 100644 core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/ports/application/domain/GetMonthlyForestProductsCmd.java create mode 100644 core/src/main/resources/mappers/monthly/GetPrevMonthlyInputStatusMapper.xml create mode 100644 core/src/main/resources/mappers/product/GetMonthlyForestProductsMapper.xml create mode 100644 front/src/main/java/app/module/front/usecase/info/monthly/createMonthlyUI/adapters/web/CreateMonthlyUIController.java create mode 100644 front/src/main/java/app/module/front/usecase/info/monthly/createMonthlyUI/adapters/web/model/CreateMonthlyReqVO.java rename front/src/main/java/app/module/front/usecase/info/monthly/getMonthlysUI/adapters/web/{GetMontylysUIController.java => GetMonthlysUIController.java} (73%) rename front/src/main/java/app/module/front/usecase/info/monthly/getMonthlysUI/adapters/web/model/{GetMontylyssReqVO.java => GetMonthlyssReqVO.java} (90%) create mode 100644 front/src/main/resources/templates/info/monthly/{id}.html diff --git a/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/adapters/persistence/GetMonthlyInputStatusDao.java b/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/adapters/persistence/GetMonthlyInputStatusDao.java index 8dc80beb..b3962e98 100644 --- a/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/adapters/persistence/GetMonthlyInputStatusDao.java +++ b/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/adapters/persistence/GetMonthlyInputStatusDao.java @@ -16,7 +16,6 @@ class GetMonthlyInputStatusDao implements GetMonthlyInputStatusPortOut { private final GetMonthlyInputStatusMapper mapper; @Override - @Transactional public Optional operate(GetMonthlyInputStatusCmd command) { GetMonthlyInputStatus secArticle = mapper.getMonthlyInputStatus(command); @@ -24,4 +23,7 @@ class GetMonthlyInputStatusDao implements GetMonthlyInputStatusPortOut { return Optional.of(secArticle); } + + + } diff --git a/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/adapters/persistence/GetMonthlyInputStatusMapper.java b/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/adapters/persistence/GetMonthlyInputStatusMapper.java index dfa8ccd1..582e692f 100644 --- a/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/adapters/persistence/GetMonthlyInputStatusMapper.java +++ b/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/adapters/persistence/GetMonthlyInputStatusMapper.java @@ -9,4 +9,5 @@ public interface GetMonthlyInputStatusMapper { GetMonthlyInputStatus getMonthlyInputStatus(GetMonthlyInputStatusCmd command); + } diff --git a/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/ports/GetMonthlyInputStatusPortIn.java b/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/ports/GetMonthlyInputStatusPortIn.java index 0a937761..7a4bde72 100644 --- a/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/ports/GetMonthlyInputStatusPortIn.java +++ b/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/ports/GetMonthlyInputStatusPortIn.java @@ -8,4 +8,5 @@ import java.util.Optional; public interface GetMonthlyInputStatusPortIn { Optional operate(GetMonthlyInputStatusCmd command); + } \ No newline at end of file diff --git a/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/ports/GetMonthlyInputStatusPortOut.java b/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/ports/GetMonthlyInputStatusPortOut.java index 908d6b61..5e0413f8 100644 --- a/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/ports/GetMonthlyInputStatusPortOut.java +++ b/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/ports/GetMonthlyInputStatusPortOut.java @@ -8,4 +8,5 @@ import java.util.Optional; public interface GetMonthlyInputStatusPortOut { Optional operate(GetMonthlyInputStatusCmd command); + } \ No newline at end of file diff --git a/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/ports/application/domain/GetMonthlyInputStatus.java b/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/ports/application/domain/GetMonthlyInputStatus.java index b0ea3679..7633010a 100644 --- a/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/ports/application/domain/GetMonthlyInputStatus.java +++ b/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/ports/application/domain/GetMonthlyInputStatus.java @@ -24,4 +24,12 @@ public class GetMonthlyInputStatus { private String createdBy; private LocalDateTime updatedAt; private String updatedBy; + + public String getKoreanMonth() { + if (month != null && month.contains("-")) { + String[] parts = month.split("-"); + return parts[0] + "년 " + Integer.parseInt(parts[1]) + "월"; + } + return ""; + } } diff --git a/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/ports/application/domain/GetMonthlyInputStatusCmd.java b/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/ports/application/domain/GetMonthlyInputStatusCmd.java index 96f09466..ed10f261 100644 --- a/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/ports/application/domain/GetMonthlyInputStatusCmd.java +++ b/core/src/main/java/app/module/core/usecase/monthly/getMonthlyInputStatus/ports/application/domain/GetMonthlyInputStatusCmd.java @@ -11,4 +11,5 @@ import lombok.Setter; @EqualsAndHashCode public class GetMonthlyInputStatusCmd { private Long id; + private Long householdSeq; } diff --git a/core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/adapters/persistence/GetPrevMonthlyInputStatusDao.java b/core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/adapters/persistence/GetPrevMonthlyInputStatusDao.java new file mode 100644 index 00000000..83e70f5b --- /dev/null +++ b/core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/adapters/persistence/GetPrevMonthlyInputStatusDao.java @@ -0,0 +1,28 @@ +package app.module.core.usecase.monthly.getPrevMonthlyInputStatus.adapters.persistence; + +import app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports.GetPrevMonthlyInputStatusPortOut; +import app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatus; +import app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatusCmd; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Repository; + +import java.util.Optional; + +@Repository +@RequiredArgsConstructor +class GetPrevMonthlyInputStatusDao implements GetPrevMonthlyInputStatusPortOut { + + private final GetPrevMonthlyInputStatusMapper mapper; + + @Override + public Optional operate(GetPrevMonthlyInputStatusCmd command) { + GetPrevMonthlyInputStatus secArticle = mapper.getPrevMonthlyInputStatus(command); + + + + return Optional.ofNullable(secArticle); + } + + + +} diff --git a/core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/adapters/persistence/GetPrevMonthlyInputStatusMapper.java b/core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/adapters/persistence/GetPrevMonthlyInputStatusMapper.java new file mode 100644 index 00000000..7f72e0a7 --- /dev/null +++ b/core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/adapters/persistence/GetPrevMonthlyInputStatusMapper.java @@ -0,0 +1,13 @@ +package app.module.core.usecase.monthly.getPrevMonthlyInputStatus.adapters.persistence; + +import app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatus; +import app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatusCmd; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface GetPrevMonthlyInputStatusMapper { + + GetPrevMonthlyInputStatus getPrevMonthlyInputStatus(GetPrevMonthlyInputStatusCmd command); + + +} diff --git a/core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/ports/GetPrevMonthlyInputStatusPortIn.java b/core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/ports/GetPrevMonthlyInputStatusPortIn.java new file mode 100644 index 00000000..9a32f9c5 --- /dev/null +++ b/core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/ports/GetPrevMonthlyInputStatusPortIn.java @@ -0,0 +1,12 @@ +package app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports; + +import app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatus; +import app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatusCmd; + +import java.util.Optional; + +public interface GetPrevMonthlyInputStatusPortIn { + + Optional operate(GetPrevMonthlyInputStatusCmd command); + +} \ No newline at end of file diff --git a/core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/ports/GetPrevMonthlyInputStatusPortOut.java b/core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/ports/GetPrevMonthlyInputStatusPortOut.java new file mode 100644 index 00000000..e13579dc --- /dev/null +++ b/core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/ports/GetPrevMonthlyInputStatusPortOut.java @@ -0,0 +1,12 @@ +package app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports; + +import app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatus; +import app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatusCmd; + +import java.util.Optional; + +public interface GetPrevMonthlyInputStatusPortOut { + + Optional operate(GetPrevMonthlyInputStatusCmd command); + +} \ No newline at end of file diff --git a/core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/ports/application/GetPrevMonthlyInputStatusService.java b/core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/ports/application/GetPrevMonthlyInputStatusService.java new file mode 100644 index 00000000..2eb90ada --- /dev/null +++ b/core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/ports/application/GetPrevMonthlyInputStatusService.java @@ -0,0 +1,22 @@ +package app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports.application; + +import app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports.GetPrevMonthlyInputStatusPortIn; +import app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports.GetPrevMonthlyInputStatusPortOut; +import app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatus; +import app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatusCmd; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.Optional; + +@Service +@RequiredArgsConstructor +class GetPrevMonthlyInputStatusService implements GetPrevMonthlyInputStatusPortIn { + + private final GetPrevMonthlyInputStatusPortOut portOut; + + @Override + public Optional operate(GetPrevMonthlyInputStatusCmd command) { + return portOut.operate(command); + } +} \ No newline at end of file diff --git a/core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/ports/application/domain/GetPrevMonthlyInputStatus.java b/core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/ports/application/domain/GetPrevMonthlyInputStatus.java new file mode 100644 index 00000000..9ef37973 --- /dev/null +++ b/core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/ports/application/domain/GetPrevMonthlyInputStatus.java @@ -0,0 +1,26 @@ +package app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports.application.domain; + +import app.module.core.config.application.enums.MonthStatus; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Getter +@Setter +@NoArgsConstructor +@EqualsAndHashCode +public class GetPrevMonthlyInputStatus { + private Long id; + private Long householdSeq; + private String month; + private MonthStatus forestProductStatus; + private MonthStatus bankAutoTransferStatus; + + private LocalDateTime createdAt; + private String createdBy; + private LocalDateTime updatedAt; + private String updatedBy; +} diff --git a/core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/ports/application/domain/GetPrevMonthlyInputStatusCmd.java b/core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/ports/application/domain/GetPrevMonthlyInputStatusCmd.java new file mode 100644 index 00000000..8dba9b3f --- /dev/null +++ b/core/src/main/java/app/module/core/usecase/monthly/getPrevMonthlyInputStatus/ports/application/domain/GetPrevMonthlyInputStatusCmd.java @@ -0,0 +1,15 @@ +package app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports.application.domain; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class GetPrevMonthlyInputStatusCmd { + private Long id; + private Long householdSeq; +} diff --git a/core/src/main/java/app/module/core/usecase/product/getForestProducts/adapters/persistence/GetForestProductsDao.java b/core/src/main/java/app/module/core/usecase/product/getForestProducts/adapters/persistence/GetForestProductsDao.java index 4654beff..f68a3410 100644 --- a/core/src/main/java/app/module/core/usecase/product/getForestProducts/adapters/persistence/GetForestProductsDao.java +++ b/core/src/main/java/app/module/core/usecase/product/getForestProducts/adapters/persistence/GetForestProductsDao.java @@ -24,7 +24,6 @@ class GetForestProductsDao implements GetForestProductsPortOut { private final GetForestProductsMapper mapper; @Override - @Transactional public Page operate(Pageable pageable, GetForestProductsCmd command) { // 게시물 목록 얻기 List contents = @@ -63,63 +62,4 @@ class GetForestProductsDao implements GetForestProductsPortOut { contents.isEmpty() ? 0 : contents.get(0).getTotal()); } - @Override - @Transactional - public List operateList(GetForestProductsCmd command) { - /*// 검색조건 초기화 - Specification
spec = (root, query, criteriaBuilder) -> null; - - // 검색어 - like 검색 - if (!StringUtils.isEmpty(command.getSearchField())) { - spec = - spec.and( - (root, query, builder) -> - builder.like( - root.get(command.getSearchField()), - "%" + command.getSearchValue() + "%")); - } - - // 공개여부 검색 - if (!StringUtils.isEmpty(command.getSearchOpen())) { - spec = - spec.and( - ((root, query, criteriaBuilder) -> - criteriaBuilder.equal( - root.get("visible"), Boolean.valueOf(command.getSearchOpen())))); - } - - List
result = getArticlesRepo.findAll(spec); - - return result.stream() - .map( - article -> - new GetArticles( - article.getId(), - article.getUpdatedBy(), - article.getUpdatedAt(), - article.getTitle(), - article.getContent(), - article.getVisible(), - article.getStartDate(), - article.getEndDate(), - article.getOrderNo(), - article.getUploadFiles().stream() - // 목록에 보여줄 대표이미지만 담는다 - .filter( - uploadFile -> uploadFile.getType() - .equals(FileUploadType.EXAMPLE_REP)) - .map( - uploadFile -> - new GetArticleFiles( - uploadFile.getId(), - uploadFile.getType(), - uploadFile.getPath(), - uploadFile.getName(), - uploadFile.getOriginName(), - uploadFile.getFileLength())) - .findFirst() - .orElse(null))) - .collect(Collectors.toList());*/ - return null; - } } diff --git a/core/src/main/java/app/module/core/usecase/product/getForestProducts/adapters/persistence/GetForestProductsMapper.java b/core/src/main/java/app/module/core/usecase/product/getForestProducts/adapters/persistence/GetForestProductsMapper.java index 0cab6305..e082d9cc 100644 --- a/core/src/main/java/app/module/core/usecase/product/getForestProducts/adapters/persistence/GetForestProductsMapper.java +++ b/core/src/main/java/app/module/core/usecase/product/getForestProducts/adapters/persistence/GetForestProductsMapper.java @@ -13,4 +13,5 @@ public interface GetForestProductsMapper { List getForestProducts( @Param("pageable") Pageable pageable, @Param("cmd") GetForestProductsCmd cmd); + } diff --git a/core/src/main/java/app/module/core/usecase/product/getForestProducts/ports/GetForestProductsPortIn.java b/core/src/main/java/app/module/core/usecase/product/getForestProducts/ports/GetForestProductsPortIn.java index a6652273..b2c0997d 100644 --- a/core/src/main/java/app/module/core/usecase/product/getForestProducts/ports/GetForestProductsPortIn.java +++ b/core/src/main/java/app/module/core/usecase/product/getForestProducts/ports/GetForestProductsPortIn.java @@ -11,5 +11,4 @@ public interface GetForestProductsPortIn { Page operate(Pageable pageable, GetForestProductsCmd command); - List operateList(GetForestProductsCmd command); } \ No newline at end of file diff --git a/core/src/main/java/app/module/core/usecase/product/getForestProducts/ports/GetForestProductsPortOut.java b/core/src/main/java/app/module/core/usecase/product/getForestProducts/ports/GetForestProductsPortOut.java index 9fa19bc1..deb89262 100644 --- a/core/src/main/java/app/module/core/usecase/product/getForestProducts/ports/GetForestProductsPortOut.java +++ b/core/src/main/java/app/module/core/usecase/product/getForestProducts/ports/GetForestProductsPortOut.java @@ -11,5 +11,4 @@ public interface GetForestProductsPortOut { Page operate(Pageable pageable, GetForestProductsCmd command); - List operateList(GetForestProductsCmd command); } \ No newline at end of file diff --git a/core/src/main/java/app/module/core/usecase/product/getForestProducts/ports/application/GetForestProductsService.java b/core/src/main/java/app/module/core/usecase/product/getForestProducts/ports/application/GetForestProductsService.java index 2256b000..a9416f69 100644 --- a/core/src/main/java/app/module/core/usecase/product/getForestProducts/ports/application/GetForestProductsService.java +++ b/core/src/main/java/app/module/core/usecase/product/getForestProducts/ports/application/GetForestProductsService.java @@ -22,8 +22,4 @@ class GetForestProductsService implements GetForestProductsPortIn { return portOut.operate(pageable, command); } - @Override - public List operateList(GetForestProductsCmd command) { - return portOut.operateList(command); - } } diff --git a/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/adapters/persistence/GetMonthlyForestProductsDao.java b/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/adapters/persistence/GetMonthlyForestProductsDao.java new file mode 100644 index 00000000..d2fe76fa --- /dev/null +++ b/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/adapters/persistence/GetMonthlyForestProductsDao.java @@ -0,0 +1,62 @@ +package app.module.core.usecase.product.getMonthlyForestProducts.adapters.persistence; + +import app.module.core.usecase.product.getMonthlyForestProducts.adapters.persistence.model.GetMonthlyForestProductsDto; +import app.module.core.usecase.product.getMonthlyForestProducts.ports.GetMonthlyForestProductsPortOut; +import app.module.core.usecase.product.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProducts; +import app.module.core.usecase.product.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProductsCmd; +import lombok.RequiredArgsConstructor; +import org.apache.commons.collections4.ListUtils; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.stream.Collectors; + +@Repository +@RequiredArgsConstructor +class GetMonthlyForestProductsDao implements GetMonthlyForestProductsPortOut { + + private final GetMonthlyForestProductsMapper mapper; + + @Override + public Page operate(Pageable pageable, GetMonthlyForestProductsCmd command) { + // 게시물 목록 얻기 + List contents = + ListUtils.emptyIfNull(mapper.getMonthlyForestProducts(pageable, command)); + + return new PageImpl<>( + contents.stream() + .map( + article -> + new GetMonthlyForestProducts( + article.getId(), + article.getHouseholdSeq(), + article.getStreetNum(), + article.getLandType(), + article.getTown(), + article.getAvailableArea(), + article.getCropName(), + article.getCropCode(), + article.getLandArea(), + article.getMonth(), + article.getMainYield(), + article.getMainYieldUnitCode(), + article.getMainSaleAmount(), + article.getMainSaleUnitCode(), + article.getSubYield(), + article.getSubYieldUnitCode(), + article.getSubSaleAmount(), + article.getSubSaleUnitCode(), + article.getMonthlyInputStatusId(), + article.getCreatedAt(), + article.getCreatedBy(), + article.getUpdatedAt(), + article.getUpdatedBy())) + .collect(Collectors.toList()), + pageable, + contents.isEmpty() ? 0 : contents.get(0).getTotal()); + } + +} diff --git a/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/adapters/persistence/GetMonthlyForestProductsMapper.java b/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/adapters/persistence/GetMonthlyForestProductsMapper.java new file mode 100644 index 00000000..14596d3e --- /dev/null +++ b/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/adapters/persistence/GetMonthlyForestProductsMapper.java @@ -0,0 +1,17 @@ +package app.module.core.usecase.product.getMonthlyForestProducts.adapters.persistence; + +import app.module.core.usecase.product.getMonthlyForestProducts.adapters.persistence.model.GetMonthlyForestProductsDto; +import app.module.core.usecase.product.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProductsCmd; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.data.domain.Pageable; + +import java.util.List; + +@Mapper +public interface GetMonthlyForestProductsMapper { + List getMonthlyForestProducts( + @Param("pageable") Pageable pageable, @Param("cmd") GetMonthlyForestProductsCmd cmd); + + +} diff --git a/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/adapters/persistence/model/GetMonthlyForestProductsDto.java b/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/adapters/persistence/model/GetMonthlyForestProductsDto.java new file mode 100644 index 00000000..b6567768 --- /dev/null +++ b/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/adapters/persistence/model/GetMonthlyForestProductsDto.java @@ -0,0 +1,47 @@ +package app.module.core.usecase.product.getMonthlyForestProducts.adapters.persistence.model; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +@Getter +@Setter +@AllArgsConstructor +public class GetMonthlyForestProductsDto { + + private Long id; + private Long householdSeq; + + private String streetNum; + private String landType; + private String town; + + private Integer availableArea; + private String cropName; + private String cropCode; + private Integer landArea; + + private String month; + + private BigDecimal mainYield; + private String mainYieldUnitCode; + private BigDecimal mainSaleAmount; + private String mainSaleUnitCode; + + private BigDecimal subYield; + private String subYieldUnitCode; + private BigDecimal subSaleAmount; + private String subSaleUnitCode; + + private Long monthlyInputStatusId; + + private LocalDateTime createdAt; + private String createdBy; + private LocalDateTime updatedAt; + private String updatedBy; + + private Long total; +} diff --git a/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/ports/GetMonthlyForestProductsPortIn.java b/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/ports/GetMonthlyForestProductsPortIn.java new file mode 100644 index 00000000..99343376 --- /dev/null +++ b/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/ports/GetMonthlyForestProductsPortIn.java @@ -0,0 +1,12 @@ +package app.module.core.usecase.product.getMonthlyForestProducts.ports; + +import app.module.core.usecase.product.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProducts; +import app.module.core.usecase.product.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProductsCmd; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; + +public interface GetMonthlyForestProductsPortIn { + + Page operate(Pageable pageable, GetMonthlyForestProductsCmd command); + +} \ No newline at end of file diff --git a/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/ports/GetMonthlyForestProductsPortOut.java b/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/ports/GetMonthlyForestProductsPortOut.java new file mode 100644 index 00000000..3a3952d8 --- /dev/null +++ b/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/ports/GetMonthlyForestProductsPortOut.java @@ -0,0 +1,12 @@ +package app.module.core.usecase.product.getMonthlyForestProducts.ports; + +import app.module.core.usecase.product.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProducts; +import app.module.core.usecase.product.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProductsCmd; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; + +public interface GetMonthlyForestProductsPortOut { + + Page operate(Pageable pageable, GetMonthlyForestProductsCmd command); + +} \ No newline at end of file diff --git a/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/ports/application/GetMonthlyForestProductsService.java b/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/ports/application/GetMonthlyForestProductsService.java new file mode 100644 index 00000000..7e86bfcd --- /dev/null +++ b/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/ports/application/GetMonthlyForestProductsService.java @@ -0,0 +1,23 @@ +package app.module.core.usecase.product.getMonthlyForestProducts.ports.application; + +import app.module.core.usecase.product.getMonthlyForestProducts.ports.GetMonthlyForestProductsPortIn; +import app.module.core.usecase.product.getMonthlyForestProducts.ports.GetMonthlyForestProductsPortOut; +import app.module.core.usecase.product.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProducts; +import app.module.core.usecase.product.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProductsCmd; +import lombok.RequiredArgsConstructor; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor +class GetMonthlyForestProductsService implements GetMonthlyForestProductsPortIn { + + private final GetMonthlyForestProductsPortOut portOut; + + @Override + public Page operate(Pageable pageable, GetMonthlyForestProductsCmd command) { + return portOut.operate(pageable, command); + } + +} diff --git a/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/ports/application/domain/GetMonthlyForestProducts.java b/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/ports/application/domain/GetMonthlyForestProducts.java new file mode 100644 index 00000000..920ac673 --- /dev/null +++ b/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/ports/application/domain/GetMonthlyForestProducts.java @@ -0,0 +1,47 @@ +package app.module.core.usecase.product.getMonthlyForestProducts.ports.application.domain; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class GetMonthlyForestProducts { + + private Long id; + private Long householdSeq; + + private String streetNum; + private String landType; + private String town; + + private Integer availableArea; + private String cropName; + private String cropCode; + private Integer landArea; + + private String month; + + private BigDecimal mainYield; + private String mainYieldUnitCode; + private BigDecimal mainSaleAmount; + private String mainSaleUnitCode; + + private BigDecimal subYield; + private String subYieldUnitCode; + private BigDecimal subSaleAmount; + private String subSaleUnitCode; + + private Long monthlyInputStatusId; + + private LocalDateTime createdAt; + private String createdBy; + private LocalDateTime updatedAt; + private String updatedBy; +} diff --git a/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/ports/application/domain/GetMonthlyForestProductsCmd.java b/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/ports/application/domain/GetMonthlyForestProductsCmd.java new file mode 100644 index 00000000..8e74420c --- /dev/null +++ b/core/src/main/java/app/module/core/usecase/product/getMonthlyForestProducts/ports/application/domain/GetMonthlyForestProductsCmd.java @@ -0,0 +1,16 @@ +package app.module.core.usecase.product.getMonthlyForestProducts.ports.application.domain; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class GetMonthlyForestProductsCmd { + + private Long monthlyInputStatusId; + private Long householdSeq; +} diff --git a/core/src/main/resources/mappers/monthly/GetMonthlyInputStatusMapper.xml b/core/src/main/resources/mappers/monthly/GetMonthlyInputStatusMapper.xml index bf7fc2ce..364d1e4e 100644 --- a/core/src/main/resources/mappers/monthly/GetMonthlyInputStatusMapper.xml +++ b/core/src/main/resources/mappers/monthly/GetMonthlyInputStatusMapper.xml @@ -20,6 +20,9 @@ FROM monthly_input_status a WHERE a.id = #{id} AND a.is_deleted = false + + AND a.household_seq = #{householdSeq} + diff --git a/core/src/main/resources/mappers/monthly/GetPrevMonthlyInputStatusMapper.xml b/core/src/main/resources/mappers/monthly/GetPrevMonthlyInputStatusMapper.xml new file mode 100644 index 00000000..ca128efd --- /dev/null +++ b/core/src/main/resources/mappers/monthly/GetPrevMonthlyInputStatusMapper.xml @@ -0,0 +1,33 @@ + + + + + + \ No newline at end of file diff --git a/core/src/main/resources/mappers/product/GetForestProductsMapper.xml b/core/src/main/resources/mappers/product/GetForestProductsMapper.xml index ce3653d3..73c93cc4 100644 --- a/core/src/main/resources/mappers/product/GetForestProductsMapper.xml +++ b/core/src/main/resources/mappers/product/GetForestProductsMapper.xml @@ -70,4 +70,9 @@ + + + + + \ No newline at end of file diff --git a/core/src/main/resources/mappers/product/GetMonthlyForestProductsMapper.xml b/core/src/main/resources/mappers/product/GetMonthlyForestProductsMapper.xml new file mode 100644 index 00000000..b7d96d7e --- /dev/null +++ b/core/src/main/resources/mappers/product/GetMonthlyForestProductsMapper.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/front/src/main/java/app/module/front/usecase/info/monthly/createMonthlyUI/adapters/web/CreateMonthlyUIController.java b/front/src/main/java/app/module/front/usecase/info/monthly/createMonthlyUI/adapters/web/CreateMonthlyUIController.java new file mode 100644 index 00000000..129278bd --- /dev/null +++ b/front/src/main/java/app/module/front/usecase/info/monthly/createMonthlyUI/adapters/web/CreateMonthlyUIController.java @@ -0,0 +1,94 @@ +package app.module.front.usecase.info.monthly.createMonthlyUI.adapters.web; + +import app.module.core.config.application.enums.MonthStatus; +import app.module.core.usecase.monthly.getMonthlyInputStatus.ports.GetMonthlyInputStatusPortIn; +import app.module.core.usecase.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatus; +import app.module.core.usecase.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatusCmd; +import app.module.core.usecase.monthly.getMonthlyInputStatuss.ports.GetMonthlyInputStatussPortIn; +import app.module.core.usecase.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatuss; +import app.module.core.usecase.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatussCmd; +import app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports.GetPrevMonthlyInputStatusPortIn; +import app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatus; +import app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatusCmd; +import app.module.core.usecase.product.getForestProduct.ports.GetForestProductPortIn; +import app.module.core.usecase.product.getForestProducts.ports.GetForestProductsPortIn; +import app.module.core.usecase.product.getMonthlyForestProducts.ports.GetMonthlyForestProductsPortIn; +import app.module.core.usecase.product.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProducts; +import app.module.core.usecase.product.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProductsCmd; +import app.module.core.usecase.uicode.list.ports.UICodeListPortIn; +import app.module.front.config.application.util.AuthUtil; +import app.module.front.usecase.info.monthly.createMonthlyUI.adapters.web.model.CreateMonthlyReqVO; +import lombok.RequiredArgsConstructor; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.data.web.PageableDefault; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; + +@Controller +@RequiredArgsConstructor +class CreateMonthlyUIController { + + + private final GetPrevMonthlyInputStatusPortIn portIn; + private final GetMonthlyInputStatusPortIn getMonthlyInputStatusPortIn; + private final GetMonthlyForestProductsPortIn getMonthlyForestProductsPortIn; + + private final UICodeListPortIn uiCodeListPortIn; + + @GetMapping(path = "/info/monthly/create/{id}") + String operate(Model model, + @PathVariable Long id, + @PageableDefault(sort = "createAt", direction = Sort.Direction.DESC, page = 0, size = 100) Pageable pageable) { + // 전달 입력 상태 취득 , 데이터가 없을 경우 null + // 이전달 입력상태:NONE일 경우도 null + + GetPrevMonthlyInputStatus pastMonthlyInfo = + portIn.operate( + new GetPrevMonthlyInputStatusCmd( + id, AuthUtil.getUserSeq())).orElse(null); + + //현재 달 입력 상태 취득 + GetMonthlyInputStatus currentMonthlyInfo = + getMonthlyInputStatusPortIn.operate( + new GetMonthlyInputStatusCmd( + id, AuthUtil.getUserSeq())).orElse(null); + + + // 전달 입력 리스트 취득 + Page pastList = Page.empty(); + if (pastMonthlyInfo != null) { + pastList = getMonthlyForestProductsPortIn.operate( + pageable, + new GetMonthlyForestProductsCmd( + pastMonthlyInfo.getId(), AuthUtil.getUserSeq())); + } + + // 이번달 입력 리스트 취득 + Page currentList = Page.empty(); + if (currentMonthlyInfo != null) { + currentList = getMonthlyForestProductsPortIn.operate( + pageable, + new GetMonthlyForestProductsCmd( + currentMonthlyInfo.getId(), AuthUtil.getUserSeq())); + } + + + + model.addAttribute("pastMonthlyInfo", pastMonthlyInfo); + model.addAttribute("currentMonthlyInfo", currentMonthlyInfo); + model.addAttribute("pastList", pastList); + model.addAttribute("currentList", currentList); + + + model.addAttribute("purposeList", uiCodeListPortIn.connect("code.purpose")); + model.addAttribute("unitList", uiCodeListPortIn.connect("code.record.unit")); + + model.addAttribute("MonthStatus", MonthStatus.class); + + return "info/monthly/{id}"; + } +} \ No newline at end of file diff --git a/front/src/main/java/app/module/front/usecase/info/monthly/createMonthlyUI/adapters/web/model/CreateMonthlyReqVO.java b/front/src/main/java/app/module/front/usecase/info/monthly/createMonthlyUI/adapters/web/model/CreateMonthlyReqVO.java new file mode 100644 index 00000000..0ec14e42 --- /dev/null +++ b/front/src/main/java/app/module/front/usecase/info/monthly/createMonthlyUI/adapters/web/model/CreateMonthlyReqVO.java @@ -0,0 +1,16 @@ +package app.module.front.usecase.info.monthly.createMonthlyUI.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class CreateMonthlyReqVO { + + private String searchField; + private String searchValue; +} diff --git a/front/src/main/java/app/module/front/usecase/info/monthly/getMonthlysUI/adapters/web/GetMontylysUIController.java b/front/src/main/java/app/module/front/usecase/info/monthly/getMonthlysUI/adapters/web/GetMonthlysUIController.java similarity index 73% rename from front/src/main/java/app/module/front/usecase/info/monthly/getMonthlysUI/adapters/web/GetMontylysUIController.java rename to front/src/main/java/app/module/front/usecase/info/monthly/getMonthlysUI/adapters/web/GetMonthlysUIController.java index 42cabf27..ea96c5c4 100644 --- a/front/src/main/java/app/module/front/usecase/info/monthly/getMonthlysUI/adapters/web/GetMontylysUIController.java +++ b/front/src/main/java/app/module/front/usecase/info/monthly/getMonthlysUI/adapters/web/GetMonthlysUIController.java @@ -1,17 +1,11 @@ package app.module.front.usecase.info.monthly.getMonthlysUI.adapters.web; import app.module.core.config.application.enums.MonthStatus; -import app.module.core.config.application.util.CommonUtil; -import app.module.core.usecase.household.getHousehold.ports.GetHouseholdPortIn; -import app.module.core.usecase.household.getHousehold.ports.application.domain.GetHouseholdCmd; -import app.module.core.usecase.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatus; import app.module.core.usecase.monthly.getMonthlyInputStatuss.ports.GetMonthlyInputStatussPortIn; import app.module.core.usecase.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatuss; import app.module.core.usecase.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatussCmd; -import app.module.core.usecase.notice.getNotices.ports.application.domain.GetNotices; -import app.module.core.usecase.notice.getNotices.ports.application.domain.GetNoticesCmd; import app.module.front.config.application.util.AuthUtil; -import app.module.front.usecase.info.monthly.getMonthlysUI.adapters.web.model.GetMontylyssReqVO; +import app.module.front.usecase.info.monthly.getMonthlysUI.adapters.web.model.GetMonthlyssReqVO; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -23,7 +17,7 @@ import org.springframework.web.bind.annotation.GetMapping; @Controller @RequiredArgsConstructor -class GetMontylysUIController { +class GetMonthlysUIController { private final GetMonthlyInputStatussPortIn portIn; @@ -32,7 +26,7 @@ class GetMontylysUIController { @GetMapping(path = "/info/monthly") String operate(Model model, @PageableDefault(sort = "month", direction = Sort.Direction.DESC, page = 0, size = 13) Pageable pageable, - GetMontylyssReqVO reqVO) { + GetMonthlyssReqVO reqVO) { Page list = portIn.operate( diff --git a/front/src/main/java/app/module/front/usecase/info/monthly/getMonthlysUI/adapters/web/model/GetMontylyssReqVO.java b/front/src/main/java/app/module/front/usecase/info/monthly/getMonthlysUI/adapters/web/model/GetMonthlyssReqVO.java similarity index 90% rename from front/src/main/java/app/module/front/usecase/info/monthly/getMonthlysUI/adapters/web/model/GetMontylyssReqVO.java rename to front/src/main/java/app/module/front/usecase/info/monthly/getMonthlysUI/adapters/web/model/GetMonthlyssReqVO.java index dffe04f2..a4fa9012 100644 --- a/front/src/main/java/app/module/front/usecase/info/monthly/getMonthlysUI/adapters/web/model/GetMontylyssReqVO.java +++ b/front/src/main/java/app/module/front/usecase/info/monthly/getMonthlysUI/adapters/web/model/GetMonthlyssReqVO.java @@ -9,7 +9,7 @@ import lombok.Setter; @Setter @AllArgsConstructor @EqualsAndHashCode -public class GetMontylyssReqVO { +public class GetMonthlyssReqVO { private String searchField; private String searchValue; diff --git a/front/src/main/resources/messages/uri.properties b/front/src/main/resources/messages/uri.properties index 8d6e5f27..b1abe7cc 100644 --- a/front/src/main/resources/messages/uri.properties +++ b/front/src/main/resources/messages/uri.properties @@ -20,8 +20,9 @@ uri.front.info.user.password=\uBE44\uBC00\uBC88\uD638 \uD655\uC778 uri.front.info.notice=\uACF5\uC9C0\uC0AC\uD56D uri.front.info.notice.{{pathVar}}=\uACF5\uC9C0\uC0AC\uD56D uri.front.info.notice.path=/info/notice -uri.front.info.monthly=\uC6D4\uBCC4 \uC784\uC0B0\uBB3C \uD604\uD669 +uri.front.info.monthly=\uC784\uC0B0\uBB3C \uD604\uD669 uri.front.info.monthly.path=/info/monthly +uri.front.info.monthly.create.{{pathVar}}=\uC784\uC0B0\uBB3C \uD604\uD669 uri.front.info.bank=\uC740\uD589 \uC790\uB3D9\uC774\uCCB4 \uB0B4\uC5ED uri.front.info.bank.path=/info/bank diff --git a/front/src/main/resources/static/ui/commonUtil.js b/front/src/main/resources/static/ui/commonUtil.js index d7436f1c..884a7e12 100644 --- a/front/src/main/resources/static/ui/commonUtil.js +++ b/front/src/main/resources/static/ui/commonUtil.js @@ -3,7 +3,7 @@ let kri = { }; kri.menu = new Object; kri.logger = new Object(); - +kri.form = new Object(); /* kri.menu */ /** * 스크립트로 페이지 이동 @@ -74,3 +74,65 @@ kri.logger.warn = function(message){ }; +kri.form.error = function(errorList){ + let isResetDone = false; + + $(errorList).each((idx, oj) => { + const target = $('[name="' + oj.field + '"]'); + let infoBox = null; + if (!isResetDone) { + const formElement = target.closest('form'); + if (formElement.length > 0) { + $(formElement).find('.component-input').removeClass('input-invalid'); + $(formElement).find('.input-flex-group').removeClass('invalid'); + $(formElement).find('.select-group').removeClass('select-invalid'); + $(formElement).find('.input-info').each(function () { + $(this).remove(); + }); + } + isResetDone = true; + } + + if (target.length > 0) { + + const component = target.closest('.component-input'); + if(component){ + component.addClass('input-invalid'); + //연결된 구조 일 경우 상위에 변경 + if(target.closest('.input-flex-group').length > 0){ + infoBox = target.closest('.input-flex-group').find('.input-info'); + } else { + infoBox = component.find('.input-info'); + } + + if (infoBox.length === 0) { + if(target.closest('.input-flex-group').length > 0){ + infoBox = $('
    ').appendTo(target.closest('.input-flex-group')); + target.closest('.input-flex-group').addClass('invalid'); + } else { + infoBox = $('
      ').appendTo(component); + } + } + infoBox.html('
    • ' + oj.message + '
    • '); + } + } + + if (target.data('type') === 'select') { + + const component = target.closest('.select-group'); + if (component) { + component.addClass('select-invalid'); + + infoBox = component.find('.input-info'); + if (infoBox.length === 0) { + infoBox = $('
        ').appendTo(component); + } + + infoBox.html('
      • ' + oj.message + '
      • '); + } + + } + }); +} + + diff --git a/front/src/main/resources/templates/info/monthly/monthlys.html b/front/src/main/resources/templates/info/monthly/monthlys.html index 17d3d3a9..334f26ac 100644 --- a/front/src/main/resources/templates/info/monthly/monthlys.html +++ b/front/src/main/resources/templates/info/monthly/monthlys.html @@ -13,7 +13,7 @@
        • - +

          @@ -27,8 +27,7 @@ + + + + \ No newline at end of file diff --git a/front/src/main/resources/templates/info/user/user.html b/front/src/main/resources/templates/info/user/user.html index cd14624d..1b6965a3 100644 --- a/front/src/main/resources/templates/info/user/user.html +++ b/front/src/main/resources/templates/info/user/user.html @@ -1,5 +1,5 @@ - @@ -161,7 +161,7 @@
            -
          • option1
          • +
          • option1
          @@ -187,7 +187,7 @@
            -
          • option1
          • +
          • option1