summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/[lng]/admin/ecc/page.tsx706
-rw-r--r--lib/soap/ecc/mapper/po-mapper.ts427
-rw-r--r--lib/soap/ecc/mapper/rfq-and-pr-mapper.ts (renamed from lib/soap/ecc-mapper.ts)2
-rw-r--r--lib/soap/ecc/send/cancel-rfq.ts346
-rw-r--r--lib/soap/ecc/send/create-po.ts417
-rw-r--r--lib/soap/ecc/send/pcr-confirm.ts682
-rw-r--r--lib/soap/ecc/send/rfq-info.ts469
-rw-r--r--lib/soap/mdg/mapper/project-mapper.ts169
-rw-r--r--lib/soap/mdg/send/vendor-master/action.ts2
-rw-r--r--lib/soap/mdg/send/vendor-master/csv-fields.ts12
-rw-r--r--lib/soap/sender.ts287
-rw-r--r--lib/soap/utils.ts54
-rw-r--r--public/wsdl/IF_EVCP_ECC_CANCEL_RFQ.csv4
-rw-r--r--public/wsdl/IF_EVCP_ECC_CANCEL_RFQ.wsdl102
-rw-r--r--public/wsdl/IF_EVCP_ECC_CREATE_PO.csv39
-rw-r--r--public/wsdl/IF_EVCP_ECC_PCR_CONFIRM.csv21
-rw-r--r--public/wsdl/IF_EVCP_ECC_PCR_CONFIRM.wsdl182
-rw-r--r--public/wsdl/IF_EVCP_ECC_RFQ_INFORMATION.csv19
-rw-r--r--public/wsdl/IF_EVCP_ECC_RFQ_INFORMATION.wsdl364
-rw-r--r--public/wsdl/IF_EVCP_MDZ_VENDOR_MASTER.wsdl286
20 files changed, 4414 insertions, 176 deletions
diff --git a/app/[lng]/admin/ecc/page.tsx b/app/[lng]/admin/ecc/page.tsx
new file mode 100644
index 00000000..bb3168c4
--- /dev/null
+++ b/app/[lng]/admin/ecc/page.tsx
@@ -0,0 +1,706 @@
+'use client'
+
+import { useState } from 'react'
+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
+import { Button } from '@/components/ui/button'
+import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
+import { Input } from '@/components/ui/input'
+import { Label } from '@/components/ui/label'
+
+import { Badge } from '@/components/ui/badge'
+import { Separator } from '@/components/ui/separator'
+import { Alert, AlertDescription } from '@/components/ui/alert'
+import { Loader2, Play, CheckCircle, XCircle, Send } from 'lucide-react'
+import { toast } from 'sonner'
+
+// SOAP 송신 함수들 import
+import { confirmTestPCR, confirmPCR } from '@/lib/soap/ecc/send/pcr-confirm'
+import { cancelTestRFQ, cancelRFQ } from '@/lib/soap/ecc/send/cancel-rfq'
+import { sendTestRFQInformation, sendRFQInformation } from '@/lib/soap/ecc/send/rfq-info'
+import { createTestPurchaseOrder, createPurchaseOrder } from '@/lib/soap/ecc/send/create-po'
+
+interface TestResult {
+ success: boolean
+ message: string
+ responseData?: string
+ timestamp: string
+ duration?: number
+}
+
+export default function ECCSenderTestPage() {
+ const [isLoading, setIsLoading] = useState<{ [key: string]: boolean }>({})
+ const [testResults, setTestResults] = useState<{ [key: string]: TestResult }>({})
+
+ // 테스트 실행 공통 함수
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ const runTest = async (testName: string, testFunction: () => Promise<any>) => {
+ setIsLoading(prev => ({ ...prev, [testName]: true }))
+ const startTime = Date.now()
+
+ try {
+ const result = await testFunction()
+ const duration = Date.now() - startTime
+
+ const testResult: TestResult = {
+ success: result.success,
+ message: result.message,
+ responseData: result.responseData,
+ timestamp: new Date().toLocaleString('ko-KR'),
+ duration
+ }
+
+ setTestResults(prev => ({ ...prev, [testName]: testResult }))
+
+ if (result.success) {
+ toast.success(`${testName} 테스트 성공`)
+ } else {
+ toast.error(`${testName} 테스트 실패: ${result.message}`)
+ }
+ } catch (error) {
+ const testResult: TestResult = {
+ success: false,
+ message: error instanceof Error ? error.message : '알 수 없는 오류',
+ timestamp: new Date().toLocaleString('ko-KR'),
+ duration: Date.now() - startTime
+ }
+
+ setTestResults(prev => ({ ...prev, [testName]: testResult }))
+ toast.error(`${testName} 테스트 오류: ${testResult.message}`)
+ } finally {
+ setIsLoading(prev => ({ ...prev, [testName]: false }))
+ }
+ }
+
+ // PCR 확인 테스트
+ const [pcrData, setPcrData] = useState({
+ PCR_REQ: 'TEST_PCR01',
+ PCR_REQ_SEQ: '00001',
+ PCR_DEC_DATE: '20241201',
+ EBELN: 'TEST_PO01',
+ EBELP: '00010',
+ PCR_STATUS: 'A',
+ WAERS: 'KRW',
+ PCR_NETPR: '1000.00',
+ PEINH: '1',
+ PCR_NETWR: '1000.00',
+ CONFIRM_CD: 'CONF',
+ CONFIRM_RSN: '테스트 확인'
+ })
+
+ // RFQ 취소 테스트
+ const [rfqCancelData, setRfqCancelData] = useState({
+ ANFNR: 'TEST_RFQ_001'
+ })
+
+ // RFQ 정보 전송 테스트
+ const [rfqInfoData, setRfqInfoData] = useState({
+ // 헤더 정보
+ ANFNR: 'RFQ0000001',
+ LIFNR: '1000000001',
+ WAERS: 'KRW',
+ ZTERM: '0001',
+ INCO1: 'FOB',
+ INCO2: 'Seoul, Korea',
+ MWSKZ: 'V0',
+ LANDS: 'KR',
+ VSTEL: '001',
+ LSTEL: '001',
+ // 아이템 정보
+ ANFPS: '00001',
+ NETPR: '1000.00',
+ NETWR: '1000.00',
+ BRTWR: '1100.00',
+ LFDAT: '20241201'
+ })
+
+ // PO 생성 테스트
+ const [poData, setPoData] = useState({
+ // 헤더 정보
+ ANFNR: 'TEST001',
+ LIFNR: '1000000001',
+ ZPROC_IND: 'A',
+ ANGNR: 'TEST001',
+ WAERS: 'KRW',
+ ZTERM: '0001',
+ INCO1: 'FOB',
+ INCO2: 'Seoul, Korea',
+ MWSKZ: 'V0',
+ LANDS: 'KR',
+ ZRCV_DT: '20241201',
+ ZATTEN_IND: 'Y',
+ IHRAN: '20241201',
+ TEXT: 'Test PO Creation',
+ // 아이템 정보
+ ANFPS: '00001',
+ NETPR: '1000.00',
+ PEINH: '1',
+ BPRME: 'EA',
+ NETWR: '1000.00',
+ BRTWR: '1100.00',
+ LFDAT: '20241201',
+ // PR 반환 정보
+ EBELN: 'PR001',
+ EBELP: '00001',
+ MSGTY: 'S',
+ MSGTXT: 'Test message'
+ })
+
+ return (
+ <div className="container mx-auto py-8 space-y-6">
+ <div className="flex items-center justify-between">
+ <div>
+ <h1 className="text-3xl font-bold">ECC SOAP Sender 테스트</h1>
+ <p className="text-muted-foreground mt-2">
+ 4개의 ECC SOAP 송신 라이브러리를 테스트합니다
+ </p>
+ </div>
+ <Badge variant="outline" className="text-sm">
+ 개발/테스트 환경
+ </Badge>
+ </div>
+
+ <Tabs defaultValue="pcr-confirm" className="w-full">
+ <TabsList className="grid w-full grid-cols-4">
+ <TabsTrigger value="pcr-confirm">PCR 확인</TabsTrigger>
+ <TabsTrigger value="rfq-cancel">RFQ 취소</TabsTrigger>
+ <TabsTrigger value="rfq-info">RFQ 정보</TabsTrigger>
+ <TabsTrigger value="po-create">PO 생성</TabsTrigger>
+ </TabsList>
+
+ {/* PCR 확인 탭 */}
+ <TabsContent value="pcr-confirm" className="space-y-6">
+ <Card>
+ <CardHeader>
+ <CardTitle className="flex items-center gap-2">
+ <Send className="h-5 w-5" />
+ PCR (Price Change Request) 확인
+ </CardTitle>
+ <CardDescription>
+ PCR 확인 요청을 ECC로 전송합니다. (IF_ECC_EVCP_PCR_CONFIRM)
+ </CardDescription>
+ </CardHeader>
+ <CardContent className="space-y-4">
+ <div className="grid grid-cols-2 gap-4">
+ <div className="space-y-2">
+ <Label htmlFor="pcr-req">PCR 요청번호 (필수)</Label>
+ <Input
+ id="pcr-req"
+ value={pcrData.PCR_REQ}
+ onChange={(e) => setPcrData(prev => ({ ...prev, PCR_REQ: e.target.value }))}
+ placeholder="PCR 요청번호 (최대 10자)"
+ />
+ </div>
+ <div className="space-y-2">
+ <Label htmlFor="pcr-seq">PCR 요청순번 (필수)</Label>
+ <Input
+ id="pcr-seq"
+ value={pcrData.PCR_REQ_SEQ}
+ onChange={(e) => setPcrData(prev => ({ ...prev, PCR_REQ_SEQ: e.target.value }))}
+ placeholder="PCR 요청순번 (5자리 숫자)"
+ />
+ </div>
+ <div className="space-y-2">
+ <Label htmlFor="pcr-date">PCR 결정일 (필수)</Label>
+ <Input
+ id="pcr-date"
+ value={pcrData.PCR_DEC_DATE}
+ onChange={(e) => setPcrData(prev => ({ ...prev, PCR_DEC_DATE: e.target.value }))}
+ placeholder="YYYYMMDD 형식"
+ />
+ </div>
+ <div className="space-y-2">
+ <Label htmlFor="ebeln">구매오더 (필수)</Label>
+ <Input
+ id="ebeln"
+ value={pcrData.EBELN}
+ onChange={(e) => setPcrData(prev => ({ ...prev, EBELN: e.target.value }))}
+ placeholder="구매오더 번호"
+ />
+ </div>
+ <div className="space-y-2">
+ <Label htmlFor="ebelp">구매오더 품번 (필수)</Label>
+ <Input
+ id="ebelp"
+ value={pcrData.EBELP}
+ onChange={(e) => setPcrData(prev => ({ ...prev, EBELP: e.target.value }))}
+ placeholder="구매오더 품번"
+ />
+ </div>
+ <div className="space-y-2">
+ <Label htmlFor="pcr-status">PCR 상태 (필수)</Label>
+ <Input
+ id="pcr-status"
+ value={pcrData.PCR_STATUS}
+ onChange={(e) => setPcrData(prev => ({ ...prev, PCR_STATUS: e.target.value }))}
+ placeholder="PCR 상태 (1자)"
+ />
+ </div>
+ </div>
+
+ <Separator />
+
+ <div className="flex gap-4">
+ <Button
+ onClick={() => runTest('PCR 확인 (샘플)', () => confirmTestPCR())}
+ disabled={isLoading['PCR 확인 (샘플)']}
+ variant="outline"
+ >
+ {isLoading['PCR 확인 (샘플)'] && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
+ <Play className="mr-2 h-4 w-4" />
+ 샘플 데이터로 테스트
+ </Button>
+ <Button
+ onClick={() => runTest('PCR 확인 (사용자)', () => confirmPCR(pcrData))}
+ disabled={isLoading['PCR 확인 (사용자)']}
+ >
+ {isLoading['PCR 확인 (사용자)'] && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
+ <Send className="mr-2 h-4 w-4" />
+ 사용자 데이터로 전송
+ </Button>
+ </div>
+
+ {/* 테스트 결과 표시 */}
+ {(testResults['PCR 확인 (샘플)'] || testResults['PCR 확인 (사용자)']) && (
+ <div className="space-y-2">
+ <h4 className="font-semibold">테스트 결과</h4>
+ {testResults['PCR 확인 (샘플)'] && (
+ <TestResultCard result={testResults['PCR 확인 (샘플)']} title="샘플 테스트" />
+ )}
+ {testResults['PCR 확인 (사용자)'] && (
+ <TestResultCard result={testResults['PCR 확인 (사용자)']} title="사용자 테스트" />
+ )}
+ </div>
+ )}
+ </CardContent>
+ </Card>
+ </TabsContent>
+
+ {/* RFQ 취소 탭 */}
+ <TabsContent value="rfq-cancel" className="space-y-6">
+ <Card>
+ <CardHeader>
+ <CardTitle className="flex items-center gap-2">
+ <Send className="h-5 w-5" />
+ RFQ (Request for Quotation) 취소
+ </CardTitle>
+ <CardDescription>
+ RFQ 취소 요청을 ECC로 전송합니다. (IF_ECC_EVCP_CANCEL_RFQ)
+ </CardDescription>
+ </CardHeader>
+ <CardContent className="space-y-4">
+ <div className="space-y-2">
+ <Label htmlFor="anfnr-cancel">RFQ 번호 (필수)</Label>
+ <Input
+ id="anfnr-cancel"
+ value={rfqCancelData.ANFNR}
+ onChange={(e) => setRfqCancelData(prev => ({ ...prev, ANFNR: e.target.value }))}
+ placeholder="RFQ 번호 (최대 10자)"
+ />
+ </div>
+
+ <Separator />
+
+ <div className="flex gap-4">
+ <Button
+ onClick={() => runTest('RFQ 취소 (샘플)', () => cancelTestRFQ())}
+ disabled={isLoading['RFQ 취소 (샘플)']}
+ variant="outline"
+ >
+ {isLoading['RFQ 취소 (샘플)'] && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
+ <Play className="mr-2 h-4 w-4" />
+ 샘플 데이터로 테스트
+ </Button>
+ <Button
+ onClick={() => runTest('RFQ 취소 (사용자)', () => cancelRFQ(rfqCancelData.ANFNR))}
+ disabled={isLoading['RFQ 취소 (사용자)']}
+ variant="destructive"
+ >
+ {isLoading['RFQ 취소 (사용자)'] && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
+ <Send className="mr-2 h-4 w-4" />
+ 사용자 데이터로 취소
+ </Button>
+ </div>
+
+ {/* 테스트 결과 표시 */}
+ {(testResults['RFQ 취소 (샘플)'] || testResults['RFQ 취소 (사용자)']) && (
+ <div className="space-y-2">
+ <h4 className="font-semibold">테스트 결과</h4>
+ {testResults['RFQ 취소 (샘플)'] && (
+ <TestResultCard result={testResults['RFQ 취소 (샘플)']} title="샘플 테스트" />
+ )}
+ {testResults['RFQ 취소 (사용자)'] && (
+ <TestResultCard result={testResults['RFQ 취소 (사용자)']} title="사용자 테스트" />
+ )}
+ </div>
+ )}
+ </CardContent>
+ </Card>
+ </TabsContent>
+
+ {/* RFQ 정보 탭 */}
+ <TabsContent value="rfq-info" className="space-y-6">
+ <Card>
+ <CardHeader>
+ <CardTitle className="flex items-center gap-2">
+ <Send className="h-5 w-5" />
+ RFQ 정보 전송
+ </CardTitle>
+ <CardDescription>
+ RFQ 정보를 ECC로 전송합니다. (IF_EVCP_ECC_RFQ_INFORMATION)
+ </CardDescription>
+ </CardHeader>
+ <CardContent className="space-y-4">
+ <div className="space-y-4">
+ <h4 className="font-semibold">RFQ 헤더 정보</h4>
+ <div className="grid grid-cols-2 gap-4">
+ <div className="space-y-2">
+ <Label htmlFor="rfq-anfnr">RFQ 번호 (필수)</Label>
+ <Input
+ id="rfq-anfnr"
+ value={rfqInfoData.ANFNR}
+ onChange={(e) => setRfqInfoData(prev => ({ ...prev, ANFNR: e.target.value }))}
+ placeholder="RFQ 번호"
+ />
+ </div>
+ <div className="space-y-2">
+ <Label htmlFor="rfq-lifnr">공급업체 계정 (필수)</Label>
+ <Input
+ id="rfq-lifnr"
+ value={rfqInfoData.LIFNR}
+ onChange={(e) => setRfqInfoData(prev => ({ ...prev, LIFNR: e.target.value }))}
+ placeholder="공급업체 계정번호"
+ />
+ </div>
+ <div className="space-y-2">
+ <Label htmlFor="rfq-waers">통화 (필수)</Label>
+ <Input
+ id="rfq-waers"
+ value={rfqInfoData.WAERS}
+ onChange={(e) => setRfqInfoData(prev => ({ ...prev, WAERS: e.target.value }))}
+ placeholder="통화 코드 (예: KRW)"
+ />
+ </div>
+ <div className="space-y-2">
+ <Label htmlFor="rfq-zterm">지불조건 (필수)</Label>
+ <Input
+ id="rfq-zterm"
+ value={rfqInfoData.ZTERM}
+ onChange={(e) => setRfqInfoData(prev => ({ ...prev, ZTERM: e.target.value }))}
+ placeholder="지불조건 키"
+ />
+ </div>
+ </div>
+
+ <h4 className="font-semibold">RFQ 아이템 정보</h4>
+ <div className="grid grid-cols-2 gap-4">
+ <div className="space-y-2">
+ <Label htmlFor="rfq-anfps">아이템 번호 (필수)</Label>
+ <Input
+ id="rfq-anfps"
+ value={rfqInfoData.ANFPS}
+ onChange={(e) => setRfqInfoData(prev => ({ ...prev, ANFPS: e.target.value }))}
+ placeholder="RFQ 아이템 번호"
+ />
+ </div>
+ <div className="space-y-2">
+ <Label htmlFor="rfq-netpr">순가격 (필수)</Label>
+ <Input
+ id="rfq-netpr"
+ value={rfqInfoData.NETPR}
+ onChange={(e) => setRfqInfoData(prev => ({ ...prev, NETPR: e.target.value }))}
+ placeholder="순가격"
+ />
+ </div>
+ <div className="space-y-2">
+ <Label htmlFor="rfq-netwr">순주문가격 (필수)</Label>
+ <Input
+ id="rfq-netwr"
+ value={rfqInfoData.NETWR}
+ onChange={(e) => setRfqInfoData(prev => ({ ...prev, NETWR: e.target.value }))}
+ placeholder="순주문가격"
+ />
+ </div>
+ <div className="space-y-2">
+ <Label htmlFor="rfq-brtwr">총주문가격 (필수)</Label>
+ <Input
+ id="rfq-brtwr"
+ value={rfqInfoData.BRTWR}
+ onChange={(e) => setRfqInfoData(prev => ({ ...prev, BRTWR: e.target.value }))}
+ placeholder="총주문가격"
+ />
+ </div>
+ </div>
+ </div>
+
+ <Separator />
+
+ <div className="flex gap-4">
+ <Button
+ onClick={() => runTest('RFQ 정보 (샘플)', () => sendTestRFQInformation())}
+ disabled={isLoading['RFQ 정보 (샘플)']}
+ variant="outline"
+ >
+ {isLoading['RFQ 정보 (샘플)'] && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
+ <Play className="mr-2 h-4 w-4" />
+ 샘플 데이터로 테스트
+ </Button>
+ <Button
+ onClick={() => runTest('RFQ 정보 (사용자)', async () => {
+ const rfqRequest = {
+ T_RFQ_HEADER: [{
+ ANFNR: rfqInfoData.ANFNR,
+ LIFNR: rfqInfoData.LIFNR,
+ WAERS: rfqInfoData.WAERS,
+ ZTERM: rfqInfoData.ZTERM,
+ INCO1: rfqInfoData.INCO1,
+ INCO2: rfqInfoData.INCO2,
+ MWSKZ: rfqInfoData.MWSKZ,
+ LANDS: rfqInfoData.LANDS,
+ VSTEL: rfqInfoData.VSTEL,
+ LSTEL: rfqInfoData.LSTEL
+ }],
+ T_RFQ_ITEM: [{
+ ANFNR: rfqInfoData.ANFNR,
+ ANFPS: rfqInfoData.ANFPS,
+ NETPR: rfqInfoData.NETPR,
+ NETWR: rfqInfoData.NETWR,
+ BRTWR: rfqInfoData.BRTWR,
+ LFDAT: rfqInfoData.LFDAT
+ }]
+ }
+ return sendRFQInformation(rfqRequest)
+ })}
+ disabled={isLoading['RFQ 정보 (사용자)']}
+ >
+ {isLoading['RFQ 정보 (사용자)'] && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
+ <Send className="mr-2 h-4 w-4" />
+ 사용자 데이터로 전송
+ </Button>
+ </div>
+
+ {/* 테스트 결과 표시 */}
+ {(testResults['RFQ 정보 (샘플)'] || testResults['RFQ 정보 (사용자)']) && (
+ <div className="space-y-2">
+ <h4 className="font-semibold">테스트 결과</h4>
+ {testResults['RFQ 정보 (샘플)'] && (
+ <TestResultCard result={testResults['RFQ 정보 (샘플)']} title="샘플 테스트" />
+ )}
+ {testResults['RFQ 정보 (사용자)'] && (
+ <TestResultCard result={testResults['RFQ 정보 (사용자)']} title="사용자 테스트" />
+ )}
+ </div>
+ )}
+ </CardContent>
+ </Card>
+ </TabsContent>
+
+ {/* PO 생성 탭 */}
+ <TabsContent value="po-create" className="space-y-6">
+ <Card>
+ <CardHeader>
+ <CardTitle className="flex items-center gap-2">
+ <Send className="h-5 w-5" />
+ PO (Purchase Order) 생성
+ </CardTitle>
+ <CardDescription>
+ 구매주문 생성 요청을 ECC로 전송합니다. (IF_ECC_EVCP_PO_CREATE)
+ </CardDescription>
+ </CardHeader>
+ <CardContent className="space-y-4">
+ <div className="space-y-4">
+ <h4 className="font-semibold">PO 헤더 정보</h4>
+ <div className="grid grid-cols-2 gap-4">
+ <div className="space-y-2">
+ <Label htmlFor="po-anfnr">입찰번호 (필수)</Label>
+ <Input
+ id="po-anfnr"
+ value={poData.ANFNR}
+ onChange={(e) => setPoData(prev => ({ ...prev, ANFNR: e.target.value }))}
+ placeholder="입찰번호"
+ />
+ </div>
+ <div className="space-y-2">
+ <Label htmlFor="po-lifnr">공급업체 계정 (필수)</Label>
+ <Input
+ id="po-lifnr"
+ value={poData.LIFNR}
+ onChange={(e) => setPoData(prev => ({ ...prev, LIFNR: e.target.value }))}
+ placeholder="공급업체 계정번호"
+ />
+ </div>
+ <div className="space-y-2">
+ <Label htmlFor="po-zproc">처리상태 (필수)</Label>
+ <Input
+ id="po-zproc"
+ value={poData.ZPROC_IND}
+ onChange={(e) => setPoData(prev => ({ ...prev, ZPROC_IND: e.target.value }))}
+ placeholder="구매처리상태"
+ />
+ </div>
+ <div className="space-y-2">
+ <Label htmlFor="po-waers">통화 (필수)</Label>
+ <Input
+ id="po-waers"
+ value={poData.WAERS}
+ onChange={(e) => setPoData(prev => ({ ...prev, WAERS: e.target.value }))}
+ placeholder="통화 코드"
+ />
+ </div>
+ </div>
+
+ <h4 className="font-semibold">PO 아이템 정보</h4>
+ <div className="grid grid-cols-2 gap-4">
+ <div className="space-y-2">
+ <Label htmlFor="po-anfps">입찰 아이템번호 (필수)</Label>
+ <Input
+ id="po-anfps"
+ value={poData.ANFPS}
+ onChange={(e) => setPoData(prev => ({ ...prev, ANFPS: e.target.value }))}
+ placeholder="입찰 아이템번호"
+ />
+ </div>
+ <div className="space-y-2">
+ <Label htmlFor="po-netpr">순가격 (필수)</Label>
+ <Input
+ id="po-netpr"
+ value={poData.NETPR}
+ onChange={(e) => setPoData(prev => ({ ...prev, NETPR: e.target.value }))}
+ placeholder="순가격"
+ />
+ </div>
+ <div className="space-y-2">
+ <Label htmlFor="po-bprme">주문단위 (필수)</Label>
+ <Input
+ id="po-bprme"
+ value={poData.BPRME}
+ onChange={(e) => setPoData(prev => ({ ...prev, BPRME: e.target.value }))}
+ placeholder="주문단위 (예: EA)"
+ />
+ </div>
+ <div className="space-y-2">
+ <Label htmlFor="po-lfdat">납기일 (필수)</Label>
+ <Input
+ id="po-lfdat"
+ value={poData.LFDAT}
+ onChange={(e) => setPoData(prev => ({ ...prev, LFDAT: e.target.value }))}
+ placeholder="YYYYMMDD 형식"
+ />
+ </div>
+ </div>
+ </div>
+
+ <Separator />
+
+ <div className="flex gap-4">
+ <Button
+ onClick={() => runTest('PO 생성 (샘플)', () => createTestPurchaseOrder())}
+ disabled={isLoading['PO 생성 (샘플)']}
+ variant="outline"
+ >
+ {isLoading['PO 생성 (샘플)'] && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
+ <Play className="mr-2 h-4 w-4" />
+ 샘플 데이터로 테스트
+ </Button>
+ <Button
+ onClick={() => runTest('PO 생성 (사용자)', async () => {
+ const poRequest = {
+ T_Bidding_HEADER: [{
+ ANFNR: poData.ANFNR,
+ LIFNR: poData.LIFNR,
+ ZPROC_IND: poData.ZPROC_IND,
+ ANGNR: poData.ANGNR,
+ WAERS: poData.WAERS,
+ ZTERM: poData.ZTERM,
+ INCO1: poData.INCO1,
+ INCO2: poData.INCO2,
+ MWSKZ: poData.MWSKZ,
+ LANDS: poData.LANDS,
+ ZRCV_DT: poData.ZRCV_DT,
+ ZATTEN_IND: poData.ZATTEN_IND,
+ IHRAN: poData.IHRAN,
+ TEXT: poData.TEXT
+ }],
+ T_Bidding_ITEM: [{
+ ANFNR: poData.ANFNR,
+ ANFPS: poData.ANFPS,
+ LIFNR: poData.LIFNR,
+ NETPR: poData.NETPR,
+ PEINH: poData.PEINH,
+ BPRME: poData.BPRME,
+ NETWR: poData.NETWR,
+ BRTWR: poData.BRTWR,
+ LFDAT: poData.LFDAT
+ }],
+ T_PR_RETURN: [{
+ ANFNR: poData.ANFNR,
+ ANFPS: poData.ANFPS,
+ EBELN: poData.EBELN,
+ EBELP: poData.EBELP,
+ MSGTY: poData.MSGTY,
+ MSGTXT: poData.MSGTXT
+ }]
+ }
+ return createPurchaseOrder(poRequest)
+ })}
+ disabled={isLoading['PO 생성 (사용자)']}
+ >
+ {isLoading['PO 생성 (사용자)'] && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
+ <Send className="mr-2 h-4 w-4" />
+ 사용자 데이터로 생성
+ </Button>
+ </div>
+
+ {/* 테스트 결과 표시 */}
+ {(testResults['PO 생성 (샘플)'] || testResults['PO 생성 (사용자)']) && (
+ <div className="space-y-2">
+ <h4 className="font-semibold">테스트 결과</h4>
+ {testResults['PO 생성 (샘플)'] && (
+ <TestResultCard result={testResults['PO 생성 (샘플)']} title="샘플 테스트" />
+ )}
+ {testResults['PO 생성 (사용자)'] && (
+ <TestResultCard result={testResults['PO 생성 (사용자)']} title="사용자 테스트" />
+ )}
+ </div>
+ )}
+ </CardContent>
+ </Card>
+ </TabsContent>
+ </Tabs>
+ </div>
+ )
+}
+
+// 테스트 결과 표시 컴포넌트
+function TestResultCard({ result, title }: { result: TestResult; title: string }) {
+ return (
+ <Alert className={result.success ? 'border-green-200 bg-green-50' : 'border-red-200 bg-red-50'}>
+ <div className="flex items-center gap-2">
+ {result.success ? (
+ <CheckCircle className="h-4 w-4 text-green-600" />
+ ) : (
+ <XCircle className="h-4 w-4 text-red-600" />
+ )}
+ <span className="font-semibold">{title}</span>
+ <Badge variant="outline" className="text-xs">
+ {result.duration}ms
+ </Badge>
+ <span className="text-xs text-muted-foreground ml-auto">
+ {result.timestamp}
+ </span>
+ </div>
+ <AlertDescription className="mt-2">
+ <div className="space-y-2">
+ <p>{result.message}</p>
+ {result.responseData && (
+ <details className="text-xs">
+ <summary className="cursor-pointer font-medium">응답 데이터 보기</summary>
+ <pre className="mt-2 p-2 bg-gray-100 rounded text-xs overflow-auto max-h-40">
+ {result.responseData}
+ </pre>
+ </details>
+ )}
+ </div>
+ </AlertDescription>
+ </Alert>
+ )
+}
diff --git a/lib/soap/ecc/mapper/po-mapper.ts b/lib/soap/ecc/mapper/po-mapper.ts
new file mode 100644
index 00000000..a6363a87
--- /dev/null
+++ b/lib/soap/ecc/mapper/po-mapper.ts
@@ -0,0 +1,427 @@
+import { debugLog, debugSuccess, debugError } from '@/lib/debug-utils';
+import db from '@/db/db';
+import {
+ contracts,
+ contractItems,
+} from '@/db/schema/contract';
+import { projects } from '@/db/schema/projects';
+import { vendors } from '@/db/schema/vendors';
+import { items } from '@/db/schema/items';
+import {
+ ZMM_HD,
+ ZMM_DT,
+} from '@/db/schema/ECC/ecc';
+import { eq } from 'drizzle-orm';
+
+// ECC 데이터 타입 정의
+export type ECCPOHeader = typeof ZMM_HD.$inferInsert;
+export type ECCPODetail = typeof ZMM_DT.$inferInsert;
+
+// 비즈니스 테이블 데이터 타입 정의
+export type ContractData = typeof contracts.$inferInsert;
+export type ContractItemData = typeof contractItems.$inferInsert;
+
+// 처리된 PO 데이터 구조
+export interface ProcessedPOData {
+ header: ECCPOHeader;
+ details: ECCPODetail[];
+}
+
+/**
+ * ECC PO 헤더 데이터를 contracts 테이블로 매핑
+ */
+export async function mapECCPOHeaderToBusiness(
+ eccHeader: ECCPOHeader
+): Promise<ContractData> {
+ debugLog('ECC PO 헤더 매핑 시작', { ebeln: eccHeader.EBELN });
+
+ // projectId 찾기 (PSPID → projects.code 기반)
+ let projectId: number | null = null;
+ if (eccHeader.PSPID) {
+ try {
+ const project = await db.query.projects.findFirst({
+ where: eq(projects.code, eccHeader.PSPID),
+ });
+ if (project) {
+ projectId = project.id;
+ debugLog('프로젝트 ID 찾음', { pspid: eccHeader.PSPID, projectId });
+ } else {
+ debugError('프로젝트를 찾을 수 없음', { pspid: eccHeader.PSPID });
+ }
+ } catch (error) {
+ debugError('프로젝트 조회 중 오류', { pspid: eccHeader.PSPID, error });
+ }
+ }
+
+ // vendorId 찾기 (LIFNR 기반)
+ let vendorId: number | null = null;
+ if (eccHeader.LIFNR) {
+ try {
+ const vendor = await db.query.vendors.findFirst({
+ where: eq(vendors.vendorCode, eccHeader.LIFNR),
+ });
+ if (vendor) {
+ vendorId = vendor.id;
+ debugLog('벤더 ID 찾음', { lifnr: eccHeader.LIFNR, vendorId });
+ } else {
+ debugError('벤더를 찾을 수 없음', { lifnr: eccHeader.LIFNR });
+ }
+ } catch (error) {
+ debugError('벤더 조회 중 오류', { lifnr: eccHeader.LIFNR, error });
+ }
+ }
+
+ // 날짜 파싱 함수 (YYYYMMDD -> YYYY-MM-DD 문자열 형식)
+ const parseDate = (dateStr: string | null): string | null => {
+ if (!dateStr || dateStr.length !== 8) return null;
+ try {
+ const year = dateStr.substring(0, 4);
+ const month = dateStr.substring(4, 6);
+ const day = dateStr.substring(6, 8);
+ return `${year}-${month}-${day}`;
+ } catch (error) {
+ debugError('날짜 파싱 오류', { dateStr, error });
+ return null;
+ }
+ };
+
+ // 금액 파싱 함수
+ const parseAmount = (amountStr: string | null): string | null => {
+ if (!amountStr) return null;
+ try {
+ // 문자열을 숫자로 변환 후 다시 문자열로 (소수점 처리)
+ const num = parseFloat(amountStr);
+ return isNaN(num) ? null : num.toString();
+ } catch (error) {
+ debugError('금액 파싱 오류', { amountStr, error });
+ return null;
+ }
+ };
+
+ // 매핑
+ const mappedData: ContractData = {
+ projectId: projectId || 1, // TODO: 기본값 설정, 실제로는 유효한 projectId 필요
+ vendorId: vendorId || 1, // TODO: 기본값 설정, 실제로는 유효한 vendorId 필요
+ contractNo: eccHeader.EBELN || '',
+ contractName: eccHeader.ZTITLE || eccHeader.EBELN || '',
+ status: eccHeader.ZPO_CNFM_STAT || 'ACTIVE',
+ startDate: parseDate(eccHeader.ZPO_DT || null),
+ endDate: null, // ZMM_DT에서 가져와야 함
+ deliveryDate: null, // ZMM_DT에서 가져와야 함
+ paymentTerms: eccHeader.ZTERM || null,
+ deliveryTerms: eccHeader.INCO1 || null,
+ deliveryLocation: eccHeader.ZUNLD_PLC_CD || null,
+ currency: eccHeader.ZPO_CURR || 'KRW',
+ totalAmount: parseAmount(eccHeader.ZPO_AMT || null),
+ netTotal: parseAmount(eccHeader.ZPO_AMT || null),
+ remarks: eccHeader.ETC_2 || null,
+ // 기본값들
+ discount: null,
+ tax: null,
+ shippingFee: null,
+ partialShippingAllowed: false,
+ partialPaymentAllowed: false,
+ version: 1,
+ };
+
+ debugSuccess('ECC PO 헤더 매핑 완료', { ebeln: eccHeader.EBELN });
+ return mappedData;
+}
+
+/**
+ * ECC PO 상세 데이터를 contract_items 테이블로 매핑
+ */
+export async function mapECCPODetailToBusiness(
+ eccDetail: ECCPODetail,
+ contractId: number
+): Promise<ContractItemData> {
+ debugLog('ECC PO 상세 매핑 시작', {
+ ebeln: eccDetail.EBELN,
+ ebelp: eccDetail.EBELP,
+ matnr: eccDetail.MATNR,
+ });
+
+ // itemId 찾기 또는 생성 (MATNR 기반으로 items 테이블에서 조회/삽입)
+ let itemId: number | null = null;
+ if (eccDetail.MATNR) {
+ try {
+ // 1. 먼저 기존 아이템 조회
+ const item = await db.query.items.findFirst({
+ where: eq(items.itemCode, eccDetail.MATNR),
+ });
+
+ if (item) {
+ itemId = item.id;
+ debugLog('기존 아이템 ID 찾음', {
+ matnr: eccDetail.MATNR,
+ itemId,
+ packageCode: item.packageCode
+ });
+ } else {
+ // 2. 아이템이 없으면 새로 생성
+ debugLog('아이템이 없어서 새로 생성', { matnr: eccDetail.MATNR });
+
+ // 프로젝트 정보 설정
+ const projectNo = eccDetail.PSPID || 'DEFAULT';
+ const packageCode = 'AUTO_GENERATED'; // 기본값으로 설정
+
+ const newItemData = {
+ ProjectNo: projectNo,
+ itemCode: eccDetail.MATNR,
+ itemName: eccDetail.MAKTX || eccDetail.MATNR || 'Unknown Item',
+ packageCode: packageCode,
+ smCode: null, // SM 코드는 ECC 데이터에서 제공되지 않음
+ description: eccDetail.MAKTX || null,
+ parentItemCode: null,
+ itemLevel: null,
+ deleteFlag: 'N',
+ unitOfMeasure: null,
+ steelType: null,
+ gradeMaterial: null,
+ changeDate: null,
+ baseUnitOfMeasure: null,
+ };
+
+ const [insertedItem] = await db.insert(items).values(newItemData).returning({ id: items.id });
+ itemId = insertedItem.id;
+
+ debugSuccess('새 아이템 생성 완료', {
+ matnr: eccDetail.MATNR,
+ itemId,
+ projectNo,
+ itemName: newItemData.itemName
+ });
+ }
+ } catch (error) {
+ debugError('아이템 조회/생성 중 오류', { matnr: eccDetail.MATNR, error });
+ }
+ }
+
+ // 수량 파싱
+ const parseQuantity = (qtyStr: string | null): number => {
+ if (!qtyStr) return 1;
+ try {
+ const num = parseInt(qtyStr);
+ return isNaN(num) ? 1 : num;
+ } catch (error) {
+ debugError('수량 파싱 오류', { qtyStr, error });
+ return 1;
+ }
+ };
+
+ // 금액 파싱
+ const parseAmount = (amountStr: string | null): string | null => {
+ if (!amountStr) return null;
+ try {
+ const num = parseFloat(amountStr);
+ return isNaN(num) ? null : num.toString();
+ } catch (error) {
+ debugError('금액 파싱 오류', { amountStr, error });
+ return null;
+ }
+ };
+
+ // 세율 계산 (MWSKZ 기반)
+ const calculateTaxRate = (mwskz: string | null): string | null => {
+ if (!mwskz) return null;
+ // 일반적인 한국 세율 매핑 (실제 비즈니스 로직에 따라 조정 필요)
+ switch (mwskz) {
+ case '10':
+ return '10.00';
+ case '00':
+ return '0.00';
+ default:
+ return '10.00'; // 기본값
+ }
+ };
+
+ const quantity = parseQuantity(eccDetail.MENGE || null);
+ const unitPrice = parseAmount(eccDetail.NETPR || null);
+ const taxRate = calculateTaxRate(eccDetail.MWSKZ || null);
+ const totalLineAmount = parseAmount(eccDetail.NETWR || null);
+
+ // 세액 계산
+ let taxAmount: string | null = null;
+ if (unitPrice && taxRate) {
+ try {
+ const unitPriceNum = parseFloat(unitPrice);
+ const taxRateNum = parseFloat(taxRate);
+ const calculatedTaxAmount = (unitPriceNum * quantity * taxRateNum) / 100;
+ taxAmount = calculatedTaxAmount.toString();
+ } catch (error) {
+ debugError('세액 계산 오류', { unitPrice, taxRate, quantity, error });
+ }
+ }
+
+ // 매핑
+ const mappedData: ContractItemData = {
+ contractId,
+ itemId: itemId || 1, // TODO: 기본값 설정, 실제로는 유효한 itemId 필요
+ description: eccDetail.MAKTX || null,
+ quantity,
+ unitPrice,
+ taxRate,
+ taxAmount,
+ totalLineAmount,
+ remark: eccDetail.ZPO_RMK || null,
+ };
+
+ debugSuccess('ECC PO 상세 매핑 완료', {
+ ebeln: eccDetail.EBELN,
+ ebelp: eccDetail.EBELP,
+ itemId,
+ });
+ return mappedData;
+}
+
+/**
+ * ECC PO 데이터를 비즈니스 테이블로 일괄 매핑 및 저장
+ */
+export async function mapAndSaveECCPOData(
+ processedPOs: ProcessedPOData[]
+): Promise<{ success: boolean; message: string; processedCount: number }> {
+ debugLog('ECC PO 데이터 일괄 매핑 및 저장 시작', {
+ poCount: processedPOs.length,
+ });
+
+ try {
+ const result = await db.transaction(async (tx) => {
+ let processedCount = 0;
+
+ for (const poData of processedPOs) {
+ const { header, details } = poData;
+
+ try {
+ // 1. 헤더 매핑 및 저장
+ const contractData = await mapECCPOHeaderToBusiness(header);
+
+ // 중복 체크 (contractNo 기준)
+ const existingContract = await tx.query.contracts.findFirst({
+ where: eq(contracts.contractNo, contractData.contractNo),
+ });
+
+ let contractId: number;
+ if (existingContract) {
+ // 기존 계약 업데이트
+ await tx
+ .update(contracts)
+ .set({
+ ...contractData,
+ updatedAt: new Date(),
+ })
+ .where(eq(contracts.id, existingContract.id));
+ contractId = existingContract.id;
+ debugLog('기존 계약 업데이트', { contractNo: contractData.contractNo, contractId });
+ } else {
+ // 새 계약 생성
+ const [insertedContract] = await tx
+ .insert(contracts)
+ .values(contractData)
+ .returning({ id: contracts.id });
+ contractId = insertedContract.id;
+ debugLog('새 계약 생성', { contractNo: contractData.contractNo, contractId });
+ }
+
+ // 2. 기존 contract_items 삭제 (교체 방식)
+ await tx
+ .delete(contractItems)
+ .where(eq(contractItems.contractId, contractId));
+
+ // 3. 상세 매핑 및 저장
+ if (details.length > 0) {
+ const contractItemsData: ContractItemData[] = [];
+
+ for (const detail of details) {
+ const itemData = await mapECCPODetailToBusiness(detail, contractId);
+ contractItemsData.push(itemData);
+ }
+
+ // 일괄 삽입
+ await tx.insert(contractItems).values(contractItemsData);
+ debugLog('계약 아이템 저장 완료', {
+ contractId,
+ itemCount: contractItemsData.length
+ });
+ }
+
+ processedCount++;
+ } catch (error) {
+ debugError('PO 데이터 처리 중 오류', {
+ ebeln: header.EBELN,
+ error
+ });
+ // 개별 PO 처리 실패 시 해당 PO만 스킵하고 계속 진행
+ continue;
+ }
+ }
+
+ return { processedCount };
+ });
+
+ debugSuccess('ECC PO 데이터 일괄 처리 완료', {
+ processedCount: result.processedCount,
+ });
+
+ return {
+ success: true,
+ message: `${result.processedCount}개의 PO 데이터가 성공적으로 처리되었습니다.`,
+ processedCount: result.processedCount,
+ };
+ } catch (error) {
+ debugError('ECC PO 데이터 처리 중 오류 발생', error);
+ return {
+ success: false,
+ message:
+ error instanceof Error
+ ? error.message
+ : '알 수 없는 오류가 발생했습니다.',
+ processedCount: 0,
+ };
+ }
+}
+
+/**
+ * ECC PO 데이터 유효성 검증
+ */
+export function validateECCPOData(
+ processedPOs: ProcessedPOData[]
+): { isValid: boolean; errors: string[] } {
+ const errors: string[] = [];
+
+ for (const poData of processedPOs) {
+ const { header, details } = poData;
+
+ // 헤더 데이터 검증
+ if (!header.EBELN) {
+ errors.push(`필수 필드 누락: EBELN (구매오더번호)`);
+ }
+ if (!header.LIFNR) {
+ errors.push(`필수 필드 누락: LIFNR (VENDOR코드) - EBELN: ${header.EBELN}`);
+ }
+
+ // 상세 데이터 검증
+ for (const detail of details) {
+ if (!detail.EBELN) {
+ errors.push(`필수 필드 누락: EBELN (구매오더번호) - EBELP: ${detail.EBELP}`);
+ }
+ if (!detail.EBELP) {
+ errors.push(`필수 필드 누락: EBELP (구매오더품목번호) - EBELN: ${detail.EBELN}`);
+ }
+ if (!detail.MATNR) {
+ errors.push(`필수 필드 누락: MATNR (자재코드) - EBELN: ${detail.EBELN}, EBELP: ${detail.EBELP}`);
+ }
+ }
+
+ // 헤더와 상세 간의 관계 검증
+ for (const detail of details) {
+ if (detail.EBELN !== header.EBELN) {
+ errors.push(`헤더와 상세의 EBELN이 일치하지 않음: Header ${header.EBELN}, Detail ${detail.EBELN}`);
+ }
+ }
+ }
+
+ return {
+ isValid: errors.length === 0,
+ errors,
+ };
+}
diff --git a/lib/soap/ecc-mapper.ts b/lib/soap/ecc/mapper/rfq-and-pr-mapper.ts
index 030d6973..e2258a4c 100644
--- a/lib/soap/ecc-mapper.ts
+++ b/lib/soap/ecc/mapper/rfq-and-pr-mapper.ts
@@ -15,7 +15,7 @@ import { eq, inArray } from 'drizzle-orm';
// NON-SAP 데이터 처리
import { oracleKnex } from '@/lib/oracle-db/db';
-import { findUserIdByEmployeeNumber } from '../users/knox-service';
+import { findUserIdByEmployeeNumber } from '../../../users/knox-service';
// ECC 데이터 타입 정의
export type ECCBidHeader = typeof PR_INFORMATION_T_BID_HEADER.$inferInsert;
diff --git a/lib/soap/ecc/send/cancel-rfq.ts b/lib/soap/ecc/send/cancel-rfq.ts
new file mode 100644
index 00000000..fcddddf8
--- /dev/null
+++ b/lib/soap/ecc/send/cancel-rfq.ts
@@ -0,0 +1,346 @@
+'use server'
+
+import { sendSoapXml, type SoapSendConfig, type SoapLogInfo, type SoapSendResult } from "@/lib/soap/sender";
+
+// ECC RFQ 취소 엔드포인트
+const ECC_CANCEL_RFQ_ENDPOINT = "http://shii8dvddb01.hec.serp.shi.samsung.net:50000/sap/xi/engine?type=entry&version=3.0&Sender.Service=P2038_D&Interface=http%3A%2F%2Fshi.samsung.co.kr%2FP2_MM%2FMMM%5EP2MM3016_SO";
+
+// RFQ 취소 요청 데이터 타입
+export interface CancelRFQRequest {
+ T_ANFNR: Array<{
+ ANFNR: string; // RFQ Number (M)
+ }>;
+}
+
+// RFQ 취소 응답 데이터 타입 (참고용)
+export interface CancelRFQResponse {
+ EV_TYPE?: string; // 응답 타입 (S: 성공, E: 에러)
+ EV_MESSAGE?: string; // 응답 메시지
+}
+
+// SOAP Body Content 생성 함수
+function createCancelRFQSoapBodyContent(rfqData: CancelRFQRequest): Record<string, unknown> {
+ return {
+ 'ns0:MT_P2MM3016_S': {
+ 'T_ANFNR': rfqData.T_ANFNR
+ }
+ };
+}
+
+// RFQ 데이터 검증 함수
+function validateCancelRFQData(rfqData: CancelRFQRequest): { isValid: boolean; errors: string[] } {
+ const errors: string[] = [];
+
+ // T_ANFNR 배열 검증
+ if (!rfqData.T_ANFNR || !Array.isArray(rfqData.T_ANFNR) || rfqData.T_ANFNR.length === 0) {
+ errors.push('T_ANFNR은 필수이며 최소 1개 이상의 RFQ 번호가 있어야 합니다.');
+ } else {
+ rfqData.T_ANFNR.forEach((item, index) => {
+ if (!item.ANFNR || typeof item.ANFNR !== 'string' || item.ANFNR.trim() === '') {
+ errors.push(`T_ANFNR[${index}].ANFNR은 필수입니다.`);
+ }
+ });
+ }
+
+ return {
+ isValid: errors.length === 0,
+ errors
+ };
+}
+
+// ECC로 RFQ 취소 SOAP XML 전송하는 함수
+async function sendCancelRFQToECC(rfqData: CancelRFQRequest): Promise<SoapSendResult> {
+ try {
+ // 데이터 검증
+ const validation = validateCancelRFQData(rfqData);
+ if (!validation.isValid) {
+ return {
+ success: false,
+ message: `데이터 검증 실패: ${validation.errors.join(', ')}`
+ };
+ }
+
+ // SOAP Body Content 생성
+ const soapBodyContent = createCancelRFQSoapBodyContent(rfqData);
+
+ // SOAP 전송 설정
+ const config: SoapSendConfig = {
+ endpoint: ECC_CANCEL_RFQ_ENDPOINT,
+ envelope: soapBodyContent,
+ soapAction: 'http://sap.com/xi/WebService/soap1.1',
+ timeout: 30000, // RFQ 취소는 30초 타임아웃
+ retryCount: 3,
+ retryDelay: 1000
+ };
+
+ // 로그 정보
+ const logInfo: SoapLogInfo = {
+ direction: 'OUTBOUND',
+ system: 'S-ERP ECC',
+ interface: 'IF_ECC_EVCP_CANCEL_RFQ'
+ };
+
+ const rfqNumbers = rfqData.T_ANFNR.map(item => item.ANFNR).join(', ');
+ console.log(`📤 RFQ 취소 요청 전송 시작 - RFQ Numbers: ${rfqNumbers}`);
+ console.log(`🔍 취소 대상 RFQ ${rfqData.T_ANFNR.length}개`);
+
+ // SOAP XML 전송
+ const result = await sendSoapXml(config, logInfo);
+
+ if (result.success) {
+ console.log(`✅ RFQ 취소 요청 전송 성공 - RFQ Numbers: ${rfqNumbers}`);
+ } else {
+ console.error(`❌ RFQ 취소 요청 전송 실패 - RFQ Numbers: ${rfqNumbers}, 오류: ${result.message}`);
+ }
+
+ return result;
+
+ } catch (error) {
+ console.error('❌ RFQ 취소 전송 중 오류 발생:', error);
+ return {
+ success: false,
+ message: error instanceof Error ? error.message : 'Unknown error'
+ };
+ }
+}
+
+// ========================================
+// 메인 RFQ 취소 서버 액션 함수들
+// ========================================
+
+// 단일 RFQ 취소 요청 처리
+export async function cancelRFQ(rfqNumber: string): Promise<{
+ success: boolean;
+ message: string;
+ responseData?: string;
+ rfqNumber?: string;
+}> {
+ try {
+ console.log(`🚀 RFQ 취소 요청 시작 - RFQ Number: ${rfqNumber}`);
+
+ const rfqData: CancelRFQRequest = {
+ T_ANFNR: [{
+ ANFNR: rfqNumber
+ }]
+ };
+
+ const result = await sendCancelRFQToECC(rfqData);
+
+ return {
+ success: result.success,
+ message: result.success ? 'RFQ 취소 요청이 성공적으로 전송되었습니다.' : result.message,
+ responseData: result.responseText,
+ rfqNumber
+ };
+
+ } catch (error) {
+ console.error('❌ RFQ 취소 요청 처리 실패:', error);
+ return {
+ success: false,
+ message: error instanceof Error ? error.message : 'Unknown error'
+ };
+ }
+}
+
+// 여러 RFQ 배치 취소 요청 처리
+export async function cancelMultipleRFQs(rfqNumbers: string[]): Promise<{
+ success: boolean;
+ message: string;
+ results?: Array<{ rfqNumber: string; success: boolean; error?: string }>;
+}> {
+ try {
+ console.log(`🚀 배치 RFQ 취소 요청 시작: ${rfqNumbers.length}개`);
+
+ // 모든 RFQ를 하나의 요청으로 처리
+ const rfqData: CancelRFQRequest = {
+ T_ANFNR: rfqNumbers.map(rfqNumber => ({ ANFNR: rfqNumber }))
+ };
+
+ const result = await sendCancelRFQToECC(rfqData);
+
+ // 결과 정리
+ const results = rfqNumbers.map(rfqNumber => ({
+ rfqNumber,
+ success: result.success,
+ error: result.success ? undefined : result.message
+ }));
+
+ const successCount = result.success ? rfqNumbers.length : 0;
+ const failCount = rfqNumbers.length - successCount;
+
+ console.log(`🎉 배치 RFQ 취소 완료: 성공 ${successCount}개, 실패 ${failCount}개`);
+
+ return {
+ success: result.success,
+ message: result.success
+ ? `배치 RFQ 취소 성공: ${successCount}개`
+ : `배치 RFQ 취소 실패: ${result.message}`,
+ results
+ };
+
+ } catch (error) {
+ console.error('❌ 배치 RFQ 취소 중 전체 오류 발생:', error);
+ return {
+ success: false,
+ message: error instanceof Error ? error.message : 'Unknown error'
+ };
+ }
+}
+
+// 개별 처리 방식의 배치 RFQ 취소 (각각 따로 전송)
+export async function cancelMultipleRFQsIndividually(rfqNumbers: string[]): Promise<{
+ success: boolean;
+ message: string;
+ results?: Array<{ rfqNumber: string; success: boolean; error?: string }>;
+}> {
+ try {
+ console.log(`🚀 개별 RFQ 취소 요청 시작: ${rfqNumbers.length}개`);
+
+ const results: Array<{ rfqNumber: string; success: boolean; error?: string }> = [];
+
+ for (const rfqNumber of rfqNumbers) {
+ try {
+ console.log(`📤 RFQ 취소 처리 중: ${rfqNumber}`);
+
+ const rfqData: CancelRFQRequest = {
+ T_ANFNR: [{ ANFNR: rfqNumber }]
+ };
+
+ const result = await sendCancelRFQToECC(rfqData);
+
+ if (result.success) {
+ console.log(`✅ RFQ 취소 성공: ${rfqNumber}`);
+ results.push({
+ rfqNumber,
+ success: true
+ });
+ } else {
+ console.error(`❌ RFQ 취소 실패: ${rfqNumber}, 오류: ${result.message}`);
+ results.push({
+ rfqNumber,
+ success: false,
+ error: result.message
+ });
+ }
+
+ // 개별 처리간 지연 (시스템 부하 방지)
+ if (rfqNumbers.length > 1) {
+ await new Promise(resolve => setTimeout(resolve, 500));
+ }
+
+ } catch (error) {
+ console.error(`❌ RFQ 취소 처리 실패: ${rfqNumber}`, error);
+ results.push({
+ rfqNumber,
+ success: false,
+ error: error instanceof Error ? error.message : 'Unknown error'
+ });
+ }
+ }
+
+ const successCount = results.filter(r => r.success).length;
+ const failCount = results.length - successCount;
+
+ console.log(`🎉 개별 RFQ 취소 완료: 성공 ${successCount}개, 실패 ${failCount}개`);
+
+ return {
+ success: failCount === 0,
+ message: `개별 RFQ 취소 완료: 성공 ${successCount}개, 실패 ${failCount}개`,
+ results
+ };
+
+ } catch (error) {
+ console.error('❌ 개별 RFQ 취소 중 전체 오류 발생:', error);
+ return {
+ success: false,
+ message: error instanceof Error ? error.message : 'Unknown error'
+ };
+ }
+}
+
+// 테스트용 RFQ 취소 함수 (샘플 데이터 포함)
+export async function cancelTestRFQ(): Promise<{
+ success: boolean;
+ message: string;
+ responseData?: string;
+ testData?: CancelRFQRequest;
+}> {
+ try {
+ console.log('🧪 테스트용 RFQ 취소 시작');
+
+ // 테스트용 샘플 데이터 생성
+ const testRFQData: CancelRFQRequest = {
+ T_ANFNR: [{
+ ANFNR: 'TEST_RFQ_001'
+ }]
+ };
+
+ const result = await sendCancelRFQToECC(testRFQData);
+
+ return {
+ success: result.success,
+ message: result.success ? '테스트 RFQ 취소가 성공적으로 전송되었습니다.' : result.message,
+ responseData: result.responseText,
+ testData: testRFQData
+ };
+
+ } catch (error) {
+ console.error('❌ 테스트 RFQ 취소 실패:', error);
+ return {
+ success: false,
+ message: error instanceof Error ? error.message : 'Unknown error'
+ };
+ }
+}
+
+// ========================================
+// 유틸리티 함수들
+// ========================================
+
+// RFQ 취소 데이터 생성 헬퍼 함수
+function createCancelRFQData(rfqNumbers: string[]): CancelRFQRequest {
+ return {
+ T_ANFNR: rfqNumbers.map(rfqNumber => ({ ANFNR: rfqNumber }))
+ };
+}
+
+// RFQ 번호 검증 함수
+function validateRFQNumber(rfqNumber: string): { isValid: boolean; error?: string } {
+ if (!rfqNumber || typeof rfqNumber !== 'string') {
+ return { isValid: false, error: 'RFQ 번호는 문자열이어야 합니다.' };
+ }
+
+ const trimmed = rfqNumber.trim();
+ if (trimmed === '') {
+ return { isValid: false, error: 'RFQ 번호는 비어있을 수 없습니다.' };
+ }
+
+ // 기본적인 길이 검증 (10자 제한 - WSDL에서 CHAR 10으로 정의)
+ if (trimmed.length > 10) {
+ return { isValid: false, error: 'RFQ 번호는 10자를 초과할 수 없습니다.' };
+ }
+
+ return { isValid: true };
+}
+
+// 여러 RFQ 번호 검증 함수
+function validateRFQNumbers(rfqNumbers: string[]): { isValid: boolean; errors: string[] } {
+ const errors: string[] = [];
+
+ if (!Array.isArray(rfqNumbers) || rfqNumbers.length === 0) {
+ errors.push('최소 1개 이상의 RFQ 번호가 필요합니다.');
+ return { isValid: false, errors };
+ }
+
+ rfqNumbers.forEach((rfqNumber, index) => {
+ const validation = validateRFQNumber(rfqNumber);
+ if (!validation.isValid) {
+ errors.push(`RFQ[${index}]: ${validation.error}`);
+ }
+ });
+
+ return {
+ isValid: errors.length === 0,
+ errors
+ };
+} \ No newline at end of file
diff --git a/lib/soap/ecc/send/create-po.ts b/lib/soap/ecc/send/create-po.ts
new file mode 100644
index 00000000..3bd28057
--- /dev/null
+++ b/lib/soap/ecc/send/create-po.ts
@@ -0,0 +1,417 @@
+'use server'
+
+import { sendSoapXml, type SoapSendConfig, type SoapLogInfo, type SoapSendResult } from "@/lib/soap/sender";
+import { getCurrentSAPDate, getCurrentSAPTime } from "@/lib/soap/utils";
+
+// ECC PO 생성 엔드포인트
+const ECC_PO_ENDPOINT = "http://shii8dvddb01.hec.serp.shi.samsung.net:50000/sap/xi/engine?type=entry&version=3.0&Sender.Service=P2038_D&Interface=http%3A%2F%2Fshi.samsung.co.kr%2FP2_MM%2FMMM%5EP2MM3015_SO";
+
+// PO 헤더 데이터 타입
+export interface POHeaderData {
+ ANFNR: string; // Bidding Number (M)
+ LIFNR: string; // Vendor Account Number (M)
+ ZPROC_IND: string; // Purchasing Processing State (M)
+ ANGNR?: string; // Bidding Number
+ WAERS: string; // Currency Key (M)
+ ZTERM: string; // Terms of Payment Key (M)
+ INCO1: string; // Incoterms (Part 1) (M)
+ INCO2: string; // Incoterms (Part 2) (M)
+ VSTEL?: string; // Shipping Point
+ LSTEL?: string; // loading Point
+ MWSKZ: string; // Tax on sales/purchases code (M)
+ LANDS: string; // Country for Tax (M)
+ ZRCV_DT: string; // Bidding Receive Date (M)
+ ZATTEN_IND: string; // Attendance Indicator (M)
+ IHRAN: string; // Bidding Submission Date (M)
+ TEXT?: string; // PO Header note
+ ZDLV_CNTLR?: string; // Delivery Controller
+ ZDLV_PRICE_T?: string; // 납품대금연동제대상여부
+ ZDLV_PRICE_NOTE?: string; // 연동제 노트
+}
+
+// PO 아이템 데이터 타입
+export interface POItemData {
+ ANFNR: string; // Bidding Number (M)
+ ANFPS: string; // Item Number of Bidding (M)
+ LIFNR: string; // Vendor Account Number (M)
+ NETPR: string; // Net Price (M)
+ PEINH: string; // Price Unit (M)
+ BPRME: string; // Order Unit of Measure (M)
+ NETWR: string; // Net Order Value (M)
+ BRTWR: string; // Gross Order Value (M)
+ LFDAT: string; // Item Delivery Date (M)
+ ZCON_NO_PO?: string; // PR Consolidation Number
+ EBELP?: string; // Series PO Item Seq
+}
+
+// PR 반환 데이터 타입
+export interface PRReturnData {
+ ANFNR: string; // PR Request Number (M)
+ ANFPS: string; // Item Number of PR Request (M)
+ EBELN: string; // Purchase Requisition Number (M)
+ EBELP: string; // Item Number of Purchase Requisition (M)
+ MSGTY: string; // Message Type (M)
+ MSGTXT?: string; // Message Text
+}
+
+// PO 생성 요청 데이터 타입
+export interface POCreateRequest {
+ T_Bidding_HEADER: POHeaderData[];
+ T_Bidding_ITEM: POItemData[];
+ T_PR_RETURN: PRReturnData[];
+ EV_ERDAT?: string; // Extract Date
+ EV_ERZET?: string; // Extract Time
+}
+
+
+
+
+
+// SOAP Body Content 생성 함수
+function createPOSoapBodyContent(poData: POCreateRequest): Record<string, unknown> {
+ return {
+ 'ns0:MT_P2MM3015_S': {
+ 'T_Bidding_HEADER': poData.T_Bidding_HEADER,
+ 'T_Bidding_ITEM': poData.T_Bidding_ITEM,
+ 'T_PR_RETURN': poData.T_PR_RETURN,
+ ...(poData.EV_ERDAT && { 'EV_ERDAT': poData.EV_ERDAT }),
+ ...(poData.EV_ERZET && { 'EV_ERZET': poData.EV_ERZET })
+ }
+ };
+}
+
+// PO 데이터 검증 함수
+function validatePOData(poData: POCreateRequest): { isValid: boolean; errors: string[] } {
+ const errors: string[] = [];
+
+ // 헤더 데이터 검증
+ if (!poData.T_Bidding_HEADER || poData.T_Bidding_HEADER.length === 0) {
+ errors.push('T_Bidding_HEADER는 필수입니다.');
+ } else {
+ poData.T_Bidding_HEADER.forEach((header, index) => {
+ const requiredFields = ['ANFNR', 'LIFNR', 'ZPROC_IND', 'WAERS', 'ZTERM', 'INCO1', 'INCO2', 'MWSKZ', 'LANDS', 'ZRCV_DT', 'ZATTEN_IND', 'IHRAN'];
+ requiredFields.forEach(field => {
+ if (!header[field as keyof POHeaderData]) {
+ errors.push(`T_Bidding_HEADER[${index}].${field}는 필수입니다.`);
+ }
+ });
+ });
+ }
+
+ // 아이템 데이터 검증
+ if (!poData.T_Bidding_ITEM || poData.T_Bidding_ITEM.length === 0) {
+ errors.push('T_Bidding_ITEM은 필수입니다.');
+ } else {
+ poData.T_Bidding_ITEM.forEach((item, index) => {
+ const requiredFields = ['ANFNR', 'ANFPS', 'LIFNR', 'NETPR', 'PEINH', 'BPRME', 'NETWR', 'BRTWR', 'LFDAT'];
+ requiredFields.forEach(field => {
+ if (!item[field as keyof POItemData]) {
+ errors.push(`T_Bidding_ITEM[${index}].${field}는 필수입니다.`);
+ }
+ });
+ });
+ }
+
+ // PR 반환 데이터 검증
+ if (!poData.T_PR_RETURN || poData.T_PR_RETURN.length === 0) {
+ errors.push('T_PR_RETURN은 필수입니다.');
+ } else {
+ poData.T_PR_RETURN.forEach((prReturn, index) => {
+ const requiredFields = ['ANFNR', 'ANFPS', 'EBELN', 'EBELP', 'MSGTY'];
+ requiredFields.forEach(field => {
+ if (!prReturn[field as keyof PRReturnData]) {
+ errors.push(`T_PR_RETURN[${index}].${field}는 필수입니다.`);
+ }
+ });
+ });
+ }
+
+ return {
+ isValid: errors.length === 0,
+ errors
+ };
+}
+
+// ECC로 PO 생성 SOAP XML 전송하는 함수
+async function sendPOToECC(poData: POCreateRequest): Promise<SoapSendResult> {
+ try {
+ // 데이터 검증
+ const validation = validatePOData(poData);
+ if (!validation.isValid) {
+ return {
+ success: false,
+ message: `데이터 검증 실패: ${validation.errors.join(', ')}`
+ };
+ }
+
+ // SOAP Body Content 생성
+ const soapBodyContent = createPOSoapBodyContent(poData);
+
+ // SOAP 전송 설정
+ const config: SoapSendConfig = {
+ endpoint: ECC_PO_ENDPOINT,
+ envelope: soapBodyContent,
+ soapAction: 'http://sap.com/xi/WebService/soap1.1',
+ timeout: 60000, // PO 생성은 60초 타임아웃
+ retryCount: 3,
+ retryDelay: 2000
+ };
+
+ // 로그 정보
+ const logInfo: SoapLogInfo = {
+ direction: 'OUTBOUND',
+ system: 'S-ERP ECC',
+ interface: 'IF_ECC_EVCP_PO_CREATE'
+ };
+
+ console.log(`📤 PO 생성 요청 전송 시작 - ANFNR: ${poData.T_Bidding_HEADER[0]?.ANFNR}`);
+ console.log(`🔍 헤더 ${poData.T_Bidding_HEADER.length}개, 아이템 ${poData.T_Bidding_ITEM.length}개, PR 반환 ${poData.T_PR_RETURN.length}개`);
+
+ // SOAP XML 전송
+ const result = await sendSoapXml(config, logInfo);
+
+ if (result.success) {
+ console.log(`✅ PO 생성 요청 전송 성공 - ANFNR: ${poData.T_Bidding_HEADER[0]?.ANFNR}`);
+ } else {
+ console.error(`❌ PO 생성 요청 전송 실패 - ANFNR: ${poData.T_Bidding_HEADER[0]?.ANFNR}, 오류: ${result.message}`);
+ }
+
+ return result;
+
+ } catch (error) {
+ console.error('❌ PO 생성 전송 중 오류 발생:', error);
+ return {
+ success: false,
+ message: error instanceof Error ? error.message : 'Unknown error'
+ };
+ }
+}
+
+// ========================================
+// 메인 PO 생성 및 전송 함수들
+// ========================================
+
+// 단일 PO 생성 요청 처리
+export async function createPurchaseOrder(poData: POCreateRequest): Promise<{
+ success: boolean;
+ message: string;
+ responseData?: string;
+ bidding_number?: string;
+}> {
+ try {
+ console.log(`🚀 PO 생성 요청 시작 - ANFNR: ${poData.T_Bidding_HEADER[0]?.ANFNR}`);
+
+ const result = await sendPOToECC(poData);
+
+ return {
+ success: result.success,
+ message: result.success ? 'PO 생성 요청이 성공적으로 전송되었습니다.' : result.message,
+ responseData: result.responseText,
+ bidding_number: poData.T_Bidding_HEADER[0]?.ANFNR
+ };
+
+ } catch (error) {
+ console.error('❌ PO 생성 요청 처리 실패:', error);
+ return {
+ success: false,
+ message: error instanceof Error ? error.message : 'Unknown error'
+ };
+ }
+}
+
+// 여러 PO 배치 생성 요청 처리
+export async function createMultiplePurchaseOrders(poDataList: POCreateRequest[]): Promise<{
+ success: boolean;
+ message: string;
+ results?: Array<{ bidding_number: string; success: boolean; error?: string }>;
+}> {
+ try {
+ console.log(`🚀 배치 PO 생성 요청 시작: ${poDataList.length}개`);
+
+ const results: Array<{ bidding_number: string; success: boolean; error?: string }> = [];
+
+ for (const poData of poDataList) {
+ try {
+ const bidding_number = poData.T_Bidding_HEADER[0]?.ANFNR || 'Unknown';
+ console.log(`📤 PO 생성 처리 중: ${bidding_number}`);
+
+ const result = await sendPOToECC(poData);
+
+ if (result.success) {
+ console.log(`✅ PO 생성 성공: ${bidding_number}`);
+ results.push({
+ bidding_number,
+ success: true
+ });
+ } else {
+ console.error(`❌ PO 생성 실패: ${bidding_number}, 오류: ${result.message}`);
+ results.push({
+ bidding_number,
+ success: false,
+ error: result.message
+ });
+ }
+
+ // 배치 처리간 지연 (시스템 부하 방지)
+ if (poDataList.length > 1) {
+ await new Promise(resolve => setTimeout(resolve, 1000));
+ }
+
+ } catch (error) {
+ const bidding_number = poData.T_Bidding_HEADER[0]?.ANFNR || 'Unknown';
+ console.error(`❌ PO 생성 처리 실패: ${bidding_number}`, error);
+ results.push({
+ bidding_number,
+ success: false,
+ error: error instanceof Error ? error.message : 'Unknown error'
+ });
+ }
+ }
+
+ const successCount = results.filter(r => r.success).length;
+ const failCount = results.length - successCount;
+
+ console.log(`🎉 배치 PO 생성 완료: 성공 ${successCount}개, 실패 ${failCount}개`);
+
+ return {
+ success: failCount === 0,
+ message: `배치 PO 생성 완료: 성공 ${successCount}개, 실패 ${failCount}개`,
+ results
+ };
+
+ } catch (error) {
+ console.error('❌ 배치 PO 생성 중 전체 오류 발생:', error);
+ return {
+ success: false,
+ message: error instanceof Error ? error.message : 'Unknown error'
+ };
+ }
+}
+
+// 테스트용 PO 생성 함수 (샘플 데이터 포함)
+export async function createTestPurchaseOrder(): Promise<{
+ success: boolean;
+ message: string;
+ responseData?: string;
+ testData?: POCreateRequest;
+}> {
+ try {
+ console.log('🧪 테스트용 PO 생성 시작');
+
+ // 테스트용 샘플 데이터 생성
+ const testPOData: POCreateRequest = {
+ T_Bidding_HEADER: [{
+ ANFNR: 'TEST001',
+ LIFNR: '1000000001',
+ ZPROC_IND: 'A',
+ ANGNR: 'TEST001',
+ WAERS: 'KRW',
+ ZTERM: '0001',
+ INCO1: 'FOB',
+ INCO2: 'Seoul, Korea',
+ VSTEL: '001',
+ LSTEL: '001',
+ MWSKZ: 'V0',
+ LANDS: 'KR',
+ ZRCV_DT: getCurrentSAPDate(),
+ ZATTEN_IND: 'Y',
+ IHRAN: getCurrentSAPDate(),
+ TEXT: 'Test PO Creation',
+ ZDLV_CNTLR: '001',
+ ZDLV_PRICE_T: 'N',
+ ZDLV_PRICE_NOTE: 'Test Note'
+ }],
+ T_Bidding_ITEM: [{
+ ANFNR: 'TEST001',
+ ANFPS: '00001',
+ LIFNR: '1000000001',
+ NETPR: '1000.00',
+ PEINH: '1',
+ BPRME: 'EA',
+ NETWR: '1000.00',
+ BRTWR: '1100.00',
+ LFDAT: getCurrentSAPDate(),
+ ZCON_NO_PO: 'CON001',
+ EBELP: '00001'
+ }],
+ T_PR_RETURN: [{
+ ANFNR: 'TEST001',
+ ANFPS: '00001',
+ EBELN: 'PR001',
+ EBELP: '00001',
+ MSGTY: 'S',
+ MSGTXT: 'Test message'
+ }],
+ EV_ERDAT: getCurrentSAPDate(),
+ EV_ERZET: getCurrentSAPTime()
+ };
+
+ const result = await sendPOToECC(testPOData);
+
+ return {
+ success: result.success,
+ message: result.success ? '테스트 PO 생성이 성공적으로 전송되었습니다.' : result.message,
+ responseData: result.responseText,
+ testData: testPOData
+ };
+
+ } catch (error) {
+ console.error('❌ 테스트 PO 생성 실패:', error);
+ return {
+ success: false,
+ message: error instanceof Error ? error.message : 'Unknown error'
+ };
+ }
+}
+
+// PO 생성 요청 상태 확인 함수 (향후 확장용)
+export async function checkPOCreationStatus(biddingNumber: string): Promise<{
+ success: boolean;
+ message: string;
+ status?: string;
+}> {
+ try {
+ console.log(`🔍 PO 생성 상태 확인: ${biddingNumber}`);
+
+ // 향후 ECC에서 상태 조회 API가 제공될 경우 구현
+ // 현재는 기본 응답만 반환
+
+ return {
+ success: true,
+ message: 'PO 생성 상태 확인 기능은 향후 구현 예정입니다.',
+ status: 'PENDING'
+ };
+
+ } catch (error) {
+ console.error('❌ PO 상태 확인 실패:', error);
+ return {
+ success: false,
+ message: error instanceof Error ? error.message : 'Unknown error'
+ };
+ }
+}
+
+// ========================================
+// 유틸리티 함수들
+// ========================================
+
+// PO 데이터 생성 헬퍼 함수
+function createPOData(
+ headers: POHeaderData[],
+ items: POItemData[],
+ prReturns: PRReturnData[],
+ options?: {
+ extractDate?: string;
+ extractTime?: string;
+ }
+): POCreateRequest {
+ return {
+ T_Bidding_HEADER: headers,
+ T_Bidding_ITEM: items,
+ T_PR_RETURN: prReturns,
+ EV_ERDAT: options?.extractDate || getCurrentSAPDate(),
+ EV_ERZET: options?.extractTime || getCurrentSAPTime()
+ };
+}
+
+// 날짜/시간 포맷 변환 함수들은 @/lib/soap/utils에서 import하여 사용
diff --git a/lib/soap/ecc/send/pcr-confirm.ts b/lib/soap/ecc/send/pcr-confirm.ts
new file mode 100644
index 00000000..7ac2d931
--- /dev/null
+++ b/lib/soap/ecc/send/pcr-confirm.ts
@@ -0,0 +1,682 @@
+
+'use server'
+
+import { sendSoapXml, type SoapSendConfig, type SoapLogInfo, type SoapSendResult } from "@/lib/soap/sender";
+
+// ECC PCR 확인 엔드포인트
+const ECC_PCR_CONFIRM_ENDPOINT = "http://shii8dvddb01.hec.serp.shi.samsung.net:50000/sap/xi/engine?type=entry&version=3.0&Sender.Service=P2038_D&Interface=http%3A%2F%2Fshi.samsung.co.kr%2FP2_MM%2FMMM%5EP2MM3019_SO";
+
+// PCR 확인 요청 데이터 타입
+export interface PCRConfirmRequest {
+ ZMM_PCR: Array<{
+ PCR_REQ: string; // PCR 요청번호 (M)
+ PCR_REQ_SEQ: string; // PCR 요청순번 (M)
+ PCR_DEC_DATE: string; // PCR 결정일 (M, YYYYMMDD)
+ EBELN: string; // 구매오더 (M)
+ EBELP: string; // 구매오더 품번 (M)
+ WAERS?: string; // PCR 통화
+ PCR_NETPR?: string; // PCR 단가
+ PEINH?: string; // Price Unit, 수량에 대한 PER 당 단가
+ PCR_NETWR?: string; // PCR 금액
+ PCR_STATUS: string; // PCR 상태 (M)
+ REJ_CD?: string; // Reject 코드
+ REJ_RSN?: string; // Reject 사유
+ CONFIRM_CD?: string; // Confirm 코드
+ CONFIRM_RSN?: string; // Confirm 사유
+ }>;
+}
+
+// PCR 확인 응답 데이터 타입 (참고용)
+export interface PCRConfirmResponse {
+ ZMM_RT?: Array<{
+ PCR_REQ: string; // PCR 요청번호
+ PCR_REQ_SEQ: string; // PCR 요청순번
+ EBELN: string; // 구매오더
+ EBELP: string; // 구매오더 품번
+ MSGTY?: string; // Message Type
+ MSGTXT?: string; // Message Text
+ }>;
+}
+
+// 보낼 때 ZMM_PCR 객체 안에 담아보내야 함
+// SEQ,Table,Field,M/O,Type,Size,Description
+// 1,ZMM_PCR,PCR_REQ,M,CHAR,10,PCR 요청번호
+// 2,ZMM_PCR,PCR_REQ_SEQ,M,NUMC,5,PCR 요청순번
+// 3,ZMM_PCR,PCR_DEC_DATE,M,DATS,8,PCR 결정일
+// 4,ZMM_PCR,EBELN,M,CHAR,10,구매오더
+// 5,ZMM_PCR,EBELP,M,NUMC,5,구매오더 품번
+// 6,ZMM_PCR,WAERS,,CUKY,5,PCR 통화
+// 7,ZMM_PCR,PCR_NETPR,,CURR,"13,2",PCR 단가
+// 8,ZMM_PCR,PEINH,,DEC,5,"Price Unit, 수량에 대한 PER 당 단가"
+// 9,ZMM_PCR,PCR_NETWR,,CURR,"13,2",PCR 금액
+// 10,ZMM_PCR,PCR_STATUS,M,CHAR,1,PCR 상태
+// 11,ZMM_PCR,REJ_CD,,CHAR,10,Reject 코드
+// 12,ZMM_PCR,REJ_RSN,,CHAR,50,Reject 사유
+// 13,ZMM_PCR,CONFIRM_CD,,CHAR,10,Confirm 코드
+// 14,ZMM_PCR,CONFIRM_RSN,,CHAR,50,Confirm 사유
+// 15,ZMM_RT,PCR_REQ,M,CHAR,10,PCR 요청번호 REPLY(NOT TO SEND)
+// 16,ZMM_RT,PCR_REQ_SEQ,M,NUMC,5,PCR 요청순번 REPLY(NOT TO SEND)
+// 17,ZMM_RT,EBELN,M,CHAR,10,구매오더 REPLY(NOT TO SEND)
+// 18,ZMM_RT,EBELP,M,NUMC,5,구매오더 품번 REPLY(NOT TO SEND)
+// 19,ZMM_RT,MSGTY,,CHAR,1,Message Type REPLY(NOT TO SEND)
+// 20,ZMM_RT,MSGTXT,,CHAR,100,Message Text REPLY(NOT TO SEND)
+
+// SOAP Body Content 생성 함수
+function createPCRConfirmSoapBodyContent(pcrData: PCRConfirmRequest): Record<string, unknown> {
+ return {
+ 'ns0:MT_P2MM3019_S': {
+ 'ZMM_PCR': pcrData.ZMM_PCR
+ }
+ };
+}
+
+// PCR 데이터 검증 함수
+function validatePCRConfirmData(pcrData: PCRConfirmRequest): { isValid: boolean; errors: string[] } {
+ const errors: string[] = [];
+
+ // ZMM_PCR 배열 검증
+ if (!pcrData.ZMM_PCR || !Array.isArray(pcrData.ZMM_PCR) || pcrData.ZMM_PCR.length === 0) {
+ errors.push('ZMM_PCR은 필수이며 최소 1개 이상의 PCR 데이터가 있어야 합니다.');
+ } else {
+ pcrData.ZMM_PCR.forEach((item, index) => {
+ // 필수 필드 검증
+ if (!item.PCR_REQ || typeof item.PCR_REQ !== 'string' || item.PCR_REQ.trim() === '') {
+ errors.push(`ZMM_PCR[${index}].PCR_REQ은 필수입니다.`);
+ } else if (item.PCR_REQ.length > 10) {
+ errors.push(`ZMM_PCR[${index}].PCR_REQ은 10자를 초과할 수 없습니다.`);
+ }
+
+ if (!item.PCR_REQ_SEQ || typeof item.PCR_REQ_SEQ !== 'string' || item.PCR_REQ_SEQ.trim() === '') {
+ errors.push(`ZMM_PCR[${index}].PCR_REQ_SEQ는 필수입니다.`);
+ } else if (item.PCR_REQ_SEQ.length > 5) {
+ errors.push(`ZMM_PCR[${index}].PCR_REQ_SEQ는 5자를 초과할 수 없습니다.`);
+ }
+
+ if (!item.PCR_DEC_DATE || typeof item.PCR_DEC_DATE !== 'string' || item.PCR_DEC_DATE.trim() === '') {
+ errors.push(`ZMM_PCR[${index}].PCR_DEC_DATE는 필수입니다.`);
+ } else if (!/^\d{8}$/.test(item.PCR_DEC_DATE)) {
+ errors.push(`ZMM_PCR[${index}].PCR_DEC_DATE는 YYYYMMDD 형식이어야 합니다.`);
+ }
+
+ if (!item.EBELN || typeof item.EBELN !== 'string' || item.EBELN.trim() === '') {
+ errors.push(`ZMM_PCR[${index}].EBELN은 필수입니다.`);
+ } else if (item.EBELN.length > 10) {
+ errors.push(`ZMM_PCR[${index}].EBELN은 10자를 초과할 수 없습니다.`);
+ }
+
+ if (!item.EBELP || typeof item.EBELP !== 'string' || item.EBELP.trim() === '') {
+ errors.push(`ZMM_PCR[${index}].EBELP는 필수입니다.`);
+ } else if (item.EBELP.length > 5) {
+ errors.push(`ZMM_PCR[${index}].EBELP는 5자를 초과할 수 없습니다.`);
+ }
+
+ if (!item.PCR_STATUS || typeof item.PCR_STATUS !== 'string' || item.PCR_STATUS.trim() === '') {
+ errors.push(`ZMM_PCR[${index}].PCR_STATUS는 필수입니다.`);
+ } else if (item.PCR_STATUS.length > 1) {
+ errors.push(`ZMM_PCR[${index}].PCR_STATUS는 1자를 초과할 수 없습니다.`);
+ }
+
+ // 선택 필드 길이 검증
+ if (item.WAERS && item.WAERS.length > 5) {
+ errors.push(`ZMM_PCR[${index}].WAERS는 5자를 초과할 수 없습니다.`);
+ }
+
+ if (item.REJ_CD && item.REJ_CD.length > 10) {
+ errors.push(`ZMM_PCR[${index}].REJ_CD는 10자를 초과할 수 없습니다.`);
+ }
+
+ if (item.REJ_RSN && item.REJ_RSN.length > 50) {
+ errors.push(`ZMM_PCR[${index}].REJ_RSN은 50자를 초과할 수 없습니다.`);
+ }
+
+ if (item.CONFIRM_CD && item.CONFIRM_CD.length > 10) {
+ errors.push(`ZMM_PCR[${index}].CONFIRM_CD는 10자를 초과할 수 없습니다.`);
+ }
+
+ if (item.CONFIRM_RSN && item.CONFIRM_RSN.length > 50) {
+ errors.push(`ZMM_PCR[${index}].CONFIRM_RSN은 50자를 초과할 수 없습니다.`);
+ }
+ });
+ }
+
+ return {
+ isValid: errors.length === 0,
+ errors
+ };
+}
+
+// ECC로 PCR 확인 SOAP XML 전송하는 함수
+async function sendPCRConfirmToECC(pcrData: PCRConfirmRequest): Promise<SoapSendResult> {
+ try {
+ // 데이터 검증
+ const validation = validatePCRConfirmData(pcrData);
+ if (!validation.isValid) {
+ return {
+ success: false,
+ message: `데이터 검증 실패: ${validation.errors.join(', ')}`
+ };
+ }
+
+ // SOAP Body Content 생성
+ const soapBodyContent = createPCRConfirmSoapBodyContent(pcrData);
+
+ // SOAP 전송 설정
+ const config: SoapSendConfig = {
+ endpoint: ECC_PCR_CONFIRM_ENDPOINT,
+ envelope: soapBodyContent,
+ soapAction: 'http://sap.com/xi/WebService/soap1.1',
+ timeout: 30000, // PCR 확인은 30초 타임아웃
+ retryCount: 3,
+ retryDelay: 1000
+ };
+
+ // 로그 정보
+ const logInfo: SoapLogInfo = {
+ direction: 'OUTBOUND',
+ system: 'S-ERP ECC',
+ interface: 'IF_ECC_EVCP_PCR_CONFIRM'
+ };
+
+ const pcrReqs = pcrData.ZMM_PCR.map(item => `${item.PCR_REQ}-${item.PCR_REQ_SEQ}`).join(', ');
+ console.log(`📤 PCR 확인 요청 전송 시작 - PCR Requests: ${pcrReqs}`);
+ console.log(`🔍 확인 대상 PCR ${pcrData.ZMM_PCR.length}개`);
+
+ // SOAP XML 전송
+ const result = await sendSoapXml(config, logInfo);
+
+ if (result.success) {
+ console.log(`✅ PCR 확인 요청 전송 성공 - PCR Requests: ${pcrReqs}`);
+ } else {
+ console.error(`❌ PCR 확인 요청 전송 실패 - PCR Requests: ${pcrReqs}, 오류: ${result.message}`);
+ }
+
+ return result;
+
+ } catch (error) {
+ console.error('❌ PCR 확인 전송 중 오류 발생:', error);
+ return {
+ success: false,
+ message: error instanceof Error ? error.message : 'Unknown error'
+ };
+ }
+}
+
+// ========================================
+// 메인 PCR 확인 서버 액션 함수들
+// ========================================
+
+// 단일 PCR 확인 요청 처리
+export async function confirmPCR(pcrItem: {
+ PCR_REQ: string;
+ PCR_REQ_SEQ: string;
+ PCR_DEC_DATE: string;
+ EBELN: string;
+ EBELP: string;
+ PCR_STATUS: string;
+ WAERS?: string;
+ PCR_NETPR?: string;
+ PEINH?: string;
+ PCR_NETWR?: string;
+ REJ_CD?: string;
+ REJ_RSN?: string;
+ CONFIRM_CD?: string;
+ CONFIRM_RSN?: string;
+}): Promise<{
+ success: boolean;
+ message: string;
+ responseData?: string;
+ pcrRequest?: string;
+}> {
+ try {
+ console.log(`🚀 PCR 확인 요청 시작 - PCR: ${pcrItem.PCR_REQ}-${pcrItem.PCR_REQ_SEQ}`);
+
+ const pcrData: PCRConfirmRequest = {
+ ZMM_PCR: [pcrItem]
+ };
+
+ const result = await sendPCRConfirmToECC(pcrData);
+
+ return {
+ success: result.success,
+ message: result.success ? 'PCR 확인 요청이 성공적으로 전송되었습니다.' : result.message,
+ responseData: result.responseText,
+ pcrRequest: `${pcrItem.PCR_REQ}-${pcrItem.PCR_REQ_SEQ}`
+ };
+
+ } catch (error) {
+ console.error('❌ PCR 확인 요청 처리 실패:', error);
+ return {
+ success: false,
+ message: error instanceof Error ? error.message : 'Unknown error'
+ };
+ }
+}
+
+// 여러 PCR 배치 확인 요청 처리
+export async function confirmMultiplePCRs(pcrItems: Array<{
+ PCR_REQ: string;
+ PCR_REQ_SEQ: string;
+ PCR_DEC_DATE: string;
+ EBELN: string;
+ EBELP: string;
+ PCR_STATUS: string;
+ WAERS?: string;
+ PCR_NETPR?: string;
+ PEINH?: string;
+ PCR_NETWR?: string;
+ REJ_CD?: string;
+ REJ_RSN?: string;
+ CONFIRM_CD?: string;
+ CONFIRM_RSN?: string;
+}>): Promise<{
+ success: boolean;
+ message: string;
+ results?: Array<{ pcrRequest: string; success: boolean; error?: string }>;
+}> {
+ try {
+ console.log(`🚀 배치 PCR 확인 요청 시작: ${pcrItems.length}개`);
+
+ // 모든 PCR을 하나의 요청으로 처리
+ const pcrData: PCRConfirmRequest = {
+ ZMM_PCR: pcrItems
+ };
+
+ const result = await sendPCRConfirmToECC(pcrData);
+
+ // 결과 정리
+ const results = pcrItems.map(item => ({
+ pcrRequest: `${item.PCR_REQ}-${item.PCR_REQ_SEQ}`,
+ success: result.success,
+ error: result.success ? undefined : result.message
+ }));
+
+ const successCount = result.success ? pcrItems.length : 0;
+ const failCount = pcrItems.length - successCount;
+
+ console.log(`🎉 배치 PCR 확인 완료: 성공 ${successCount}개, 실패 ${failCount}개`);
+
+ return {
+ success: result.success,
+ message: result.success
+ ? `배치 PCR 확인 성공: ${successCount}개`
+ : `배치 PCR 확인 실패: ${result.message}`,
+ results
+ };
+
+ } catch (error) {
+ console.error('❌ 배치 PCR 확인 중 전체 오류 발생:', error);
+ return {
+ success: false,
+ message: error instanceof Error ? error.message : 'Unknown error'
+ };
+ }
+}
+
+// 개별 처리 방식의 배치 PCR 확인 (각각 따로 전송)
+export async function confirmMultiplePCRsIndividually(pcrItems: Array<{
+ PCR_REQ: string;
+ PCR_REQ_SEQ: string;
+ PCR_DEC_DATE: string;
+ EBELN: string;
+ EBELP: string;
+ PCR_STATUS: string;
+ WAERS?: string;
+ PCR_NETPR?: string;
+ PEINH?: string;
+ PCR_NETWR?: string;
+ REJ_CD?: string;
+ REJ_RSN?: string;
+ CONFIRM_CD?: string;
+ CONFIRM_RSN?: string;
+}>): Promise<{
+ success: boolean;
+ message: string;
+ results?: Array<{ pcrRequest: string; success: boolean; error?: string }>;
+}> {
+ try {
+ console.log(`🚀 개별 PCR 확인 요청 시작: ${pcrItems.length}개`);
+
+ const results: Array<{ pcrRequest: string; success: boolean; error?: string }> = [];
+
+ for (const pcrItem of pcrItems) {
+ try {
+ const pcrRequest = `${pcrItem.PCR_REQ}-${pcrItem.PCR_REQ_SEQ}`;
+ console.log(`📤 PCR 확인 처리 중: ${pcrRequest}`);
+
+ const pcrData: PCRConfirmRequest = {
+ ZMM_PCR: [pcrItem]
+ };
+
+ const result = await sendPCRConfirmToECC(pcrData);
+
+ if (result.success) {
+ console.log(`✅ PCR 확인 성공: ${pcrRequest}`);
+ results.push({
+ pcrRequest,
+ success: true
+ });
+ } else {
+ console.error(`❌ PCR 확인 실패: ${pcrRequest}, 오류: ${result.message}`);
+ results.push({
+ pcrRequest,
+ success: false,
+ error: result.message
+ });
+ }
+
+ // 개별 처리간 지연 (시스템 부하 방지)
+ if (pcrItems.length > 1) {
+ await new Promise(resolve => setTimeout(resolve, 500));
+ }
+
+ } catch (error) {
+ const pcrRequest = `${pcrItem.PCR_REQ}-${pcrItem.PCR_REQ_SEQ}`;
+ console.error(`❌ PCR 확인 처리 실패: ${pcrRequest}`, error);
+ results.push({
+ pcrRequest,
+ success: false,
+ error: error instanceof Error ? error.message : 'Unknown error'
+ });
+ }
+ }
+
+ const successCount = results.filter(r => r.success).length;
+ const failCount = results.length - successCount;
+
+ console.log(`🎉 개별 PCR 확인 완료: 성공 ${successCount}개, 실패 ${failCount}개`);
+
+ return {
+ success: failCount === 0,
+ message: `개별 PCR 확인 완료: 성공 ${successCount}개, 실패 ${failCount}개`,
+ results
+ };
+
+ } catch (error) {
+ console.error('❌ 개별 PCR 확인 중 전체 오류 발생:', error);
+ return {
+ success: false,
+ message: error instanceof Error ? error.message : 'Unknown error'
+ };
+ }
+}
+
+// 테스트용 PCR 확인 함수 (샘플 데이터 포함)
+export async function confirmTestPCR(): Promise<{
+ success: boolean;
+ message: string;
+ responseData?: string;
+ testData?: PCRConfirmRequest;
+}> {
+ try {
+ console.log('🧪 테스트용 PCR 확인 시작');
+
+ // 테스트용 샘플 데이터 생성
+ const testPCRData: PCRConfirmRequest = {
+ ZMM_PCR: [{
+ PCR_REQ: 'TEST_PCR01',
+ PCR_REQ_SEQ: '00001',
+ PCR_DEC_DATE: '20241201',
+ EBELN: 'TEST_PO01',
+ EBELP: '00010',
+ PCR_STATUS: 'A',
+ WAERS: 'KRW',
+ PCR_NETPR: '1000.00',
+ PEINH: '1',
+ PCR_NETWR: '1000.00',
+ CONFIRM_CD: 'CONF',
+ CONFIRM_RSN: '테스트 확인'
+ }]
+ };
+
+ const result = await sendPCRConfirmToECC(testPCRData);
+
+ return {
+ success: result.success,
+ message: result.success ? '테스트 PCR 확인이 성공적으로 전송되었습니다.' : result.message,
+ responseData: result.responseText,
+ testData: testPCRData
+ };
+
+ } catch (error) {
+ console.error('❌ 테스트 PCR 확인 실패:', error);
+ return {
+ success: false,
+ message: error instanceof Error ? error.message : 'Unknown error'
+ };
+ }
+}
+
+// ========================================
+// 유틸리티 함수들
+// ========================================
+
+// PCR 확인 데이터 생성 헬퍼 함수
+function createPCRConfirmData(pcrItems: Array<{
+ PCR_REQ: string;
+ PCR_REQ_SEQ: string;
+ PCR_DEC_DATE: string;
+ EBELN: string;
+ EBELP: string;
+ PCR_STATUS: string;
+ WAERS?: string;
+ PCR_NETPR?: string;
+ PEINH?: string;
+ PCR_NETWR?: string;
+ REJ_CD?: string;
+ REJ_RSN?: string;
+ CONFIRM_CD?: string;
+ CONFIRM_RSN?: string;
+}>): PCRConfirmRequest {
+ return {
+ ZMM_PCR: pcrItems
+ };
+}
+
+// PCR 요청번호 검증 함수
+function validatePCRNumber(pcrReq: string): { isValid: boolean; error?: string } {
+ if (!pcrReq || typeof pcrReq !== 'string') {
+ return { isValid: false, error: 'PCR 요청번호는 문자열이어야 합니다.' };
+ }
+
+ const trimmed = pcrReq.trim();
+ if (trimmed === '') {
+ return { isValid: false, error: 'PCR 요청번호는 비어있을 수 없습니다.' };
+ }
+
+ // 기본적인 길이 검증 (10자 제한 - WSDL에서 CHAR 10으로 정의)
+ if (trimmed.length > 10) {
+ return { isValid: false, error: 'PCR 요청번호는 10자를 초과할 수 없습니다.' };
+ }
+
+ return { isValid: true };
+}
+
+// PCR 요청순번 검증 함수
+function validatePCRSequence(pcrReqSeq: string): { isValid: boolean; error?: string } {
+ if (!pcrReqSeq || typeof pcrReqSeq !== 'string') {
+ return { isValid: false, error: 'PCR 요청순번은 문자열이어야 합니다.' };
+ }
+
+ const trimmed = pcrReqSeq.trim();
+ if (trimmed === '') {
+ return { isValid: false, error: 'PCR 요청순번은 비어있을 수 없습니다.' };
+ }
+
+ // 숫자 형식 검증 (NUMC 5자리)
+ if (!/^\d{1,5}$/.test(trimmed)) {
+ return { isValid: false, error: 'PCR 요청순번은 1-5자리 숫자여야 합니다.' };
+ }
+
+ return { isValid: true };
+}
+
+// PCR 결정일 검증 함수
+function validatePCRDecisionDate(pcrDecDate: string): { isValid: boolean; error?: string } {
+ if (!pcrDecDate || typeof pcrDecDate !== 'string') {
+ return { isValid: false, error: 'PCR 결정일은 문자열이어야 합니다.' };
+ }
+
+ const trimmed = pcrDecDate.trim();
+ if (trimmed === '') {
+ return { isValid: false, error: 'PCR 결정일은 비어있을 수 없습니다.' };
+ }
+
+ // YYYYMMDD 형식 검증
+ if (!/^\d{8}$/.test(trimmed)) {
+ return { isValid: false, error: 'PCR 결정일은 YYYYMMDD 형식이어야 합니다.' };
+ }
+
+ // 날짜 유효성 검증
+ const year = parseInt(trimmed.substring(0, 4));
+ const month = parseInt(trimmed.substring(4, 6));
+ const day = parseInt(trimmed.substring(6, 8));
+
+ if (month < 1 || month > 12) {
+ return { isValid: false, error: 'PCR 결정일의 월이 올바르지 않습니다.' };
+ }
+
+ if (day < 1 || day > 31) {
+ return { isValid: false, error: 'PCR 결정일의 일이 올바르지 않습니다.' };
+ }
+
+ // 실제 날짜 검증
+ const date = new Date(year, month - 1, day);
+ if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) {
+ return { isValid: false, error: 'PCR 결정일이 유효하지 않은 날짜입니다.' };
+ }
+
+ return { isValid: true };
+}
+
+// PCR 상태 검증 함수
+function validatePCRStatus(pcrStatus: string): { isValid: boolean; error?: string } {
+ if (!pcrStatus || typeof pcrStatus !== 'string') {
+ return { isValid: false, error: 'PCR 상태는 문자열이어야 합니다.' };
+ }
+
+ const trimmed = pcrStatus.trim();
+ if (trimmed === '') {
+ return { isValid: false, error: 'PCR 상태는 비어있을 수 없습니다.' };
+ }
+
+ if (trimmed.length !== 1) {
+ return { isValid: false, error: 'PCR 상태는 1자리여야 합니다.' };
+ }
+
+ return { isValid: true };
+}
+
+// 구매오더 검증 함수
+function validatePurchaseOrder(ebeln: string): { isValid: boolean; error?: string } {
+ if (!ebeln || typeof ebeln !== 'string') {
+ return { isValid: false, error: '구매오더는 문자열이어야 합니다.' };
+ }
+
+ const trimmed = ebeln.trim();
+ if (trimmed === '') {
+ return { isValid: false, error: '구매오더는 비어있을 수 없습니다.' };
+ }
+
+ if (trimmed.length > 10) {
+ return { isValid: false, error: '구매오더는 10자를 초과할 수 없습니다.' };
+ }
+
+ return { isValid: true };
+}
+
+// 구매오더 품번 검증 함수
+function validatePurchaseOrderItem(ebelp: string): { isValid: boolean; error?: string } {
+ if (!ebelp || typeof ebelp !== 'string') {
+ return { isValid: false, error: '구매오더 품번은 문자열이어야 합니다.' };
+ }
+
+ const trimmed = ebelp.trim();
+ if (trimmed === '') {
+ return { isValid: false, error: '구매오더 품번은 비어있을 수 없습니다.' };
+ }
+
+ // 숫자 형식 검증 (NUMC 5자리)
+ if (!/^\d{1,5}$/.test(trimmed)) {
+ return { isValid: false, error: '구매오더 품번은 1-5자리 숫자여야 합니다.' };
+ }
+
+ return { isValid: true };
+}
+
+// 통화 검증 함수
+function validateCurrency(waers?: string): { isValid: boolean; error?: string } {
+ if (!waers) {
+ return { isValid: true }; // 선택 필드
+ }
+
+ if (typeof waers !== 'string') {
+ return { isValid: false, error: '통화는 문자열이어야 합니다.' };
+ }
+
+ const trimmed = waers.trim();
+ if (trimmed.length > 5) {
+ return { isValid: false, error: '통화는 5자를 초과할 수 없습니다.' };
+ }
+
+ return { isValid: true };
+}
+
+// 여러 PCR 아이템 검증 함수
+function validatePCRItems(pcrItems: Array<{
+ PCR_REQ: string;
+ PCR_REQ_SEQ: string;
+ PCR_DEC_DATE: string;
+ EBELN: string;
+ EBELP: string;
+ PCR_STATUS: string;
+ WAERS?: string;
+}>): { isValid: boolean; errors: string[] } {
+ const errors: string[] = [];
+
+ if (!Array.isArray(pcrItems) || pcrItems.length === 0) {
+ errors.push('최소 1개 이상의 PCR 아이템이 필요합니다.');
+ return { isValid: false, errors };
+ }
+
+ pcrItems.forEach((item, index) => {
+ const pcrReqValid = validatePCRNumber(item.PCR_REQ);
+ if (!pcrReqValid.isValid) {
+ errors.push(`PCR[${index}] 요청번호: ${pcrReqValid.error}`);
+ }
+
+ const pcrSeqValid = validatePCRSequence(item.PCR_REQ_SEQ);
+ if (!pcrSeqValid.isValid) {
+ errors.push(`PCR[${index}] 요청순번: ${pcrSeqValid.error}`);
+ }
+
+ const pcrDateValid = validatePCRDecisionDate(item.PCR_DEC_DATE);
+ if (!pcrDateValid.isValid) {
+ errors.push(`PCR[${index}] 결정일: ${pcrDateValid.error}`);
+ }
+
+ const eBelnValid = validatePurchaseOrder(item.EBELN);
+ if (!eBelnValid.isValid) {
+ errors.push(`PCR[${index}] 구매오더: ${eBelnValid.error}`);
+ }
+
+ const eBelpValid = validatePurchaseOrderItem(item.EBELP);
+ if (!eBelpValid.isValid) {
+ errors.push(`PCR[${index}] 구매오더품번: ${eBelpValid.error}`);
+ }
+
+ const statusValid = validatePCRStatus(item.PCR_STATUS);
+ if (!statusValid.isValid) {
+ errors.push(`PCR[${index}] 상태: ${statusValid.error}`);
+ }
+
+ const currencyValid = validateCurrency(item.WAERS);
+ if (!currencyValid.isValid) {
+ errors.push(`PCR[${index}] 통화: ${currencyValid.error}`);
+ }
+ });
+
+ return {
+ isValid: errors.length === 0,
+ errors
+ };
+}
diff --git a/lib/soap/ecc/send/rfq-info.ts b/lib/soap/ecc/send/rfq-info.ts
new file mode 100644
index 00000000..43fe821f
--- /dev/null
+++ b/lib/soap/ecc/send/rfq-info.ts
@@ -0,0 +1,469 @@
+'use server'
+
+/**
+ * RFQ(Request for Quotation) 정보 전송 시스템
+ *
+ * 기준 문서:
+ * - WSDL: IF_EVCP_ECC_RFQ_INFORMATION.wsdl
+ * - I/F 정의서: IF_EVCP_ECC_RFQ_INFORMATION.csv (송신측)
+ *
+ * 주요 구조:
+ * - T_RFQ_HEADER: RFQ 헤더 정보 (ANFNR, LIFNR, WAERS 등)
+ * - T_RFQ_ITEM: RFQ 아이템 정보 (ANFNR, ANFPS, NETPR 등)
+ *
+ * 주의사항:
+ * - EV_TYPE, EV_MESSAGE는 응답 전용 필드 (송신시 사용 안함)
+ * - 필수 필드(M)와 선택 필드(O) 구분 적용
+ */
+
+import { sendSoapXml, type SoapSendConfig, type SoapLogInfo, type SoapSendResult } from "@/lib/soap/sender";
+import { getCurrentSAPDate } from "@/lib/soap/utils";
+
+// ECC RFQ 정보 전송 엔드포인트
+const ECC_RFQ_ENDPOINT = "http://shii8dvddb01.hec.serp.shi.samsung.net:50000/sap/xi/engine?type=entry&version=3.0&Sender.Service=P2038_D&Interface=http%3A%2F%2Fshi.samsung.co.kr%2FP2_MM%2FMMM%5EP2MM3014_SO";
+
+// RFQ 헤더 데이터 타입
+export interface RFQHeaderData {
+ ANFNR: string; // RFQ Number (필수) - CHAR(10)
+ LIFNR: string; // Vendor's account number (필수) - CHAR(10)
+ WAERS: string; // Currency Key (필수) - CUKY(5)
+ ZTERM: string; // Terms of Payment Key (필수) - CHAR(4)
+ INCO1: string; // Incoterms (Part 1) (필수) - CHAR(3)
+ INCO2: string; // Incoterms (Part 2) (필수) - CHAR(28)
+ MWSKZ: string; // Tax on Sales/Purchases Code (필수) - CHAR(2)
+ LANDS: string; // Country for Tax Return (필수) - CHAR(3)
+ VSTEL?: string; // Place of Shipping (선택) - CHAR(3)
+ LSTEL?: string; // Place of Destination (선택) - CHAR(3)
+}
+
+// RFQ 아이템 데이터 타입
+export interface RFQItemData {
+ ANFNR: string; // RFQ Number (필수) - CHAR(10)
+ ANFPS: string; // Item Number of RFQ (필수) - NUMC(5,0)
+ NETPR: string; // Net Price in Purchasing Document (in Document Currency) (필수) - CURR(11,2)
+ NETWR: string; // Net Order Value in PO Currency (필수) - CURR(13,2)
+ BRTWR: string; // Gross order value in PO currency (필수) - CURR(13,2)
+ LFDAT?: string; // Item delivery date (선택) - DATS(8)
+}
+
+// RFQ 정보 전송 요청 데이터 타입
+export interface RFQInfoRequest {
+ T_RFQ_HEADER: RFQHeaderData[];
+ T_RFQ_ITEM: RFQItemData[];
+}
+
+// RFQ 응답 데이터 타입 (WSDL P2MM3014_S_response 기준)
+// 주의: CSV 정의서에 따르면 EV_TYPE, EV_MESSAGE는 "수신측 응답으로 보낼 내용이 아님"
+export interface RFQInfoResponse {
+ EV_TYPE?: string; // Message Type - CHAR(1) (응답 전용, 송신시 사용 안함)
+ EV_MESSAGE?: string; // Message Text - CHAR(100) (응답 전용, 송신시 사용 안함)
+}
+
+// SOAP Body Content 생성 함수
+function createRFQSoapBodyContent(rfqData: RFQInfoRequest): Record<string, unknown> {
+ return {
+ 'ns0:MT_P2MM3014_S': {
+ 'T_RFQ_HEADER': rfqData.T_RFQ_HEADER,
+ 'T_RFQ_ITEM': rfqData.T_RFQ_ITEM
+ }
+ };
+}
+
+
+
+// RFQ 데이터 기본 검증 함수 (필수 필드만 확인)
+function validateRFQData(rfqData: RFQInfoRequest): { isValid: boolean; errors: string[] } {
+ const errors: string[] = [];
+
+ // 헤더 데이터 검증
+ if (!rfqData.T_RFQ_HEADER || rfqData.T_RFQ_HEADER.length === 0) {
+ errors.push('T_RFQ_HEADER는 필수입니다.');
+ } else {
+ rfqData.T_RFQ_HEADER.forEach((header, index) => {
+ // 필수 필드 존재 여부만 검증
+ const requiredFields = ['ANFNR', 'LIFNR', 'WAERS', 'ZTERM', 'INCO1', 'INCO2', 'MWSKZ', 'LANDS'];
+ requiredFields.forEach(field => {
+ if (!header[field as keyof RFQHeaderData]) {
+ errors.push(`T_RFQ_HEADER[${index}].${field}는 필수입니다.`);
+ }
+ });
+ });
+ }
+
+ // 아이템 데이터 검증
+ if (!rfqData.T_RFQ_ITEM || rfqData.T_RFQ_ITEM.length === 0) {
+ errors.push('T_RFQ_ITEM은 필수입니다.');
+ } else {
+ rfqData.T_RFQ_ITEM.forEach((item, index) => {
+ // 필수 필드 존재 여부만 검증
+ const requiredFields = ['ANFNR', 'ANFPS', 'NETPR', 'NETWR', 'BRTWR'];
+ requiredFields.forEach(field => {
+ if (!item[field as keyof RFQItemData]) {
+ errors.push(`T_RFQ_ITEM[${index}].${field}는 필수입니다.`);
+ }
+ });
+ });
+ }
+
+ // RFQ 번호 일관성 검증
+ if (rfqData.T_RFQ_HEADER.length > 0 && rfqData.T_RFQ_ITEM.length > 0) {
+ const headerRFQNumbers = new Set(rfqData.T_RFQ_HEADER.map(h => h.ANFNR));
+ const itemRFQNumbers = new Set(rfqData.T_RFQ_ITEM.map(i => i.ANFNR));
+
+ for (const itemRFQ of itemRFQNumbers) {
+ if (!headerRFQNumbers.has(itemRFQ)) {
+ errors.push(`T_RFQ_ITEM의 ANFNR '${itemRFQ}'에 해당하는 T_RFQ_HEADER가 없습니다.`);
+ }
+ }
+ }
+
+ return {
+ isValid: errors.length === 0,
+ errors
+ };
+}
+
+// ECC로 RFQ 정보 SOAP XML 전송하는 함수
+async function sendRFQToECC(rfqData: RFQInfoRequest): Promise<SoapSendResult> {
+ try {
+ // 데이터 검증
+ const validation = validateRFQData(rfqData);
+ if (!validation.isValid) {
+ return {
+ success: false,
+ message: `데이터 검증 실패: ${validation.errors.join(', ')}`
+ };
+ }
+
+ // SOAP Body Content 생성
+ const soapBodyContent = createRFQSoapBodyContent(rfqData);
+
+ // SOAP 전송 설정
+ const config: SoapSendConfig = {
+ endpoint: ECC_RFQ_ENDPOINT,
+ envelope: soapBodyContent,
+ soapAction: 'http://sap.com/xi/WebService/soap1.1',
+ timeout: 60000, // RFQ 정보 전송은 60초 타임아웃
+ retryCount: 3,
+ retryDelay: 2000
+ };
+
+ // 로그 정보
+ const logInfo: SoapLogInfo = {
+ direction: 'OUTBOUND',
+ system: 'S-ERP ECC',
+ interface: 'IF_EVCP_ECC_RFQ_INFORMATION'
+ };
+
+ console.log(`📤 RFQ 정보 전송 시작 - ANFNR: ${rfqData.T_RFQ_HEADER[0]?.ANFNR}`);
+ console.log(`🔍 헤더 ${rfqData.T_RFQ_HEADER.length}개, 아이템 ${rfqData.T_RFQ_ITEM.length}개`);
+
+ // SOAP XML 전송
+ const result = await sendSoapXml(config, logInfo);
+
+ if (result.success) {
+ console.log(`✅ RFQ 정보 전송 성공 - ANFNR: ${rfqData.T_RFQ_HEADER[0]?.ANFNR}`);
+ } else {
+ console.error(`❌ RFQ 정보 전송 실패 - ANFNR: ${rfqData.T_RFQ_HEADER[0]?.ANFNR}, 오류: ${result.message}`);
+ }
+
+ return result;
+
+ } catch (error) {
+ console.error('❌ RFQ 정보 전송 중 오류 발생:', error);
+ return {
+ success: false,
+ message: error instanceof Error ? error.message : 'Unknown error'
+ };
+ }
+}
+
+// ========================================
+// 메인 RFQ 정보 전송 함수들
+// ========================================
+
+// 단일 RFQ 정보 전송 처리
+export async function sendRFQInformation(rfqData: RFQInfoRequest): Promise<{
+ success: boolean;
+ message: string;
+ responseData?: string;
+ rfq_number?: string;
+}> {
+ try {
+ console.log(`🚀 RFQ 정보 전송 요청 시작 - ANFNR: ${rfqData.T_RFQ_HEADER[0]?.ANFNR}`);
+
+ const result = await sendRFQToECC(rfqData);
+
+ return {
+ success: result.success,
+ message: result.success ? 'RFQ 정보가 성공적으로 전송되었습니다.' : result.message,
+ responseData: result.responseText,
+ rfq_number: rfqData.T_RFQ_HEADER[0]?.ANFNR
+ };
+
+ } catch (error) {
+ console.error('❌ RFQ 정보 전송 처리 실패:', error);
+ return {
+ success: false,
+ message: error instanceof Error ? error.message : 'Unknown error'
+ };
+ }
+}
+
+// 여러 RFQ 배치 정보 전송 처리
+export async function sendMultipleRFQInformation(rfqDataList: RFQInfoRequest[]): Promise<{
+ success: boolean;
+ message: string;
+ results?: Array<{ rfq_number: string; success: boolean; error?: string }>;
+}> {
+ try {
+ console.log(`🚀 배치 RFQ 정보 전송 시작: ${rfqDataList.length}개`);
+
+ const results: Array<{ rfq_number: string; success: boolean; error?: string }> = [];
+
+ for (const rfqData of rfqDataList) {
+ try {
+ const rfq_number = rfqData.T_RFQ_HEADER[0]?.ANFNR || 'Unknown';
+ console.log(`📤 RFQ 정보 처리 중: ${rfq_number}`);
+
+ const result = await sendRFQToECC(rfqData);
+
+ if (result.success) {
+ console.log(`✅ RFQ 정보 전송 성공: ${rfq_number}`);
+ results.push({
+ rfq_number,
+ success: true
+ });
+ } else {
+ console.error(`❌ RFQ 정보 전송 실패: ${rfq_number}, 오류: ${result.message}`);
+ results.push({
+ rfq_number,
+ success: false,
+ error: result.message
+ });
+ }
+
+ // 배치 처리간 지연 (시스템 부하 방지)
+ if (rfqDataList.length > 1) {
+ await new Promise(resolve => setTimeout(resolve, 1000));
+ }
+
+ } catch (error) {
+ const rfq_number = rfqData.T_RFQ_HEADER[0]?.ANFNR || 'Unknown';
+ console.error(`❌ RFQ 정보 처리 실패: ${rfq_number}`, error);
+ results.push({
+ rfq_number,
+ success: false,
+ error: error instanceof Error ? error.message : 'Unknown error'
+ });
+ }
+ }
+
+ const successCount = results.filter(r => r.success).length;
+ const failCount = results.length - successCount;
+
+ console.log(`🎉 배치 RFQ 정보 전송 완료: 성공 ${successCount}개, 실패 ${failCount}개`);
+
+ return {
+ success: failCount === 0,
+ message: `배치 RFQ 정보 전송 완료: 성공 ${successCount}개, 실패 ${failCount}개`,
+ results
+ };
+
+ } catch (error) {
+ console.error('❌ 배치 RFQ 정보 전송 중 전체 오류 발생:', error);
+ return {
+ success: false,
+ message: error instanceof Error ? error.message : 'Unknown error'
+ };
+ }
+}
+
+// 테스트용 RFQ 정보 전송 함수 (샘플 데이터 포함)
+export async function sendTestRFQInformation(): Promise<{
+ success: boolean;
+ message: string;
+ responseData?: string;
+ testData?: RFQInfoRequest;
+}> {
+ try {
+ console.log('🧪 테스트용 RFQ 정보 전송 시작');
+
+ // 테스트용 샘플 데이터 생성
+ const testRFQData: RFQInfoRequest = {
+ T_RFQ_HEADER: [{
+ ANFNR: 'RFQ0000001', // CHAR(10) - RFQ Number
+ LIFNR: '1000000001', // CHAR(10) - Vendor's account number
+ WAERS: 'KRW', // CUKY(5) - Currency Key
+ ZTERM: '0001', // CHAR(4) - Terms of Payment Key
+ INCO1: 'FOB', // CHAR(3) - Incoterms (Part 1)
+ INCO2: 'Seoul, Korea', // CHAR(28) - Incoterms (Part 2)
+ MWSKZ: 'V0', // CHAR(2) - Tax on Sales/Purchases Code
+ LANDS: 'KR', // CHAR(3) - Country for Tax Return
+ VSTEL: '001', // CHAR(3) - Place of Shipping (선택)
+ LSTEL: '001' // CHAR(3) - Place of Destination (선택)
+ }],
+ T_RFQ_ITEM: [{
+ ANFNR: 'RFQ0000001', // CHAR(10) - RFQ Number
+ ANFPS: '00001', // NUMC(5,0) - Item Number of RFQ
+ NETPR: '1000.00', // CURR(11,2) - Net Price in Purchasing Document
+ NETWR: '1000.00', // CURR(13,2) - Net Order Value in PO Currency
+ BRTWR: '1100.00', // CURR(13,2) - Gross order value in PO currency
+ LFDAT: getCurrentSAPDate() // DATS(8) - Item delivery date (선택)
+ }]
+ };
+
+ const result = await sendRFQToECC(testRFQData);
+
+ return {
+ success: result.success,
+ message: result.success ? '테스트 RFQ 정보가 성공적으로 전송되었습니다.' : result.message,
+ responseData: result.responseText,
+ testData: testRFQData
+ };
+
+ } catch (error) {
+ console.error('❌ 테스트 RFQ 정보 전송 실패:', error);
+ return {
+ success: false,
+ message: error instanceof Error ? error.message : 'Unknown error'
+ };
+ }
+}
+
+// RFQ 정보 전송 상태 확인 함수 (향후 확장용)
+export async function checkRFQInformationStatus(rfqNumber: string): Promise<{
+ success: boolean;
+ message: string;
+ status?: string;
+}> {
+ try {
+ console.log(`🔍 RFQ 정보 전송 상태 확인: ${rfqNumber}`);
+
+ // 향후 ECC에서 상태 조회 API가 제공될 경우 구현
+ // 현재는 기본 응답만 반환
+
+ return {
+ success: true,
+ message: 'RFQ 정보 전송 상태 확인 기능은 향후 구현 예정입니다.',
+ status: 'PENDING'
+ };
+
+ } catch (error) {
+ console.error('❌ RFQ 상태 확인 실패:', error);
+ return {
+ success: false,
+ message: error instanceof Error ? error.message : 'Unknown error'
+ };
+ }
+}
+
+// ========================================
+// 유틸리티 함수들
+// ========================================
+
+// RFQ 데이터 생성 헬퍼 함수
+function createRFQData(
+ headers: RFQHeaderData[],
+ items: RFQItemData[]
+): RFQInfoRequest {
+ return {
+ T_RFQ_HEADER: headers,
+ T_RFQ_ITEM: items
+ };
+}
+
+// RFQ 헤더 데이터 생성 헬퍼 함수
+function createRFQHeader(
+ rfqNumber: string, // ANFNR - CHAR(10)
+ vendorNumber: string, // LIFNR - CHAR(10)
+ currency: string = 'KRW', // WAERS - CUKY(5)
+ paymentTerms: string = '0001', // ZTERM - CHAR(4)
+ incoterms1: string = 'FOB', // INCO1 - CHAR(3)
+ incoterms2: string = 'Seoul, Korea', // INCO2 - CHAR(28)
+ taxCode: string = 'V0', // MWSKZ - CHAR(2)
+ countryForTax: string = 'KR', // LANDS - CHAR(3) (Country for Tax Return)
+ options?: {
+ shippingPlace?: string; // VSTEL - CHAR(3) (Place of Shipping)
+ destinationPlace?: string; // LSTEL - CHAR(3) (Place of Destination)
+ }
+): RFQHeaderData {
+ return {
+ ANFNR: rfqNumber,
+ LIFNR: vendorNumber,
+ WAERS: currency,
+ ZTERM: paymentTerms,
+ INCO1: incoterms1,
+ INCO2: incoterms2,
+ MWSKZ: taxCode,
+ LANDS: countryForTax,
+ VSTEL: options?.shippingPlace,
+ LSTEL: options?.destinationPlace
+ };
+}
+
+// RFQ 아이템 데이터 생성 헬퍼 함수
+function createRFQItem(
+ rfqNumber: string, // ANFNR - CHAR(10)
+ itemNumber: string, // ANFPS - NUMC(5,0)
+ netPrice: string, // NETPR - CURR(11,2) Net Price in Purchasing Document (in Document Currency)
+ netOrderValue: string, // NETWR - CURR(13,2) Net Order Value in PO Currency
+ grossOrderValue: string, // BRTWR - CURR(13,2) Gross order value in PO currency
+ deliveryDate?: string // LFDAT - DATS(8) Item delivery date (선택)
+): RFQItemData {
+ return {
+ ANFNR: rfqNumber,
+ ANFPS: itemNumber,
+ NETPR: netPrice,
+ NETWR: netOrderValue,
+ BRTWR: grossOrderValue,
+ LFDAT: deliveryDate
+ };
+}
+
+// RFQ 번호 기준으로 헤더와 아이템 매칭 검증
+function validateRFQMatching(headers: RFQHeaderData[], items: RFQItemData[]): {
+ isValid: boolean;
+ errors: string[];
+ orphanItems: string[];
+} {
+ const errors: string[] = [];
+ const orphanItems: string[] = [];
+
+ const headerRFQNumbers = new Set(headers.map(h => h.ANFNR));
+
+ for (const item of items) {
+ if (!headerRFQNumbers.has(item.ANFNR)) {
+ orphanItems.push(item.ANFNR);
+ errors.push(`RFQ 아이템 '${item.ANFNR}-${item.ANFPS}'에 해당하는 헤더가 없습니다.`);
+ }
+ }
+
+ return {
+ isValid: errors.length === 0,
+ errors,
+ orphanItems
+ };
+}
+
+// RFQ 데이터 요약 정보 생성
+function getRFQDataSummary(rfqData: RFQInfoRequest): {
+ rfqNumbers: string[];
+ totalHeaders: number;
+ totalItems: number;
+ itemsPerRFQ: Record<string, number>;
+} {
+ const rfqNumbers = [...new Set(rfqData.T_RFQ_HEADER.map(h => h.ANFNR))];
+ const itemsPerRFQ: Record<string, number> = {};
+
+ for (const rfqNumber of rfqNumbers) {
+ itemsPerRFQ[rfqNumber] = rfqData.T_RFQ_ITEM.filter(i => i.ANFNR === rfqNumber).length;
+ }
+
+ return {
+ rfqNumbers,
+ totalHeaders: rfqData.T_RFQ_HEADER.length,
+ totalItems: rfqData.T_RFQ_ITEM.length,
+ itemsPerRFQ
+ };
+}
diff --git a/lib/soap/mdg/mapper/project-mapper.ts b/lib/soap/mdg/mapper/project-mapper.ts
new file mode 100644
index 00000000..112dd4f5
--- /dev/null
+++ b/lib/soap/mdg/mapper/project-mapper.ts
@@ -0,0 +1,169 @@
+import { debugLog, debugSuccess, debugError } from '@/lib/debug-utils';
+import db from '@/db/db';
+import { projects } from '@/db/schema/projects';
+import { PROJECT_MASTER_CMCTB_PROJ_MAST } from '@/db/schema/MDG/mdg';
+import { eq } from 'drizzle-orm';
+
+// MDG 데이터 타입 정의
+export type MDGProjectData = typeof PROJECT_MASTER_CMCTB_PROJ_MAST.$inferInsert;
+
+// 비즈니스 테이블 데이터 타입 정의
+export type ProjectData = typeof projects.$inferInsert;
+
+/**
+ * MDG 프로젝트 마스터 데이터를 비즈니스 테이블 projects에 매핑하여 저장
+ */
+export async function mapAndSaveMDGProjectData(
+ mdgProjects: MDGProjectData[]
+): Promise<{ success: boolean; message: string; processedCount: number }> {
+ try {
+ debugLog('MDG 프로젝트 마스터 데이터 매핑 시작', { count: mdgProjects.length });
+
+ if (mdgProjects.length === 0) {
+ return { success: true, message: '처리할 데이터가 없습니다', processedCount: 0 };
+ }
+
+ const mappedProjects: ProjectData[] = [];
+ let processedCount = 0;
+
+ for (const mdgProject of mdgProjects) {
+ try {
+ // MDG 데이터를 projects 테이블 구조에 매핑
+ const mappedProject = mapMDGToProject(mdgProject);
+
+ if (mappedProject) {
+ mappedProjects.push(mappedProject);
+ processedCount++;
+ }
+ } catch (error) {
+ debugError('개별 프로젝트 매핑 중 오류', {
+ project: mdgProject.PROJ_NO,
+ error: error instanceof Error ? error.message : 'Unknown error'
+ });
+ // 개별 오류는 로그만 남기고 계속 진행
+ continue;
+ }
+ }
+
+ if (mappedProjects.length === 0) {
+ return { success: false, message: '매핑된 프로젝트가 없습니다', processedCount: 0 };
+ }
+
+ // 데이터베이스에 저장
+ await saveProjectsToDatabase(mappedProjects);
+
+ debugSuccess('MDG 프로젝트 마스터 데이터 매핑 완료', {
+ total: mdgProjects.length,
+ processed: processedCount
+ });
+
+ return {
+ success: true,
+ message: `${processedCount}개 프로젝트 매핑 및 저장 완료`,
+ processedCount
+ };
+
+ } catch (error) {
+ const errorMessage = error instanceof Error ? error.message : 'Unknown error';
+ debugError('MDG 프로젝트 마스터 데이터 매핑 중 오류 발생', { error: errorMessage });
+ return {
+ success: false,
+ message: `매핑 실패: ${errorMessage}`,
+ processedCount: 0
+ };
+ }
+}
+
+/**
+ * MDG 프로젝트 데이터를 비즈니스 테이블 projects 구조로 변환
+ * TODO: 실제 매핑 로직은 사용자가 추가할 예정
+ *
+ id: serial("id").primaryKey(), << 자동
+ code: varchar("code", { length: 50 }).notNull(), <<
+ name: text("name").notNull(),
+ type: varchar("type", { length: 20 }).default("ship").notNull(),
+ pspid: char('pspid', { length: 24 }).unique(), // 프로젝트ID (ECC), TODO: 매핑 필요
+ createdAt: timestamp("created_at").defaultNow().notNull(),
+ updatedAt: timestamp("updated_at").defaultNow().notNull(),
+ */
+function mapMDGToProject(mdgProject: MDGProjectData): ProjectData | null {
+ try {
+ // 필수 필드 검증
+ if (!mdgProject.PROJ_NO) {
+ debugError('PROJ_NO가 없는 프로젝트 데이터', { project: mdgProject });
+ return null;
+ }
+
+ // TODO: 사용자가 실제 매핑 로직을 추가할 예정
+ // 현재는 기본 구조만 제공
+ const mappedProject: ProjectData = {
+ code: mdgProject.PROJ_NO || '',
+ name: mdgProject.PROJ_NM || mdgProject.PROJ_NO || '',
+ type: 'ship', // 기본값, 필요시 매핑 로직 추가
+ pspid: mdgProject.PROJ_NO || null, // ECC 프로젝트 ID와 연결
+ // id, createdAt, updatedAt는 자동 생성
+ };
+
+ debugLog('프로젝트 매핑 완료', {
+ original: mdgProject.PROJ_NO,
+ mapped: mappedProject.code
+ });
+
+ return mappedProject;
+
+ } catch (error) {
+ debugError('프로젝트 매핑 중 오류', {
+ project: mdgProject.PROJ_NO,
+ error: error instanceof Error ? error.message : 'Unknown error'
+ });
+ return null;
+ }
+}
+
+/**
+ * 매핑된 프로젝트 데이터를 데이터베이스에 저장
+ */
+async function saveProjectsToDatabase(mappedProjects: ProjectData[]): Promise<void> {
+ try {
+ debugLog('프로젝트 데이터베이스 저장 시작', { count: mappedProjects.length });
+
+ await db.transaction(async (tx) => {
+ // 기존 데이터와 중복 체크 및 UPSERT
+ for (const project of mappedProjects) {
+ if (project.pspid) {
+ // pspid가 있는 경우 기존 데이터 확인
+ const existingProject = await tx
+ .select({ id: projects.id })
+ .from(projects)
+ .where(eq(projects.pspid, project.pspid))
+ .limit(1);
+
+ if (existingProject.length > 0) {
+ // 기존 데이터 업데이트
+ await tx
+ .update(projects)
+ .set({
+ code: project.code,
+ name: project.name,
+ type: project.type,
+ updatedAt: new Date(),
+ })
+ .where(eq(projects.pspid, project.pspid));
+ } else {
+ // 새 데이터 삽입
+ await tx.insert(projects).values(project);
+ }
+ } else {
+ // pspid가 없는 경우 새 데이터 삽입
+ await tx.insert(projects).values(project);
+ }
+ }
+ });
+
+ debugSuccess('프로젝트 데이터베이스 저장 완료', { count: mappedProjects.length });
+
+ } catch (error) {
+ debugError('프로젝트 데이터베이스 저장 중 오류', { error });
+ throw error;
+ }
+}
diff --git a/lib/soap/mdg/send/vendor-master/action.ts b/lib/soap/mdg/send/vendor-master/action.ts
index d35d7a76..a7b4d8a4 100644
--- a/lib/soap/mdg/send/vendor-master/action.ts
+++ b/lib/soap/mdg/send/vendor-master/action.ts
@@ -17,7 +17,7 @@ import {
VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_PORG_ZVPFN
} from "@/db/schema/MDG/mdg";
import { eq, sql, desc } from "drizzle-orm";
-import { withSoapLogging } from "../../../utils";
+import { withSoapLogging } from "@/lib/soap/utils";
import { XMLBuilder } from 'fast-xml-parser';
import { CSV_FIELDS } from './csv-fields';
diff --git a/lib/soap/mdg/send/vendor-master/csv-fields.ts b/lib/soap/mdg/send/vendor-master/csv-fields.ts
index 335bd905..8d5af41d 100644
--- a/lib/soap/mdg/send/vendor-master/csv-fields.ts
+++ b/lib/soap/mdg/send/vendor-master/csv-fields.ts
@@ -31,25 +31,25 @@ export const CSV_FIELDS: CsvField[] = [
{ table: 'SUPPLIER_MASTER', field: 'ZZVNDTYP', mandatory: false },
{ table: 'SUPPLIER_MASTER', field: 'ZZREQID', mandatory: true },
{ table: 'SUPPLIER_MASTER', field: 'ZZIND01', mandatory: false },
- { table: 'SUPPLIER_MASTER', field: 'ADDRNO', mandatory: true },
+ { table: 'SUPPLIER_MASTER', field: 'ADDRNO', mandatory: false },
{ table: 'SUPPLIER_MASTER', field: 'NATION', mandatory: false },
{ table: 'SUPPLIER_MASTER', field: 'COUNTRY', mandatory: true },
{ table: 'SUPPLIER_MASTER', field: 'LANGU', mandatory: false },
- { table: 'SUPPLIER_MASTER', field: 'POST_CODE1', mandatory: true },
- { table: 'SUPPLIER_MASTER', field: 'CITY1', mandatory: true },
+ { table: 'SUPPLIER_MASTER', field: 'POST_CODE1', mandatory: true }, // 우편번호 (postal_code)
+ { table: 'SUPPLIER_MASTER', field: 'CITY1', mandatory: true }, // 주소 (address)
{ table: 'SUPPLIER_MASTER', field: 'CITY2', mandatory: false },
{ table: 'SUPPLIER_MASTER', field: 'REGION', mandatory: false },
- { table: 'SUPPLIER_MASTER', field: 'STREET', mandatory: true },
+ { table: 'SUPPLIER_MASTER', field: 'STREET', mandatory: true }, // 상세주소 (address_detail)
{ table: 'SUPPLIER_MASTER', field: 'CONSNUMBER', mandatory: false },
{ table: 'SUPPLIER_MASTER', field: 'TEL_NUMBER', mandatory: false },
{ table: 'SUPPLIER_MASTER', field: 'TEL_EXTENS', mandatory: false },
- { table: 'SUPPLIER_MASTER', field: 'R3_USER', mandatory: true },
+ { table: 'SUPPLIER_MASTER', field: 'R3_USER', mandatory: true }, // 모바일여부 010 시작이면 1
{ table: 'SUPPLIER_MASTER', field: 'FAX_NUMBER', mandatory: false },
{ table: 'SUPPLIER_MASTER', field: 'FAX_EXTENS', mandatory: false },
{ table: 'SUPPLIER_MASTER', field: 'URI_ADDR', mandatory: false },
{ table: 'SUPPLIER_MASTER', field: 'SMTP_ADDR', mandatory: false },
{ table: 'SUPPLIER_MASTER', field: 'TAXTYPE', mandatory: true },
- { table: 'SUPPLIER_MASTER', field: 'TAXNUM', mandatory: false },
+ { table: 'SUPPLIER_MASTER', field: 'TAXNUM', mandatory: false }, // 한국이면 KR2
{ table: 'SUPPLIER_MASTER', field: 'BP_TX_TYP', mandatory: false },
{ table: 'SUPPLIER_MASTER', field: 'STCD3', mandatory: false },
{ table: 'SUPPLIER_MASTER', field: 'ZZIND03', mandatory: false }
diff --git a/lib/soap/sender.ts b/lib/soap/sender.ts
new file mode 100644
index 00000000..580d0c5a
--- /dev/null
+++ b/lib/soap/sender.ts
@@ -0,0 +1,287 @@
+'use server'
+
+import { withSoapLogging } from "@/lib/soap/utils";
+import { XMLBuilder } from 'fast-xml-parser';
+
+// 기본 인증 정보 타입
+export interface SoapAuthConfig {
+ username?: string;
+ password?: string;
+}
+
+// SOAP 전송 설정 타입
+export interface SoapSendConfig {
+ endpoint: string;
+ envelope: Record<string, any>;
+ soapAction?: string;
+ timeout?: number;
+ retryCount?: number;
+ retryDelay?: number;
+}
+
+// 로깅 정보 타입
+export interface SoapLogInfo {
+ direction: 'INBOUND' | 'OUTBOUND';
+ system: string;
+ interface: string;
+}
+
+// 전송 결과 타입
+export interface SoapSendResult {
+ success: boolean;
+ message: string;
+ responseText?: string;
+ statusCode?: number;
+ headers?: Record<string, string>;
+}
+
+// 기본 환경변수에서 인증 정보 가져오기
+function getDefaultAuth(): SoapAuthConfig {
+ return {
+ username: process.env.MDG_SOAP_USERNAME,
+ password: process.env.MDG_SOAP_PASSWORD
+ };
+}
+
+// 공통 XML 빌더 생성
+function createXmlBuilder() {
+ return new XMLBuilder({
+ ignoreAttributes: false,
+ format: true,
+ attributeNamePrefix: '@_',
+ textNodeName: '#text',
+ suppressEmptyNode: true,
+ suppressUnpairedNode: false,
+ indentBy: ' ',
+ processEntities: false,
+ suppressBooleanAttributes: false,
+ cdataPropName: false,
+ tagValueProcessor: (name, val) => val,
+ attributeValueProcessor: (name, val) => val
+ });
+}
+
+// SOAP Envelope 생성
+function createSoapEnvelope(
+ namespace: string,
+ bodyContent: Record<string, any>
+): Record<string, any> {
+ return {
+ 'soap:Envelope': {
+ '@_xmlns:soap': 'http://schemas.xmlsoap.org/soap/envelope/',
+ '@_xmlns:ns0': namespace,
+ 'soap:Body': bodyContent
+ }
+ };
+}
+
+// XML 생성
+export async function generateSoapXml(
+ envelope: Record<string, any>,
+ xmlDeclaration: string = '<?xml version="1.0" encoding="UTF-8"?>\n'
+): Promise<string> {
+ const builder = createXmlBuilder();
+ const xmlBody = builder.build(envelope);
+ return xmlDeclaration + xmlBody;
+}
+
+// SOAP XML 전송 공통 함수
+export async function sendSoapXml(
+ config: SoapSendConfig,
+ logInfo: SoapLogInfo,
+ auth?: SoapAuthConfig
+): Promise<SoapSendResult> {
+ try {
+ // 인증 정보 설정 (기본값 사용)
+ const authConfig = auth || getDefaultAuth();
+
+ // XML 생성
+ const soapEnvelope = createSoapEnvelope(
+ 'http://shi.samsung.co.kr/P2_MD/MDZ',
+ config.envelope
+ );
+
+ const xmlData = await generateSoapXml(soapEnvelope);
+
+ console.log('📤 SOAP XML 전송 시작');
+ console.log('🔍 전송 XML (첫 500자):', xmlData.substring(0, 500));
+
+ const result = await withSoapLogging(
+ logInfo.direction,
+ logInfo.system,
+ logInfo.interface,
+ xmlData,
+ async () => {
+ // 헤더 설정
+ const headers: Record<string, string> = {
+ 'Content-Type': 'text/xml; charset=utf-8',
+ 'SOAPAction': config.soapAction || 'http://sap.com/xi/WebService/soap1.1',
+ };
+
+ // Basic Authentication 헤더 추가
+ if (authConfig.username && authConfig.password) {
+ const credentials = Buffer.from(`${authConfig.username}:${authConfig.password}`).toString('base64');
+ headers['Authorization'] = `Basic ${credentials}`;
+ console.log('🔐 Basic Authentication 헤더 추가 완료');
+ } else {
+ console.warn('⚠️ SOAP 인증 정보가 설정되지 않았습니다.');
+ }
+
+ // fetch 옵션 설정
+ const fetchOptions: RequestInit = {
+ method: 'POST',
+ headers,
+ body: xmlData,
+ };
+
+ // 타임아웃 설정
+ if (config.timeout) {
+ const controller = new AbortController();
+ const timeoutId = setTimeout(() => controller.abort(), config.timeout);
+
+ try {
+ const response = await fetch(config.endpoint, {
+ ...fetchOptions,
+ signal: controller.signal
+ });
+ clearTimeout(timeoutId);
+ return response;
+ } catch (error) {
+ clearTimeout(timeoutId);
+ if (error instanceof Error && error.name === 'AbortError') {
+ throw new Error(`요청 타임아웃 (${config.timeout}ms)`);
+ }
+ throw error;
+ }
+ } else {
+ return await fetch(config.endpoint, fetchOptions);
+ }
+ }
+ );
+
+ // 응답 처리
+ const response = result as Response;
+ const responseText = await response.text();
+
+ console.log('📥 SOAP 응답 수신:', response.status, response.statusText);
+ console.log('🔍 응답 XML (첫 500자):', responseText.substring(0, 500));
+
+ // HTTP 상태 코드 확인
+ if (!response.ok) {
+ throw new Error(`HTTP ${response.status}: ${response.statusText}`);
+ }
+
+ // SOAP Fault 검사
+ if (responseText.includes('soap:Fault') || responseText.includes('SOAP:Fault')) {
+ throw new Error(`SOAP Fault: ${responseText}`);
+ }
+
+ // 응답 헤더 수집
+ const responseHeaders: Record<string, string> = {};
+ response.headers.forEach((value, key) => {
+ responseHeaders[key] = value;
+ });
+
+ return {
+ success: true,
+ message: '전송 성공',
+ responseText,
+ statusCode: response.status,
+ headers: responseHeaders
+ };
+
+ } catch (error) {
+ console.error('❌ SOAP XML 전송 실패:', error);
+ return {
+ success: false,
+ message: error instanceof Error ? error.message : 'Unknown error'
+ };
+ }
+}
+
+// 재시도 로직이 포함된 SOAP 전송 함수
+export async function sendSoapXmlWithRetry(
+ config: SoapSendConfig,
+ logInfo: SoapLogInfo,
+ auth?: SoapAuthConfig
+): Promise<SoapSendResult> {
+ const maxRetries = config.retryCount || 3;
+ const retryDelay = config.retryDelay || 1000;
+
+ for (let attempt = 1; attempt <= maxRetries; attempt++) {
+ try {
+ console.log(`🔄 SOAP 전송 시도 ${attempt}/${maxRetries}`);
+
+ const result = await sendSoapXml(config, logInfo, auth);
+
+ if (result.success) {
+ return result;
+ }
+
+ // 마지막 시도가 아니면 재시도
+ if (attempt < maxRetries) {
+ console.log(`⏳ ${retryDelay}ms 후 재시도...`);
+ await new Promise(resolve => setTimeout(resolve, retryDelay));
+ }
+
+ } catch (error) {
+ console.error(`❌ SOAP 전송 시도 ${attempt} 실패:`, error);
+
+ if (attempt === maxRetries) {
+ return {
+ success: false,
+ message: `최대 재시도 횟수 초과: ${error instanceof Error ? error.message : 'Unknown error'}`
+ };
+ }
+
+ // 마지막 시도가 아니면 재시도
+ console.log(`⏳ ${retryDelay}ms 후 재시도...`);
+ await new Promise(resolve => setTimeout(resolve, retryDelay));
+ }
+ }
+
+ return {
+ success: false,
+ message: '알 수 없는 오류로 전송 실패'
+ };
+}
+
+// 간단한 SOAP 전송 함수 (기본 설정 사용)
+export async function sendSimpleSoapXml(
+ endpoint: string,
+ bodyContent: Record<string, any>,
+ logInfo: SoapLogInfo,
+ options?: {
+ namespace?: string;
+ soapAction?: string;
+ auth?: SoapAuthConfig;
+ timeout?: number;
+ }
+): Promise<SoapSendResult> {
+ const config: SoapSendConfig = {
+ endpoint,
+ envelope: bodyContent,
+ soapAction: options?.soapAction,
+ timeout: options?.timeout || 30000, // 기본 30초
+ };
+
+ const auth = options?.auth || getDefaultAuth();
+
+ return await sendSoapXml(config, logInfo, auth);
+}
+
+// MDG 전용 SOAP 전송 함수 (기존 action.ts와 호환)
+export async function sendMdgSoapXml(
+ bodyContent: Record<string, any>,
+ logInfo: SoapLogInfo,
+ auth?: SoapAuthConfig
+): Promise<SoapSendResult> {
+ const config: SoapSendConfig = {
+ endpoint: "http://shii8dvddb01.hec.serp.shi.samsung.net:50000/sap/xi/engine?type=entry&version=3.0&Sender.Service=P2038_Q&Interface=http%3A%2F%2Fshi.samsung.co.kr%2FP2_MD%2FMDZ%5EP2MD3007_AO&QualityOfService=ExactlyOnce",
+ envelope: bodyContent,
+ soapAction: 'http://sap.com/xi/WebService/soap1.1',
+ timeout: 60000, // MDG는 60초 타임아웃
+ };
+
+ return await sendSoapXml(config, logInfo, auth);
+}
diff --git a/lib/soap/utils.ts b/lib/soap/utils.ts
index 52c82d47..6c09edbe 100644
--- a/lib/soap/utils.ts
+++ b/lib/soap/utils.ts
@@ -322,7 +322,7 @@ export function createSuccessResponse(
*/
export async function replaceSubTableData<T extends Record<string, unknown>>(
tx: Parameters<Parameters<typeof db.transaction>[0]>[0],
- table: any, // Drizzle 테이블 객체 - 복잡한 제네릭 타입으로 인해 any 사용
+ table: any, // Drizzle 테이블 객체 - 동적 필드 접근을 위해 any 사용 (규칙에서 허용)
data: T[],
parentField: string,
parentValue: string
@@ -553,4 +553,56 @@ export async function logSoapExecution(
console.error('SOAP 로그 기록 실패:', error);
// 로그 기록 실패는 메인 로직에 영향을 주지 않도록 throw 하지 않음
}
+}
+
+// ========================================
+// SAP 데이터 포맷 변환 공통 함수들
+// ========================================
+
+/**
+ * 날짜 포맷 변환 헬퍼 함수 (YYYY-MM-DD -> YYYYMMDD)
+ * SAP 시스템에서 요구하는 DATS 타입 형식으로 변환
+ * @param dateString ISO 날짜 문자열 (YYYY-MM-DD)
+ * @returns SAP DATS 형식 문자열 (YYYYMMDD)
+ */
+export function formatDateForSAP(dateString: string): string {
+ return dateString.replace(/-/g, '');
+}
+
+/**
+ * 시간 포맷 변환 헬퍼 함수 (HH:MM:SS -> HHMMSS)
+ * SAP 시스템에서 요구하는 TIMS 타입 형식으로 변환
+ * @param timeString ISO 시간 문자열 (HH:MM:SS)
+ * @returns SAP TIMS 형식 문자열 (HHMMSS)
+ */
+export function formatTimeForSAP(timeString: string): string {
+ return timeString.replace(/:/g, '');
+}
+
+/**
+ * 현재 날짜를 SAP DATS 형식으로 반환
+ * @returns 현재 날짜의 SAP DATS 형식 (YYYYMMDD)
+ */
+export function getCurrentSAPDate(): string {
+ return formatDateForSAP(new Date().toISOString().slice(0, 10));
+}
+
+/**
+ * 현재 시간을 SAP TIMS 형식으로 반환
+ * @returns 현재 시간의 SAP TIMS 형식 (HHMMSS)
+ */
+export function getCurrentSAPTime(): string {
+ return formatTimeForSAP(new Date().toTimeString().slice(0, 8));
+}
+
+/**
+ * JavaScript Date 객체를 SAP 날짜/시간 형식으로 변환
+ * @param date JavaScript Date 객체
+ * @returns SAP 날짜/시간 형식 객체 { date: YYYYMMDD, time: HHMMSS }
+ */
+export function dateToSAPFormat(date: Date): { date: string; time: string } {
+ return {
+ date: formatDateForSAP(date.toISOString().slice(0, 10)),
+ time: formatTimeForSAP(date.toTimeString().slice(0, 8))
+ };
} \ No newline at end of file
diff --git a/public/wsdl/IF_EVCP_ECC_CANCEL_RFQ.csv b/public/wsdl/IF_EVCP_ECC_CANCEL_RFQ.csv
new file mode 100644
index 00000000..6efba743
--- /dev/null
+++ b/public/wsdl/IF_EVCP_ECC_CANCEL_RFQ.csv
@@ -0,0 +1,4 @@
+SEQ,Table,Field,M/O,Type,Size,Description
+1,,ANFNR,M,CHAR,10,RFQ Number
+2,,EV_TYPE,,CHAR,1, 수신측 응답으로, 보낼 내용이 아님
+3,,EV_MESSAGE,,CHAR,100, 수신측 응답으로, 보낼 내용이 아님
diff --git a/public/wsdl/IF_EVCP_ECC_CANCEL_RFQ.wsdl b/public/wsdl/IF_EVCP_ECC_CANCEL_RFQ.wsdl
new file mode 100644
index 00000000..15ddd667
--- /dev/null
+++ b/public/wsdl/IF_EVCP_ECC_CANCEL_RFQ.wsdl
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- P2MM3016_SO -->
+<wsdl:definitions name="P2MM3016_SO" targetNamespace="http://shi.samsung.co.kr/P2_MM/MMM"
+ xmlns:p1="http://shi.samsung.co.kr/P2_MM/MMM"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+ <wsdl:documentation />
+ <wsp:UsingPolicy wsdl:required="true" />
+ <wsp:Policy wsu:Id="OP_P2MM3016_SO" />
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://shi.samsung.co.kr/P2_MM/MMM"
+ xmlns="http://shi.samsung.co.kr/P2_MM/MMM" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <xsd:element name="MT_P2MM3016_S" type="P2MM3016_S" />
+ <xsd:element name="MT_P2MM3016_S_response" type="P2MM3016_S_response" />
+ <xsd:complexType name="P2MM3016_S_response">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/VersionID">
+ e725311966ae11f0bd2b0000007e145f</xsd:appinfo>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="EV_TYPE" type="xsd:string" minOccurs="0">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ e6b9b40466ae11f0c54e32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="EV_MESSAGE" type="xsd:string" minOccurs="0">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ e6b9b40566ae11f08eff32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="P2MM3016_S">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/VersionID">
+ df7cdb8c66ae11f0ad720000007e145f</xsd:appinfo>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="T_ANFNR" minOccurs="0" maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ df0a333c66ae11f0befa32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="ANFNR" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ df0a333b66ae11f0861b32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="MT_P2MM3016_S">
+ <wsdl:documentation />
+ <wsdl:part name="MT_P2MM3016_S" element="p1:MT_P2MM3016_S" />
+ </wsdl:message>
+ <wsdl:message name="MT_P2MM3016_S_response">
+ <wsdl:documentation />
+ <wsdl:part name="MT_P2MM3016_S_response" element="p1:MT_P2MM3016_S_response" />
+ </wsdl:message>
+ <wsdl:portType name="P2MM3016_SO">
+ <wsdl:documentation />
+ <wsdl:operation name="P2MM3016_SO">
+ <wsdl:documentation />
+ <wsp:Policy>
+ <wsp:PolicyReference URI="#OP_P2MM3016_SO" />
+ </wsp:Policy>
+ <wsdl:input message="p1:MT_P2MM3016_S" />
+ <wsdl:output message="p1:MT_P2MM3016_S_response" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="P2MM3016_SOBinding" type="p1:P2MM3016_SO">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
+ <wsdl:operation name="P2MM3016_SO">
+ <soap:operation soapAction="http://sap.com/xi/WebService/soap1.1"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
+ <wsdl:input>
+ <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="P2MM3016_SOService">
+ <wsdl:port name="P2MM3016_SOPort" binding="p1:P2MM3016_SOBinding">
+ <soap:address
+ location="http://shii8dvddb01.hec.serp.shi.samsung.net:50000/sap/xi/engine?type=entry&amp;version=3.0&amp;Sender.Service=P2038_D&amp;Interface=http%3A%2F%2Fshi.samsung.co.kr%2FP2_MM%2FMMM%5EP2MM3016_SO"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions> \ No newline at end of file
diff --git a/public/wsdl/IF_EVCP_ECC_CREATE_PO.csv b/public/wsdl/IF_EVCP_ECC_CREATE_PO.csv
new file mode 100644
index 00000000..f4188d5c
--- /dev/null
+++ b/public/wsdl/IF_EVCP_ECC_CREATE_PO.csv
@@ -0,0 +1,39 @@
+SEQ,Table,Field,M/O,Type,Size,Description
+1,T_Bidding_HEADER,ANFNR,M,CHAR,10,Bidding Number
+2,T_Bidding_HEADER,LIFNR,M,CHAR,10,Vendor Account Number
+3,T_Bidding_HEADER,ZPROC_IND,M,CHAR,1,Purchasing Processing State
+4,T_Bidding_HEADER,ANGNR,,CHAR,10,Bidding Number
+5,T_Bidding_HEADER,WAERS,M,CUKY,5,Currency Key
+6,T_Bidding_HEADER,ZTERM,M,CHAR,4,Terms of Payment Key
+7,T_Bidding_HEADER,INCO1,M,CHAR,3,Incoterms (Part 1)
+8,T_Bidding_HEADER,INCO2,M,CHAR,28,Incoterms (Part 2)
+9,T_Bidding_HEADER,VSTEL,,CHAR,3,Shipping Point
+10,T_Bidding_HEADER,LSTEL,,CHAR,3,loading Point
+11,T_Bidding_HEADER,MWSKZ,M,CHAR,2,Tax on sales/purchases code
+12,T_Bidding_HEADER,LANDS,M,CHAR,3,Country for Tax
+13,T_Bidding_HEADER,ZRCV_DT,M,DATS,8,Bidding Receive Date
+14,T_Bidding_HEADER,ZATTEN_IND,M,CHAR,1,Attendance Indicator
+15,T_Bidding_HEADER,IHRAN,M,DATS,8,Bidding Submission Date
+16,T_Bidding_HEADER,TEXT,,CHAR,,PO Header note
+17,T_Bidding_HEADER,ZDLV_CNTLR,,CHAR,3,Delivery Controller
+18,T_Bidding_HEADER,ZDLV_PRICE_T,,CHAR,1,"납품대금연동제대상여부(Y:대상, N:미대상, 공백:미해당)"
+19,T_Bidding_HEADER,ZDLV_PRICE_NOTE,,CHAR,,연동제 노트 (Long Text)
+20,T_Bidding_ITEM,ANFNR,M,CHAR,10,Bidding Number
+21,T_Bidding_ITEM,ANFPS,M,NUMC,5,Item Number of Bidding
+22,T_Bidding_ITEM,LIFNR,M,CHAR,10,Vendor Account Number
+23,T_Bidding_ITEM,NETPR,M,CURR,"17,2",Net Price
+24,T_Bidding_ITEM,PEINH,M,DEC,5,Price Unit
+25,T_Bidding_ITEM,BPRME,M,UNIT,3,Order Unit of Measure
+26,T_Bidding_ITEM,NETWR,M,CURR,"17,2",Net Order Value
+27,T_Bidding_ITEM,BRTWR,M,CURR,"17,2",Gross Order Value
+28,T_Bidding_ITEM,LFDAT,M,DATS,8,Item Delivery Date
+29,T_Bidding_ITEM,ZCON_NO_PO,,CHAR,15,PR Consolidation Number
+30,T_Bidding_ITEM,EBELP,,NUMC,5,Series PO Item Seq
+31,T_PR_RETURN,ANFNR,M,CHAR,10,PR Request Number
+32,T_PR_RETURN,ANFPS,M,NUMC,5,Item Number of PR Request
+33,T_PR_RETURN,EBELN,M,CHAR,10,Purchase Requisition Number
+34,T_PR_RETURN,EBELP,M,NUMC,5,Item Number of Purchase Requisition
+35,T_PR_RETURN,MSGTY,M,CHAR,1,Message Type
+36,T_PR_RETURN,MSGTXT,,CHAR,100,Message Text
+37,,EV_ERDAT,,DATS,8,Extract Date
+38,,EV_ERZET,,TIMS,6,Extract Time
diff --git a/public/wsdl/IF_EVCP_ECC_PCR_CONFIRM.csv b/public/wsdl/IF_EVCP_ECC_PCR_CONFIRM.csv
new file mode 100644
index 00000000..ab5345ad
--- /dev/null
+++ b/public/wsdl/IF_EVCP_ECC_PCR_CONFIRM.csv
@@ -0,0 +1,21 @@
+SEQ,Table,Field,M/O,Type,Size,Description
+1,,PCR_REQ,M,CHAR,10,PCR 요청번호
+2,,PCR_REQ_SEQ,M,NUMC,5,PCR 요청순번
+3,,PCR_DEC_DATE,M,DATS,8,PCR 결정일
+4,,EBELN,M,CHAR,10,구매오더
+5,,EBELP,M,NUMC,5,구매오더 품번
+6,,WAERS,,CUKY,5,PCR 통화
+7,,PCR_NETPR,,CURR,"13,2",PCR 단가
+8,,PEINH,,DEC,5,"Price Unit, 수량에 대한 PER 당 단가"
+9,,PCR_NETWR,,CURR,"13,2",PCR 금액
+10,,PCR_STATUS,M,CHAR,1,PCR 상태
+11,,REJ_CD,,CHAR,10,Reject 코드
+12,,REJ_RSN,,CHAR,50,Reject 사유
+13,,CONFIRM_CD,,CHAR,10,Confirm 코드
+14,,CONFIRM_RSN,,CHAR,50,Confirm 사유
+15,,PCR_REQ,M,CHAR,10,PCR 요청번호
+16,,PCR_REQ_SEQ,M,NUMC,5,PCR 요청순번
+17,,EBELN,M,CHAR,10,구매오더
+18,,EBELP,M,NUMC,5,구매오더 품번
+19,,MSGTY,,CHAR,1,Message Type
+20,,MSGTXT,,CHAR,100,Message Text
diff --git a/public/wsdl/IF_EVCP_ECC_PCR_CONFIRM.wsdl b/public/wsdl/IF_EVCP_ECC_PCR_CONFIRM.wsdl
index 1dc9a9b9..e97f8139 100644
--- a/public/wsdl/IF_EVCP_ECC_PCR_CONFIRM.wsdl
+++ b/public/wsdl/IF_EVCP_ECC_PCR_CONFIRM.wsdl
@@ -1 +1,181 @@
-<!-- 송신 WSDL 이므로, SAP XI에서 WSDL 생성해서 받을 예정 --> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- P2MM3019_SO -->
+<wsdl:definitions name="P2MM3019_SO" targetNamespace="http://shi.samsung.co.kr/P2_MM/MMM" xmlns:p1="http://shi.samsung.co.kr/P2_MM/MMM" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
+ <wsdl:binding name="P2MM3019_SOBinding" type="p1:P2MM3019_SO">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
+ <wsdl:operation name="P2MM3019_SO">
+ <soap:operation soapAction="http://sap.com/xi/WebService/soap1.1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
+ <wsdl:input>
+ <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:documentation/>
+ <wsdl:message name="MT_P2MM3019_S_response">
+ <wsdl:documentation/>
+ <wsdl:part element="p1:MT_P2MM3019_S_response" name="MT_P2MM3019_S_response"/>
+ </wsdl:message>
+ <wsdl:message name="MT_P2MM3019_S">
+ <wsdl:documentation/>
+ <wsdl:part element="p1:MT_P2MM3019_S" name="MT_P2MM3019_S"/>
+ </wsdl:message>
+ <wsdl:portType name="P2MM3019_SO">
+ <wsdl:documentation/>
+ <wsdl:operation name="P2MM3019_SO">
+ <wsdl:documentation/>
+ <wsdl:input message="p1:MT_P2MM3019_S"/>
+ <wsdl:output message="p1:MT_P2MM3019_S_response"/>
+ <wsp:Policy>
+ <wsp:PolicyReference URI="#OP_P2MM3019_SO"/>
+ </wsp:Policy>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:service name="P2MM3019_SOService">
+ <wsdl:port binding="p1:P2MM3019_SOBinding" name="P2MM3019_SOPort">
+ <soap:address location="http://shii8dvddb01.hec.serp.shi.samsung.net:50000/sap/xi/engine?type=entry&amp;version=3.0&amp;Sender.Service=P2038_D&amp;Interface=http%3A%2F%2Fshi.samsung.co.kr%2FP2_MM%2FMMM%5EP2MM3019_SO" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://shi.samsung.co.kr/P2_MM/MMM" xmlns="http://shi.samsung.co.kr/P2_MM/MMM" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <xsd:complexType name="P2MM3019_S_response">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/VersionID">24adad88741611f090090000007e145e</xsd:appinfo>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="ZMM_RT">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">23eb7435741611f086d132a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element minOccurs="0" name="MSGTXT" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">23eb7434741611f0ceae32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="MSGTY" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">23eb7433741611f0bff932a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="EBELN" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">23eb7431741611f0be2432a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="EBELP" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">23eb7432741611f08cc532a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="PCR_REQ_SEQ" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">23eb7430741611f0862532a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="PCR_REQ" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">23eb742f741611f0c2ae32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="P2MM3019_S">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/VersionID">1bc86c08741611f0cc780000007e145e</xsd:appinfo>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="ZMM_PCR">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">1a9e4e2e741611f0881f32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element minOccurs="0" name="CONFIRM_CD" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">1a9e4e2c741611f0b9be32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="CONFIRM_RSN" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">1a9e4e2d741611f0b8fc32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="PCR_NETPR" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">1a9e4453741611f0893232a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="PCR_NETWR" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">1a9e4455741611f0a4ce32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="PEINH" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">1a9e4454741611f0bff832a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="REJ_CD" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">1a9e4457741611f0b19a32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="REJ_RSN" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">1a9e4e2b741611f0badf32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="WAERS" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">1a9e4452741611f09f4132a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="EBELN" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">1a9e4450741611f0c02b32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="EBELP" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">1a9e4451741611f0b1f832a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="PCR_DEC_DATE" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">1a9e444f741611f0ab5632a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="PCR_REQ_SEQ" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">1a9e444e741611f0989932a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="PCR_REQ" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">1a9df75f741611f0bed332a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="PCR_STATUS" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">1a9e4456741611f090e332a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:element name="MT_P2MM3019_S_response" type="P2MM3019_S_response"/>
+ <xsd:element name="MT_P2MM3019_S" type="P2MM3019_S"/>
+ </xsd:schema>
+ </wsdl:types>
+ <wsp:Policy wsu:Id="OP_P2MM3019_SO"/>
+ <wsp:UsingPolicy wsdl:required="true"/>
+</wsdl:definitions> \ No newline at end of file
diff --git a/public/wsdl/IF_EVCP_ECC_RFQ_INFORMATION.csv b/public/wsdl/IF_EVCP_ECC_RFQ_INFORMATION.csv
new file mode 100644
index 00000000..959e1913
--- /dev/null
+++ b/public/wsdl/IF_EVCP_ECC_RFQ_INFORMATION.csv
@@ -0,0 +1,19 @@
+SEQ,Table,Field,M/O,Type,Size,Description
+1,T_RFQ_HEADER,ANFNR,M,CHAR,10,RFQ Number
+2,T_RFQ_HEADER,LIFNR,M,CHAR,10,Vendor's account number
+3,T_RFQ_HEADER,WAERS,M,CUKY,5,Currency Key
+4,T_RFQ_HEADER,ZTERM,M,CHAR,4,Terms of Payment Key
+5,T_RFQ_HEADER,INCO1,M,CHAR,3,Incoterms (Part 1)
+6,T_RFQ_HEADER,INCO2,M,CHAR,28,Incoterms (Part 2)
+7,T_RFQ_HEADER,VSTEL,,CHAR,3,Place of Shipping
+8,T_RFQ_HEADER,LSTEL,,CHAR,3,Place of Destination
+9,T_RFQ_HEADER,MWSKZ,M,CHAR,2,Tax on Sales/Purchases Code
+10,T_RFQ_HEADER,LANDS,M,CHAR,3,Country for Tax Return
+11,T_RFQ_ITEM,ANFNR,M,CHAR,10,RFQ Number
+12,T_RFQ_ITEM,ANFPS,M,NUMC,"5,0",Item Number of RFQ
+13,T_RFQ_ITEM,NETPR,M,CURR,"11,2",Net Price in Purchasing Document (in Document Currency)
+14,T_RFQ_ITEM,NETWR,M,CURR,"13,2",Net Order Value in PO Currency
+15,T_RFQ_ITEM,BRTWR,M,CURR,"13,2",Gross order value in PO currency
+16,T_RFQ_ITEM,LFDAT,,DATS,8,Item delivery date
+17,,EV_TYPE,,CHAR,1,수신측 응답으로 보낼 내용이 아님
+18,,EV_MESSAGE,,CHAR,100,수신측 응답으로 보낼 내용이 아님
diff --git a/public/wsdl/IF_EVCP_ECC_RFQ_INFORMATION.wsdl b/public/wsdl/IF_EVCP_ECC_RFQ_INFORMATION.wsdl
index 5ca7260a..36237953 100644
--- a/public/wsdl/IF_EVCP_ECC_RFQ_INFORMATION.wsdl
+++ b/public/wsdl/IF_EVCP_ECC_RFQ_INFORMATION.wsdl
@@ -1,170 +1,202 @@
<?xml version="1.0" encoding="UTF-8"?>
-<wsdl:definitions name="P2MM3014_SO" targetNamespace="http://shi.samsung.co.kr/P2_MM/MMM" xmlns:p1="http://shi.samsung.co.kr/P2_MM/MMM" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
- <wsdl:binding name="P2MM3014_SOBinding" type="p1:P2MM3014_SO">
- <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
- <wsdl:operation name="P2MM3014_SO">
- <soap:operation soapAction="http://sap.com/xi/WebService/soap1.1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
- <wsdl:input>
- <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:documentation/>
- <wsdl:message name="MT_P2MM3014_S_response">
- <wsdl:documentation/>
- <wsdl:part element="p1:MT_P2MM3014_S_response" name="MT_P2MM3014_S_response"/>
- </wsdl:message>
- <wsdl:message name="MT_P2MM3014_S">
- <wsdl:documentation/>
- <wsdl:part element="p1:MT_P2MM3014_S" name="MT_P2MM3014_S"/>
- </wsdl:message>
- <wsdl:portType name="P2MM3014_SO">
- <wsdl:documentation/>
- <wsdl:operation name="P2MM3014_SO">
- <wsdl:documentation/>
- <wsdl:input message="p1:MT_P2MM3014_S"/>
- <wsdl:output message="p1:MT_P2MM3014_S_response"/>
- <wsp:Policy>
- <wsp:PolicyReference URI="#OP_P2MM3014_SO"/>
- </wsp:Policy>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:service name="P2MM3014_SOService">
- <wsdl:port binding="p1:P2MM3014_SOBinding" name="P2MM3014_SOPort">
- <soap:address location="http://shii8dvddb01.hec.serp.shi.samsung.net:50000/sap/xi/engine?type=entry&amp;version=3.0&amp;Sender.Service=P2038_D&amp;Interface=http%3A%2F%2Fshi.samsung.co.kr%2FP2_MM%2FMMM%5EP2MM3014_SO" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
- </wsdl:port>
- </wsdl:service>
- <wsdl:types>
- <xsd:schema targetNamespace="http://shi.samsung.co.kr/P2_MM/MMM" xmlns="http://shi.samsung.co.kr/P2_MM/MMM" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:complexType name="P2MM3014_S_response">
- <xsd:annotation>
- <xsd:appinfo source="http://sap.com/xi/VersionID">e4f1434162c411f09f5e0000007e145f</xsd:appinfo>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="EV_MESSAGE" type="xsd:string">
- <xsd:annotation>
- <xsd:appinfo source="http://sap.com/xi/TextID">e42a046362c411f0b76b32a76e607ae9</xsd:appinfo>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="EV_TYPE" type="xsd:string">
- <xsd:annotation>
- <xsd:appinfo source="http://sap.com/xi/TextID">e42a046262c411f0a85b32a76e607ae9</xsd:appinfo>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="P2MM3014_S">
- <xsd:annotation>
- <xsd:appinfo source="http://sap.com/xi/VersionID">dd6cc8d562c411f095860000007e145f</xsd:appinfo>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="T_RFQ_HEADER">
- <xsd:annotation>
- <xsd:appinfo source="http://sap.com/xi/TextID">dd04ef5c62c411f0c9d732a76e607ae9</xsd:appinfo>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="LSTEL" type="xsd:string">
- <xsd:annotation>
- <xsd:appinfo source="http://sap.com/xi/TextID">dd04b7b962c411f08fc732a76e607ae9</xsd:appinfo>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="VSTEL" type="xsd:string">
- <xsd:annotation>
- <xsd:appinfo source="http://sap.com/xi/TextID">dd04b7b862c411f0a76d32a76e607ae9</xsd:appinfo>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="ANFNR" type="xsd:string">
- <xsd:annotation>
- <xsd:appinfo source="http://sap.com/xi/TextID">dd04b7b262c411f0ad7e32a76e607ae9</xsd:appinfo>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="INCO1" type="xsd:string">
- <xsd:annotation>
- <xsd:appinfo source="http://sap.com/xi/TextID">dd04b7b662c411f0be5532a76e607ae9</xsd:appinfo>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="INCO2" type="xsd:string">
- <xsd:annotation>
- <xsd:appinfo source="http://sap.com/xi/TextID">dd04b7b762c411f0cee832a76e607ae9</xsd:appinfo>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="LANDS" type="xsd:string">
- <xsd:annotation>
- <xsd:appinfo source="http://sap.com/xi/TextID">dd04ef5b62c411f0bb9932a76e607ae9</xsd:appinfo>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="LIFNR" type="xsd:string">
- <xsd:annotation>
- <xsd:appinfo source="http://sap.com/xi/TextID">dd04b7b362c411f0819a32a76e607ae9</xsd:appinfo>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="MWSKZ" type="xsd:string">
- <xsd:annotation>
- <xsd:appinfo source="http://sap.com/xi/TextID">dd04b7ba62c411f0a39a32a76e607ae9</xsd:appinfo>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="WAERS" type="xsd:string">
- <xsd:annotation>
- <xsd:appinfo source="http://sap.com/xi/TextID">dd04b7b462c411f0c38132a76e607ae9</xsd:appinfo>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="ZTERM" type="xsd:string">
- <xsd:annotation>
- <xsd:appinfo source="http://sap.com/xi/TextID">dd04b7b562c411f09f0732a76e607ae9</xsd:appinfo>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
+<!-- P2MM3014_SO -->
+<wsdl:definitions name="P2MM3014_SO" targetNamespace="http://shi.samsung.co.kr/P2_MM/MMM"
+ xmlns:p1="http://shi.samsung.co.kr/P2_MM/MMM"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+ <wsdl:documentation />
+ <wsp:UsingPolicy wsdl:required="true" />
+ <wsp:Policy wsu:Id="OP_P2MM3014_SO" />
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://shi.samsung.co.kr/P2_MM/MMM"
+ xmlns="http://shi.samsung.co.kr/P2_MM/MMM" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <xsd:element name="MT_P2MM3014_S_response" type="P2MM3014_S_response" />
+ <xsd:element name="MT_P2MM3014_S" type="P2MM3014_S" />
+ <xsd:complexType name="P2MM3014_S_response">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/VersionID">
+ e4f1434162c411f09f5e0000007e145f</xsd:appinfo>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="EV_TYPE" type="xsd:string" minOccurs="0">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ e42a046262c411f0a85b32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="EV_MESSAGE" type="xsd:string" minOccurs="0">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ e42a046362c411f0b76b32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
</xsd:complexType>
- </xsd:element>
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="T_RFQ_ITEM">
- <xsd:annotation>
- <xsd:appinfo source="http://sap.com/xi/TextID">dd04ef6362c411f096e532a76e607ae9</xsd:appinfo>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="LFDAT" type="xsd:string">
- <xsd:annotation>
- <xsd:appinfo source="http://sap.com/xi/TextID">dd04ef6262c411f0c08232a76e607ae9</xsd:appinfo>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="ANFNR" type="xsd:string">
- <xsd:annotation>
- <xsd:appinfo source="http://sap.com/xi/TextID">dd04ef5d62c411f0c01432a76e607ae9</xsd:appinfo>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="ANFPS" type="xsd:string">
- <xsd:annotation>
- <xsd:appinfo source="http://sap.com/xi/TextID">dd04ef5e62c411f0cb4532a76e607ae9</xsd:appinfo>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="BRTWR" type="xsd:string">
- <xsd:annotation>
- <xsd:appinfo source="http://sap.com/xi/TextID">dd04ef6162c411f094b532a76e607ae9</xsd:appinfo>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="NETPR" type="xsd:string">
- <xsd:annotation>
- <xsd:appinfo source="http://sap.com/xi/TextID">dd04ef5f62c411f0bdca32a76e607ae9</xsd:appinfo>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="NETWR" type="xsd:string">
- <xsd:annotation>
- <xsd:appinfo source="http://sap.com/xi/TextID">dd04ef6062c411f0ae2032a76e607ae9</xsd:appinfo>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
+ <xsd:complexType name="P2MM3014_S">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/VersionID">
+ dd6cc8d562c411f095860000007e145f</xsd:appinfo>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="T_RFQ_HEADER" minOccurs="0" maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ dd04ef5c62c411f0c9d732a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="ANFNR" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ dd04b7b262c411f0ad7e32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="LIFNR" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ dd04b7b362c411f0819a32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="WAERS" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ dd04b7b462c411f0c38132a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="ZTERM" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ dd04b7b562c411f09f0732a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="INCO1" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ dd04b7b662c411f0be5532a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="INCO2" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ dd04b7b762c411f0cee832a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="VSTEL" type="xsd:string" minOccurs="0">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ dd04b7b862c411f0a76d32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="LSTEL" type="xsd:string" minOccurs="0">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ dd04b7b962c411f08fc732a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="MWSKZ" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ dd04b7ba62c411f0a39a32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="LANDS" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ dd04ef5b62c411f0bb9932a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="T_RFQ_ITEM" minOccurs="0" maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ dd04ef6362c411f096e532a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="ANFNR" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ dd04ef5d62c411f0c01432a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="ANFPS" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ dd04ef5e62c411f0cb4532a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="NETPR" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ dd04ef5f62c411f0bdca32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="NETWR" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ dd04ef6062c411f0ae2032a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="BRTWR" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ dd04ef6162c411f094b532a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="LFDAT" type="xsd:string" minOccurs="0">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">
+ dd04ef6262c411f0c08232a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
</xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:element name="MT_P2MM3014_S_response" type="P2MM3014_S_response"/>
- <xsd:element name="MT_P2MM3014_S" type="P2MM3014_S"/>
- </xsd:schema>
- </wsdl:types>
- <wsp:Policy wsu:Id="OP_P2MM3014_SO"/>
- <wsp:UsingPolicy wsdl:required="true"/>
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="MT_P2MM3014_S">
+ <wsdl:documentation />
+ <wsdl:part name="MT_P2MM3014_S" element="p1:MT_P2MM3014_S" />
+ </wsdl:message>
+ <wsdl:message name="MT_P2MM3014_S_response">
+ <wsdl:documentation />
+ <wsdl:part name="MT_P2MM3014_S_response" element="p1:MT_P2MM3014_S_response" />
+ </wsdl:message>
+ <wsdl:portType name="P2MM3014_SO">
+ <wsdl:documentation />
+ <wsdl:operation name="P2MM3014_SO">
+ <wsdl:documentation />
+ <wsp:Policy>
+ <wsp:PolicyReference URI="#OP_P2MM3014_SO" />
+ </wsp:Policy>
+ <wsdl:input message="p1:MT_P2MM3014_S" />
+ <wsdl:output message="p1:MT_P2MM3014_S_response" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="P2MM3014_SOBinding" type="p1:P2MM3014_SO">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
+ <wsdl:operation name="P2MM3014_SO">
+ <soap:operation soapAction="http://sap.com/xi/WebService/soap1.1"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
+ <wsdl:input>
+ <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="P2MM3014_SOService">
+ <wsdl:port name="P2MM3014_SOPort" binding="p1:P2MM3014_SOBinding">
+ <soap:address
+ location="http://shii8dvddb01.hec.serp.shi.samsung.net:50000/sap/xi/engine?type=entry&amp;version=3.0&amp;Sender.Service=P2038_D&amp;Interface=http%3A%2F%2Fshi.samsung.co.kr%2FP2_MM%2FMMM%5EP2MM3014_SO"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
+ </wsdl:port>
+ </wsdl:service>
</wsdl:definitions> \ No newline at end of file
diff --git a/public/wsdl/IF_EVCP_MDZ_VENDOR_MASTER.wsdl b/public/wsdl/IF_EVCP_MDZ_VENDOR_MASTER.wsdl
new file mode 100644
index 00000000..5c5d75f0
--- /dev/null
+++ b/public/wsdl/IF_EVCP_MDZ_VENDOR_MASTER.wsdl
@@ -0,0 +1,286 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- P2MD3007_AO -->
+<wsdl:definitions name="P2MD3007_AO" targetNamespace="http://shi.samsung.co.kr/P2_MD/MDZ" xmlns:p1="http://shi.samsung.co.kr/P2_MD/MDZ" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
+ <wsdl:binding name="P2MD3007_AOBinding" type="p1:P2MD3007_AO">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
+ <wsdl:operation name="P2MD3007_AO">
+ <soap:operation soapAction="http://sap.com/xi/WebService/soap1.1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
+ <wsdl:input>
+ <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
+ </wsdl:input>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:documentation/>
+ <wsdl:message name="MT_P2MD3007_S">
+ <wsdl:documentation/>
+ <wsdl:part element="p1:MT_P2MD3007_S" name="MT_P2MD3007_S"/>
+ </wsdl:message>
+ <wsdl:portType name="P2MD3007_AO">
+ <wsdl:documentation/>
+ <wsdl:operation name="P2MD3007_AO">
+ <wsdl:documentation/>
+ <wsdl:input message="p1:MT_P2MD3007_S"/>
+ <wsp:Policy>
+ <wsp:PolicyReference URI="#OP_P2MD3007_AO"/>
+ </wsp:Policy>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:service name="P2MD3007_AOService">
+ <wsdl:port binding="p1:P2MD3007_AOBinding" name="P2MD3007_AOPort">
+ <soap:address location="http://shii8dvddb01.hec.serp.shi.samsung.net:50000/sap/xi/engine?type=entry&amp;version=3.0&amp;Sender.Service=P2038_Q&amp;Interface=http%3A%2F%2Fshi.samsung.co.kr%2FP2_MD%2FMDZ%5EP2MD3007_AO&amp;QualityOfService=ExactlyOnce" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://shi.samsung.co.kr/P2_MD/MDZ" xmlns="http://shi.samsung.co.kr/P2_MD/MDZ" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <xsd:complexType name="P2MD3007_S">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/VersionID">8dd6f9a22c9611f0c16f0000007e145f</xsd:appinfo>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="SUPPLIER_MASTER">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d4812ba2c9611f0c61232a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element minOccurs="0" name="BP_TX_TYP" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d4807512c9611f0c2c432a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="CITY2" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d47d8122c9611f0823032a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="CONSNUMBER" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d47d8152c9611f0cc6732a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="FAX_EXTENS" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d48074c2c9611f0ae3132a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="FAX_NUMBER" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d48074b2c9611f0b93d32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="J_1KFREPRE" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d4786d12c9611f0809e32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="J_1KFTBUS" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d4786d22c9611f0a0fa32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="J_1KFTIND" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d4786d32c9611f0817332a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="LANGU" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d47d80f2c9611f0c57932a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="NAME2" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d4761fa2c9611f0c88832a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="NAME3" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d4786cc2c9611f0a7a632a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="NAME4" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d4786cd2c9611f0c53232a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="NATION" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d47ad1c2c9611f0bda932a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="REGION" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d47d8132c9611f08e2332a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="SMTP_ADDR" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d48074e2c9611f0a81432a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="STCD3" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d4807522c9611f0ae1c32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="TAXNUM" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d4807502c9611f0a02a32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="TEL_EXTENS" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d4807492c9611f0a9d032a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="TEL_NUMBER" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d47d8162c9611f0c29732a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="URI_ADDR" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d48074d2c9611f0beed32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="VBUND" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d4786d02c9611f082ca32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="VEMAIL" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d47ad122c9611f0c6dc32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="VQMGRP" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d4786d42c9611f09f1532a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="VTELNO" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d4786d52c9611f0a37c32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="ZTYPE" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d4786cf2c9611f0cfbb32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="ZZCNAME1" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d47ad132c9611f0c9e332a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="ZZCNAME2" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d47ad142c9611f0847332a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="ZZIND01" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d47ad1a2c9611f099b732a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="ZZIND03" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d4812b92c9611f08f8332a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="ZZTELF1_C" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d47ad152c9611f0864f32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element minOccurs="0" name="ZZVNDTYP" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d47ad182c9611f0baef32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="ADDRNO" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d47ad1b2c9611f0acd832a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="BP_HEADER" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d4761f62c9611f0945a32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="CITY1" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d47d8112c9611f0af0332a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="COUNTRY" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d47d80e2c9611f08e5632a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="IBND_TYPE" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d47ad172c9611f0b65332a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="KTOKK" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d4786ce2c9611f0c4bd32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="MASTERFLAG" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d47ad162c9611f0806532a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="NAME1" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d4761f92c9611f0b09b32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="POST_CODE1" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d47d8102c9611f0c5fc32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="R3_USER" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d48074a2c9611f08aca32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="SORT1" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d4761f82c9611f0ccc232a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="STREET" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d47d8142c9611f0cd1632a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="TAXTYPE" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d48074f2c9611f0b99d32a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="ZZREQID" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d47ad192c9611f0824832a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="ZZSRMCD" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo source="http://sap.com/xi/TextID">8d4761f72c9611f0a18232a76e607ae9</xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:element name="MT_P2MD3007_S" type="P2MD3007_S"/>
+ </xsd:schema>
+ </wsdl:types>
+ <wsp:Policy wsu:Id="OP_P2MD3007_AO"/>
+ <wsp:UsingPolicy wsdl:required="true"/>
+</wsdl:definitions> \ No newline at end of file