/********************************************************************************************************************************************/
/*时间:2019-8-24*/
/*功能:分别实现U8 XML交换数据文件*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using Tools;
namespace EAI
{
public static class ApplicationDataToU8XML
{
static string XmlModelTemplatePath = "D:\\EAI\\XML\\"; //为了便于理解此处路径都以绝对路径表示
//static string XmlModel = "OughtReceive001.xml";
public static void ApplicationDataToOughtReceiveXML()
{
XmlTextWriter xmlTextWriter = new XmlTextWriter(XmlModelTemplatePath + "OughtReceive001.xml", Encoding.Default);
xmlTextWriter.Formatting = Formatting.Indented;
xmlTextWriter.WriteStartDocument();
xmlTextWriter.WriteComment("应收单 roottag:类型 billtype:系统用 docid:唯一编号 receiver:接收方 sender:发送方编码 proc:操作码 codeexchanged:编码是否转换 exportneedexch导出时是否要根据对照表替换");
xmlTextWriter.WriteStartElement("ufinterface");
xmlTextWriter.WriteAttributeString("roottag", "oughtreceive");
xmlTextWriter.WriteAttributeString("billtype", "");
xmlTextWriter.WriteAttributeString("docid", "");
xmlTextWriter.WriteAttributeString("receiver", "u8");
xmlTextWriter.WriteAttributeString("sender", "");
xmlTextWriter.WriteAttributeString("proc", "add");
xmlTextWriter.WriteAttributeString("codeexchanged", "N");
xmlTextWriter.WriteAttributeString("exportneedexch", "N");
xmlTextWriter.WriteAttributeString("paginate", "");
xmlTextWriter.WriteAttributeString("display", "应收单");
xmlTextWriter.WriteAttributeString("family", "应收管理");
xmlTextWriter.WriteAttributeString("timestamp", "");
xmlTextWriter.WriteAttributeString("version", "2.0");
xmlTextWriter.WriteStartElement("oughtreceive");
xmlTextWriter.Indentation = ;
xmlTextWriter.WriteStartElement("header");
xmlTextWriter.Indentation = ;
//以下部分用第三方系统的数据替换,具体实现过程根据实际情况
xmlTextWriter.WriteElementString("vouchtype", "R0");
xmlTextWriter.WriteElementString("code", "");
xmlTextWriter.WriteElementString("relatevouchercode", "");
xmlTextWriter.WriteElementString("date","2019-08-20");
xmlTextWriter.WriteElementString("cust_vendor_code", "");
xmlTextWriter.WriteElementString("deptcode","");
xmlTextWriter.WriteElementString("personcode", "");
xmlTextWriter.WriteElementString("item_classcode", "");
xmlTextWriter.WriteElementString("item_code", "");
xmlTextWriter.WriteElementString("digest", "");
xmlTextWriter.WriteElementString("subjectcode", ""); //科目编码项目本例填空,实际应用是可以根据实际情况选择
xmlTextWriter.WriteElementString("currency_name", "人民币");
xmlTextWriter.WriteElementString("currency_rate", "");
xmlTextWriter.WriteElementString("bdebitcredit", "");
xmlTextWriter.WriteElementString("natamount", "");
xmlTextWriter.WriteElementString("amount", "");
xmlTextWriter.WriteElementString("natbalance", "");
xmlTextWriter.WriteElementString("balancy", "");
xmlTextWriter.WriteElementString("paycondition_code", "");
xmlTextWriter.WriteElementString("operator", "");
xmlTextWriter.WriteElementString("flag", "AR");
xmlTextWriter.WriteElementString("quantity", "");
xmlTextWriter.WriteElementString("leavquantity", "");
xmlTextWriter.WriteElementString("define1", "");
xmlTextWriter.WriteElementString("define2", "");
xmlTextWriter.WriteElementString("define3", "");
xmlTextWriter.WriteElementString("define4", "");
xmlTextWriter.WriteElementString("define5", "");
xmlTextWriter.WriteElementString("define6", "");
xmlTextWriter.WriteElementString("define7", "");
xmlTextWriter.WriteElementString("define8","");
xmlTextWriter.WriteElementString("define9", "");
xmlTextWriter.WriteElementString("define10", "");
xmlTextWriter.WriteElementString("define11", "");
xmlTextWriter.WriteElementString("define12", "");
xmlTextWriter.WriteElementString("define13", "");
xmlTextWriter.WriteElementString("define14", "");
xmlTextWriter.WriteElementString("define15", "");
xmlTextWriter.WriteElementString("define16", "");
xmlTextWriter.WriteElementString("startflag", "");
xmlTextWriter.WriteEndElement();
//本例为了简化以一条明细项的实现举例
for (int i = ; i < ; i++)
{
xmlTextWriter.WriteStartElement("body");
xmlTextWriter.Indentation = ;
xmlTextWriter.WriteStartElement("entry");
xmlTextWriter.Indentation = ;
xmlTextWriter.WriteElementString("headid", "");
xmlTextWriter.WriteElementString("cust_vendor_code","");
xmlTextWriter.WriteElementString("deptcode", "");
xmlTextWriter.WriteElementString("personcode", "");
xmlTextWriter.WriteElementString("item_classcode","");
xmlTextWriter.WriteElementString("item_code", "");
xmlTextWriter.WriteElementString("digest", "");
xmlTextWriter.WriteElementString("subjectcode", "");
xmlTextWriter.WriteElementString("currency_name", "人民币");
xmlTextWriter.WriteElementString("currency_rate", "");
xmlTextWriter.WriteElementString("bdebitcredit", "");
xmlTextWriter.WriteElementString("natamount", "");
xmlTextWriter.WriteElementString("amount", "");
xmlTextWriter.WriteElementString("shouldquantity", "");
xmlTextWriter.WriteElementString("shouldnumber", "");
xmlTextWriter.WriteElementString("quantity","");
xmlTextWriter.WriteElementString("assitantunit", "");
xmlTextWriter.WriteElementString("number", "");
xmlTextWriter.WriteElementString("price", "");
xmlTextWriter.WriteElementString("cost", "");
xmlTextWriter.WriteElementString("plancost", "");
xmlTextWriter.WriteElementString("planprice", "");
xmlTextWriter.WriteElementString("serial", "");
xmlTextWriter.WriteElementString("makedate", "");
xmlTextWriter.WriteElementString("validdate", "");
xmlTextWriter.WriteElementString("transitionid","");
xmlTextWriter.WriteElementString("subbillcode", "");
xmlTextWriter.WriteElementString("subpurchaseid", "");
xmlTextWriter.WriteElementString("position","");
xmlTextWriter.WriteElementString("itemclasscode","");
xmlTextWriter.WriteElementString("itemclassname", "");
xmlTextWriter.WriteElementString("itemcode", "");
xmlTextWriter.WriteElementString("itemname", "");
xmlTextWriter.WriteEndElement();
xmlTextWriter.WriteEndElement();
}
xmlTextWriter.Flush();
xmlTextWriter.Close(); }
public static void ApplicationDataToVoucherXML()
{
XmlTextWriter xmlTextWriter = new XmlTextWriter(XmlModelTemplatePath + "voucher001.xml", Encoding.Default);
xmlTextWriter.Formatting = Formatting.Indented;
xmlTextWriter.WriteStartDocument();
xmlTextWriter.WriteComment("凭证 roottag:类型 billtype:系统用 docid:唯一编号 receiver:接收方 sender:发送方编码 proc:操作码 codeexchanged:编码是否转换 exportneedexch导出时是否要根据对照表替换");
xmlTextWriter.WriteStartElement("ufinterface");
xmlTextWriter.WriteAttributeString("roottag", "voucher");
xmlTextWriter.WriteAttributeString("billtype", "gl");
xmlTextWriter.WriteAttributeString("docid", "");
xmlTextWriter.WriteAttributeString("receiver", "u8");
xmlTextWriter.WriteAttributeString("sender", "");
xmlTextWriter.WriteAttributeString("proc", "add");
xmlTextWriter.WriteAttributeString("codeexchanged", "N");
xmlTextWriter.WriteAttributeString("exportneedexch", "N");
xmlTextWriter.WriteAttributeString("renewproofno", "y");
xmlTextWriter.WriteAttributeString("timestamp", "");
xmlTextWriter.WriteAttributeString("version", "2.0");
xmlTextWriter.WriteStartElement("voucher");
xmlTextWriter.WriteAttributeString("id", "");
xmlTextWriter.Indentation = ;
xmlTextWriter.WriteStartElement("voucher_head");
xmlTextWriter.Indentation = ;
//以下部分用第三方系统的数据替换,具体实现过程根据实际情况
xmlTextWriter.WriteElementString("company", "");
xmlTextWriter.WriteElementString("voucher_type", "记");
xmlTextWriter.WriteElementString("fiscal_year", "");
xmlTextWriter.WriteElementString("accounting_period", "");
xmlTextWriter.WriteElementString("voucher_id", "");
xmlTextWriter.WriteElementString("attachment_number", "");
xmlTextWriter.WriteElementString("date", "2006-10-25");
xmlTextWriter.WriteElementString("enter", "demo");
xmlTextWriter.WriteElementString("cashier", "");
xmlTextWriter.WriteElementString("signature", "");
xmlTextWriter.WriteElementString("checker", "");
xmlTextWriter.WriteElementString("posting_date", "");
xmlTextWriter.WriteElementString("posting_person", "");
xmlTextWriter.WriteElementString("voucher_making_system", "AR");
xmlTextWriter.WriteElementString("memo1", "");
xmlTextWriter.WriteElementString("memo2", "");
xmlTextWriter.WriteElementString("reserve1", "AR");
xmlTextWriter.WriteElementString("reserve2", "");
xmlTextWriter.WriteElementString("revokeflag", "");
xmlTextWriter.WriteEndElement();
//本例为了简化以一条明细项的实现举例
for (int i = ; i < ; i++)
{
xmlTextWriter.WriteStartElement("voucher_body");
xmlTextWriter.Indentation = ;
xmlTextWriter.WriteStartElement("entry");
xmlTextWriter.Indentation = ;
xmlTextWriter.WriteElementString("entry_id", "");
xmlTextWriter.WriteElementString("account_code", "1131 ");
xmlTextWriter.WriteElementString("abstract", "其他应收单");
xmlTextWriter.WriteElementString("settlement", "");
xmlTextWriter.WriteElementString("document_id", "");
xmlTextWriter.WriteElementString("document_date", "");
xmlTextWriter.WriteElementString("currency", "");
xmlTextWriter.WriteElementString("unit_price", "");
xmlTextWriter.WriteElementString("exchange_rate1", "");
xmlTextWriter.WriteElementString("exchange_rate2", "");
xmlTextWriter.WriteElementString("debit_quantity", "");
xmlTextWriter.WriteElementString("primary_debit_amount", "");
xmlTextWriter.WriteElementString("secondary_debit_amount", "");
xmlTextWriter.WriteElementString("natural_debit_currency", "");
xmlTextWriter.WriteElementString("credit_quantity", "");
xmlTextWriter.WriteElementString("primary_credit_amount", "");
xmlTextWriter.WriteElementString("secondary_credit_amount", "");
xmlTextWriter.WriteElementString("natural_credit_currency", "");
xmlTextWriter.WriteElementString("bill_type", "R0");
xmlTextWriter.WriteElementString("bill_id", "");
xmlTextWriter.WriteElementString("bill_date", "2006-10-20");
xmlTextWriter.WriteStartElement("detail");
xmlTextWriter.WriteElementString("cash_flow_statement", "");
xmlTextWriter.WriteElementString("code_remark_statement", "");
xmlTextWriter.WriteEndElement();
xmlTextWriter.WriteEndElement(); xmlTextWriter.WriteElementString("entry_id", "");
xmlTextWriter.WriteElementString("account_code", "5503 ");
xmlTextWriter.WriteElementString("abstract", "其他应收单");
xmlTextWriter.WriteElementString("settlement", "");
xmlTextWriter.WriteElementString("document_id", "");
xmlTextWriter.WriteElementString("document_date", "");
xmlTextWriter.WriteElementString("currency", "");
xmlTextWriter.WriteElementString("unit_price", "");
xmlTextWriter.WriteElementString("exchange_rate1", "");
xmlTextWriter.WriteElementString("exchange_rate2", "");
xmlTextWriter.WriteElementString("debit_quantity", "");
xmlTextWriter.WriteElementString("primary_debit_amount", "");
xmlTextWriter.WriteElementString("secondary_debit_amount", "");
xmlTextWriter.WriteElementString("natural_debit_currency", "");
xmlTextWriter.WriteElementString("credit_quantity", "");
xmlTextWriter.WriteElementString("primary_credit_amount", "");
xmlTextWriter.WriteElementString("secondary_credit_amount", "");
xmlTextWriter.WriteElementString("natural_credit_currency", "");
xmlTextWriter.WriteElementString("bill_type", "R0");
xmlTextWriter.WriteElementString("bill_id", "");
xmlTextWriter.WriteElementString("bill_date", "2006-10-20");
xmlTextWriter.WriteStartElement("detail");
xmlTextWriter.WriteElementString("cash_flow_statement", "");
xmlTextWriter.WriteElementString("code_remark_statement", "");
xmlTextWriter.WriteEndElement();
xmlTextWriter.WriteEndElement(); xmlTextWriter.WriteEndElement(); }
xmlTextWriter.Flush();
xmlTextWriter.Close(); }
}
}   

U8 EAI实现XML的生成的更多相关文章

  1. U811.1接口EAI系列之二--生成销售出库单调用U8的EAI通用处理方法--PowerBuilder语言

    1.销售系统销售出库,更新U811.1材料库存的EAI的XML生成. 2.主要根据U8配置会生成出库单和同时是否更新库存量,还是更新现存量等等. 3.具体参考代码如下: 作者:王春天 2013-11- ...

  2. WebAPI使用多个xml文件生成帮助文档

    一.前言 上篇有提到在WebAPI项目内,通过在Nuget里安装(Microsoft.AspNet.WebApi.HelpPage)可以根据注释生成帮助文档,查看代码实现会发现是基于解析项目生成的xm ...

  3. 在Salesforce中处理Xml的生成与解析

    在Salesforce中处理Xml的生成与解析 1): Generate Xml private String ConvertAccountToXmlInfo(Account acc){ Dom.Do ...

  4. WebAPI使用多个xml文件生成帮助文档(转)

    http://www.cnblogs.com/idoudou/p/xmldocumentation-for-web-api-include-documentation-from-beyond-the- ...

  5. json、xml ---- 数据格式生成类

    自己写的一个生成json/xml 格式数据的类,可用于api数据传输: <?php class Response{ /** *生成指定数据格式 *@param intval $code 状态码 ...

  6. 利用Vistual Studio自带的xsd.exe工具,根据XML自动生成XSD

    利用Vistual Studio自带的xsd.exe工具,根据XML自动生成XSD 1, 命令提示符-->找到vs自带的xsd.exe工具所在的文件夹 例如: C:\Program Files ...

  7. XML文件生成C++代码(基于rapidxml)

    简述 与XML文件生成C++代码(基于pugixml)中的功能一致,只是这里改用的rapidxml来实现.就不多说了,直接放代码. 代码 #include "rapidxml-1.13/ra ...

  8. XML文件生成C++代码(基于pugixml)

    简述 在一个项目中需要用到XML的解析和生成,知乎上有人推荐rapidxml和pugixml等库.RapidXML一看库还比较大,就先研究一下pugixml了. 因为对解析XML的需求不大(都是一些很 ...

  9. 在页面和请求中分别使用XML Publisher生成PDF报表且自动上传至附件服务器

    两个技术要点: 1.使用TemplateHelper.processTemplate方法生成目标PDF的InputStream流,再使用ftp中上传流的方法将其上传至附件服务器. 2.在请求中调用AM ...

随机推荐

  1. MaxCompute 图计算用户手册(下)

    示例程序 强连通分量 在有向图中,如果从任意一个顶点出发,都能通过图中的边到达图中的每一个顶点,则称之为强连通图.一张有向图的顶点数极大的强连通子图称为强连通分量.此算法示例基于 parallel C ...

  2. HLSL像素着色器

    原文:HLSL像素着色器 昨日不可追, 今日尤可为.勤奋,炽诚,不忘初心 手机淘宝二维码 扫描       或者打开连接:程序设计开发 ,掌声鼓励,欢迎光临.     像素着色器替代了固定渲染管线的  ...

  3. 2018-9-19-Roslyn-通过-Nuget-管理公司配置

    title author date CreateTime categories Roslyn 通过 Nuget 管理公司配置 lindexi 2018-9-19 10:57:5 +0800 2018- ...

  4. HDU-1257_最少拦截系统

    最少拦截系统 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Problem Desc ...

  5. NOIP2007 树网的核 && [BZOJ2282][Sdoi2011]消防

    NOIP2007 树网的核 树的直径的最长性是一个很有用的概念,可能对一些题都帮助. 树的直径给定一棵树,树中每条边都有一个权值,树中两点之间的距离定义为连接两点的路径边权之和.树中最远的两个节点之间 ...

  6. @bzoj - 4381@ [POI2015] Odwiedziny

    目录 @description@ @solution@ @accepted code@ @details@ @description@ 给定一棵 n 个点的树,树上每条边的长度都为 1 ,第 i 个点 ...

  7. @codechef - BIKE@ Chef and Bike

    目录 @description@ @solution@ @accepted code@ @details@ @description@ 输入 n(n ≤ 22) 个点,m(m ≤ 8000) 个边.每 ...

  8. 学习layer弹层组件移动版

    layer弹层组件官网 常用参数: shadeClose:默认true,是否点击遮罩时关闭层

  9. Android ListView批量选择(全选、反选、全不选)

    APP的开发中,会常遇到这样的需求:批量取消(删除)List中的数据.这就要求ListVIew支持批量选择.全选.单选等等功能,做一个比较强大的ListView批量选择功能是很有必要的,那如何做呢? ...

  10. 原生js实现多个随机大小颜色位置速度小球的碰壁反弹

    文章地址 https://www.cnblogs.com/sandraryan/ 需求:生成n个小球,让他们在一个大盒子中碰壁反弹,要求小球随机颜色,大小,初始位置,运动速度. 思路分析: 创建小球随 ...