diff options
| author | joonhoekim <26rote@gmail.com> | 2025-11-18 20:49:59 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-11-18 20:49:59 +0900 |
| commit | 18a5bf7d1df331b8e554fc7fe2cabd8902cb0d19 (patch) | |
| tree | d258ed3f02cb1d05e6597c8b8f1e8aac84de4f5b /lib/soap/ecc/mapper/rfq-and-pr-mapper.ts | |
| parent | 36ac8e0b4e6dc3b7c5691046708645d643703c71 (diff) | |
(김준회) 견적목록관리: 설계담당자 정보 대표PR로 처리
Diffstat (limited to 'lib/soap/ecc/mapper/rfq-and-pr-mapper.ts')
| -rw-r--r-- | lib/soap/ecc/mapper/rfq-and-pr-mapper.ts | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/soap/ecc/mapper/rfq-and-pr-mapper.ts b/lib/soap/ecc/mapper/rfq-and-pr-mapper.ts index 85fbb918..d08bc5fb 100644 --- a/lib/soap/ecc/mapper/rfq-and-pr-mapper.ts +++ b/lib/soap/ecc/mapper/rfq-and-pr-mapper.ts @@ -24,6 +24,7 @@ import { findUserInfoByEKGRP, findProjectInfoByPSPID, parseSAPDateTime, + findUserInfoByPERNR, } from './common-mapper-utils'; // ECC 데이터 타입 정의 @@ -154,11 +155,13 @@ export async function mapECCRfqHeaderToRfqLast( const inChargeUserInfo = await findUserInfoByEKGRP(eccHeader.EKGRP || null); const inChargeUserId = inChargeUserInfo?.userId || null; - // 대표 PR Item 기반으로 projectId, itemCode, itemName 설정 (없으면 첫번째 PR Item 사용) + // 대표 PR Item 기반으로 projectId, itemCode, itemName, 설계담당자 설정 (없으면 첫번째 PR Item 사용) let projectId: number | null = null; let itemCode: string | null = null; let itemName: string | null = null; let prNumber: string | null = null; + let engPicName: string | null = null; + let engPicEmployeeNumber: string | null = null; let representativeItem: ECCBidItem | undefined; if (firstItem) { @@ -185,6 +188,15 @@ export async function mapECCRfqHeaderToRfqLast( // prNumber: 대표 PR의 BANFN 또는 첫번째 PR의 ZREQ_FN 값 prNumber = representativeItem?.BANFN || firstItem.ZREQ_FN || null; + + // 설계담당자 정보: 대표 PR Item의 PERNR로 조회 + if (targetItem.PERNR) { + const engPicInfo = await findUserInfoByPERNR(targetItem.PERNR); + if (engPicInfo) { + engPicName = engPicInfo.userName; + engPicEmployeeNumber = engPicInfo.employeeNumber; + } + } } // 매핑 @@ -199,7 +211,8 @@ export async function mapECCRfqHeaderToRfqLast( rfqSendDate: null, // ECC에서 제공되지 않음 status: 'RFQ 생성', // 한글 상태로 변경 rfqSealedYn: false, - EngPicName: null, // ECC에서 제공되지 않음 + EngPicName: engPicName, // 대표 PR Item의 PERNR로 조회한 설계담당자명 + EngPicEmployeeNumber: engPicEmployeeNumber, // 대표 PR Item의 PERNR(사번) packageNo: null, // ECC에서 제공되지 않음 packageName: null, // ECC에서 제공되지 않음 remark: null, |
