diff --git a/core/src/main/resources/mappers/monthly/GetMonthlyInputStatussMapper.xml b/core/src/main/resources/mappers/monthly/GetMonthlyInputStatussMapper.xml index dc27d809..c104e6a9 100644 --- a/core/src/main/resources/mappers/monthly/GetMonthlyInputStatussMapper.xml +++ b/core/src/main/resources/mappers/monthly/GetMonthlyInputStatussMapper.xml @@ -17,7 +17,7 @@ a.created_at AS createdAt, a.created_by AS createdBy, a.updated_at AS updatedAt, - a.updated_by AS updatedBy + a.updated_by AS updatedBy, COUNT(*) OVER () AS total FROM monthly_input_status a WHERE a.is_deleted = false diff --git a/core/src/main/resources/mappers/product/GetForestProductsMapper.xml b/core/src/main/resources/mappers/product/GetForestProductsMapper.xml index fb326f84..f18b4593 100644 --- a/core/src/main/resources/mappers/product/GetForestProductsMapper.xml +++ b/core/src/main/resources/mappers/product/GetForestProductsMapper.xml @@ -30,7 +30,7 @@ a.created_at AS createdAt, a.created_by AS createdBy, a.updated_at AS updatedAt, - a.updated_by AS updatedBy + a.updated_by AS updatedBy, COUNT(*) OVER () AS total FROM forest_product a WHERE a.is_deleted = false 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/GetMontylysUIController.java index 98ec695c..d40c7b7c 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/GetMontylysUIController.java @@ -3,7 +3,18 @@ package app.module.front.usecase.info.monthly.getMonthlysUI.adapters.web; 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.usecase.info.monthly.getMonthlysUI.adapters.web.model.GetMontylyssReqVO; 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; @@ -12,14 +23,23 @@ import org.springframework.web.bind.annotation.GetMapping; @RequiredArgsConstructor class GetMontylysUIController { - private final GetHouseholdPortIn getHouseholdPortIn; + + private final GetMonthlyInputStatussPortIn portIn; + @GetMapping(path = "/info/monthly") - String operate(Model model) { + String operate(Model model, + @PageableDefault(sort = "month", direction = Sort.Direction.DESC, page = 0, size = 13) Pageable pageable, + GetMontylyssReqVO reqVO) { - model.addAttribute("userInfo", - getHouseholdPortIn.operate(new GetHouseholdCmd(CommonUtil.getLoginUsername())).orElseThrow()); + Page notices = + portIn.operate( + pageable, + new GetMonthlyInputStatussCmd( + reqVO.getSearchField(), reqVO.getSearchValue())); + model.addAttribute("reqVO", reqVO); + model.addAttribute("list", notices); return "info/monthly/monthlys"; } } \ No newline at end of file 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/GetMontylyssReqVO.java new file mode 100644 index 00000000..dffe04f2 --- /dev/null +++ b/front/src/main/java/app/module/front/usecase/info/monthly/getMonthlysUI/adapters/web/model/GetMontylyssReqVO.java @@ -0,0 +1,16 @@ +package app.module.front.usecase.info.monthly.getMonthlysUI.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class GetMontylyssReqVO { + + private String searchField; + private String searchValue; +} diff --git a/front/src/main/resources/templates/info/monthly/monthlys.html b/front/src/main/resources/templates/info/monthly/monthlys.html index 59e58ddd..5d89cbb8 100644 --- a/front/src/main/resources/templates/info/monthly/monthlys.html +++ b/front/src/main/resources/templates/info/monthly/monthlys.html @@ -2,126 +2,54 @@ -
-
- - - -
-
- - - -
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
- - - - - - - - - - -
- - -
-
-
- -
-
+
+
+
+
+

+ 월별 등록된 임산물 현황을
확인하세요. +

+
+ +
+
-