summaryrefslogtreecommitdiff
path: root/lib/soap/ecc/mapper/rfq-and-pr-mapper.ts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/soap/ecc/mapper/rfq-and-pr-mapper.ts')
-rw-r--r--lib/soap/ecc/mapper/rfq-and-pr-mapper.ts42
1 files changed, 10 insertions, 32 deletions
diff --git a/lib/soap/ecc/mapper/rfq-and-pr-mapper.ts b/lib/soap/ecc/mapper/rfq-and-pr-mapper.ts
index f2683213..cc241aa6 100644
--- a/lib/soap/ecc/mapper/rfq-and-pr-mapper.ts
+++ b/lib/soap/ecc/mapper/rfq-and-pr-mapper.ts
@@ -1,7 +1,12 @@
/**
- * pr 발행 후, pr을 묶어서 rfq, bidding 을 sap ecc에서 생성한 경우
- * ZBSART = AN인 경우, 즉 rfq인 경우 해당 케이스를 soap으로 수신한 뒤 이 함수에서 rqfLast, rfqPrItems 테이블에 매핑
- * bidding인 경우는 bidding-and-pr-mapper.ts 파일에서 매핑
+ * SAP ECC에서 PR을 묶어 RFQ를 생성한 경우 SOAP으로 수신하여 처리하는 매퍼
+ *
+ * ZBSART = AN (RFQ)인 경우 이 파일에서 처리하여 rfqsLast, rfqPrItems 테이블에 매핑합니다.
+ * ZBSART = AB (Bidding)인 경우는 bidding-and-pr-mapper.ts 파일에서 매핑합니다.
+ *
+ * 주요 변경사항:
+ * - POS 파일 자동 다운로드 로직 제거됨 (온디맨드 방식으로 변경)
+ * - 사용자가 필요할 때만 POS 파일을 다운로드하도록 개선
*/
import { debugLog, debugSuccess, debugError } from '@/lib/debug-utils';
@@ -20,7 +25,6 @@ import {
findProjectInfoByPSPID,
parseSAPDateTime,
} from './common-mapper-utils';
-import { syncRfqPosFiles } from '@/lib/pos';
// ECC 데이터 타입 정의
export type ECCBidHeader = typeof PR_INFORMATION_T_BID_HEADER.$inferInsert;
@@ -374,34 +378,8 @@ export async function mapAndSaveECCRfqDataToRfqLast(
processedCount: result.processedCount,
});
- // 6) 각 RFQ에 대해 POS 파일 자동 동기화 (비동기로 실행하여 메인 플로우 블록하지 않음)
- debugLog('RFQ POS 파일 자동 동기화 시작', { rfqCount: result.insertedRfqs.length });
-
- // 비동기로 각 RFQ의 POS 파일 동기화 실행 (결과를 기다리지 않음)
- result.insertedRfqs.forEach(async (rfq) => {
- try {
- debugLog(`RFQ ${rfq.rfqCode} POS 파일 동기화 시작`, { rfqId: rfq.id });
- const syncResult = await syncRfqPosFiles(rfq.id, 1); // 시스템 사용자 ID = 1
-
- if (syncResult.success) {
- debugSuccess(`RFQ ${rfq.rfqCode} POS 파일 동기화 완료`, {
- rfqId: rfq.id,
- successCount: syncResult.successCount,
- failedCount: syncResult.failedCount
- });
- } else {
- debugError(`RFQ ${rfq.rfqCode} POS 파일 동기화 실패`, {
- rfqId: rfq.id,
- errors: syncResult.errors
- });
- }
- } catch (error) {
- debugError(`RFQ ${rfq.rfqCode} POS 파일 동기화 중 예외 발생`, {
- rfqId: rfq.id,
- error: error instanceof Error ? error.message : '알 수 없는 오류'
- });
- }
- });
+ // Note: POS 파일은 온디맨드 방식으로 사용자가 필요할 때 다운로드됩니다.
+ // 자동 다운로드는 더 이상 수행하지 않습니다.
return {
success: true,