summaryrefslogtreecommitdiff
path: root/lib/swp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/swp')
-rw-r--r--lib/swp/document-service.ts46
-rw-r--r--lib/swp/table/swp-table-columns.tsx20
-rw-r--r--lib/swp/vendor-actions.ts6
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) {