diff options
| author | joonhoekim <26rote@gmail.com> | 2025-08-25 10:52:24 +0000 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-08-25 10:52:24 +0000 |
| commit | 83f67ed333f0237b434a41d1eceef417c0d48313 (patch) | |
| tree | eb911edaccf778e78be5564416748ff577a8aa76 /lib/soap/ecc | |
| parent | 780d56edd3772813b4e557061a3c90d9f7d1ddd0 (diff) | |
(김준회) 설정 변경 및 WSDL namespace 반영, 로그인 완료시 dashboard 이동 (콜백 없을 때)
Diffstat (limited to 'lib/soap/ecc')
| -rw-r--r-- | lib/soap/ecc/mapper/po-mapper.ts | 18 | ||||
| -rw-r--r-- | lib/soap/ecc/send/cancel-rfq.ts | 10 | ||||
| -rw-r--r-- | lib/soap/ecc/send/create-po.ts | 7 | ||||
| -rw-r--r-- | lib/soap/ecc/send/pcr-confirm.ts | 7 | ||||
| -rw-r--r-- | lib/soap/ecc/send/rfq-info.ts | 7 |
5 files changed, 33 insertions, 16 deletions
diff --git a/lib/soap/ecc/mapper/po-mapper.ts b/lib/soap/ecc/mapper/po-mapper.ts index a6363a87..6e282b98 100644 --- a/lib/soap/ecc/mapper/po-mapper.ts +++ b/lib/soap/ecc/mapper/po-mapper.ts @@ -98,10 +98,20 @@ export async function mapECCPOHeaderToBusiness( } }; + // projectId와 vendorId 필수 체크 + if (!projectId) { + debugError('프로젝트를 찾을 수 없어 매핑을 건너뜁니다', { pspid: eccHeader.PSPID }); + throw new Error(`프로젝트를 찾을 수 없습니다: PSPID=${eccHeader.PSPID}`); + } + if (!vendorId) { + debugError('벤더를 찾을 수 없어 매핑을 건너뜁니다', { lifnr: eccHeader.LIFNR }); + throw new Error(`벤더를 찾을 수 없습니다: LIFNR=${eccHeader.LIFNR}`); + } + // 매핑 const mappedData: ContractData = { - projectId: projectId || 1, // TODO: 기본값 설정, 실제로는 유효한 projectId 필요 - vendorId: vendorId || 1, // TODO: 기본값 설정, 실제로는 유효한 vendorId 필요 + projectId, + vendorId, contractNo: eccHeader.EBELN || '', contractName: eccHeader.ZTITLE || eccHeader.EBELN || '', status: eccHeader.ZPO_CNFM_STAT || 'ACTIVE', @@ -249,14 +259,14 @@ export async function mapECCPODetailToBusiness( const calculatedTaxAmount = (unitPriceNum * quantity * taxRateNum) / 100; taxAmount = calculatedTaxAmount.toString(); } catch (error) { - debugError('세액 계산 오류', { unitPrice, taxRate, quantity, error }); + debugError('세액(taxAmount) 계산 오류((unitPriceNum * quantity * taxRateNum) / 100)', { unitPrice, taxRate, quantity, error }); } } // 매핑 const mappedData: ContractItemData = { contractId, - itemId: itemId || 1, // TODO: 기본값 설정, 실제로는 유효한 itemId 필요 + itemId: itemId!, // 아이템이 없으면 자동 생성되므로 null이 될 수 없음 description: eccDetail.MAKTX || null, quantity, unitPrice, diff --git a/lib/soap/ecc/send/cancel-rfq.ts b/lib/soap/ecc/send/cancel-rfq.ts index fcddddf8..b26ca38b 100644 --- a/lib/soap/ecc/send/cancel-rfq.ts +++ b/lib/soap/ecc/send/cancel-rfq.ts @@ -2,8 +2,8 @@ import { sendSoapXml, type SoapSendConfig, type SoapLogInfo, type SoapSendResult } from "@/lib/soap/sender"; -// ECC RFQ 취소 엔드포인트 -const ECC_CANCEL_RFQ_ENDPOINT = "http://shii8dvddb01.hec.serp.shi.samsung.net:50000/sap/xi/engine?type=entry&version=3.0&Sender.Service=P2038_D&Interface=http%3A%2F%2Fshi.samsung.co.kr%2FP2_MM%2FMMM%5EP2MM3016_SO"; +// ECC RFQ 취소 엔드포인트 (WSDL에 명시된 P2038_D 사용) +const ECC_CANCEL_RFQ_ENDPOINT = "http://shii8dvddb01.hec.serp.shi.samsung.net:50000/sap/xi/engine?type=entry&version=3.0&Sender.Service=P2038_D&Interface=http%3A%2F%2Fshi.samsung.co.kr%2FP2_MM%2FMMM%5EP2MM3016_SO&QualityOfService=ExactlyOnce"; // RFQ 취소 요청 데이터 타입 export interface CancelRFQRequest { @@ -70,7 +70,8 @@ async function sendCancelRFQToECC(rfqData: CancelRFQRequest): Promise<SoapSendRe soapAction: 'http://sap.com/xi/WebService/soap1.1', timeout: 30000, // RFQ 취소는 30초 타임아웃 retryCount: 3, - retryDelay: 1000 + retryDelay: 1000, + namespace: 'http://shi.samsung.co.kr/P2_MM/MMM' // ECC MM 모듈 네임스페이스 }; // 로그 정보 @@ -83,6 +84,9 @@ async function sendCancelRFQToECC(rfqData: CancelRFQRequest): Promise<SoapSendRe const rfqNumbers = rfqData.T_ANFNR.map(item => item.ANFNR).join(', '); console.log(`📤 RFQ 취소 요청 전송 시작 - RFQ Numbers: ${rfqNumbers}`); console.log(`🔍 취소 대상 RFQ ${rfqData.T_ANFNR.length}개`); + console.log(`🌐 엔드포인트: ${ECC_CANCEL_RFQ_ENDPOINT}`); + console.log(`📋 네임스페이스: ${config.namespace}`); + console.log(`🔐 SOAPAction: ${config.soapAction}`); // SOAP XML 전송 const result = await sendSoapXml(config, logInfo); diff --git a/lib/soap/ecc/send/create-po.ts b/lib/soap/ecc/send/create-po.ts index 3bd28057..d44f091b 100644 --- a/lib/soap/ecc/send/create-po.ts +++ b/lib/soap/ecc/send/create-po.ts @@ -3,8 +3,8 @@ import { sendSoapXml, type SoapSendConfig, type SoapLogInfo, type SoapSendResult } from "@/lib/soap/sender"; import { getCurrentSAPDate, getCurrentSAPTime } from "@/lib/soap/utils"; -// ECC PO 생성 엔드포인트 -const ECC_PO_ENDPOINT = "http://shii8dvddb01.hec.serp.shi.samsung.net:50000/sap/xi/engine?type=entry&version=3.0&Sender.Service=P2038_D&Interface=http%3A%2F%2Fshi.samsung.co.kr%2FP2_MM%2FMMM%5EP2MM3015_SO"; +// ECC PO 생성 엔드포인트 (WSDL에 명시된 P2038_D 사용) +const ECC_PO_ENDPOINT = "http://shii8dvddb01.hec.serp.shi.samsung.net:50000/sap/xi/engine?type=entry&version=3.0&Sender.Service=P2038_D&Interface=http%3A%2F%2Fshi.samsung.co.kr%2FP2_MM%2FMMM%5EP2MM3015_SO&QualityOfService=ExactlyOnce"; // PO 헤더 데이터 타입 export interface POHeaderData { @@ -154,7 +154,8 @@ async function sendPOToECC(poData: POCreateRequest): Promise<SoapSendResult> { soapAction: 'http://sap.com/xi/WebService/soap1.1', timeout: 60000, // PO 생성은 60초 타임아웃 retryCount: 3, - retryDelay: 2000 + retryDelay: 2000, + namespace: 'http://shi.samsung.co.kr/P2_MM/MMM' // ECC MM 모듈 네임스페이스 }; // 로그 정보 diff --git a/lib/soap/ecc/send/pcr-confirm.ts b/lib/soap/ecc/send/pcr-confirm.ts index 7ac2d931..46d1a909 100644 --- a/lib/soap/ecc/send/pcr-confirm.ts +++ b/lib/soap/ecc/send/pcr-confirm.ts @@ -3,8 +3,8 @@ import { sendSoapXml, type SoapSendConfig, type SoapLogInfo, type SoapSendResult } from "@/lib/soap/sender"; -// ECC PCR 확인 엔드포인트 -const ECC_PCR_CONFIRM_ENDPOINT = "http://shii8dvddb01.hec.serp.shi.samsung.net:50000/sap/xi/engine?type=entry&version=3.0&Sender.Service=P2038_D&Interface=http%3A%2F%2Fshi.samsung.co.kr%2FP2_MM%2FMMM%5EP2MM3019_SO"; +// ECC PCR 확인 엔드포인트 (WSDL에 명시된 P2038_D 사용) +const ECC_PCR_CONFIRM_ENDPOINT = "http://shii8dvddb01.hec.serp.shi.samsung.net:50000/sap/xi/engine?type=entry&version=3.0&Sender.Service=P2038_D&Interface=http%3A%2F%2Fshi.samsung.co.kr%2FP2_MM%2FMMM%5EP2MM3019_SO&QualityOfService=ExactlyOnce"; // PCR 확인 요청 데이터 타입 export interface PCRConfirmRequest { @@ -167,7 +167,8 @@ async function sendPCRConfirmToECC(pcrData: PCRConfirmRequest): Promise<SoapSend soapAction: 'http://sap.com/xi/WebService/soap1.1', timeout: 30000, // PCR 확인은 30초 타임아웃 retryCount: 3, - retryDelay: 1000 + retryDelay: 1000, + namespace: 'http://shi.samsung.co.kr/P2_MM/MMM' // ECC MM 모듈 네임스페이스 }; // 로그 정보 diff --git a/lib/soap/ecc/send/rfq-info.ts b/lib/soap/ecc/send/rfq-info.ts index 43fe821f..d313a74b 100644 --- a/lib/soap/ecc/send/rfq-info.ts +++ b/lib/soap/ecc/send/rfq-info.ts @@ -19,8 +19,8 @@ import { sendSoapXml, type SoapSendConfig, type SoapLogInfo, type SoapSendResult } from "@/lib/soap/sender"; import { getCurrentSAPDate } from "@/lib/soap/utils"; -// ECC RFQ 정보 전송 엔드포인트 -const ECC_RFQ_ENDPOINT = "http://shii8dvddb01.hec.serp.shi.samsung.net:50000/sap/xi/engine?type=entry&version=3.0&Sender.Service=P2038_D&Interface=http%3A%2F%2Fshi.samsung.co.kr%2FP2_MM%2FMMM%5EP2MM3014_SO"; +// ECC RFQ 정보 전송 엔드포인트 (WSDL에 명시된 P2038_D 사용) +const ECC_RFQ_ENDPOINT = "http://shii8dvddb01.hec.serp.shi.samsung.net:50000/sap/xi/engine?type=entry&version=3.0&Sender.Service=P2038_D&Interface=http%3A%2F%2Fshi.samsung.co.kr%2FP2_MM%2FMMM%5EP2MM3014_SO&QualityOfService=ExactlyOnce"; // RFQ 헤더 데이터 타입 export interface RFQHeaderData { @@ -145,7 +145,8 @@ async function sendRFQToECC(rfqData: RFQInfoRequest): Promise<SoapSendResult> { soapAction: 'http://sap.com/xi/WebService/soap1.1', timeout: 60000, // RFQ 정보 전송은 60초 타임아웃 retryCount: 3, - retryDelay: 2000 + retryDelay: 2000, + namespace: 'http://shi.samsung.co.kr/P2_MM/MMM' // ECC MM 모듈 네임스페이스 }; // 로그 정보 |
