From 89eb494450a12fcbf58a88d7786152af5d83a8cf Mon Sep 17 00:00:00 2001
From: joonhoekim <26rote@gmail.com>
Date: Thu, 30 Oct 2025 19:13:38 +0900
Subject: (김준회) fix: SWP 해양 문서리스트 관리 피드백 반영
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../plant/document-stages-columns.tsx | 20 +++----
.../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 }) => (
),
@@ -334,16 +333,17 @@ export function getDocumentStagesColumns({
return (
-
- {getStatusText(doc.status || '')}
-
+ {doc.docClass ? (
+
+ {doc.docClass}
+
+ ) : (
+ -
+ )}
)
},
- 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`(SELECT code FROM projects WHERE id = ${stageDocuments.projectId})`,
vendorCode: sql`(SELECT vendor_code FROM vendors WHERE id = ${stageDocuments.vendorId})`,
vendorName: sql`(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',
--
cgit v1.2.3