diff options
| author | joonhoekim <26rote@gmail.com> | 2025-12-04 21:02:10 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-12-04 21:02:10 +0900 |
| commit | 240f4f31b3b6ff6a46436978fb988588a1972721 (patch) | |
| tree | dbf81b022d861cb077e84a10b913c26fd064db8b /lib/soap | |
| parent | 5699e866201566366981ae8399a835fc7fa9fa47 (diff) | |
| parent | ae211e5b9d9bf8e1566b78a85ec4522360833ea9 (diff) | |
(김준회) Merge branch 'dujinkim' of https://github.com/DTS-Development/SHI_EVCP into dujinkim
Diffstat (limited to 'lib/soap')
| -rw-r--r-- | lib/soap/ecc/mapper/bidding-and-pr-mapper.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/soap/ecc/mapper/bidding-and-pr-mapper.ts b/lib/soap/ecc/mapper/bidding-and-pr-mapper.ts index 9bdd238d..00873d83 100644 --- a/lib/soap/ecc/mapper/bidding-and-pr-mapper.ts +++ b/lib/soap/ecc/mapper/bidding-and-pr-mapper.ts @@ -32,6 +32,7 @@ import { parseSAPDateToString, findSpecificationByMATNR, } from './common-mapper-utils'; +import { updateBiddingAmounts } from '@/lib/bidding/service'; // Note: POS 파일은 온디맨드 방식으로 다운로드됩니다. // 자동 동기화 관련 import는 제거되었습니다. @@ -497,6 +498,20 @@ export async function mapAndSaveECCBiddingData( }; }); + // 새로 생성된 Bidding들에 대해 금액 집계 업데이트 (PR 아이템의 금액 정보를 Bidding 헤더에 반영) + if (result.insertedBiddings && result.insertedBiddings.length > 0) { + debugLog('Bidding 금액 집계 업데이트 시작', { count: result.insertedBiddings.length }); + await Promise.all( + result.insertedBiddings.map(async (bidding) => { + try { + await updateBiddingAmounts(bidding.id); + } catch (err) { + debugError(`Bidding ${bidding.biddingNumber} 금액 업데이트 실패`, err); + } + }) + ); + } + debugSuccess('ECC Bidding 데이터 일괄 처리 완료', { processedCount: result.processedCount, }); |
