Forráskód Böngészése

添加项目文件。

wup 1 éve%!(EXTRA string=óta)
szülő
commit
c928cd1026

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 16 - 0
BillofPayment.cs


+ 17 - 0
Config/appsettings.json

@@ -0,0 +1,17 @@
+{
+  "Logging": {
+    "LogLevel": {
+      "Default": "Information",
+      "Microsoft": "Warning",
+      "Microsoft.Hosting.Lifetime": "Information"
+    }
+  },
+  "AllowedHosts": "*",
+  "Version": "1.0.0",
+  "X-KDApi-AcctID": "61c9778c87d3d1",
+  "X-KDApi-UserName": "demo",
+  "X-KDApi-AppID": "246112_QZ1J3YvHVuA8WY8Jw7xBQw8EUJRYWLnu",
+  "X-KDApi-AppSec": "117cc3e66dad4623afd5482f6615ba69",
+  "X-KDApi-LCID": "2052",
+  "X-KDApi-ServerUrl": "http://121.37.217.34/k3cloud/"
+}

+ 36 - 0
Kingdee.CDP.WebApi.SDK.Test.csproj

@@ -0,0 +1,36 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>netcoreapp3.1</TargetFramework>
+    <RootNamespace>Kingdee.CDP.WebApi.SDK.Test_.netcore3._1_</RootNamespace>
+
+    <IsPackable>false</IsPackable>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
+    <PackageReference Include="MSTest.TestAdapter" Version="2.2.3" />
+    <PackageReference Include="MSTest.TestFramework" Version="2.2.3" />
+    <PackageReference Include="coverlet.collector" Version="3.0.2" />
+    <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <Reference Include="Kingdee.CDP.WebApi.SDK">
+      <HintPath>resources\Kingdee.CDP.WebApi.SDK.dll</HintPath>
+    </Reference>
+  </ItemGroup>
+
+  <ItemGroup>
+    <None Update="Config\appsettings.json">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="resources\Kingdee.CDP.WebApi.SDK.dll">
+      <CopyToOutputDirectory>Never</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+
+</Project>

+ 31 - 0
Kingdee.CDP.WebApi.SDK.Test.sln

@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.32630.194
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "kingdeeApi", "..\kingdeeApi\kingdeeApi.csproj", "{F5C1DE47-01D1-4232-809F-396538CF78AD}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LiChenkingdee", "LiChenkingdee\LiChenkingdee.csproj", "{F7041CAC-5572-42F4-A468-3511254EFB92}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{F5C1DE47-01D1-4232-809F-396538CF78AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{F5C1DE47-01D1-4232-809F-396538CF78AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{F5C1DE47-01D1-4232-809F-396538CF78AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{F5C1DE47-01D1-4232-809F-396538CF78AD}.Release|Any CPU.Build.0 = Release|Any CPU
+		{F7041CAC-5572-42F4-A468-3511254EFB92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{F7041CAC-5572-42F4-A468-3511254EFB92}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{F7041CAC-5572-42F4-A468-3511254EFB92}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{F7041CAC-5572-42F4-A468-3511254EFB92}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {81330B43-2B7C-4799-85CC-4AAA471CF54A}
+	EndGlobalSection
+EndGlobal

+ 6 - 0
LiChenkingdee/App.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
+    </startup>
+</configuration>

+ 143 - 0
LiChenkingdee/Controllers/HttpHepler.cs

@@ -0,0 +1,143 @@
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ConsoleApp1.Controller.Sql_controller
+{
+    /// <summary>
+    /// Post方式提交数据,返回网页的源代码
+    /// </summary>
+    /// <param name="url">发送请求的 URL</param>
+    /// <param name="param">请求的参数集合</param>
+    /// <returns>远程资源的响应结果</returns>
+    public class HttpHepler
+    {
+        /// <summary>
+        /// Post方式提交数据,返回网页的源代码
+        /// </summary>
+        /// <param name="url">发送请求的 URL</param>
+        /// <param name="param">请求的参数集合</param>
+        /// <returns>远程资源的响应结果</returns>
+        public string sendPost(string url, Dictionary<string, Object> param)
+        {
+            string result = "";
+            StringBuilder postData = new StringBuilder();
+            if (param != null && param.Count > 0)
+            {
+                foreach (var p in param)
+                {
+                    if (postData.Length > 0)
+                    {
+                        postData.Append("&");
+                    }
+                    postData.Append(p.Key);
+                    postData.Append("=");
+                    postData.Append(p.Value);
+                }
+            }
+            byte[] byteData = Encoding.GetEncoding("UTF-8").GetBytes(postData.ToString());
+            try
+            {
+
+                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
+                request.ContentType = "application/x-www-form-urlencoded";
+                request.Referer = url;
+                request.Accept = "*/*";
+                request.Timeout = 30 * 1000;
+                request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)";
+                request.Method = "POST";
+                request.ContentLength = byteData.Length;
+                Stream stream = request.GetRequestStream();
+                stream.Write(byteData, 0, byteData.Length);
+                stream.Flush();
+                stream.Close();
+                HttpWebResponse response = (HttpWebResponse)request.GetResponse();
+                Stream backStream = response.GetResponseStream();
+                StreamReader sr = new StreamReader(backStream, Encoding.GetEncoding("UTF-8"));
+                result = sr.ReadToEnd();
+                sr.Close();
+                backStream.Close();
+                response.Close();
+                request.Abort();
+            }
+            catch (Exception ex)
+            {
+                result = ex.Message;
+            }
+            return result;
+        }
+
+        /// <summary>
+        /// Post方法提交数据
+        /// </summary>
+        /// <param name="url">发送请求的 URL</param>
+        /// <param name="postDataStr">Json参数</param>
+        /// <returns></returns>
+        public string HttpPost(string url, string postDataStr)
+        {
+            Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
+            byte[] arrB = encode.GetBytes(postDataStr);
+            HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(url);
+            myReq.Method = "POST";
+            myReq.ContentType = "application/json";
+            myReq.ContentLength = arrB.Length;
+            Stream outStream = myReq.GetRequestStream();
+            outStream.Write(arrB, 0, arrB.Length);
+            outStream.Close();
+            //接收HTTP做出的响应
+            WebResponse myResp = myReq.GetResponse();
+            Stream ReceiveStream = myResp.GetResponseStream();
+            StreamReader readStream = new StreamReader(ReceiveStream, encode);
+            Char[] read = new Char[256];
+            int count = readStream.Read(read, 0, 256);
+            string str = null;
+            while (count > 0)
+            {
+                str += new String(read, 0, count);
+                count = readStream.Read(read, 0, 256);
+            }
+            readStream.Close();
+            myResp.Close();
+
+            return str;
+        }
+
+
+        /// <summary>
+        /// Get方式提交数据
+        /// </summary>
+        /// <param name="methodname"></param>
+        /// <returns></returns>
+        public object retObject(string methodname)
+        {
+            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(methodname);
+            request.Method = "GET";
+            request.ContentType = "text/html;charset=UTF-8";
+            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
+            Stream myResponseStream = response.GetResponseStream();
+            StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.UTF8);
+            string retString = myStreamReader.ReadToEnd();
+
+            var retObject = (JObject)JsonConvert.DeserializeObject(retString);
+            return retObject;
+        }
+
+        /// <summary>
+        /// Json解析
+        /// </summary>
+        /// <param name="result"></param>
+        /// <returns></returns>
+        public string[] jsons(string result)
+        {
+            JObject jo = JObject.Parse(result);
+            string[] values1 = jo.Properties().Select(item => item.Value.ToString()).ToArray();
+            return values1;
+        }
+    }
+}

