diff options
| author | joonhoekim <26rote@gmail.com> | 2025-11-28 16:05:42 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-11-28 16:05:42 +0900 |
| commit | 927b3d6cbfad6ce84ec1bff2faaace95e9586efd (patch) | |
| tree | 7faa247934eaf3186cf7e2489d0df5406d971507 /app | |
| parent | b278ee06ce347a4d2b1201d02a7f0061f607657a (diff) | |
(김준회) dolce RegisterKind 코드 오류 수정 (APPP --> APPR-P), 업로드시 file max seq 처리 추가, 상세도면 추가시 RegisterSerialNo 최대값 + 1 으로 요청
Diffstat (limited to 'app')
| -rw-r--r-- | app/[lng]/partners/(partners)/document-list-ship/dolce-upload-page-v2.tsx | 4 | ||||
| -rw-r--r-- | app/api/dolce/upload-files/route.ts | 24 |
2 files changed, 21 insertions, 7 deletions
diff --git a/app/[lng]/partners/(partners)/document-list-ship/dolce-upload-page-v2.tsx b/app/[lng]/partners/(partners)/document-list-ship/dolce-upload-page-v2.tsx index 555b921c..80c64c8e 100644 --- a/app/[lng]/partners/(partners)/document-list-ship/dolce-upload-page-v2.tsx +++ b/app/[lng]/partners/(partners)/document-list-ship/dolce-upload-page-v2.tsx @@ -629,7 +629,7 @@ export default function DolceUploadPageV2({ searchParams }: DolceUploadPageV2Pro </Card> {/* 하단: 상세도면리스트 + 파일리스트 - 항상 렌더링 */} - <div className="grid grid-cols-1 2xl:grid-cols-[60fr_40fr] gap-4 flex-shrink-0 min-h-[45vh]"> + <div className="grid grid-cols-1 2xl:grid-cols-[60fr_40fr] gap-4 flex-shrink-0 h-[45vh]"> {/* 좌측: 상세도면 리스트 */} <Card className="flex flex-col min-h-0 h-full 2xl:h-auto min-w-0"> <CardHeader className="flex-row items-center justify-between py-3 flex-shrink-0"> @@ -637,7 +637,7 @@ export default function DolceUploadPageV2({ searchParams }: DolceUploadPageV2Pro {t("detailDialog.detailListTitle")} {selectedDrawing && ( <span className="text-xs font-normal text-muted-foreground ml-2"> - {selectedDrawing.DrawingNo} + Drawing No: {selectedDrawing.DrawingNo}, Drawing Name: {selectedDrawing.DrawingName}, Discipline: {selectedDrawing.Discipline} </span> )} </CardTitle> diff --git a/app/api/dolce/upload-files/route.ts b/app/api/dolce/upload-files/route.ts index 898f9b2a..3d0a92f7 100644 --- a/app/api/dolce/upload-files/route.ts +++ b/app/api/dolce/upload-files/route.ts @@ -81,19 +81,33 @@ async function uploadFileToDolce( async function getExistingFileSeq(uploadId: string): Promise<number> { try { const response = await fetch( - `${DOLCE_API_URL}/PorjectWebProxyService.ashx?service=FileInfoList`, + `${DOLCE_API_URL}/Services/VDCSWebService.svc/FileInfoList`, { method: "POST", headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ uploadId }), + body: JSON.stringify({ uploadId: uploadId }), } ); if (response.ok) { const data = await response.json(); - const existingCount = data.FileInfoListResult?.length || 0; - console.log(`[Proxy] 기존 파일=${existingCount}개, 새 파일 시작 Seq=${existingCount + 1}`); - return existingCount + 1; + + let maxSeq = 0; + + // FileInfoListResult가 배열인지 확인하고 최대 FileSeq 탐색 + if (data.FileInfoListResult && Array.isArray(data.FileInfoListResult)) { + data.FileInfoListResult.forEach((item: any) => { + // FileSeq가 문자열로 오므로 숫자로 변환 (예: "6") + const seq = parseInt(item.FileSeq, 10); + if (!isNaN(seq) && seq > maxSeq) { + maxSeq = seq; + } + }); + } + + const nextSeq = maxSeq + 1; + console.log(`[Proxy] 기존 파일 최대 Seq=${maxSeq}, 새 파일 시작 Seq=${nextSeq}`); + return nextSeq; } else { console.warn(`[Proxy] FileInfoList 조회 실패, startSeq=1로 시작`); return 1; |
