点击“蓝色按钮”,执行以下两个在线示例工程,了解 EDI 标准报文导入/导出数据库过程,执行完成后,点击“绿色按钮”,可以获取到示例工程代码。关于示例工程安装步骤,请参考页面“安装示例工程”。
示例一:X12标准报文导入SQLite数据库(如安装示例工程示例一)
准备转换 …
解析 X12 文件,生成 XPathXML 文件
读取 XpathXML 文件,映射业务数据
导入数据到 SQLite 数据库
导入成功!
* ANSI/X12 标准报文 850(订单)示例文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
ISA*00* *00* *ZZ*WAYNE_TECH *ZZ*ACME *160609*1330*U*00401*000000007*0*T*>~ GS*PO*WAYNE_TECH*ACME*20160609*1330*7*T*004010~ ST*850*0001~ BEG*00*DS*0476696888**20150708~ REF*SB*ZZ11~ REF*6P*ZZ~ REF*8M*0056~ REF*CR*1070335099~ REF*CO*7109790082~ PER*CN*ACME, Inc.*TE*(555) 555-5555~ CSH*SC~ SAC*C*ZZZZ**********06~ TD5*Z*2*123456~ N9*PD*ZCOF~ MSG*Thanks!~ N1*BY*Wayne Tech*92*5601~ N1*EN*ACME, Inc.~ N1*ST*Wayne Tech Plant 1*92*0000505462~ N2*Wayne Tech Plant 1*~ N3*100 Wayne Ave.~ N4*Chapel Hill*NC*27514*US**~ PO1**500000*EA*495*TP*BP*337S3744*VP*422242224~ PID*F****500,000 red widgets****EN~ SCH*500000*EA***002*20180708~ PO1**100*EA*395*HP*BP*337S3745*VP*422242226~ PID*F****100 blue widgets****EN~ SCH*100*EA***002*20180708~ CTT*2*500100~ SE*27*0001~ GE*1*7~ IEA*1*000000007~ |
示例二:SQLite数据库数据导入并生成X12标准报文(如安装示例工程示例二)
准备导出 …
解析数据库文件,映射业务数据
生成 XPathXML 文件
读取 XpathXML 文件,生成 X12 标准报文
生成成功!
* 数据库端口从数据库表中导出的默认的 XML 示例文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
<Items> <SalesOrders> <ID>1</ID> <ShippingLine1>100 Wayne Ave.</ShippingLine1> <TimeModified>2017-11-09T12:19:52.0000+08:00</TimeModified> <DueDate null="true"/> <ReferenceNumber>1070335099</ReferenceNumber> <ShippingState>NC</ShippingState> <IsTaxIncluded>0</IsTaxIncluded> <IsManuallyClosed>0</IsManuallyClosed> <TimeCreated>2017-11-09T12:19:52.0000+08:00</TimeCreated> <IsPrinted>0</IsPrinted> <ShippingPostalCode>27514</ShippingPostalCode> <Template>Sales Order Template</Template> <Date>2017-11-09T12:19:52.0000+08:00</Date> <IsToBeEmailed>0</IsToBeEmailed> <TemplateId>80000008-1435180913</TemplateId> <EditSequence>1</EditSequence> <ShippingCity>Chapel Hill</ShippingCity> <ShippingAddress>Wayne Tech Plant 1</ShippingAddress> <ShippingCountry>US</ShippingCountry> <CustomerId>0056</CustomerId> <IsToBePrinted>0</IsToBePrinted> <IsFullyInvoiced>1</IsFullyInvoiced> <SalesOrderLineItems> <ItemDescription>500,000 red widgets</ItemDescription> <ItemQuantity>500000</ItemQuantity> <ItemId>1</ItemId> <TimeModified>2017-11-09T12:19:52.0000+08:00</TimeModified> <ItemLineId>1</ItemLineId> <ItemUnitOfMeasure>TP</ItemUnitOfMeasure> <ItemRate>495</ItemRate> </SalesOrderLineItems> <SalesOrderLineItems> <ItemDescription>100 blue widgets</ItemDescription> <ItemQuantity>100</ItemQuantity> <ItemId>1</ItemId> <TimeModified>2017-11-09T12:19:52.0000+08:00</TimeModified> <ItemLineId>2</ItemLineId> <ItemUnitOfMeasure>HP</ItemUnitOfMeasure> <ItemRate>395</ItemRate> </SalesOrderLineItems> </SalesOrders> </Items> |