summaryrefslogtreecommitdiff
path: root/lib/swp/document-service.ts
diff options
context:
space:
mode:
authorjoonhoekim <26rote@gmail.com>2025-11-27 13:48:44 +0900
committerjoonhoekim <26rote@gmail.com>2025-11-27 13:48:44 +0900
commitb43b1d92ef3d7e57b5df5cd72f75dc3a1c3f1c7a (patch)
tree943e2a52c9e56bdce2fa3a35ef61b795370f47e0 /lib/swp/document-service.ts
parent79cfa7ea8f21ae227dbb2843ae536fe876ba7c55 (diff)
(김준회) swp 파일 개수 컬럼 삭제 (API에서 주지 않는 데이터), dolce rebuild 에서 상태값 수정, bulk upload MatchBatchFileDwg API 사용해 Edit 으로 보내도록 수정 (Category, status 하드코딩 값 넣어주도록 처리), 상세도면, 파일 추가시 확인 다이얼로그 추가
Diffstat (limited to 'lib/swp/document-service.ts')
-rw-r--r--lib/swp/document-service.ts46
1 files changed, 8 insertions, 38 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개만
};
});