diff options
| author | joonhoekim <26rote@gmail.com> | 2025-11-11 17:49:09 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-11-11 17:49:09 +0900 |
| commit | 88b737a71372353e47c466553273d88f5bf36834 (patch) | |
| tree | a5d2221fac72392a26a1ffdf587ffc2fbc60b027 /lib/soap/ecc/mapper | |
| parent | e8e1d9c53580d546e400923d76e6c4a5ef96bd76 (diff) | |
(김준회) SOAP: PO생성요청시 미구현 부분 처리, PO 수신시 LOEKZ(삭제지시자)있는 PR은 스킵하도록 변경
Diffstat (limited to 'lib/soap/ecc/mapper')
| -rw-r--r-- | lib/soap/ecc/mapper/po-mapper.ts | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/lib/soap/ecc/mapper/po-mapper.ts b/lib/soap/ecc/mapper/po-mapper.ts index 847ffdc0..4f8b8034 100644 --- a/lib/soap/ecc/mapper/po-mapper.ts +++ b/lib/soap/ecc/mapper/po-mapper.ts @@ -402,16 +402,30 @@ export async function mapAndSaveECCPOData( const contractItemsData: ContractItemData[] = []; for (const detail of details) { + // LOEKZ(삭제지시자)가 null이 아니면 스킵 + if (detail.LOEKZ !== null && detail.LOEKZ !== undefined && detail.LOEKZ !== '') { + debugLog('삭제 지시된 아이템 스킵', { + ebeln: detail.EBELN, + ebelp: detail.EBELP, + loekz: detail.LOEKZ + }); + continue; + } + const itemData = await mapECCPODetailToBusiness(detail, contractId); contractItemsData.push(itemData); } - // 일괄 삽입 - await tx.insert(contractItems).values(contractItemsData); - debugLog('계약 아이템 저장 완료', { - contractId, - itemCount: contractItemsData.length - }); + // 일괄 삽입 (유효한 아이템이 있을 때만) + if (contractItemsData.length > 0) { + await tx.insert(contractItems).values(contractItemsData); + debugLog('계약 아이템 저장 완료', { + contractId, + itemCount: contractItemsData.length + }); + } else { + debugLog('저장할 유효한 계약 아이템 없음', { contractId }); + } } processedCount++; |
