From a42873419d14652d3639d2ae02d2ea54653b4749 Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Wed, 2 Jul 2025 04:46:24 +0000 Subject: (김준회) 견적프로젝트 해양 TOP - nonsap(견적물량관리시스템) 데이터 가져오기 추가 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/[lng]/evcp/(evcp)/bid-projects/layout.tsx | 39 ++++++++++ app/[lng]/evcp/(evcp)/bid-projects/page.tsx | 84 +++++++++------------- .../(ECC)/IF_ECC_EVCP_BIDDING_PROJECT/route.ts | 11 ++- 3 files changed, 84 insertions(+), 50 deletions(-) create mode 100644 app/[lng]/evcp/(evcp)/bid-projects/layout.tsx (limited to 'app') diff --git a/app/[lng]/evcp/(evcp)/bid-projects/layout.tsx b/app/[lng]/evcp/(evcp)/bid-projects/layout.tsx new file mode 100644 index 00000000..9c142df1 --- /dev/null +++ b/app/[lng]/evcp/(evcp)/bid-projects/layout.tsx @@ -0,0 +1,39 @@ +import * as React from "react" +import { BidProjectsContainer } from "@/components/bidding-projects/bid-projects-container" +import { Shell } from "@/components/shell" +import { DataTableSkeleton } from "@/components/data-table/data-table-skeleton" + +// Layout 컴포넌트는 서버 컴포넌트입니다 +export default function BidProjectsLayout({ + children, +}: { + children: React.ReactNode +}) { + // 프로젝트 타입 정의 + const projectTypes = [ + { id: "all", name: "전체" }, + { id: "SHIP", name: "조선" }, + { id: "TOP", name: "해양 TOP" }, + { id: "HULL", name: "해양 HULL" }, + ] + + return ( + + + } + > + + {children} + + + + ) +} \ No newline at end of file diff --git a/app/[lng]/evcp/(evcp)/bid-projects/page.tsx b/app/[lng]/evcp/(evcp)/bid-projects/page.tsx index 55f90dbb..e98d391b 100644 --- a/app/[lng]/evcp/(evcp)/bid-projects/page.tsx +++ b/app/[lng]/evcp/(evcp)/bid-projects/page.tsx @@ -2,13 +2,11 @@ import * as React from "react" import { type SearchParams } from "@/types/table" import { getValidFilters } from "@/lib/data-table" -import { Skeleton } from "@/components/ui/skeleton" import { DataTableSkeleton } from "@/components/data-table/data-table-skeleton" -import { Shell } from "@/components/shell" import { getBidProjectLists } from "@/lib/bidding-projects/service" import { searchParamsBidProjectsCache } from "@/lib/bidding-projects/validation" import { BidProjectsTable } from "@/lib/bidding-projects/table/projects-table" -import { InformationButton } from "@/components/information/information-button" +import type { Filter } from "@/types/table" interface IndexPageProps { searchParams: Promise @@ -18,60 +16,48 @@ export default async function IndexPage(props: IndexPageProps) { const searchParams = await props.searchParams const search = searchParamsBidProjectsCache.parse(searchParams) - const validFilters = getValidFilters(search.filters) + // URL에서 프로젝트 타입 가져오기 + const projectType = searchParams.type || "all" + + // 기존 필터에 프로젝트 타입 필터 추가 + let filters = search.filters || [] + + // 타입별 필터링 (전체가 아닌 경우만) + if (projectType !== "all") { + const typeFilter: Filter = { + id: "pjtType", + value: projectType, + type: "select", + operator: "eq" + } + + // 기존 pjtType 필터가 있으면 제거하고 새로 추가 + filters = filters.filter(f => f.id !== "pjtType") + filters = [...filters, typeFilter] + } + + const validFilters = getValidFilters(filters) const promises = Promise.all([ getBidProjectLists({ ...search, filters: validFilters, }), - ]) return ( - -
-
-
-
-

- 견적 프로젝트 리스트 -

- -
-

- SAP(S-ERP)로부터 수신한 견적 프로젝트 데이터입니다. 기술영업의 Budgetary RFQ에서 사용됩니다. - {/* - - 버튼 - - 을 통해 담당자 연락처, 입찰 이력, 계약 이력, 패키지 내용 등을 확인 할 수 있습니다. */} -

-
-
-
- - }> - {/* */} - - - } - > - - -
+ + } + > + + ) } diff --git a/app/api/(S-ERP)/(ECC)/IF_ECC_EVCP_BIDDING_PROJECT/route.ts b/app/api/(S-ERP)/(ECC)/IF_ECC_EVCP_BIDDING_PROJECT/route.ts index a63fff40..0c36974f 100644 --- a/app/api/(S-ERP)/(ECC)/IF_ECC_EVCP_BIDDING_PROJECT/route.ts +++ b/app/api/(S-ERP)/(ECC)/IF_ECC_EVCP_BIDDING_PROJECT/route.ts @@ -279,6 +279,14 @@ async function saveToDatabase(data: RequestData) { where: eq(biddingProjects.pspid, project.pspid) }); + // sector 값에 따라 pjtType 결정 + let pjtType: 'SHIP' | 'HULL' | null = null; + if (project.sector === 'S') { + pjtType = 'SHIP'; + } else if (project.sector === 'M') { + pjtType = 'HULL'; + } + const projectValues: NewBiddingProject = { pspid: project.pspid, projNm: project.projNm, @@ -296,7 +304,8 @@ async function saveToDatabase(data: RequestData) { pmodelUom: project.pmodelUom, txt04: project.txt04, txt30: project.txt30, - estmPm: project.estmPm + estmPm: project.estmPm, + pjtType: pjtType }; if (existingProject) { -- cgit v1.2.3