diff options
Diffstat (limited to 'app/api')
| -rw-r--r-- | app/api/(S-ERP)/(MDG)/IF_MDZ_EVCP_VENDOR_MASTER/route.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/api/(S-ERP)/(MDG)/IF_MDZ_EVCP_VENDOR_MASTER/route.ts b/app/api/(S-ERP)/(MDG)/IF_MDZ_EVCP_VENDOR_MASTER/route.ts index 9c74b5c5..9caaa61a 100644 --- a/app/api/(S-ERP)/(MDG)/IF_MDZ_EVCP_VENDOR_MASTER/route.ts +++ b/app/api/(S-ERP)/(MDG)/IF_MDZ_EVCP_VENDOR_MASTER/route.ts @@ -30,6 +30,7 @@ import { bulkUpsert, bulkReplaceSubTableData } from "@/lib/soap/batch-utils"; +import { mapAndSaveMDGVendorData } from "@/lib/soap/mdg/mapper/vendor-mapper"; // 스키마에서 직접 타입 추론 type VendorHeaderData = typeof VENDOR_MASTER_BP_HEADER.$inferInsert; @@ -165,6 +166,13 @@ export async function POST(request: NextRequest) { // 데이터베이스 저장 await saveToDatabase(processedVendors); + // 벤더 매퍼를 사용하여 비즈니스 테이블에 데이터 매핑 및 저장 + const vndrCodes = processedVendors.map(v => v.vendorHeader.VNDRCD).filter((code): code is string => !!code); + if (vndrCodes.length > 0) { + const mapperResult = await mapAndSaveMDGVendorData(vndrCodes); + console.log(`📋 벤더 매퍼 결과: ${mapperResult.message}`); + } + console.log(`🎉 처리 완료: ${processedVendors.length}개 벤더 데이터`); return createSuccessResponse('http://60.101.108.100/api/IF_MDZ_EVCP_VENDOR_MASTER/'); |
