From f440aee7ff899a6aa93b8e1b5d98ea78df210872 Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Mon, 22 Sep 2025 19:48:40 +0900 Subject: (김준회) 수정: POS 문서는 ECC에서 들어올 때 PR 아이템 기준으로 가져오도록 변경 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/rfq-last/table/rfq-attachments-dialog.tsx | 88 +++++++++++++-------------- 1 file changed, 44 insertions(+), 44 deletions(-) (limited to 'lib/rfq-last/table/rfq-attachments-dialog.tsx') diff --git a/lib/rfq-last/table/rfq-attachments-dialog.tsx b/lib/rfq-last/table/rfq-attachments-dialog.tsx index 4513b0b0..161e446a 100644 --- a/lib/rfq-last/table/rfq-attachments-dialog.tsx +++ b/lib/rfq-last/table/rfq-attachments-dialog.tsx @@ -26,8 +26,8 @@ import { toast } from "sonner" import { RfqsLastView } from "@/db/schema" import { getRfqAttachmentsAction } from "../service" import { downloadFile, quickPreview, smartFileAction, formatFileSize, getFileInfo } from "@/lib/file-download" -import { syncRfqPosFiles } from "@/lib/pos" -import { useSession } from "next-auth/react" +// import { syncRfqPosFiles } from "@/lib/pos" // 주석 처리: ECC 매핑 시 자동 처리로 변경 +// import { useSession } from "next-auth/react" // 주석 처리: 동기화 UI 제거로 불필요 // 첨부파일 타입 interface RfqAttachment { @@ -57,9 +57,9 @@ export function RfqAttachmentsDialog({ isOpen, onClose, rfqData }: RfqAttachment const [attachments, setAttachments] = React.useState([]) const [isLoading, setIsLoading] = React.useState(false) const [downloadingFiles, setDownloadingFiles] = React.useState>(new Set()) - const [isSyncing, setIsSyncing] = React.useState(false) + // const [isSyncing, setIsSyncing] = React.useState(false) // 주석 처리: 동기화 UI 제거 - const { data: session } = useSession() + // const { data: session } = useSession() // 주석 처리: 동기화 UI 제거로 불필요 // 첨부파일 목록 로드 React.useEffect(() => { @@ -158,48 +158,48 @@ export function RfqAttachmentsDialog({ isOpen, onClose, rfqData }: RfqAttachment } } - // POS 파일 동기화 핸들러 - const handlePosSync = async () => { - if (!session?.user?.id || !rfqData.id) { - toast.error("로그인이 필요하거나 RFQ 정보가 없습니다") - return - } + // POS 파일 동기화 핸들러 - 주석 처리: ECC 매핑 시 자동 처리로 변경 + // const handlePosSync = async () => { + // if (!session?.user?.id || !rfqData.id) { + // toast.error("로그인이 필요하거나 RFQ 정보가 없습니다") + // return + // } - setIsSyncing(true) + // setIsSyncing(true) - try { - const result = await syncRfqPosFiles(rfqData.id, parseInt(session.user.id)) + // try { + // const result = await syncRfqPosFiles(rfqData.id, parseInt(session.user.id)) - if (result.success) { - toast.success( - `POS 파일 동기화 완료: 성공 ${result.successCount}건, 실패 ${result.failedCount}건` - ) + // if (result.success) { + // toast.success( + // `POS 파일 동기화 완료: 성공 ${result.successCount}건, 실패 ${result.failedCount}건` + // ) - // 성공한 경우 첨부파일 목록 새로고침 - if (result.successCount > 0) { - const refreshResult = await getRfqAttachmentsAction(rfqData.id) - if (refreshResult.success) { - setAttachments(refreshResult.data) - } - } + // // 성공한 경우 첨부파일 목록 새로고침 + // if (result.successCount > 0) { + // const refreshResult = await getRfqAttachmentsAction(rfqData.id) + // if (refreshResult.success) { + // setAttachments(refreshResult.data) + // } + // } - // 상세 결과 표시 - if (result.details.length > 0) { - const failedItems = result.details.filter(d => d.status === 'failed') - if (failedItems.length > 0) { - console.warn("POS 동기화 실패 항목:", failedItems) - } - } - } else { - toast.error(`POS 파일 동기화 실패: ${result.errors.join(', ')}`) - } - } catch (error) { - console.error("POS 동기화 오류:", error) - toast.error("POS 파일 동기화 중 오류가 발생했습니다") - } finally { - setIsSyncing(false) - } - } + // // 상세 결과 표시 + // if (result.details.length > 0) { + // const failedItems = result.details.filter(d => d.status === 'failed') + // if (failedItems.length > 0) { + // console.warn("POS 동기화 실패 항목:", failedItems) + // } + // } + // } else { + // toast.error(`POS 파일 동기화 실패: ${result.errors.join(', ')}`) + // } + // } catch (error) { + // console.error("POS 동기화 오류:", error) + // toast.error("POS 파일 동기화 중 오류가 발생했습니다") + // } finally { + // setIsSyncing(false) + // } + // } // 첨부파일 타입별 색상 const getAttachmentTypeBadgeVariant = (type: string) => { @@ -224,8 +224,8 @@ export function RfqAttachmentsDialog({ isOpen, onClose, rfqData }: RfqAttachment - {/* POS 동기화 버튼 */} - + */} -- cgit v1.2.3