diff options
| author | joonhoekim <26rote@gmail.com> | 2025-11-27 13:48:44 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-11-27 13:48:44 +0900 |
| commit | b43b1d92ef3d7e57b5df5cd72f75dc3a1c3f1c7a (patch) | |
| tree | 943e2a52c9e56bdce2fa3a35ef61b795370f47e0 /lib/swp | |
| parent | 79cfa7ea8f21ae227dbb2843ae536fe876ba7c55 (diff) | |
(김준회) swp 파일 개수 컬럼 삭제 (API에서 주지 않는 데이터), dolce rebuild 에서 상태값 수정, bulk upload MatchBatchFileDwg API 사용해 Edit 으로 보내도록 수정 (Category, status 하드코딩 값 넣어주도록 처리), 상세도면, 파일 추가시 확인 다이얼로그 추가
Diffstat (limited to 'lib/swp')
| -rw-r--r-- | lib/swp/document-service.ts | 46 | ||||
| -rw-r--r-- | lib/swp/table/swp-table-columns.tsx | 20 | ||||
| -rw-r--r-- | lib/swp/vendor-actions.ts | 6 |
3 files changed, 12 insertions, 60 deletions
diff --git a/lib/swp/document-service.ts b/lib/swp/document-service.ts index b89d3442..6d8d7831 100644 --- a/lib/swp/document-service.ts +++ b/lib/swp/document-service.ts @@ -149,9 +149,7 @@ export interface DocumentDetail { * 문서 목록 아이템 (통계 포함) */ export interface DocumentListItem extends SwpDocumentApiResponse { - fileCount: number; - standbyFileCount: number; // STAT=SCW01 - latestFiles: SwpFileApiResponse[]; + // fileCount, standbyFileCount, latestFiles 제거됨 } // ============================================================================ @@ -170,49 +168,21 @@ export async function getDocumentList( debugLog("[getDocumentList] 시작", { projNo, vndrCd }); try { - // 병렬 API 호출 - const [documents, allFiles] = await Promise.all([ - fetchGetVDRDocumentList({ - proj_no: projNo, - doc_gb: "V", - vndrCd: vndrCd, - }), - fetchGetExternalInboxList({ - projNo: projNo, - vndrCd: vndrCd, - }), - ]); + // API 호출 + const documents = await fetchGetVDRDocumentList({ + proj_no: projNo, + doc_gb: "V", + vndrCd: vndrCd, + }); debugLog("[getDocumentList] API 조회 완료", { documents: documents.length, - files: allFiles.length, }); - // 파일을 문서별로 그룹핑 - const filesByDoc = new Map<string, SwpFileApiResponse[]>(); - for (const file of allFiles) { - const docNo = file.OWN_DOC_NO; - if (!filesByDoc.has(docNo)) { - filesByDoc.set(docNo, []); - } - filesByDoc.get(docNo)!.push(file); - } - - // 문서에 파일 통계 추가 + // 문서 목록 반환 (파일 통계 제거) const result = documents.map((doc) => { - const allFiles = filesByDoc.get(doc.OWN_DOC_NO || "") || []; - - // 최신 REV의 파일만 필터링 - const latestRevFiles = allFiles.filter((f) => f.REV_NO === doc.LTST_REV_NO); - const standbyFiles = latestRevFiles.filter((f) => f.STAT === "SCW01"); - return { ...doc, - fileCount: latestRevFiles.length, - standbyFileCount: standbyFiles.length, - latestFiles: latestRevFiles - .sort((a, b) => b.CRTE_DTM.localeCompare(a.CRTE_DTM)) - .slice(0, 5), // 최신 5개만 }; }); diff --git a/lib/swp/table/swp-table-columns.tsx b/lib/swp/table/swp-table-columns.tsx index 91c811c3..261cf960 100644 --- a/lib/swp/table/swp-table-columns.tsx +++ b/lib/swp/table/swp-table-columns.tsx @@ -138,25 +138,7 @@ export const swpDocumentColumns: ColumnDef<DocumentListItem>[] = [ minSize: 100, maxSize: 100, }, - { - id: "stats", - header: "파일", - cell: ({ row }) => ( - <div className="text-center"> - <div className="text-sm font-medium"> - {row.original.fileCount}개 - </div> - {row.original.standbyFileCount > 0 && ( - <div className="text-xs text-yellow-600"> - 대기중 {row.original.standbyFileCount} - </div> - )} - </div> - ), - size: 100, - minSize: 100, - maxSize: 100, - }, + { id: "actions", header: "커버페이지 다운로드", diff --git a/lib/swp/vendor-actions.ts b/lib/swp/vendor-actions.ts index 78521fed..12b7c513 100644 --- a/lib/swp/vendor-actions.ts +++ b/lib/swp/vendor-actions.ts @@ -304,9 +304,9 @@ export async function fetchVendorSwpStats(projNo?: string) { let uploadedFiles = 0; for (const doc of documents) { - totalFiles += doc.fileCount; - // standbyFileCount가 0이 아니면 업로드된 것으로 간주 - uploadedFiles += doc.fileCount - doc.standbyFileCount; + // 파일 통계는 더 이상 계산하지 않음 (API 호출 제거됨) + // totalFiles += doc.fileCount; + // uploadedFiles += doc.fileCount - doc.standbyFileCount; // 리비전 수 추정 (LTST_REV_NO 기반) if (doc.LTST_REV_NO) { |