+ 447 - 0
LiChenkingdee/Controllers/kingdeeToList.cs

@@ -0,0 +1,447 @@
+using ConsoleApp1.Controller.Sql_controller;
+using Kingdee.BOS.WebApi.Client;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.IO;
+
+namespace LiChenkingdee.Controllers
+{
+    /// <summary>
+    /// 获取金蝶数据
+    /// </summary>
+    public class kingdeeToList
+    {
+        HttpHepler http = new HttpHepler();
+        public void kindeeDL()
+        {
+            K3CloudApiClient client = new K3CloudApiClient("http://121.37.217.34/k3cloud/");        //http://121.37.217.34/k3cloud/
+            var loginResult = client.ValidateLogin("612cade2b0fead", "administrator", "lichen17LC+", 2052);   //正式
+            //var loginResult = client.ValidateLogin("61c9778c87d3d1", "administrator", "Lichen*2021", 2052);     //测试
+            var resultType = JObject.Parse(loginResult)["LoginResultType"].Value<int>();
+            //登录结果类型等于1,代表登录成功
+            if (resultType == 1)
+            {
+                //client.ExecuteBillQuery("{"FormId":"","FieldKeys":"","FilterString":"","OrderString":"","TopRowCount":0,"StartRow":0,"Limit":0}");
+                //PostKingdeeYG(client, DateTime.Now);          //员工
+                //PostKingdeeQT(client, DateTime.Now);          //其他往来单位
+                PostKingdeeKH(client, DateTime.Now);          //客户单位
+                //PostKingdeeGYS(client, DateTime.Now);           //供应商
+                //PostKingdeeFK(client, DateTime.Now);          //付款
+                //PostKingdeeYF(client, DateTime.Now);          //应付
+            }
+        }
+       
+        /// <summary>
+        /// 获取付款单
+        /// </summary>
+        public void PostKingdeeFK(K3CloudApiClient client,DateTime date)
+        {
+            string SJ = date.AddDays(-1).ToString("yyyy-MM-dd");
+           var FKList = client.ExecuteBillQuery("{"+
+                "\"FormId\": \"CN_PAYAPPLY\","+
+                "\"FieldKeys\": \"FBillNo \","+
+                "\"FilterString\": \"FCREATEDATE >'" + SJ + "' and FDOCUMENTSTATUS = 'B'\"," +
+                "\"OrderString\": \"\","+
+                "\"TopRowCount\": 0,"+
+                "\"StartRow\": 0,"+
+                "\"Limit\": 0}");
+            foreach (var item in FKList)
+            {
+                string FBillNo = item[0].ToString();
+                PostFKList(client, FBillNo);
+            }
+        }
+
+        /// <summary>
+        /// 应付单
+        /// </summary>
+        /// <param name="client"></param>
+        /// <param name="date"></param>
+        public void PostKingdeeYF(K3CloudApiClient client, DateTime date)
+        {
+            string SJ = date.AddDays(-1).ToString("yyyy-MM-dd");
+            var FKList = client.ExecuteBillQuery("{" +
+                 "\"FormId\": \"AP_Payable\"," +
+                 "\"FieldKeys\": \"FBillNo \"," +
+                 "\"FilterString\": \"FCREATEDATE >'" + SJ + "'\"," +
+                 "\"OrderString\": \"\"," +
+                 "\"TopRowCount\": 0," +
+                 "\"StartRow\": 0," +
+                 "\"Limit\": 0}");
+            foreach (var items in FKList)
+            {
+                string FBillNo = items[0].ToString();
+                PostYFList(client, FBillNo);
+            }
+        }
+
+        /// <summary>
+        /// 付款申请单明细
+        /// </summary>
+        /// <returns></returns>
+        public void PostFKList(K3CloudApiClient client,string FBillNo)
+        {
+            int i = 0;
+            string url = "http://39.98.219.9:9001/api/lichen/form/fksq";
+            Dictionary<string, List<Dictionary<string, string>>> dicFBillHead = new Dictionary<string, List<Dictionary<string, string>>>(); //头
+            Dictionary<string, List<Dictionary<string, string>>> FkFBillBody = new Dictionary<string, List<Dictionary<string, string>>>();//体
+            //string Contentjsonhead = "";
+            string Contentjsonbody = "";
+            List<Dictionary<string, string>> ListTable = new List<Dictionary<string, string>>();
+            string ArrList = client.View("CN_PAYAPPLY", "{\"CreateOrgId\":0,\"Number\":\""+ FBillNo + "\",\"Id\":\"\"}");
+            //string ArrList = client.View("CN_PAYAPPLY", "{\"CreateOrgId\":0,\"Number\":\"FKSQ000061\",\"Id\":\"\"}");
+            JObject array = JsonConvert.DeserializeObject<JObject>(ArrList);
+            foreach (var itemList in array["Result"])
+            {
+                if (i == 0)
+                {
+                    i++;
+                    continue;
+                }
+                switch (itemList.Parent["Result"]["FCONTACTUNITTYPE"].ToString())
+                {
+                    case "BD_Supplier":
+                        Contentjsonbody = "供应商";
+                        break;
+                    case "BD_Customer":
+                        Contentjsonbody = "客户";
+                        break;
+                    case "BD_Empinfo":
+                        Contentjsonbody = "员工";
+                        break;
+                    case "FIN_OTHERS":
+                        Contentjsonbody = "其他往来单位";
+                        break;
+                }
+                Dictionary<string, string> dicFkFBillHead = new Dictionary<string, string>();//单据头
+                dicFkFBillHead.Add("FBillNo", itemList.Parent["Result"]["FBILLNo"].ToString());        //单据编号
+                dicFkFBillHead.Add("FCREATORID", itemList.Parent["Result"]["FCREATORID"]["Id"].ToString());      //创建人ID
+                dicFkFBillHead.Add("FCREATORNAME", itemList.Parent["Result"]["FCREATORID"]["Name"].ToString());   //创建人
+                dicFkFBillHead.Add("FSETTLEORGID", itemList.Parent["Result"]["FSETTLEORGID_Id"].ToString());    //FSETTLEORGID  结算组织
+                dicFkFBillHead.Add("FPURCHASEORGID", itemList.Parent["Result"]["FPURCHASEORGID_Id"].ToString());    //FPURCHASEORGID  采购组织
+                dicFkFBillHead.Add("FDATE",GetChinaTicks(Convert.ToDateTime(itemList.Parent["Result"]["FDATE"].ToString())));    //FDATE 申请日期
+                dicFkFBillHead.Add("FBILLTYPEID", itemList.Parent["Result"]["FBILLTYPEID"]["MultiLanguageText"][0]["Name"].ToString());    //单据类型:FBILLTYPEID
+                dicFkFBillHead.Add("FCONTACTUNITTYPE", Contentjsonbody);    //往来单位类型:FCONTACTUNITTYPE
+                dicFkFBillHead.Add("FCONTACTUNIT_Id", itemList.Parent["Result"]["FCONTACTUNIT_Id"].ToString());      //往来单位编码
+                dicFkFBillHead.Add("FCONTACTUNIT", itemList.Parent["Result"]["FCONTACTUNIT"]["MultiLanguageText"][0]["Name"].ToString());    //往来单位:FCONTACTUNIT
+                //dicFkFBillHead.Add("FBUSINESSTYPE",itemList.Parent["FBUSINESSTYPE"])    //业务类型:FBUSINESSTYPE
+                dicFkFBillHead.Add("FPAYORGID", itemList.Parent["Result"]["FPAYORGID"]["MultiLanguageText"][0]["Name"].ToString());    //付款组织:FPAYORGID
+                dicFkFBillHead.Add("F_BQB_Combo", itemList.Parent["Result"]["F_BQB_Combo"].ToString());    //付款类型:F_BQB_Combo
+                dicFkFBillHead.Add("F_BQB_FKDQ", itemList.Parent["Result"]["F_BQB_FKDQ"].ToString());    //付款地区:F_BQB_FKDQ
+                dicFkFBillHead.Add("FEXPENSEDEPTID", string.IsNullOrEmpty(itemList.Parent["Result"]["FPAYAPPLYENTRY"][0]["FEXPENSEDEPTID"].ToString()) ? "无数据": itemList.Parent["Result"]["FPAYAPPLYENTRY"][0]["FEXPENSEDEPTID"]["MultiLanguageText"][0]["Name"].ToString());   //费用承担部门
+                dicFkFBillHead.Add("FAPPLYORGID", itemList.Parent["Result"]["FAPPLYORGID"]["MultiLanguageText"][0]["Name"].ToString());    //申请组织
+                dicFkFBillHead.Add("FRECTUNIT", itemList.Parent["Result"]["FRECTUNIT"]["MultiLanguageText"][0]["Name"].ToString());    //收款单位
+                dicFkFBillHead.Add("F_BQB_FKGS", itemList.Parent["Result"]["F_BQB_FKGS"]["MultiLanguageText"][0]["FDataValue"].ToString());    //付款公司
+                //Contentjsonhead = JsonConvert.SerializeObject(dicFkFBillHead);
+                //单据体
+                ///单据体数据
+                
+                List<Dictionary<string, string>> ListListBody = new List<Dictionary<string, string>>();
+                foreach (var itemsData in array["Result"]["Result"]["FPAYAPPLYENTRY"])
+                {
+                    string FDescription = string.IsNullOrEmpty(itemsData.Parent[0]["Description"].ToString()) ? "无数据" : itemsData.Parent[0]["Description"].ToString().Replace("\\", "");
+                    Dictionary<string, string> dicFkFPAYAPPLYENTRY = new Dictionary<string, string>();
+                    dicFkFPAYAPPLYENTRY.Add("FSETTLETYPEID", itemsData.Parent[0]["FSETTLETYPEID"]["MultiLanguageText"][0]["Name"].ToString());     //结算方式:FSETTLETYPEID //
+                    dicFkFPAYAPPLYENTRY.Add("FEACHBANKACCOUNT", itemsData.Parent[0]["FEACHBANKACCOUNT"].ToString());    //对方银行账号:FEACHBANKACCOUNT 
+                    dicFkFPAYAPPLYENTRY.Add("FAPPLYAMOUNTFOR", itemsData.Parent[0]["FAPPLYAMOUNTFOR"].ToString());    //申请付款金额:FAPPLYAMOUNTFOR 
+                    dicFkFPAYAPPLYENTRY.Add("FENDDATE", GetChinaTicks(Convert.ToDateTime(itemsData.Parent[0]["FENDDATE"].ToString())));    //到期日:FENDDATE 
+                    dicFkFPAYAPPLYENTRY.Add("FEXPECTPAYDATE", GetChinaTicks(Convert.ToDateTime(itemsData.Parent[0]["FEXPECTPAYDATE"].ToString())));    //期望付款日期:FEXPECTPAYDATE 
+                    dicFkFPAYAPPLYENTRY.Add("FEACHCCOUNTNAME",string.IsNullOrEmpty(itemsData.Parent[0]["MultiLanguageText"][0].ToString())?"无数据": itemsData.Parent[0]["MultiLanguageText"][0]["FEACHCCOUNTNAME"].ToString());    //对方账户名称:FEACHCCOUNTNAME 
+                    dicFkFPAYAPPLYENTRY.Add("FEACHBANKNAME", itemsData.Parent[0]["MultiLanguageText"][0]["FEACHBANKNAME"].ToString());    //对方开户行:FEACHBANKNAME 
+                    dicFkFPAYAPPLYENTRY.Add("FCOSTID_id", itemsData.Parent[0]["FCOSTID_Id"].ToString());    //费用项目ID:FCOSTID_id
+                    dicFkFPAYAPPLYENTRY.Add("FCOSTID", string.IsNullOrEmpty(itemsData.Parent[0]["FCOSTID"].ToString())?"无数据": itemsData.Parent[0]["FCOSTID"]["MultiLanguageText"][0]["Name"].ToString());    //费用项目:FCOSTID 
+                    dicFkFPAYAPPLYENTRY.Add("FDescription", FDescription);         //备注
+
+                    //备注:FDescription 
+                    ListListBody.Add(dicFkFPAYAPPLYENTRY);
+                }
+                dicFkFBillHead.Add("DataTable", JsonConvert.SerializeObject(ListListBody));
+                ListTable.Add(dicFkFBillHead);
+            }
+            Dictionary<string, List<Dictionary<string, string>>> Mapdata = new Dictionary<string, List<Dictionary<string, string>>>();
+            Mapdata.Add("data", ListTable);
+            string acts = http.HttpPost(url, JsonConvert.SerializeObject(Mapdata));
+        }
+
+        #region 应付单
+        public void PostYFList(K3CloudApiClient client, string FBillNo)
+        {
+            int i = 0;
+            string url = "http://39.98.219.9:9001/api/lichen/form/yfd";
+            //string url = "http://192.168.1.148:9001/api/lichen/form/yfd";
+            Dictionary<string, List<Dictionary<string, string>>> dicFBillHead = new Dictionary<string, List<Dictionary<string, string>>>(); //头
+            Dictionary<string, List<Dictionary<string, string>>> FkFBillBody = new Dictionary<string, List<Dictionary<string, string>>>();//体
+            //string Contentjsonbody = "";
+            List<Dictionary<string, string>> ListTable = new List<Dictionary<string, string>>();
+            string ArrList = client.View("AP_Payable", "{\"CreateOrgId\":0,\"Number\":\"" + FBillNo + "\",\"Id\":\"\"}");//AP00014611
+            //string ArrList = client.View("AP_Payable", "{\"CreateOrgId\":0,\"Number\":\"AP00014611\",\"Id\":\"\"}");
+            JObject array = JsonConvert.DeserializeObject<JObject>(ArrList);
+            foreach (var itemList in array["Result"])
+            {
+                if (i == 0)
+                {
+                    i++;
+                    continue;
+                }
+                string SUPPLIERID = string.IsNullOrEmpty(itemList.Parent["Result"]["SUPPLIERID"]["MultiLanguageText"][0]["Name"].ToString()) ? "无数据" : itemList.Parent["Result"]["SUPPLIERID"]["MultiLanguageText"][0]["Name"].ToString();
+                string PayCurrency = string.IsNullOrEmpty(itemList.Parent["Result"]["CURRENCYID"]["MultiLanguageText"][0]["Name"].ToString()) ? "人民币" : itemList.Parent["Result"]["CURRENCYID"]["MultiLanguageText"][0]["Name"].ToString();
+                string PayCondition = string.IsNullOrEmpty(itemList.Parent["Result"]["SUPPLIERID"]["SupplierFinance"][0]["PayCondition"]["MultiLanguageText"][0]["Name"].ToString()) ? "预付" : itemList.Parent["Result"]["SUPPLIERID"]["SupplierFinance"][0]["PayCondition"]["MultiLanguageText"][0]["Name"].ToString();
+                Dictionary<string, string> dicFkFBillHead = new Dictionary<string, string>();//单据头
+                dicFkFBillHead.Add("textField_ljqs84wy", itemList.Parent["Result"]["BillNo"].ToString());        //单据编号
+                dicFkFBillHead.Add("selectField_ljqs84ww", itemList.Parent["Result"]["BillTypeID"]["MultiLanguageText"][0]["Name"].ToString());      //单据类型
+                dicFkFBillHead.Add("selectField_ljqs84wz", SUPPLIERID);   //供应商
+                dicFkFBillHead.Add("textareaField_ljqs84xc", itemList.Parent["Result"]["REMARK"].ToString());    // 备注
+                dicFkFBillHead.Add("selectField_ljqs84x4", PayCurrency);    //币别
+                dicFkFBillHead.Add("selectField_ljqs84xe", PayCondition);    //付款条件
+                dicFkFBillHead.Add("dateField_ljqs84xd", GetChinaTicks(Convert.ToDateTime(itemList.Parent["Result"]["DATE"].ToString())).ToString());    //业务日期
+                dicFkFBillHead.Add("selectField_ljqs84x5", itemList.Parent["Result"]["SETTLEORGID"]["MultiLanguageText"][0]["Name"].ToString());    //结算组织
+                dicFkFBillHead.Add("selectField_ljqs84x6", itemList.Parent["Result"]["FPAYORGID"]["MultiLanguageText"][0]["Name"].ToString());      //付款组织
+                dicFkFBillHead.Add("dateField_ljqs84xf", GetChinaTicks(Convert.ToDateTime(itemList.Parent["Result"]["FENDDATE_H"].ToString())).ToString());    //到期日
+                dicFkFBillHead.Add("selectField_ljqs84x7", itemList.Parent["Result"]["PURCHASEORGID"]["MultiLanguageText"][0]["Name"].ToString());   //采购组织
+                dicFkFBillHead.Add("numberField_ljzdjury", itemList.Parent["Result"]["FALLAMOUNTFOR"].ToString()); //价税合计
+                //dicFkFBillHead.Add("selectField_ljzbvqin", itemList.Parent["Result"]["FALLAMOUNTFOR"].ToString()); //价税合计
+                ///单据体数据
+                List<Dictionary<string, string>> ListListBody = new List<Dictionary<string, string>>();
+                foreach (var itemsData in array["Result"]["Result"]["AP_PAYABLEENTRY"])
+                {
+                    string F_BQB_Base = string.IsNullOrEmpty(itemsData["F_BQB_Base"].ToString()) ? "" : itemsData["F_BQB_Base"]["MultiLanguageText"][0]["Name"].ToString();
+                    string MATERIALID_Id = string.IsNullOrEmpty(itemsData["MATERIALID"].ToString())?" ": itemsData["MATERIALID"]["Number"].ToString();
+                    string MATERIALID = string.IsNullOrEmpty(itemsData["MATERIALID"].ToString())?" ": itemsData["MATERIALID"]["MultiLanguageText"][0]["Name"].ToString();
+                    string FPRICEUNITID = string.IsNullOrEmpty(itemsData["PRICEUNITID"].ToString())?"": itemsData["PRICEUNITID"]["MultiLanguageText"][0]["Name"].ToString();
+                    string FPrice = string.IsNullOrEmpty(itemsData["FPrice"].ToString())?"0": itemsData["FPrice"].ToString();
+                    string PriceQty = string.IsNullOrEmpty(itemsData["PriceQty"].ToString()) ? "0" : itemsData["PriceQty"].ToString();
+                    string TaxPrice = string.IsNullOrEmpty(itemsData["TaxPrice"].ToString())?"0": itemsData["TaxPrice"].ToString();
+                    string EntryTaxRate = string.IsNullOrEmpty(itemsData["EntryTaxRate"].ToString()) ? "0" : itemsData["EntryTaxRate"].ToString();
+                    string EntryDiscountRate = string.IsNullOrEmpty(itemsData["EntryDiscountRate"].ToString()) ? "0" : itemsData["EntryDiscountRate"].ToString();
+                    string FDISCOUNTAMOUNTFOR = string.IsNullOrEmpty(itemsData["FDISCOUNTAMOUNTFOR"].ToString()) ? "0" : itemsData["FDISCOUNTAMOUNTFOR"].ToString();
+                    string FALLAMOUNTFOR_D = string.IsNullOrEmpty(itemsData["FALLAMOUNTFOR_D"].ToString()) ? "0" : itemsData["FALLAMOUNTFOR_D"].ToString();
+                    string FTAXAMOUNTFOR_D = string.IsNullOrEmpty(itemsData["FTAXAMOUNTFOR_D"].ToString()) ? "0" : itemsData["FTAXAMOUNTFOR_D"].ToString();
+                    string FNoTaxAmountFor_D = string.IsNullOrEmpty(itemsData["FNoTaxAmountFor_D"].ToString()) ? "0" : itemsData["FNoTaxAmountFor_D"].ToString();
+                    string FCOSTID = string.IsNullOrEmpty(itemsData["FCOSTID"].ToString()) ? "" : itemsData["FCOSTID"]["MultiLanguageText"][0]["Name"].ToString();
+                    string Number = string.IsNullOrEmpty(itemsData["FCOSTID"].ToString()) ? "" : itemsData["FCOSTID"]["Number"].ToString();
+                    string FCOSTDEPARTMENTID = string.IsNullOrEmpty(itemsData["FCOSTDEPARTMENTID"].ToString()) ? "" : itemsData["FCOSTDEPARTMENTID"]["MultiLanguageText"][0]["Name"].ToString();
+                    Dictionary<string, string> dicFkFPAYAPPLYENTRY = new Dictionary<string, string>();
+                    dicFkFPAYAPPLYENTRY.Add("selectField_ljz5shhv", FCOSTID);     //费用项目名称
+                    dicFkFPAYAPPLYENTRY.Add("textField_ljz5shhw", Number);     //费用项目编码
+                    dicFkFPAYAPPLYENTRY.Add("selectField_ljqs84xh", F_BQB_Base);     //客户
+                    dicFkFPAYAPPLYENTRY.Add("selectField_ljqs84xi", MATERIALID_Id);    //物料编码
+                    dicFkFPAYAPPLYENTRY.Add("textField_ljqs84xl", MATERIALID);    //物料名称 
+                    dicFkFPAYAPPLYENTRY.Add("textField_ljqs84xm", FPRICEUNITID);    //计价单位
+                    dicFkFPAYAPPLYENTRY.Add("numberField_ljqs84xn", FPrice);    //单价 
+                    dicFkFPAYAPPLYENTRY.Add("numberField_ljqs84xo", PriceQty);    //计价数量
+                    dicFkFPAYAPPLYENTRY.Add("numberField_ljqs84xp", TaxPrice);    //含税单价
+                    dicFkFPAYAPPLYENTRY.Add("numberField_ljqs84xq", EntryTaxRate);    //税率
+                    dicFkFPAYAPPLYENTRY.Add("numberField_ljqs84xs", EntryDiscountRate);    //折扣率 
+                    dicFkFPAYAPPLYENTRY.Add("numberField_ljqs84xt", FDISCOUNTAMOUNTFOR);         //折扣额
+                    dicFkFPAYAPPLYENTRY.Add("numberField_ljqs84xu", FNoTaxAmountFor_D);         //不含税金额
+                    dicFkFPAYAPPLYENTRY.Add("numberField_ljqs84xv", FTAXAMOUNTFOR_D);         //税额
+                    dicFkFPAYAPPLYENTRY.Add("numberField_ljqs84xw", FALLAMOUNTFOR_D);         //价税合计
+                    dicFkFPAYAPPLYENTRY.Add("textField_ljzbvqik", FCOSTDEPARTMENTID);         //费用承担部门
+                    ListListBody.Add(dicFkFPAYAPPLYENTRY);
+                }
+                dicFkFBillHead.Add("tableField_ljqs84xg", JsonConvert.SerializeObject(ListListBody));
+                ListTable.Add(dicFkFBillHead);
+            }
+            Dictionary<string, List<Dictionary<string, string>>> Mapdata = new Dictionary<string, List<Dictionary<string, string>>>();
+            Mapdata.Add("data", ListTable);
+            string acts = http.HttpPost(url, JsonConvert.SerializeObject(Mapdata));
+        }
+        #endregion
+
+        /// <summary>
+        /// 时间转换 毫秒级别的时间戳
+        /// </summary>
+        /// <param name="dateTime"></param>
+        /// <returns></returns>
+        public static string GetChinaTicks(DateTime dateTime)
+        {
+            //北京时间相差8小时
+            DateTime startTime = TimeZoneInfo.ConvertTime(new DateTime(1970, 1, 1, 8, 0, 0, 0), TimeZoneInfo.Local);
+            long t = (dateTime.Ticks - startTime.Ticks) / 10000;   //除10000调整为13位
+            return t.ToString();
+        }
+
+        #region 往来单位同步
+        /// <summary>
+        /// 获取金蝶客户往来单位
+        /// </summary>
+        public void PostKingdeeKH(K3CloudApiClient client, DateTime date)
+        {
+            try
+            {
+                DataTable dt = new DataTable();
+                dt.Columns.Add("Type", Type.GetType("System.String"));
+                dt.Columns.Add("FNumber", Type.GetType("System.String"));
+                 dt.Columns.Add("FName", Type.GetType("System.String"));
+                DataRow newRow;
+                DataTable dt2 = new DataTable(); 
+                
+                string daTime = date.AddDays(-1).ToString("yyyy-MM-ddThh:mm:ss");//FCreateDate >= '" + daTime + "'
+                ///往来单位         FCreateDate >= '" + daTime + "',
+                string url = "http://39.98.219.9:9001/api/lichen/form/wldx";
+                //string url = "https://mc.cloudpure.cn/frp/lichen/form/wldx";
+                //client.ExecuteBillQuerySync({\"FormId\": \"BD_Customer\",\"FieldKeys\": \"FNumber,FName\",\"FilterString\":\"FDOCUMENTSTATUS = 'C'\",\"OrderString\": \"\",\"TopRowCount\": 0,\"StartRow\": 0,\"Limit\": 0}");
+                var dtlits = client.ExecuteBillQuery("{\"FormId\": \"BD_Customer\",\"FieldKeys\": \"FNumber,FName\",\"FilterString\":\"FDOCUMENTSTATUS = 'C'\",\"OrderString\": \"\",\"TopRowCount\": 0,\"StartRow\": 0,\"Limit\": 0}");
+                List<Dictionary<string, string>> MapDic = new List<Dictionary<string, string>>();
+                foreach (var item in dtlits) 
+                {
+                  if (item.Count > 1)
+                  {
+                        newRow = dt.NewRow();
+                        newRow["Type"] = "客户";
+                        newRow["FNumber"] = item[0].ToString();
+                        newRow["FName"] = item[1].ToString();
+                        dt.Rows.Add(newRow);
+                        DataView dv = new DataView(dt);
+                        dt2 = dv.ToTable(true,new string[]{"Type","FNumber","FName"});
+                    }
+                }
+                foreach (DataRow item in dt2.Rows)
+                {
+                    Dictionary<string, string> dic = new Dictionary<string, string>();
+                    dic.Add("Type", "客户");
+                    dic.Add("FNumber", item["FNumber"].ToString());
+                    dic.Add("FName", item["FName"].ToString());
+                    MapDic.Add(dic);
+                    Dictionary<string, List<Dictionary<string, string>>> Mapdata = new Dictionary<string, List<Dictionary<string, string>>>();
+                    Mapdata.Add("data", MapDic);
+                    string Contentjson = JsonConvert.SerializeObject(Mapdata);
+                    string acts = http.HttpPost(url, Contentjson);
+                }
+                ShowLog("OK");
+            }
+            catch (Exception e)
+            {
+
+                ShowLog(e.Message);
+            }
+        }
+
+        /// <summary>
+        /// 同步金蝶员工往来单位
+        /// </summary>
+        /// <param name="client"></param>
+        /// <param name="date"></param>
+        public void PostKingdeeYG(K3CloudApiClient client, DateTime date)
+        {
+            try
+            {
+                //FCreateDate >= '" + daTime + "'\",FCreateDate >= '" + daTime + "'
+                string daTime = date.AddDays(-1).ToString("yyyy-MM-ddThh:mm:ss");//39.98.219.9:9001     //FCreateDate >= '" + daTime + "'and
+                //string url = "http://192.168.1.76:9001/api/lichen/form/wldx";
+                string url = "http://39.98.219.9:9001/api/lichen/form/wldx";
+                var KingdeeWLList = client.ExecuteBillQuery("{\"FormId\":\"BD_Empinfo\",\"FieldKeys\":\"FNumber,FName\",\"FilterString\":\"FCreateDate >= '" + daTime + "'and FDOCUMENTSTATUS = 'C'\",\"OrderString\": \"\",\"TopRowCount\": 0,\"StartRow\": 0,\"Limit\": 0}");
+                List<Dictionary<string, string>> MapDic = new List<Dictionary<string, string>>();
+                foreach (var item in KingdeeWLList)
+                {
+                    if (item.Count > 1)
+                    {
+                        Dictionary<string, string> dic = new Dictionary<string, string>();
+                        dic.Add("Type", "员工");
+                        dic.Add("FNumber", item[0].ToString());
+                        dic.Add("FName", item[1].ToString());
+                        MapDic.Add(dic);
+                        Dictionary<string, List<Dictionary<string, string>>> Mapdata = new Dictionary<string, List<Dictionary<string, string>>>();
+                        Mapdata.Add("data", MapDic);
+                        string Contentjson = JsonConvert.SerializeObject(Mapdata);
+                        string acts = http.HttpPost(url, Contentjson);
+                    }
+                }
+                ShowLog("OK");
+            }
+            catch (Exception e)
+            {
+
+                ShowLog(e.Message);
+            }
+        }
+
+        /// <summary>
+        /// 其他往来单位
+        /// </summary>
+        /// <param name="client"></param>
+        /// <param name="date"></param>
+        public void PostKingdeeQT(K3CloudApiClient client, DateTime date)
+        {
+            try
+            {
+                //FCreateDate >= '" + daTime + "',
+                string daTime = date.AddDays(-1).ToString("yyyy-MM-ddThh:mm:ss");       //FCreateDate >= '" + daTime + "'
+                string url = "http://39.98.219.9:9001/api/lichen/form/wldx";
+                var KingdeeWLList = client.ExecuteBillQuery("{\"FormId\": \"FIN_OTHERS\",\"FieldKeys\": \"FNumber,FName\",\"FilterString\":\"FCreateDate >= '" + daTime + "' andFDOCUMENTSTATUS = 'C'\",\"OrderString\": \"\",\"TopRowCount\": 0,\"StartRow\": 0,\"Limit\": 0}");
+                List<Dictionary<string, string>> MapDic = new List<Dictionary<string, string>>();
+                foreach (var item in KingdeeWLList)
+                {
+                    if (item.Count > 1)
+                    {
+                        Dictionary<string, string> dic = new Dictionary<string, string>();
+                        dic.Add("Type", "其他往来单位");
+                        dic.Add("FNumber", item[0].ToString());
+                        dic.Add("FName", item[1].ToString());
+                        MapDic.Add(dic);
+                        Dictionary<string, List<Dictionary<string, string>>> Mapdata = new Dictionary<string, List<Dictionary<string, string>>>();
+                        Mapdata.Add("data", MapDic);
+                        string Contentjson = JsonConvert.SerializeObject(Mapdata);
+                        string acts = http.HttpPost(url, Contentjson);
+                    }
+                }
+                ShowLog("OK");
+            }
+            catch (Exception e)
+            {
+
+                ShowLog(e.Message);
+            }
+        }
+        /// <summary>
+        /// 供应商
+        /// </summary>
+        /// <param name="client"></param>
+        /// <param name="date"></param>
+        public void PostKingdeeGYS(K3CloudApiClient client, DateTime date)
+        {
+            try
+            {
+                string daTime = date.AddDays(-1).ToString("yyyy-MM-ddThh:mm:ss");           //FCreateDate >= '" + daTime + "',
+                string url = "http://39.98.219.9:9001/api/lichen/form/wldx";
+                //string querylist = "{\"FormId\":\"BD_Supplier\",\"FieldKeys\":\"FNumber,FName\",\"FilterString\":\"FDOCUMENTSTATUS = 'C'\",\"OrderString\":\"\",\"TopRowCount\":0,\"StartRow\":0,\"Limit\":0}";
+                var KingdeeGYSList = client.ExecuteBillQuery("{ \"FormId\":\"BD_Supplier\",\"FieldKeys\":\"FNumber,FName\",\"FilterString\":\"FCreateDate >= '" + daTime + "' and FDOCUMENTSTATUS = 'C'\",\"OrderString\":\"\",\"TopRowCount\":0,\"StartRow\":0,\"Limit\":0}");
+                //var KingdeeGYSList = client.ExecuteBillQuery(querylist);
+                List<Dictionary<string, string>> MapDic = new List<Dictionary<string, string>>();
+                foreach (var item in KingdeeGYSList)
+                {
+                    if (item.Count > 1)
+                    {
+                        Dictionary<string, string> dic = new Dictionary<string, string>();
+                        dic.Add("Type", "供应商");
+                        dic.Add("FNumber", item[0].ToString());
+                        dic.Add("FName", item[1].ToString());
+                        MapDic.Add(dic);
+                        Dictionary<string, List<Dictionary<string, string>>> Mapdata = new Dictionary<string, List<Dictionary<string, string>>>();
+                        Mapdata.Add("data", MapDic);
+                        string Contentjson = JsonConvert.SerializeObject(Mapdata);
+                        string acts = http.HttpPost(url, Contentjson);
+                    }
+                }
+                ShowLog("OK");
+            }
+            catch (Exception e)
+            {
+
+                ShowLog(e.Message);
+            }
+        }
+        #endregion
+
+
+        #region 创建文本文件
+        public void ShowLog(string log)
+        {
+            File.AppendAllText("log.txt", "\r\n" + log +",日期:"+DateTime.Now);
+        }
+        #endregion
+    }
+}

