임산물현황 달 리스트

This commit is contained in:
주우성
2025-06-14 20:39:34 +09:00
parent 944b9475b1
commit cffe52132a
6 changed files with 30 additions and 20 deletions

View File

@@ -7,8 +7,8 @@ import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor @RequiredArgsConstructor
public enum MonthStatus { public enum MonthStatus {
NONE("미등록"), // 미등록 NONE("미등록"), // 미등록
NOTHING("데이터없음으로 등록"), // 등록할것이 없음 NOTHING("등록없음"), // 등록할것이 없음
REGISTERED("데이터등록"); // 등록됨 REGISTERED("등록완료"); // 등록됨
private final String desc; private final String desc;
} }

View File

@@ -25,4 +25,13 @@ public class GetMonthlyInputStatuss {
private String createdBy; private String createdBy;
private LocalDateTime updatedAt; private LocalDateTime updatedAt;
private String updatedBy; private String updatedBy;
public String getKoreanMonth() {
if (month != null && month.contains("-")) {
String[] parts = month.split("-");
return parts[0] + "년 " + Integer.parseInt(parts[1]) + "월";
}
return "";
}
} }

View File

@@ -13,4 +13,5 @@ public class GetMonthlyInputStatussCmd {
private String searchField; private String searchField;
private String searchValue; private String searchValue;
private Long householdSeq;
} }

View File

@@ -22,6 +22,11 @@
FROM monthly_input_status a FROM monthly_input_status a
WHERE a.is_deleted = false WHERE a.is_deleted = false
<if test="cmd.householdSeq != null">
AND a.household_seq = ${cmd.householdSeq}
</if>
<if test="cmd.searchField != null and cmd.searchField != ''"> <if test="cmd.searchField != null and cmd.searchField != ''">
<choose> <choose>
<when test="cmd.searchField eq 'month'"> <when test="cmd.searchField eq 'month'">

View File

@@ -1,5 +1,6 @@
package app.module.front.usecase.info.monthly.getMonthlysUI.adapters.web; 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.config.application.util.CommonUtil;
import app.module.core.usecase.household.getHousehold.ports.GetHouseholdPortIn; 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.household.getHousehold.ports.application.domain.GetHouseholdCmd;
@@ -9,6 +10,7 @@ import app.module.core.usecase.monthly.getMonthlyInputStatuss.ports.application.
import app.module.core.usecase.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatussCmd; 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.GetNotices;
import app.module.core.usecase.notice.getNotices.ports.application.domain.GetNoticesCmd; 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.GetMontylyssReqVO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
@@ -32,14 +34,18 @@ class GetMontylysUIController {
@PageableDefault(sort = "month", direction = Sort.Direction.DESC, page = 0, size = 13) Pageable pageable, @PageableDefault(sort = "month", direction = Sort.Direction.DESC, page = 0, size = 13) Pageable pageable,
GetMontylyssReqVO reqVO) { GetMontylyssReqVO reqVO) {
Page<GetMonthlyInputStatuss> notices = Page<GetMonthlyInputStatuss> list =
portIn.operate( portIn.operate(
pageable, pageable,
new GetMonthlyInputStatussCmd( new GetMonthlyInputStatussCmd(
reqVO.getSearchField(), reqVO.getSearchValue())); reqVO.getSearchField(), reqVO.getSearchValue(), AuthUtil.getUserSeq()));
model.addAttribute("reqVO", reqVO); model.addAttribute("reqVO", reqVO);
model.addAttribute("list", notices); model.addAttribute("list", list);
// TODO 페키지명이 넘무 길어서 그냥
model.addAttribute("MonthStatus", MonthStatus.class);
return "info/monthly/monthlys"; return "info/monthly/monthlys";
} }
} }

View File

@@ -11,22 +11,11 @@
</h3> </h3>
</hgroup> </hgroup>
<ul class="product-col-list"> <ul class="product-col-list">
<li>
<li th:each="item : ${list.content}" th:classappend="${item.forestProductStatus != MonthStatus.NONE} ? ' complete'">
<a href=""> <a href="">
<p class="list-tit">2025년 5월</p> <p class="list-tit" th:text="${item.koreanMonth}"></p>
<span class="tag">미등록</span> <span class="tag" th:text="${item.forestProductStatus.desc}"></span>
</a>
</li>
<li class="complete">
<a href="">
<p class="list-tit">2025년 5월</p>
<span class="tag">등록완료</span>
</a>
</li>
<li class="complete">
<a href="">
<p class="list-tit">2025년 5월</p>
<span class="tag">등록완료</span>
</a> </a>
</li> </li>
</ul> </ul>