diff options
Diffstat (limited to 'lib/vendor-document-list')
| -rw-r--r-- | lib/vendor-document-list/plant/document-stages-columns.tsx | 20 | ||||
| -rw-r--r-- | lib/vendor-document-list/plant/shi-buyer-system-api.ts | 65 |
2 files changed, 48 insertions, 37 deletions
diff --git a/lib/vendor-document-list/plant/document-stages-columns.tsx b/lib/vendor-document-list/plant/document-stages-columns.tsx index d5dfc895..f9cde264 100644 --- a/lib/vendor-document-list/plant/document-stages-columns.tsx +++ b/lib/vendor-document-list/plant/document-stages-columns.tsx @@ -322,10 +322,9 @@ export function getDocumentStagesColumns({ columns.push( - // 현재 스테이지 (상태, 담당자 한 줄) - + // 문서 분류 (Doc. Class) { - accessorKey: "status", + accessorKey: "docClass", header: ({ column }) => ( <DataTableColumnHeaderSimple column={column} title="Doc. Class" /> ), @@ -334,16 +333,17 @@ export function getDocumentStagesColumns({ return ( <div className="flex items-center gap-2"> - <Badge - variant={getStatusColor(doc.status || '')} - className="text-xs px-1.5 py-0" - > - {getStatusText(doc.status || '')} - </Badge> + {doc.docClass ? ( + <span className="text-sm font-medium text-blue-600 dark:text-blue-400"> + {doc.docClass} + </span> + ) : ( + <span className="text-gray-400 dark:text-gray-500 text-sm">-</span> + )} </div> ) }, - size: 180, + size: 120, enableResizing: true, meta: { excelHeader: "Doc. Class" diff --git a/lib/vendor-document-list/plant/shi-buyer-system-api.ts b/lib/vendor-document-list/plant/shi-buyer-system-api.ts index 49b5995d..b23bd269 100644 --- a/lib/vendor-document-list/plant/shi-buyer-system-api.ts +++ b/lib/vendor-document-list/plant/shi-buyer-system-api.ts @@ -16,12 +16,12 @@ import path from 'path' interface ShiDocumentInfo { PROJ_NO: string SHI_DOC_NO: string - CATEGORY: string + CATEGORY: string | null RESPONSIBLE_CD: string RESPONSIBLE: string VNDR_CD: string VNDR_NM: string - DSN_SKL: string + DSN_SKL: string | null MIFP_CD: string MIFP_NM: string CG_EMPNO1: string @@ -327,6 +327,7 @@ export class ShiBuyerSystemAPI { title: stageDocuments.title, status: stageDocuments.status, buyerSystemComment: stageDocuments.buyerSystemComment, // 코멘트 필드 추가 + docClass: stageDocuments.docClass, // DOC_CLASS 필드 추가 projectCode: sql<string>`(SELECT code FROM projects WHERE id = ${stageDocuments.projectId})`, vendorCode: sql<string>`(SELECT vendor_code FROM vendors WHERE id = ${stageDocuments.vendorId})`, vendorName: sql<string>`(SELECT vendor_name FROM vendors WHERE id = ${stageDocuments.vendorId})`, @@ -364,31 +365,41 @@ export class ShiBuyerSystemAPI { } private async sendDocumentInfo(documents: DocumentWithStages[]) { - const shiDocuments: ShiDocumentInfo[] = documents.map((doc) => ({ - PROJ_NO: doc.projectCode, - SHI_DOC_NO: doc.docNumber, - CATEGORY: null, // SHI 설계자가 직접 입력함 - // 김준식 프로 요청으로 RESPONSIBLE_CD / RESPONSIBLE 값 변경 (251002,김준회) - RESPONSIBLE_CD: 'C00001', // 고정 - RESPONSIBLE: 'SHI', // 고정 - VNDR_CD: doc.vendorCode || '', - VNDR_NM: doc.vendorName || '', - DSN_SKL: null, // SHI 설계자가 직접 입력함 - MIFP_CD: '', - MIFP_NM: '', - CG_EMPNO1: '', - CG_EMPNM1: '', - OWN_DOC_NO: doc.vendorDocNumber || doc.docNumber, - DSC: doc.title, - DOC_CLASS: doc.docClass || '', // 선택한 DOC_CLASS 사용 - COMMENT: doc.buyerSystemComment || '', // 실제 코멘트 전송 - // 조민정 프로 요청으로 'ACTIVE' --> '생성요청' 값으로 변경 (251002,김준회) - STATUS: '생성요청', // 고정 - CRTER: 'EVCP_SYSTEM', // 고정 - CRTE_DTM: new Date().toISOString(), - CHGR: 'EVCP_SYSTEM', // 고정 - CHG_DTM: new Date().toISOString(), - })); + const shiDocuments: ShiDocumentInfo[] = documents.map((doc) => { + const docInfo: ShiDocumentInfo = { + PROJ_NO: doc.projectCode, + SHI_DOC_NO: doc.docNumber, + CATEGORY: null, // SHI 설계자가 직접 입력함 + // 김준식 프로 요청으로 RESPONSIBLE_CD / RESPONSIBLE 값 변경 (251002,김준회) + RESPONSIBLE_CD: 'C00001', // 고정 + RESPONSIBLE: 'SHI', // 고정 + VNDR_CD: doc.vendorCode || '', + VNDR_NM: doc.vendorName || '', + DSN_SKL: null, // SHI 설계자가 직접 입력함 + MIFP_CD: '', + MIFP_NM: '', + CG_EMPNO1: '', + CG_EMPNM1: '', + OWN_DOC_NO: doc.vendorDocNumber || doc.docNumber, + DSC: doc.title, + DOC_CLASS: doc.docClass || '', // 선택한 DOC_CLASS 사용 + COMMENT: doc.buyerSystemComment || '', // 실제 코멘트 전송 + // 조민정 프로 요청으로 'ACTIVE' --> '생성요청' 값으로 변경 (251002,김준회) + STATUS: '생성요청', // 고정 + CRTER: 'EVCP_SYSTEM', // 고정 + CRTE_DTM: new Date().toISOString(), + CHGR: 'EVCP_SYSTEM', // 고정 + CHG_DTM: new Date().toISOString(), + }; + + // DOC_CLASS 값 로깅 (디버깅용) + console.log(`[SHI API] 문서 ${doc.docNumber} - DOC_CLASS: "${doc.docClass}" -> 전송값: "${docInfo.DOC_CLASS}"`); + + return docInfo; + }); + + // 전송 데이터 로깅 (디버깅용) + console.log('[SHI API] SetDwgInfo 요청 데이터:', JSON.stringify(shiDocuments, null, 2)) const response = await fetch(`${this.baseUrl}/SetDwgInfo`, { method: 'POST', |