+ 80 - 0
LiChenkingdee/Form1.Designer.cs

@@ -0,0 +1,80 @@
+
+namespace LiChenkingdee
+{
+    partial class Form1
+    {
+        /// <summary>
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows 窗体设计器生成的代码
+
+        /// <summary>
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.components = new System.ComponentModel.Container();
+            this.label1 = new System.Windows.Forms.Label();
+            this.textBox1 = new System.Windows.Forms.TextBox();
+            this.timer1 = new System.Windows.Forms.Timer(this.components);
+            this.SuspendLayout();
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(49, 19);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(53, 12);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "同步时间";
+            // 
+            // textBox1
+            // 
+            this.textBox1.Location = new System.Drawing.Point(108, 12);
+            this.textBox1.Name = "textBox1";
+            this.textBox1.Size = new System.Drawing.Size(100, 21);
+            this.textBox1.TabIndex = 1;
+            // 
+            // timer1
+            // 
+            this.timer1.Interval = 600000;
+            this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
+            // 
+            // Form1
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(307, 55);
+            this.Controls.Add(this.textBox1);
+            this.Controls.Add(this.label1);
+            this.Name = "Form1";
+            this.Text = "Form1";
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.TextBox textBox1;
+        private System.Windows.Forms.Timer timer1;
+    }
+}
+

