임산물현황 추가 팝업까지 + 값체크.

This commit is contained in:
주우성
2025-06-15 12:55:33 +09:00
parent 9723b58aa9
commit ecf5b83bba
39 changed files with 1257 additions and 85 deletions

View File

@@ -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<GetMonthlyForestProducts> pastList = Page.empty();
if (pastMonthlyInfo != null) {
pastList = getMonthlyForestProductsPortIn.operate(
pageable,
new GetMonthlyForestProductsCmd(
pastMonthlyInfo.getId(), AuthUtil.getUserSeq()));
}
// 이번달 입력 리스트 취득
Page<GetMonthlyForestProducts> 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}";
}
}

View File

@@ -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;
}

View File

@@ -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<GetMonthlyInputStatuss> list =
portIn.operate(

View File

@@ -9,7 +9,7 @@ import lombok.Setter;
@Setter
@AllArgsConstructor
@EqualsAndHashCode
public class GetMontylyssReqVO {
public class GetMonthlyssReqVO {
private String searchField;
private String searchValue;