+ 32 - 0
LiChenkingdee/Form1.cs

@@ -0,0 +1,32 @@
+using LiChenkingdee.Controllers;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace LiChenkingdee
+{
+    public partial class Form1 : Form
+    {
+        public Form1()
+        {
+            kingdeeToList toList = new kingdeeToList();
+            InitializeComponent();
+            toList.kindeeDL();
+            //Enabled = true;
+            //timer1.Interval = 600000;
+        }
+
+        private void timer1_Tick(object sender, EventArgs e)
+        {
+            //kingdeeToList toList = new kingdeeToList();
+            //toList.kindeeDL();
+            //textBox1.SelectedText = DateTime.Now.ToString();
+        }
+    }
+}

+ 123 - 0
LiChenkingdee/Form1.resx

@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+</root>

+ 128 - 0
LiChenkingdee/LiChenkingdee.csproj

@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{F7041CAC-5572-42F4-A468-3511254EFB92}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <RootNamespace>LiChenkingdee</RootNamespace>
+    <AssemblyName>LiChenkingdee</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <PublishUrl>D:\代码\力辰\LiChen定时\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>22</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <PublishWizardCompleted>true</PublishWizardCompleted>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ManifestCertificateThumbprint>5D6A597F156C9A0A917463B7F081990510E7AB7B</ManifestCertificateThumbprint>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ManifestKeyFile>LiChenkingdee_TemporaryKey.pfx</ManifestKeyFile>
+  </PropertyGroup>
+  <PropertyGroup>
+    <GenerateManifests>true</GenerateManifests>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignManifests>true</SignManifests>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Kingdee.BOS.WebApi.Client">
+      <HintPath>C:\Users\Administrator\Desktop\金蝶\Kingdee.BOS.WebApi.Client.DLL</HintPath>
+    </Reference>
+    <Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>C:\Users\Administrator\Desktop\金蝶\Newtonsoft.Json.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Controllers\HttpHepler.cs" />
+    <Compile Include="Controllers\kingdeeToList.cs" />
+    <Compile Include="Form1.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Form1.Designer.cs">
+      <DependentUpon>Form1.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <EmbeddedResource Include="Form1.resx">
+      <DependentUpon>Form1.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <None Include="LiChenkingdee_TemporaryKey.pfx" />
+    <None Include="packages.config" />
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 22 - 0
LiChenkingdee/Program.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace LiChenkingdee
+{
+    static class Program
+    {
+        /// <summary>
+        /// 应用程序的主入口点。
+        /// </summary>
+        [STAThread]
+        static void Main()
+        {
+            Application.EnableVisualStyles();
+            Application.SetCompatibleTextRenderingDefault(false);
+            Application.Run(new Form1());
+        }
+    }
+}

+ 36 - 0
LiChenkingdee/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("LiChenkingdee")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("LiChenkingdee")]
+[assembly: AssemblyCopyright("Copyright ©  2023")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("f7041cac-5572-42f4-a468-3511254efb92")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
+//通过使用 "*",如下所示:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 70 - 0
LiChenkingdee/Properties/Resources.Designer.cs

@@ -0,0 +1,70 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本: 4.0.30319.42000
+//
+//     对此文件的更改可能导致不正确的行为,如果
+//     重新生成代码,则所做更改将丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+
+namespace LiChenkingdee.Properties
+{
+    /// <summary>
+    ///   强类型资源类,用于查找本地化字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources
+    {
+
+        private static global::System.Resources.ResourceManager resourceMan;
+
+        private static global::System.Globalization.CultureInfo resourceCulture;
+
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources()
+        {
+        }
+
+        /// <summary>
+        ///   返回此类使用的缓存 ResourceManager 实例。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager
+        {
+            get
+            {
+                if ((resourceMan == null))
+                {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LiChenkingdee.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+
+        /// <summary>
+        ///   重写当前线程的 CurrentUICulture 属性,对
+        ///   使用此强类型资源类的所有资源查找执行重写。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture
+        {
+            get
+            {
+                return resourceCulture;
+            }
+            set
+            {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 117 - 0
LiChenkingdee/Properties/Resources.resx

@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 29 - 0
LiChenkingdee/Properties/Settings.Designer.cs

@@ -0,0 +1,29 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+
+namespace LiChenkingdee.Properties
+{
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+    {
+
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+        public static Settings Default
+        {
+            get
+            {
+                return defaultInstance;
+            }
+        }
+    }
+}

+ 7 - 0
LiChenkingdee/Properties/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

+ 4 - 0
LiChenkingdee/packages.config

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="Newtonsoft.Json" version="13.0.3" targetFramework="net45" />
+</packages>

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 152 - 0
OperateExample.cs


+ 158 - 0
Reimbursement.cs

@@ -0,0 +1,158 @@
+using Kingdee.CDP.WebApi.SDK;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Text;
+
+namespace Kingdee.BOS.WebApi.SDK.Test
+{
+    [TestClass]
+    public class Reimbursement
+    {
+        /// <summary>
+        /// 报销申请单
+        /// </summary>
+        [TestMethod]
+        public string Test_reimbursement(object ydapidata)
+        {
+            string jsonsZTab = "";
+            //List<string> dic = new List<string>();
+            JObject array = JsonConvert.DeserializeObject<JObject>(ydapidata.ToString());
+            foreach (var item in array["tableField_leqinlq8"])
+            {
+                JObject itemarray = JsonConvert.DeserializeObject<JObject>(item.ToString());
+                //DateTime dqr = GetDateTime(itemarray["dateField_leqinlqd"].ToString());
+                //DateTime yfr = GetDateTime(itemarray["dateField_lgdd2fz5"].ToString());
+                jsonsZTab += "{\"FExpID\": { \"FNUMBER\": \"FYXM09_SYS\" },\"FLocExpSubmitAmount\": 10.3,\"FLocReqSubmitAmount\": 10.3,\"FLOCTAXAMOUNT\": 0.3,\"FLOCNOTAXAMOUNT\": 10.0,\"FTaxSubmitAmt\": 10.0,\"FTaxRate\": 3.0,\"FTaxAmt\": 0.3,\"FExpenseAmount\": 10.3,\"FExpenseDeptEntryID\": {\"FNUMBER\": \"001.01\" },\"FRequestAmount\": 10.3,\"FExpSubmitAmount\": 10.3,\"FReqSubmitAmount\": 10.3,\"FOnlineBank\": false},";
+            }
+            //初始化
+            var clienter = new K3CloudApi();
+            StringBuilder error = new StringBuilder();
+            //测试连接
+            RepoResult reporesult = clienter.CheckAuthInfo();
+            Assert.IsTrue(reporesult.ResponseStatus.IsSuccess);
+            if (reporesult.ResponseStatus.IsSuccess)
+            {
+                //保存接口的请求参数的规定格式
+                var requestJObject = JObject.Parse("{\"NeedUpDateFields\": [],\"NeedReturnFields\": [],\"IsDeleteEntry\": \"true\",\"SubSystemId\": \"\",\"IsVerifyBaseDataField\": \"false\",\"IsEntryBatchFill\": \"true\",\"ValidateFlag\": \"true\",\"NumberSearch\": \"true\",\"IsAutoAdjustField\": \"false\",\"InterationFlags\": \"\",\"IgnoreInterationFlag\": \"\"," +
+                    "\"Model\": {" +
+                    "\"FID\": 0,\"FDate\": \"2023-04-13 00:00:00\"," +
+                    "\"FCurrencyID\": {\"FNUMBER\": \"PRE001\"}," +
+                    "\"FOrgID\": {\"FNumber\": \"101\"}," +
+                    "\"FCausa\": \"测试\"," +
+                    "\"FProposerID\": {\"FSTAFFNUMBER\": \"010907031023147775\"}," +
+                    "\"FRequestDeptID\": {\"FNUMBER\": \"001.01\"}," +
+                    "\"FContactPhoneNo\": \"19972642292\"," +
+                    "\"FBillTypeID\": {\"FNUMBER\": \"FYBXD001_SYS\"}," +
+                    "\"FExpenseOrgId\": {\"FNumber\": \"101\"}," +
+                    "\"FExpenseDeptID\": {\"FNUMBER\": \"001.01\"}," +
+                    "\"FCONTACTUNITTYPE\": \"BD_Empinfo\"," +
+                    "\"FCONTACTUNIT\": {\"FNumber\": \"010907031023147775\"}," +
+                    "\"FPayOrgId\": {\"FNumber\": \"101\" }," +
+                    "\"FPaySettlleTypeID\": {\"FNUMBER\": \"JSFS04_SYS\"}," +
+                    "\"FBankBranchT\": \"开户银行\",\"FBankAccountNameT\": \"账户名称\",\"FBankAccountT\": \"银行账户\"," +
+                    "\"FLocCurrencyID\": {\"FNUMBER\":\"PRE001\"}," +
+                    "\"FExchangeTypeID\": {\"FNUMBER\":\"HLTX01_SYS\"}," +
+                    "\"FExchangeRate\": 1.0,\"FSplitEntry\": false,\"FCombinedPay\": true,\"FLocExpAmountSum\": 30.5,\"FLocReqAmountSum\": 30.5,\"FExpAmountSum\": 30.5,\"FReqAmountSum\": 30.5," +
+                    "\"FCreatorId\": {\"FUserID\": 16394 }," +
+                    "\"FCreateDate\": \"2023-04-13 17:34:10\",\"FRequestType\": \"1\",\"FReqReimbAmountSum\": 30.5,\"FReqPayReFoundAmountSum\": 30.5,\"FBankAddress\": \"开户行地址\",\"FBANKCNAPS\": \"联行号\",\"FRealPay\": false," +
+                    "\"FBankDetail\": {\"FNUMBER\": \"11\" },\"FCountry\":\"中国\",\"FNProvince\": \"1\",\"FNCity\": \"1\",\"FMultiPayee\": false,\"FillByBeimAmount\": false,\"F_BQB_KFDQ\": \"湖南付款\"," +
+                    "\"FEntity\": ["+jsonsZTab.Substring(0, jsonsZTab.Length - 1)+ "]}}");
+                //调用保存接口
+                var resultJson = clienter.Save("ER_ExpReimbursement", JsonConvert.SerializeObject(requestJObject));
+                JObject resJson = JsonConvert.DeserializeObject<JObject>(resultJson);
+                //根据不同业务单据拼接不同的字段和数值
+                var number = resJson["Result"]["Number"].ToString();
+                //对返回结果进行解析和校验,这里使用的是JsonPatch
+                var isSuccess = ValidateResponse(resultJson);
+                Assert.IsTrue(isSuccess);
+                Assert.IsTrue(Test_EmpInfo_Submit(clienter, number));
+                Assert.IsTrue(Test_EmpInfo_Audit(clienter, number));
+                return resultJson.ToString();
+            }
+            else
+            {
+               return error.AppendLine("User authentication information is wrong, please check again!").ToString();
+            }
+        }
+
+        #region 
+        /// <summary>
+        /// 报销-查询
+        /// </summary>
+        /// <param name="clienter"></param>
+        /// <param name="number"></param>
+        /// <returns></returns>
+        public bool Test_EmpInfo_View(K3CloudApi clienter, string number)
+        {
+            //查询的请求参数
+            var param = JObject.Parse("{\"CreateOrgId\":0,\"Number\":\"" +
+                number +
+                "\",\"Id\":\"\"}");
+            //调用查询接口
+            var resultJson = clienter.View("ER_ExpReimbursement", JsonConvert.SerializeObject(param));
+            return ValidateResponse(resultJson);
+        }
+        /// <summary>
+        /// 报销-提交
+        /// </summary>
+        /// <param name="clienter"></param>
+        /// <param name="number"></param>
+        /// <returns></returns>
+        public bool Test_EmpInfo_Submit(K3CloudApi clienter, string number)
+        {
+            //查询的请求参数
+            var param = JObject.Parse("{\"CreateOrgId\": 0," +
+                "\"Numbers\": [\"" + number + "\"]," +
+                "\"Ids\": \"\"," +
+                "\"SelectedPostId\": 0," +
+                "\"NetworkCtrl\": \"\"," +
+               "\"IgnoreInterationFlag\": \"\"}");
+            //调用查询接口
+            var resultJson = clienter.Submit("ER_ExpReimbursement", JsonConvert.SerializeObject(param));
+            return ValidateResponse(resultJson);
+        }
+        /// <summary>
+        /// 报销-审核
+        /// </summary>
+        /// <param name="clienter"></param>
+        /// <param name="number"></param>
+        /// <returns></returns>
+        public bool Test_EmpInfo_Audit(K3CloudApi clienter, string number)
+        {
+            //查询的请求参数
+            var param = JObject.Parse("{\"CreateOrgId\":0,\"Numbers\":[\"" +
+                number +
+                "\"],\"Ids\":\"\",\"InterationFlags\":\"\",\"NetworkCtrl\":\"\",\"IsVerifyProcInst\":\"\",\"IgnoreInterationFlag\":\"\"}");
+            //调用查询接口
+            var resultJson = clienter.Audit("ER_ExpReimbursement", JsonConvert.SerializeObject(param));
+            return ValidateResponse(resultJson);
+        }
+        #endregion
+        public bool ValidateResponse(string resultJson)
+        {
+            //对返回结果进行解析和校验,这里使用的是JsonPatch
+            var resultJObject = JObject.Parse(resultJson);
+            var queryNode = resultJObject.SelectToken("$..IsSuccess");
+            if (queryNode == null)
+            {
+                return true;
+            }
+            var isSuccess = queryNode.Value<Boolean>();
+            return isSuccess;
+        }
+
+        /// <summary>
+        /// 时间戳转换
+        /// </summary>
+        /// <param name="timeStamp"></param>
+        /// <returns></returns>
+        public DateTime GetDateTime(string timeStamp)
+        {
+            var posixTime = DateTime.SpecifyKind(new DateTime(1970, 1, 1), DateTimeKind.Utc);
+            var time = posixTime.AddMilliseconds(Convert.ToDouble(timeStamp));
+            return time;
+        }
+    }
+}

BIN
resources/Kingdee.CDP.WebApi.SDK.dll