From f89aeb9e6c53d9850a8621a279cc663e27db3d00 Mon Sep 17 00:00:00 2001 From: tdx Date: Thu, 18 Sep 2025 03:55:47 +0000 Subject: [PATCH] SVN r995 SVN-Revision: r995 --- 其他程序/GetApiData/GetApiData.sln | 25 + .../GetApiData/GetApiData/FrmMain.Designer.cs | 341 ++++++++++ 其他程序/GetApiData/GetApiData/FrmMain.cs | 588 ++++++++++++++++++ 其他程序/GetApiData/GetApiData/FrmMain.resx | 120 ++++ .../GetApiData/GetApiData/GetApiData.csproj | 283 +++++++++ .../GetApiData/KingdeeModel/FBomId.cs | Bin 0 -> 173 bytes .../GetApiData/KingdeeModel/FEntityItem.cs | 15 + .../GetApiData/KingdeeModel/FLot.cs | Bin 0 -> 203 bytes .../GetApiData/KingdeeModel/FMaterialId.cs | Bin 0 -> 212 bytes .../GetApiData/KingdeeModel/FReportType.cs | Bin 0 -> 210 bytes .../GetApiData/KingdeeModel/FWorkshipId.cs | Bin 0 -> 210 bytes .../KingdeeModel/PRD_MORPTFEntity_LinkItem.cs | Bin 0 -> 401 bytes .../GetApiData/KingdeeModel/PRD_MORPTModel.cs | 53 ++ 其他程序/GetApiData/GetApiData/Program.cs | Bin 0 -> 586 bytes .../GetApiData/Properties/AssemblyInfo.cs | 9 + .../Properties/Resources.Designer.cs | 40 ++ .../GetApiData/Properties/Resources.resx | 117 ++++ .../Properties/Settings.Designer.cs | 1 + .../GetApiData/Properties/Settings.settings | 7 + 19 files changed, 1599 insertions(+) create mode 100644 其他程序/GetApiData/GetApiData.sln create mode 100644 其他程序/GetApiData/GetApiData/FrmMain.Designer.cs create mode 100644 其他程序/GetApiData/GetApiData/FrmMain.cs create mode 100644 其他程序/GetApiData/GetApiData/FrmMain.resx create mode 100644 其他程序/GetApiData/GetApiData/GetApiData.csproj create mode 100644 其他程序/GetApiData/GetApiData/KingdeeModel/FBomId.cs create mode 100644 其他程序/GetApiData/GetApiData/KingdeeModel/FEntityItem.cs create mode 100644 其他程序/GetApiData/GetApiData/KingdeeModel/FLot.cs create mode 100644 其他程序/GetApiData/GetApiData/KingdeeModel/FMaterialId.cs create mode 100644 其他程序/GetApiData/GetApiData/KingdeeModel/FReportType.cs create mode 100644 其他程序/GetApiData/GetApiData/KingdeeModel/FWorkshipId.cs create mode 100644 其他程序/GetApiData/GetApiData/KingdeeModel/PRD_MORPTFEntity_LinkItem.cs create mode 100644 其他程序/GetApiData/GetApiData/KingdeeModel/PRD_MORPTModel.cs create mode 100644 其他程序/GetApiData/GetApiData/Program.cs create mode 100644 其他程序/GetApiData/GetApiData/Properties/AssemblyInfo.cs create mode 100644 其他程序/GetApiData/GetApiData/Properties/Resources.Designer.cs create mode 100644 其他程序/GetApiData/GetApiData/Properties/Resources.resx create mode 100644 其他程序/GetApiData/GetApiData/Properties/Settings.Designer.cs create mode 100644 其他程序/GetApiData/GetApiData/Properties/Settings.settings diff --git a/其他程序/GetApiData/GetApiData.sln b/其他程序/GetApiData/GetApiData.sln new file mode 100644 index 0000000..87d276e --- /dev/null +++ b/其他程序/GetApiData/GetApiData.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.35130.168 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GetApiData", "GetApiData\GetApiData.csproj", "{ACB19EF7-F810-43F0-8D4D-7EE615F12AF1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {ACB19EF7-F810-43F0-8D4D-7EE615F12AF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ACB19EF7-F810-43F0-8D4D-7EE615F12AF1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ACB19EF7-F810-43F0-8D4D-7EE615F12AF1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ACB19EF7-F810-43F0-8D4D-7EE615F12AF1}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {27FF5848-FA21-4463-ACDC-36AC245C1EAF} + EndGlobalSection +EndGlobal diff --git a/其他程序/GetApiData/GetApiData/FrmMain.Designer.cs b/其他程序/GetApiData/GetApiData/FrmMain.Designer.cs new file mode 100644 index 0000000..31a1830 --- /dev/null +++ b/其他程序/GetApiData/GetApiData/FrmMain.Designer.cs @@ -0,0 +1,341 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace GetApiData +{ + partial class FrmMain + { + /// + /// 必需的设计器变量。 + /// + private IContainer components = null; + + private TextBox textServerName; + private TextBox textBaseName; + private Label labelServerName; + private Label labelBaseName; + private Button btnCheck; + private Button btnClose; + private Panel panel1; + private Panel panel2; + private ProgressBar progressBar; + private TextBox resultText; + private CheckBox kingdoToRyCheck; + private CheckBox RyToKingdoCheck; + + /// + /// 清理所有正在使用的资源。 + /// + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) components.Dispose(); + base.Dispose(disposing); + } + + #region Windows 窗体设计器生成的代码 + + private void InitializeComponent() + { + this.textServerName = new System.Windows.Forms.TextBox(); + this.textBaseName = new System.Windows.Forms.TextBox(); + this.labelServerName = new System.Windows.Forms.Label(); + this.labelBaseName = new System.Windows.Forms.Label(); + this.btnCheck = new System.Windows.Forms.Button(); + this.btnClose = new System.Windows.Forms.Button(); + this.panel1 = new System.Windows.Forms.Panel(); + this.panel2 = new System.Windows.Forms.Panel(); + this.progressBar = new System.Windows.Forms.ProgressBar(); + this.resultText = new System.Windows.Forms.TextBox(); + this.kingdoToRyCheck = new System.Windows.Forms.CheckBox(); + this.RyToKingdoCheck = new System.Windows.Forms.CheckBox(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.k3appId = new System.Windows.Forms.TextBox(); + this.k3ServerName = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.k3appSecret = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.k3dbId = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.k3userName = new System.Windows.Forms.TextBox(); + this.label6 = new System.Windows.Forms.Label(); + this.k3number = new System.Windows.Forms.TextBox(); + this.panel1.SuspendLayout(); + this.panel2.SuspendLayout(); + this.SuspendLayout(); + // + // textServerName + // + this.textServerName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textServerName.Location = new System.Drawing.Point(92, 9); + this.textServerName.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.textServerName.Name = "textServerName"; + this.textServerName.Size = new System.Drawing.Size(575, 21); + this.textServerName.TabIndex = 0; + this.textServerName.Text = "183.223.99.133,14331"; + // + // textBaseName + // + this.textBaseName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBaseName.Location = new System.Drawing.Point(92, 34); + this.textBaseName.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.textBaseName.Name = "textBaseName"; + this.textBaseName.Size = new System.Drawing.Size(575, 21); + this.textBaseName.TabIndex = 1; + this.textBaseName.Text = "lserp_cs"; + // + // labelServerName + // + this.labelServerName.AutoSize = true; + this.labelServerName.Location = new System.Drawing.Point(9, 12); + this.labelServerName.Name = "labelServerName"; + this.labelServerName.Size = new System.Drawing.Size(77, 12); + this.labelServerName.TabIndex = 2; + this.labelServerName.Text = "服务器地址:"; + // + // labelBaseName + // + this.labelBaseName.AutoSize = true; + this.labelBaseName.Location = new System.Drawing.Point(9, 36); + this.labelBaseName.Name = "labelBaseName"; + this.labelBaseName.Size = new System.Drawing.Size(77, 12); + this.labelBaseName.TabIndex = 3; + this.labelBaseName.Text = "数据库名称:"; + // + // btnCheck + // + this.btnCheck.Location = new System.Drawing.Point(533, 212); + this.btnCheck.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.btnCheck.Name = "btnCheck"; + this.btnCheck.Size = new System.Drawing.Size(64, 22); + this.btnCheck.TabIndex = 4; + this.btnCheck.Text = "开始同步"; + this.btnCheck.UseVisualStyleBackColor = true; + this.btnCheck.Click += new System.EventHandler(this.OnbtnCheck_Click); + // + // btnClose + // + this.btnClose.Location = new System.Drawing.Point(603, 212); + this.btnClose.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.btnClose.Name = "btnClose"; + this.btnClose.Size = new System.Drawing.Size(64, 22); + this.btnClose.TabIndex = 5; + this.btnClose.Text = "关闭"; + this.btnClose.UseVisualStyleBackColor = true; + this.btnClose.Click += new System.EventHandler(this.OnbtnClose_Click); + // + // panel1 + // + this.panel1.Controls.Add(this.panel2); + this.panel1.Controls.Add(this.resultText); + this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.panel1.Location = new System.Drawing.Point(0, 241); + this.panel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(677, 287); + this.panel1.TabIndex = 6; + // + // panel2 + // + this.panel2.Controls.Add(this.progressBar); + this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom; + this.panel2.Location = new System.Drawing.Point(0, 267); + this.panel2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(677, 20); + this.panel2.TabIndex = 1; + // + // progressBar + // + this.progressBar.Dock = System.Windows.Forms.DockStyle.Fill; + this.progressBar.Location = new System.Drawing.Point(0, 0); + this.progressBar.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.progressBar.Name = "progressBar"; + this.progressBar.Size = new System.Drawing.Size(677, 20); + this.progressBar.TabIndex = 2; + // + // resultText + // + this.resultText.Dock = System.Windows.Forms.DockStyle.Fill; + this.resultText.Location = new System.Drawing.Point(0, 0); + this.resultText.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.resultText.Multiline = true; + this.resultText.Name = "resultText"; + this.resultText.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.resultText.Size = new System.Drawing.Size(677, 287); + this.resultText.TabIndex = 0; + // + // kingdoToRyCheck + // + this.kingdoToRyCheck.AutoSize = true; + this.kingdoToRyCheck.Location = new System.Drawing.Point(11, 218); + this.kingdoToRyCheck.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.kingdoToRyCheck.Name = "kingdoToRyCheck"; + this.kingdoToRyCheck.Size = new System.Drawing.Size(84, 16); + this.kingdoToRyCheck.TabIndex = 7; + this.kingdoToRyCheck.Text = "金蝶到蕊源"; + this.kingdoToRyCheck.UseVisualStyleBackColor = true; + // + // RyToKingdoCheck + // + this.RyToKingdoCheck.AutoSize = true; + this.RyToKingdoCheck.Location = new System.Drawing.Point(107, 218); + this.RyToKingdoCheck.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.RyToKingdoCheck.Name = "RyToKingdoCheck"; + this.RyToKingdoCheck.Size = new System.Drawing.Size(84, 16); + this.RyToKingdoCheck.TabIndex = 8; + this.RyToKingdoCheck.Text = "蕊源到金蝶"; + this.RyToKingdoCheck.UseVisualStyleBackColor = true; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(9, 86); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(47, 12); + this.label1.TabIndex = 12; + this.label1.Text = "appId:"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(9, 62); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(65, 12); + this.label2.TabIndex = 11; + this.label2.Text = "金蝶地址:"; + // + // k3appId + // + this.k3appId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.k3appId.Location = new System.Drawing.Point(92, 84); + this.k3appId.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.k3appId.Name = "k3appId"; + this.k3appId.Size = new System.Drawing.Size(575, 21); + this.k3appId.TabIndex = 10; + this.k3appId.Text = "214972_7c3q2cuP4npZ2a1EQ/TtSZ9G4L2W7smL"; + // + // k3ServerName + // + this.k3ServerName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.k3ServerName.Location = new System.Drawing.Point(92, 59); + this.k3ServerName.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.k3ServerName.Name = "k3ServerName"; + this.k3ServerName.Size = new System.Drawing.Size(575, 21); + this.k3ServerName.TabIndex = 9; + this.k3ServerName.Text = "https://rychip.ik3cloud.com/k3cloud/"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(9, 111); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(71, 12); + this.label3.TabIndex = 14; + this.label3.Text = "appSecret:"; + // + // k3appSecret + // + this.k3appSecret.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.k3appSecret.Location = new System.Drawing.Point(92, 109); + this.k3appSecret.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.k3appSecret.Name = "k3appSecret"; + this.k3appSecret.PasswordChar = '*'; + this.k3appSecret.Size = new System.Drawing.Size(575, 21); + this.k3appSecret.TabIndex = 13; + this.k3appSecret.Text = "e36cf74480c24f23b33eddb76760b434"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(9, 136); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(41, 12); + this.label4.TabIndex = 16; + this.label4.Text = "dbId:"; + // + // k3dbId + // + this.k3dbId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.k3dbId.Location = new System.Drawing.Point(92, 134); + this.k3dbId.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.k3dbId.Name = "k3dbId"; + this.k3dbId.Size = new System.Drawing.Size(575, 21); + this.k3dbId.TabIndex = 15; + this.k3dbId.Text = "20180807124126"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(9, 161); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(65, 12); + this.label5.TabIndex = 18; + this.label5.Text = "userName:"; + // + // k3userName + // + this.k3userName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.k3userName.Location = new System.Drawing.Point(92, 159); + this.k3userName.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.k3userName.Name = "k3userName"; + this.k3userName.Size = new System.Drawing.Size(575, 21); + this.k3userName.TabIndex = 17; + this.k3userName.Text = "administrator"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(9, 186); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(65, 12); + this.label6.TabIndex = 20; + this.label6.Text = "组织机构:"; + // + // k3number + // + this.k3number.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.k3number.Location = new System.Drawing.Point(92, 184); + this.k3number.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.k3number.Name = "k3number"; + this.k3number.Size = new System.Drawing.Size(575, 21); + this.k3number.TabIndex = 19; + this.k3number.Text = "101"; + // + // FrmMain + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(677, 528); + this.Controls.Add(this.label6); + this.Controls.Add(this.k3number); + this.Controls.Add(this.label5); + this.Controls.Add(this.k3userName); + this.Controls.Add(this.label4); + this.Controls.Add(this.k3dbId); + this.Controls.Add(this.label3); + this.Controls.Add(this.k3appSecret); + this.Controls.Add(this.label1); + this.Controls.Add(this.label2); + this.Controls.Add(this.k3appId); + this.Controls.Add(this.k3ServerName); + this.Controls.Add(this.RyToKingdoCheck); + this.Controls.Add(this.kingdoToRyCheck); + this.Controls.Add(this.panel1); + this.Controls.Add(this.btnClose); + this.Controls.Add(this.btnCheck); + this.Controls.Add(this.labelBaseName); + this.Controls.Add(this.labelServerName); + this.Controls.Add(this.textBaseName); + this.Controls.Add(this.textServerName); + \ No newline at end of file diff --git a/其他程序/GetApiData/GetApiData/FrmMain.cs b/其他程序/GetApiData/GetApiData/FrmMain.cs new file mode 100644 index 0000000..e7aa398 --- /dev/null +++ b/其他程序/GetApiData/GetApiData/FrmMain.cs @@ -0,0 +1,588 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using GetApiData.KingdeeModel; // 你项目里的模型命名空间(保持不变) +using Kingdee.BOS.WebApi.Client; // K3 Cloud API 客户端 +using Lskj.Core; // 你项目里的 DBConfig / SqlHelper 等 +using Lskj.Util; // IniHelper 等 +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace GetApiData +{ + public partial class FrmMain : Form + { + #region Fields + + private int _stepCount = 0; + + // 金蝶 → 本地:字段映射(K3 原字段 -> 本地列别名) + private readonly string FieldKeys_MATERIAL = "FNumber,FName,FSpecification,F_PAEZ_Base,FBaseUnitId.FName,FModifyDate,FModifierId.FName"; + private readonly string AsFieldKeys_MATERIAL = "ProductId,appellation,spec,model,Productunitname,Operatedate,OperatorName"; + + private readonly string FieldKeys_BOM = "FMATERIALID.FNumber,FITEMNAME,FITEMMODEL,FNumber,Fid,FModifyDate"; + private readonly string AsFieldKeys_BOM = "ProductId,mappellation,mspec,TechnicsName,Billdocument_Id,Operatedate"; + + private readonly string FieldKeys_BOMList = "FMATERIALIDCHILD.FNumber,FNUMERATOR,FDENOMINATOR,Fid"; + private readonly string AsFieldKeys_BOMList = "ProductId,Famount,Amount,Billdocument_Id"; + + private readonly string FieldKeys_PRD_MO_Main = "Fid,FBILLNO,FBillType.FNAME,FDate"; + private readonly string AsFieldKeys_PRD_MO_Main = "mps_mpt_jdid,mps_mpt_billdocument_id,mps_mpt_inoutspecies,mps_mpt_operatedate"; + + private readonly string FieldKeys_PRD_MO_List = "FTreeEntity_FEntryId,FBILLNO,FMaterialId.FNumber,FQty,FLot.FNumber"; + private readonly string AsFieldKeys_PRD_MO_List = "mps_lpt_jdid,mps_lpt_billdocument_id,mps_lpt_productid,mps_lpt_amount,mps_lpt_waferbatch_id"; + + private K3CloudApiClient apiClient = new K3CloudApiClient("https://rychip.ik3cloud.com/k3cloud/"); + private string zzjgNumber = ""; + + #endregion + + public FrmMain() + { + InitializeComponent(); + this.Load += OnFrmMain_Load; + } + + #region Form events + + private void OnFrmMain_Load(object sender, EventArgs e) + { + // 从 ini 读默认连接参数 + textServerName.Text = IniHelper.Read("startColund.ini", "ServiceKey"); + textBaseName.Text = IniHelper.Read("startColund.ini", "ServiceData"); + k3ServerName.Text = IniHelper.Read("startColund.ini", "K3Service"); + k3appId.Text = IniHelper.Read("startColund.ini", "K3AppId"); + k3appSecret.Text = IniHelper.Read("startColund.ini", "K3AppSecret"); + k3dbId.Text = IniHelper.Read("startColund.ini", "K3DbId"); + k3userName.Text = IniHelper.Read("startColund.ini", "K3UserName"); + k3number.Text = IniHelper.Read("startColund.ini", "K3Number"); + } + + private void OnbtnCheck_Click(object sender, EventArgs e) + { + zzjgNumber = ""; + resultText.Clear(); + + if (string.IsNullOrWhiteSpace(textServerName.Text) || string.IsNullOrWhiteSpace(textBaseName.Text)) + { + resultText.AppendText("数据库地址或数据库名不能为空!\r\n"); + return; + } + if (string.IsNullOrWhiteSpace(k3ServerName.Text)) + { + resultText.AppendText("金蝶地址不能为空!\r\n"); + return; + } + apiClient = new K3CloudApiClient(k3ServerName.Text); + if (string.IsNullOrWhiteSpace(k3appId.Text)) + { + resultText.AppendText("金蝶appId不能为空!\r\n"); + return; + } + if (string.IsNullOrWhiteSpace(k3appSecret.Text)) + { + resultText.AppendText("金蝶appSecret不能为空!\r\n"); + return; + } + if (string.IsNullOrWhiteSpace(k3dbId.Text)) + { + resultText.AppendText("金蝶dbId不能为空!\r\n"); + return; + } + if (string.IsNullOrWhiteSpace(k3userName.Text)) + { + resultText.AppendText("金蝶userName不能为空!\r\n"); + return; + } + if (string.IsNullOrWhiteSpace(k3number.Text)) + { + resultText.AppendText("金蝶组织机构编码不能为空!\r\n"); + return; + } + DBConfig.Instance.ServerName = textServerName.Text.Trim(); + DBConfig.Instance.DataBase = textBaseName.Text.Trim(); + + if (!(LoginByAppSecret() && DBConfig.Instance.CreateConnection())) + { + resultText.AppendText("数据库连接失败!请检查数据库设置\r\n"); + return; + } + + IniHelper.Write("startColund.ini", "ServiceKey", textServerName.Text); + IniHelper.Write("startColund.ini", "ServiceData", textBaseName.Text); + IniHelper.Write("startColund.ini", "K3Service", k3ServerName.Text); + IniHelper.Write("startColund.ini", "K3AppId", k3appId.Text); + IniHelper.Write("startColund.ini", "K3AppSecret", k3appSecret.Text); + IniHelper.Write("startColund.ini", "K3DbId", k3dbId.Text); + IniHelper.Write("startColund.ini", "K3UserName", k3userName.Text); + IniHelper.Write("startColund.ini", "K3Number", k3number.Text); + + resultText.AppendText("数据库连接成功,开始同步...\r\n"); + + #region 获取组织机构内码 + var payload = new + { + Number = k3number.Text, + }; + string data = JsonConvert.SerializeObject(payload); + var jsonList = apiClient.View("ORG_Organizations", data); + JObject zzjgJObject = (JObject)JsonConvert.DeserializeObject(jsonList); + if ((zzjgJObject["Result"]["ResponseStatus"]["IsSuccess"] + "").Equals("True")) + { + string name = zzjgJObject["Result"]["Result"]["Name"][0]["Value"] + ""; + zzjgNumber = zzjgJObject["Result"]["Result"]["Id"] + ""; + resultText.AppendText($"正在同步组织机构名称:{ name},内码:{zzjgNumber}\r\n"); + } + else + { + resultText.AppendText($"不存在编码为{ k3number.Text}的组织机构\r\n"); + return; + } + #endregion + + bool kd2ry = kingdoToRyCheck.Checked; + bool ry2kd = RyToKingdoCheck.Checked; + + if (kd2ry && !ry2kd) + { + ResetProgress(10); + Sync_Kingdee_To_Local(); + } + else if (!kd2ry && ry2kd) + { + string mainCols = "wms_mjoins_billdocument_id,wms_mjoins_operatedate,wms_mjoins_mstr1,wms_mjoins_bak,wms_mjoins_jdid"; + DataTable mainDb = SqlHelper.ExecuteDataTable($"SELECT {mainCols} FROM Wms_BillJoinSMainTab"); + ResetProgress(Math.Max(1, mainDb.Rows.Count)); + Sync_Ry_To_Kingdee(); + } + else if (!kd2ry && !ry2kd) + { + resultText.AppendText("请勾选操作类型\r\n"); + } + else + { + string mainCols = "wms_mjoins_billdocument_id,wms_mjoins_operatedate,wms_mjoins_mstr1,wms_mjoins_bak,wms_mjoins_jdid"; + DataTable mainDb = SqlHelper.ExecuteDataTable($"SELECT {mainCols} FROM Wms_BillJoinSMainTab"); + ResetProgress(10 + Math.Max(1, mainDb.Rows.Count)); + Sync_Kingdee_To_Local(); + Sync_Ry_To_Kingdee(); + } + } + + private void OnbtnClose_Click(object sender, EventArgs e) => this.Close(); + + #endregion + + #region K3 Login + + private bool LoginByAppSecret() + { + // 注意:以下 appId/appSecret 是硬编码在客户端 + string json = apiClient.LoginByAppSecret(k3dbId.Text, k3userName.Text, k3appId.Text, k3appSecret.Text, 2052); + JObject jo = JObject.Parse(json); + return jo.TryGetValue("LoginResultType", out var v) && v?.Value() == 1; + } + + #endregion + + #region Progress helpers + + private void ResetProgress(int maximum) + { + _stepCount = 0; + progressBar.Value = 0; + progressBar.Style = ProgressBarStyle.Blocks; + progressBar.Minimum = 0; + progressBar.Step = 1; + progressBar.MarqueeAnimationSpeed = 100; + progressBar.Maximum = Math.Max(1, maximum); + SetProgressText(0); + } + + private void StepProgress() + { + _stepCount++; + if (progressBar.Value < progressBar.Maximum) + progressBar.PerformStep(); + + double percent = progressBar.Maximum > 0 ? (progressBar.Value * 100.0 / progressBar.Maximum) : 0.0; + SetProgressText(percent); + progressBar.Refresh(); + } + + private void SetProgressText(double percent) + { + progressBar.Text = $"{percent:0.##}%"; // ProgressBar 本身不显示文本,仅保留 + } + + #endregion + + #region Kingdee API helpers + + private static DataTable ToDataTable(List> jsonList, DataTable dataBaseShape, string asFieldKeys) + { + var dt = new DataTable(); + var cols = asFieldKeys.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries); + + for (int i = 0; i < cols.Length; i++) + { + var colName = cols[i]; + var type = (dataBaseShape != null && i < dataBaseShape.Columns.Count) ? dataBaseShape.Columns[i].DataType : typeof(string); + dt.Columns.Add(colName, type); + } + + if (jsonList != null && jsonList.Count > 0) + { + foreach (var row in jsonList) + { + var dr = dt.NewRow(); + for (int j = 0; j < Math.Min(row.Count, dt.Columns.Count); j++) + dr[j] = row[j] ?? ""; + dt.Rows.Add(dr); + } + } + + return dt; + } + + private DataTable GetApiSource(string formId, DataTable localShape, string fieldKeys, string asFieldKeys, string filterStr = "") + { + string filter = BuildOrgFilter(formId, filterStr, zzjgNumber); + var payload = new + { + FormId = formId, + FieldKeys = fieldKeys, + FilterString = filter, + OrderString = "", + TopRowCount = 0, + StartRow = 0, + Limit = 0 + }; + + string data = JsonConvert.SerializeObject(payload); + var jsonList = apiClient.ExecuteBillQuery(data); + var result = ToDataTable(jsonList, localShape, asFieldKeys); + StepProgress(); + return result; + } + + private DataTable GetApiSource(string formId, string fieldKeys, string filterStr = "") + { + string filter = BuildOrgFilter(formId, filterStr, zzjgNumber); + var payload = new + { + FormId = formId, + FieldKeys = fieldKeys, + FilterString = filter, + OrderString = "", + TopRowCount = 0, + StartRow = 0, + Limit = 0 + }; + + string data = JsonConvert.SerializeObject(payload); + var list = apiClient.ExecuteBillQuery(data)?.ToList() ?? new List>(); + var cols = fieldKeys.Split(',').ToList(); + + var dt = new DataTable(); + foreach (var c in cols) dt.Columns.Add(c); + + foreach (var row in list) + { + var dr = dt.NewRow(); + for (int i = 0; i < cols.Count && i < row.Count; i++) + dr[cols[i]] = row[i]; + dt.Rows.Add(dr); + } + return dt; + } + + private static string BuildOrgFilter(string formId, string filterStr, string zzjgNumber) + { + bool isPrd = (formId == "PRD_MO" || formId == "PRD_MORPT"); + string orgField = isPrd ? "FPrdOrgId" : "FUseOrgId"; + string baseFilter = $"{orgField}='{zzjgNumber}'"; + if (string.IsNullOrWhiteSpace(filterStr)) return baseFilter; + return $"{baseFilter} and {filterStr}"; + } + + private static DataTable GetDataBase(string tableName) + { + string sql = $"SELECT top 1 * FROM {tableName}"; + return SqlHelper.ExecuteDataTable(sql); + } + + private static DataTable GetDataBase(string tableName, string asFieldKeys) + { + string sql = $"SELECT {asFieldKeys} FROM {tableName}"; + return SqlHelper.ExecuteDataTable(sql); + } + + #endregion + + #region Diff & Upsert + + private static string BuildWhere(string primaryKey, DataRow row) + { + var keys = primaryKey.Split(',').Select(k => k.Trim()); + return string.Join(" AND ", keys.Select(k => + { + string v = row[k] == null ? "" : $"{row[k]}".Replace("'", "''"); + return $"{k}='{v}'"; + })); + } + + private DataTable GetExcept(DataTable firstTable, DataTable secondTable, string primaryKey) + { + try + { + DataTable dataTable = firstTable.Clone(); + foreach (DataRow row in firstTable.Rows) + { + DataRow dataRow2 = dataTable.NewRow(); + foreach (DataColumn column in firstTable.Columns) + { + dataRow2[column.ColumnName] = row[column.ColumnName]; + } + DataRow[] array; + if (primaryKey.Split(',').Length > 1) + { + string text = string.Empty; + for (int num = 0; num < primaryKey.Split(',').Length; num++) + { + text = text + string.Format("{0}='{1}'", primaryKey.Split(',')[num] ?? "", string.Concat(row[primaryKey.Split(',')[num]])) + " And "; + } + array = secondTable.Select(text.TrimEnd(' ', 'd', 'n', 'A')); + } + else + { + array = secondTable.Select(string.Format("{0}='{1}'", primaryKey ?? "", string.Concat(row[primaryKey]))); + } + if (array.Length > 0) + { + for (int num = 0; num < array[0].ItemArray.Length; num++) + { + if (array[0][num].GetType() == typeof(DateTime)) + { + if (string.IsNullOrEmpty(string.Concat(array[0][num]))) + { + array[0][num] = DateTime.Now; + } + if (string.IsNullOrEmpty(string.Concat(row[num]))) + { + row[num] = DateTime.Now; + } + if (Convert.ToDateTime(string.Concat(array[0][num])).ToString("yyyy-MM-dd HH:mm:ss") != Convert.ToDateTime(string.Concat(row[num])).ToString("yyyy-MM-dd HH:mm:ss")) + { + dataTable.Rows.Add(dataRow2); + break; + } + } + else if (array[0][num].GetType() == typeof(decimal)) + { + if (!Convert.ToDecimal(string.Concat(array[0][num])).Equals(Convert.ToDecimal(string.Concat(row[num])))) + { + dataTable.Rows.Add(dataRow2); + break; + } + } + else if (string.Concat(array[0][num]) != string.Concat(row[num])) + { + dataTable.Rows.Add(dataRow2); + break; + } + } + } + else + { + dataTable.Rows.Add(dataRow2); + } + } + return dataTable; + } + catch (Exception) + { + throw; + } + } + + private bool GetExceptAndUpdate(DataTable apiSource, DataTable dataBase, string tableName, string primaryKey, string identityKeys, string asfieldKeys) + { + try + { + DataTable dataBase2 = GetDataBase(tableName); + DataTable dataTable = SqlHelper.ExecuteDataTable($"select COLUMN_NAME,IS_NULLABLE from information_schema.columns where table_name = '{tableName}'"); + DataTable dataTable2 = new DataTable(); + dataTable2 = GetExcept(dataBase, apiSource, primaryKey); + DataTable dataTable3 = new DataTable(); + dataTable3 = GetExcept(apiSource, dataBase, primaryKey); + string text = string.Empty; + foreach (DataRow row in dataTable3.Rows) + { + string text2 = string.Empty; + DataRow[] array; + if (primaryKey.Split(',').Length > 1) + { + for (int num = 0; num < primaryKey.Split(',').Length; num++) + { + text2 = text2 + string.Format("{0}='{1}'", primaryKey.Split(',')[num] ?? "", string.Concat(row[primaryKey.Split(',')[num]])) + " And "; + } + text2 = text2.TrimEnd(' ', 'd', 'n', 'A'); + array = dataBase.Select(text2); + } + else + { + text2 = string.Format("{0}='{1}'", primaryKey ?? "", string.Concat(row[primaryKey])); + array = dataBase.Select(text2); + } + if (array.Length != 0) + { + foreach (DataColumn column in row.Table.Columns) + { + if (!string.Concat(row[column.ColumnName]).Equals(string.Concat(array[0][column.ColumnName]))) + { + string format = "update {0} set {1} = N'{2}' where {3};\r\n"; + text += string.Format(format, tableName, column.ColumnName, string.Concat(row[column.ColumnName]).Replace("'", "''"), text2); + } + } + continue; + } + string format2 = "insert into {0} ({1}) values ({2});\r\n"; + string text3 = string.Empty; + string text4 = string.Empty; + foreach (DataColumn column2 in dataBase2.Columns) + { + if (asfieldKeys.Split(',').Contains(column2.ColumnName)) + { + text4 += string.Format("'{0}',", string.Concat(row[column2.ColumnName]).Replace("'", "''")); + text3 += string.Format(column2.ColumnName + ","); + } + else if (string.Concat(dataTable.Select(string.Format("COLUMN_NAME='{0}'", column2.ColumnName ?? "")).First()["IS_NULLABLE"]) == "NO" && !(column2.ColumnName == identityKeys)) + { + if (column2.DataType == typeof(decimal) || column2.DataType == typeof(double) || column2.DataType == typeof(short) || column2.DataType == typeof(int) || column2.DataType == typeof(long)) + { + text4 += "0,"; + text3 += string.Format(column2.ColumnName + ","); + } + else if (column2.DataType == typeof(DateTime)) + { + text4 += $"'{DateTime.Now}',"; + text3 += string.Format(column2.ColumnName + ","); + } + else + { + text4 += $"'',"; + text3 += string.Format(column2.ColumnName + ","); + } + } + } + text += string.Format(format2, tableName, text3.TrimEnd(','), text4.TrimEnd(',')); + } + if (!string.IsNullOrEmpty(text)) + { + SqlHelper.ExecuteNonQuery(text); + } + StepProgress(); + return true; + } + catch (Exception ex) + { + resultText.AppendText(ex.Message + "\r\n"); + StepProgress(); + return false; + } + } + + #endregion + + #region Sync flows + + private void Sync_Kingdee_To_Local() + { + try + { + DataTable dbProduct = GetDataBase("p_producttab", AsFieldKeys_MATERIAL); + DataTable apiMaterial = GetApiSource("BD_MATERIAL", dbProduct, FieldKeys_MATERIAL, AsFieldKeys_MATERIAL); + + DataTable dbBom = GetDataBase("bom_billtab", AsFieldKeys_BOM); + DataTable apiBom = GetApiSource("ENG_BOM", dbBom, FieldKeys_BOM, AsFieldKeys_BOM); + + DataTable dbBomList = GetDataBase("bom_billlisttab", AsFieldKeys_BOMList); + DataTable apiBomList = GetApiSource("ENG_BOM", dbBomList, FieldKeys_BOMList, AsFieldKeys_BOMList); + + DataTable dbMoMain = GetDataBase("mps_planTaskMainTab", AsFieldKeys_PRD_MO_Main); + DataTable apiMoMain = GetApiSource("PRD_MO", dbMoMain, FieldKeys_PRD_MO_Main, AsFieldKeys_PRD_MO_Main, "FDate>'2021-10-26'"); + + DataTable dbMoList = GetDataBase("mps_planTaskListTab", AsFieldKeys_PRD_MO_List); + DataTable apiMoList = GetApiSource("PRD_MO", dbMoList, FieldKeys_PRD_MO_List, AsFieldKeys_PRD_MO_List, "FDate>'2021-10-26'"); + + if (GetExceptAndUpdate(apiMaterial, dbProduct, "p_producttab", "ProductId", "id", AsFieldKeys_MATERIAL)) + resultText.AppendText("金蝶 Material 物料清单 => p_producttab 同步完成\r\n"); + else + resultText.AppendText("金蝶 Material 物料清单 => p_producttab 同步失败\r\n"); + + if (GetExceptAndUpdate(apiBom, dbBom, "bom_billtab", "Billdocument_Id", "id", AsFieldKeys_BOM)) + resultText.AppendText("金蝶 BOM 主表 => bom_billtab 同步完成\r\n"); + else + resultText.AppendText("金蝶 BOM 主表 => bom_billtab 同步失败\r\n"); + + if (GetExceptAndUpdate(apiBomList, dbBomList, "bom_billlisttab", "ProductId,Billdocument_Id", "id", AsFieldKeys_BOMList)) + resultText.AppendText("金蝶 BOM 明细表 => bom_billlisttab 同步完成\r\n"); + else + resultText.AppendText("金蝶 BOM 明细表 => bom_billlisttab 同步失败\r\n"); + + if (GetExceptAndUpdate(apiMoMain, dbMoMain, "mps_planTaskMainTab", "mps_mpt_billdocument_id", "mps_mpt_id", AsFieldKeys_PRD_MO_Main)) + resultText.AppendText("金蝶 PRD_MO 生产订单主表 => mps_planTaskMainTab 同步完成\r\n"); + else + resultText.AppendText("金蝶 PRD_MO 生产订单主表 => mps_planTaskMainTab 同步失败\r\n"); + + if (GetExceptAndUpdate(apiMoList, dbMoList, "mps_planTaskListTab", "mps_lpt_billdocument_id", "mps_lpt_id", AsFieldKeys_PRD_MO_List)) + resultText.AppendText("金蝶 PRD_MO 生产订单明细表 => mps_planTaskListTab 同步完成\r\n"); + else + resultText.AppendText("金蝶 PRD_MO 生产订单明细表 => mps_planTaskListTab 同步失败\r\n"); + } + catch (Exception ex) + { + resultText.AppendText(ex.Message + "\r\n"); + } + finally + { + resultText.AppendText("同步结束!\r\n"); + } + } + + private void Sync_Ry_To_Kingdee() + { + try + { + string mainCols = "wms_mjoins_billdocument_id,wms_mjoins_operatedate,wms_mjoins_mstr1,wms_mjoins_bak,wms_mjoins_jdid"; + string listCols = "wms_ljoins_productid,wms_ljoins_rwlno,wms_ljoins_id,wms_ljoins_lstr2,wms_ljoins_lstr1,wms_ljoins_amount,wms_ljoins_famount,wms_ljoins_lstr3,wms_ljoins_batch_id,wms_ljoins_lstr4,wms_ljoins_billdocument_id,wms_ljoins_jdid"; + + DataTable mainDb = SqlHelper.ExecuteDataTable($"SELECT {mainCols} FROM Wms_BillJoinSMainTab"); + DataTable listDb = SqlHelper.ExecuteDataTable($"SELECT {listCols} FROM wms_billjoinslistTab"); + + DataTable morptApi = GetApiSource("PRD_MORPT", mainDb, "FBillNo,FDate,FWorkshipId.FNumber,FDescription", mainCols); + DataTable moIdNo = GetApiSource("PRD_MO", "Fid,FBillNo"); + + foreach (DataRow mainRow in mainDb.Rows) + { + try + { + string billNo = $"{mainRow["wms_mjoins_billdocument_id"]}"; + string jdid = $"{mainRow["wms_mjoins_jdid"]}".Trim(); + + bool exists = morptApi.Select($"wms_mjoins_billdocument_id='{billNo.Replace("'", "''")}'").Any(); + if (exists || string.IsNullOrEmpty(jdid) || jdid == "0") continue; + + var details = listDb.Select($"wms_ljoins_billdocument_id='{billNo.Replace("'", "''")}'").ToList(); + if (details.Count == 0) continue; + + decimal amount = details.Sum(d => SafeToDecimal(d, "wms_ljoins_amount")); + decimal famount = details.Sum(d => SafeToDecimal(d, "wms_ljoins_famount")); + + string jsonDraft = apiClient.Draft("PRD_MORPT", + \ No newline at end of file diff --git a/其他程序/GetApiData/GetApiData/FrmMain.resx b/其他程序/GetApiData/GetApiData/FrmMain.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/其他程序/GetApiData/GetApiData/FrmMain.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/其他程序/GetApiData/GetApiData/GetApiData.csproj b/其他程序/GetApiData/GetApiData/GetApiData.csproj new file mode 100644 index 0000000..7aa8e26 --- /dev/null +++ b/其他程序/GetApiData/GetApiData/GetApiData.csproj @@ -0,0 +1,283 @@ + + + + + Debug + AnyCPU + {ACB19EF7-F810-43F0-8D4D-7EE615F12AF1} + WinExe + GetApiData + GetApiData + v4.0 + 512 + true + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.BonusSkins.v15.2.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.Charts.v15.2.Core.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.CodeParser.v15.2.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.Data.v15.2.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.DataAccess.v15.2.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.DataAccess.v15.2.UI.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.Office.v15.2.Core.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.Pdf.v15.2.Core.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.Pdf.v15.2.Drawing.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.PivotGrid.v15.2.Core.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.Printing.v15.2.Core.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.RichEdit.v15.2.Core.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.Sparkline.v15.2.Core.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.Spreadsheet.v15.2.Core.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.Utils.v15.2.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.Utils.v15.2.UI.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.Xpo.v15.2.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.XtraBars.v15.2.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.XtraCharts.v15.2.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.XtraCharts.v15.2.Extensions.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.XtraCharts.v15.2.UI.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.XtraCharts.v15.2.Wizard.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.XtraEditors.v15.2.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.XtraGauges.v15.2.Core.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.XtraGrid.v15.2.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.XtraLayout.v15.2.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.XtraNavBar.v15.2.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.XtraPivotGrid.v15.2.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.XtraPrinting.v15.2.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.XtraReports.v15.2.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.XtraReports.v15.2.Extensions.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.XtraRichEdit.v15.2.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.XtraScheduler.v15.2.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.XtraScheduler.v15.2.Core.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.XtraSpreadsheet.v15.2.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.XtraTreeList.v15.2.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\DevExpress.XtraVerticalGrid.v15.2.dll + + + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\ICSharpCode.SharpZipLib.dll + + + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\itextsharp.dll + + + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\Kingdee.BOS.WebApi.Client.dll + + + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\Kingdee.BOS.WebApi.DataEntities.dll + + + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\Lskj.AutoUpdate.dll + + + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\Lskj.Business.dll + + + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\Lskj.Control.dll + + + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\Lskj.Core.dll + + + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\Lskj.Data.dll + + + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\Lskj.Model.dll + + + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\Lskj.Push.dll + + + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\Lskj.Util.dll + + + False + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\Newtonsoft.Json.dll + + + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\NPOI.dll + + + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\O2S.Components.PDFView4NET.dll + + + + + + + + + + + + + D:\下载\xwechat_files\wxid_9htys9sllfcy22_4c66\msg\file\2025-09\蕊源同步工具(1)\Xilium.CefGlue.dll + + + + + Form + + + FrmMain.cs + + + + + + + + + + + + + FrmMain.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + \ No newline at end of file diff --git a/其他程序/GetApiData/GetApiData/KingdeeModel/FBomId.cs b/其他程序/GetApiData/GetApiData/KingdeeModel/FBomId.cs new file mode 100644 index 0000000000000000000000000000000000000000..546cd2e4890a7f3fe05b2fcc8939643414bb87ee GIT binary patch literal 173 zcmb1;W|k5akgVa7FG1hnt01${jkUoG`Q6sMK`u?c$(q|IIEd%{sp2_p6Or z(~C7PKla;u_Ro*ZKZZ9{&1Wo5teLm}8VBjbU`8{R5aAN2^ai?CA!S;qvbuxITy{(|8LrztH4&h zH~50ozplG(EZ1AZukmVos=wlOvU2C(r*l_ztW{|r^fx;Dai9nNR zZ6=O2S7+y6UBGkUkE_qVQx1COG9E%(r=L6*EU&MtJ8Nl|gXT4V9@fpuhW>Kwe|&;oew$e!`0{hUfxb&gGe_owE$V!t>;EaG>t1}&FV!+x JX~B`^9ssOuVQc^Z literal 0 HcmV?d00001 diff --git a/其他程序/GetApiData/GetApiData/KingdeeModel/FWorkshipId.cs b/其他程序/GetApiData/GetApiData/KingdeeModel/FWorkshipId.cs new file mode 100644 index 0000000000000000000000000000000000000000..664a78ce9903aad39e79acdc40e63dd219bc5481 GIT binary patch literal 210 zcmb1;W|k5akgVa7$oF!Kcjnb zko(5ABX)7VQp;{>9(G%3RctEwIGgKl@w?mAQ?CeVtqBd(;_$ntzwYisajRJ@_BYuj z>kq3hjlIrcS@vvk;@vxcC&fK<`re(P@!x;q2mK=^iIM@E JJeTn60|5E$TYUfk literal 0 HcmV?d00001 diff --git a/其他程序/GetApiData/GetApiData/KingdeeModel/PRD_MORPTFEntity_LinkItem.cs b/其他程序/GetApiData/GetApiData/KingdeeModel/PRD_MORPTFEntity_LinkItem.cs new file mode 100644 index 0000000000000000000000000000000000000000..71e73142bc917a21aa0da5785e4bcecbd413b422 GIT binary patch literal 401 zcmV;C0dD>n8v_~@5E*<584i4Da%@~#TwGjSTwGjWFdbZ6TwGiL0001|icsD#!Oe`v zhvdI;nUu~^6ws1Q0-i@fFIc%21;dth3*=xPv3X2VF!D&-mPlS<*RgyHbF6qZYy`j@ z?O0s6`ovLOJ=?XpvaUO55_b)8DhILAOtS|nXSug7TIZ>7 zsiSTpaDhA!UxAMQX&6`w&UCuz)@A6}@wqaAo2$*Z_;~olK0_!@hi`21dG{NlEQz!A z*5fLoW_I!d_Q|=c|7<(eOs3R!e#=%Q_JN?XcCScHHBc;4FR^}ia#T~O4dH3uB_Xad^WP9 v^iJg_q$0}<6levitd{|!@zJPA2kY`vG2%NqQv7S5gW%&>DkXcuoGQ{A7YM>q literal 0 HcmV?d00001 diff --git a/其他程序/GetApiData/GetApiData/KingdeeModel/PRD_MORPTModel.cs b/其他程序/GetApiData/GetApiData/KingdeeModel/PRD_MORPTModel.cs new file mode 100644 index 0000000..eda33f4 --- /dev/null +++ b/其他程序/GetApiData/GetApiData/KingdeeModel/PRD_MORPTModel.cs @@ -0,0 +1,53 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; + +namespace GetApiData.KingdeeModel +{ + + internal class PRD_MORPTModel + { + public static string CreateData(DataRow billMainRow, DataRow billDetailRow, string quaQty, string finishQty, DataTable MoTable) + { + string fBillNo = ((billMainRow.Table.Columns.Contains("wms_mjoins_billdocument_id") && !string.IsNullOrEmpty(string.Concat(billMainRow["wms_mjoins_billdocument_id"]))) ? string.Concat(billMainRow["wms_mjoins_billdocument_id"]) : ""); + string text = ((billMainRow.Table.Columns.Contains("wms_mjoins_inoutspecies") && !string.IsNullOrEmpty(string.Concat(billMainRow["wms_mjoins_inoutspecies"]))) ? string.Concat(billMainRow["wms_mjoins_inoutspecies"]) : ""); + string fDate = ((billMainRow.Table.Columns.Contains("wms_mjoins_operatedate") && !string.IsNullOrEmpty(string.Concat(billMainRow["wms_mjoins_operatedate"]))) ? string.Concat(billMainRow["wms_mjoins_operatedate"]) : ""); + string fNumber = ((billMainRow.Table.Columns.Contains("wms_mjoins_mstr1") && !string.IsNullOrEmpty(string.Concat(billMainRow["wms_mjoins_mstr1"]))) ? string.Concat(billMainRow["wms_mjoins_mstr1"]) : ""); + string fDescription = ((billMainRow.Table.Columns.Contains("wms_mjoins_bak") && !string.IsNullOrEmpty(string.Concat(billMainRow["wms_mjoins_bak"]))) ? string.Concat(billMainRow["wms_mjoins_bak"]) : ""); + List list = new List(); + FEntityItem fEntityItem = new FEntityItem(); + string text2 = ((MoTable.Select(string.Format("{0}='{1}'", "Fid", string.Concat(billMainRow["wms_mjoins_jdid"]))).Count() > 0) ? string.Concat(MoTable.Select(string.Format("{0}='{1}'", "Fid", string.Concat(billMainRow["wms_mjoins_jdid"]))).First()["FBillNo"]) : ""); + string text3 = ((billMainRow.Table.Columns.Contains("wms_mjoins_jdid") && !string.IsNullOrEmpty(string.Concat(billMainRow["wms_mjoins_jdid"]))) ? string.Concat(billMainRow["wms_mjoins_jdid"]) : ""); + string text4 = ((billDetailRow.Table.Columns.Contains("wms_ljoins_jdid") && !string.IsNullOrEmpty(string.Concat(billDetailRow["wms_ljoins_jdid"]))) ? string.Concat(billDetailRow["wms_ljoins_jdid"]) : ""); + string fNumber2 = ((billDetailRow.Table.Columns.Contains("wms_ljoins_productid") && !string.IsNullOrEmpty(string.Concat(billDetailRow["wms_ljoins_productid"]))) ? string.Concat(billDetailRow["wms_ljoins_productid"]) : ""); + string fNumber3 = ((billDetailRow.Table.Columns.Contains("wms_ljoins_lstr3") && !string.IsNullOrEmpty(string.Concat(billDetailRow["wms_ljoins_lstr3"]))) ? string.Concat(billDetailRow["wms_ljoins_lstr3"]) : ""); + string fNumber4 = ((billDetailRow.Table.Columns.Contains("wms_ljoins_batch_id") && !string.IsNullOrEmpty(string.Concat(billDetailRow["wms_ljoins_batch_id"]))) ? string.Concat(billDetailRow["wms_ljoins_batch_id"]) : ""); + string fNumber5 = ((billDetailRow.Table.Columns.Contains("wms_ljoins_lstr4") && !string.IsNullOrEmpty(string.Concat(billDetailRow["wms_ljoins_lstr4"]))) ? string.Concat(billDetailRow["wms_ljoins_lstr4"]) : ""); + string text5 = ((billDetailRow.Table.Columns.Contains("wms_ljoins_billdocument_id") && !string.IsNullOrEmpty(string.Concat(billDetailRow["wms_ljoins_billdocument_id"]))) ? string.Concat(billDetailRow["wms_ljoins_billdocument_id"]) : ""); + fEntityItem.FIsNew = "false"; + fEntityItem.FWorkshipId.FNumber = fNumber3; + fEntityItem.FMoBillNo = text2; + fEntityItem.FSrcInterId = text3; + fEntityItem.FMoId = text3; + fEntityItem.FMoEntryId = text4; + fEntityItem.FSrcEntryId = text4; + fEntityItem.FMaterialId.FNumber = fNumber2; + fEntityItem.FProductType = "1"; + fEntityItem.FReportType.FNumber = "CTG001"; + fEntityItem.FSrcBillNo = text2; + fEntityItem.FSrcBillType = "PRD_MO"; + fEntityItem.FLot.FNumber = fNumber4; + fEntityItem.FWorkshipId.FNumber = fNumber3; + fEntityItem.FQuaQty = quaQty; + fEntityItem.FFinishQty = finishQty; + fEntityItem.FBomId.FNumber = fNumber5; + fEntityItem.FMOMAINENTRYID = text4; + List list2 = new List(); + PRD_MORPTFEntity_LinkItem pRD_MORPTFEntity_LinkItem = new PRD_MORPTFEntity_LinkItem(); + string fEntity_Link_FRuleId = "PRD_MO2MORPT"; + string fEntity_Link_FSTableName = "T_PRD_MOENTRY"; + string fEntity_Link_FSBillId = ((billMainRow.Table.Columns.Contains("wms_mjoins_jdid") && !string.IsNullOrEmpty(string.Concat(billMainRow["wms_mjoins_jdid"]))) ? string.Concat(billMainRow["wms_mjoins_jdid"]) : ""); + string fEntity_Link_FSId = ((billDetailRow.Table.Columns.C \ No newline at end of file diff --git a/其他程序/GetApiData/GetApiData/Program.cs b/其他程序/GetApiData/GetApiData/Program.cs new file mode 100644 index 0000000000000000000000000000000000000000..defd3ccf67548c3bed9bfe472961cc08d0533382 GIT binary patch literal 586 zcmV-Q0=4}Z8v_~@5E*<584i4Da%@~#TwGjSTwGjWFdbZ6TwGiL0001|icsD#!Oe`v zhvdI;nUu~D??{t_LQ~L@TmVWX@|zPttiQ6csaPx!UdFQ&YW_XY6z+!%K#frUq0la> z=!^tHVG{(iS3;X$xlD^Rrg|4}A!sszQ~qCTKUdo%VW^*2q!N&DQb3i}%YxFE_t`6i z5FVRy(uhJ)9v|_c)ER6X3;J}P?@01ezj-v|sE(N2Hfz=JLkw1P z0u|e2ewIW9woGGqz0rEN@3XD?@2cM@6-!=i8c1(81Sl?s+rhlwX~>t(0_TOyo*9 z(p7oR?ExRW!)r`CT|Qy6V40P~nm4S$yxk~tQjXe>s3yL6_BJs*Sp1%7!ioT8Z~4KS zgoIk*ZWnCQ9Jh|B%?Z3MaSuxK8c~eQqj6x-Y2|Ah8S;_GUB!($8c9L8 z1%bL?g9jZfK%tpX>OgK{GVBp{e+YQBqqEjN9;Qph+^xQ7y>8$^qL@tzwF6kF8|X&X Ywr2cmP>K>;uO2L%E9dVsIR>5(Zkr$#Y5)KL literal 0 HcmV?d00001 diff --git a/其他程序/GetApiData/GetApiData/Properties/AssemblyInfo.cs b/其他程序/GetApiData/GetApiData/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3ba18f9 --- /dev/null +++ b/其他程序/GetApiData/GetApiData/Properties/AssemblyInfo.cs @@ -0,0 +1,9 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("GetApiData")] +[assembly: Ass \ No newline at end of file diff --git a/其他程序/GetApiData/GetApiData/Properties/Resources.Designer.cs b/其他程序/GetApiData/GetApiData/Properties/Resources.Designer.cs new file mode 100644 index 0000000..3c9e2b4 --- /dev/null +++ b/其他程序/GetApiData/GetApiData/Properties/Resources.Designer.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本: 4.0.30319.42000 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + + +namespace GetApiData.Properties +{ + /// + /// 强类型资源类,用于查找本地化字符串等。 + /// + // 此类是由 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() + { + } + + /// + /// 返回此类使用的缓存 ResourceManager 实例。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager Resou \ No newline at end of file diff --git a/其他程序/GetApiData/GetApiData/Properties/Resources.resx b/其他程序/GetApiData/GetApiData/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/其他程序/GetApiData/GetApiData/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/其他程序/GetApiData/GetApiData/Properties/Settings.Designer.cs b/其他程序/GetApiData/GetApiData/Properties/Settings.Designer.cs new file mode 100644 index 0000000..ea896b7 --- /dev/null +++ b/其他程序/GetApiData/GetApiData/Properties/Settings.Designer.cs @@ -0,0 +1 @@ +//------------------------------------------------------------------ \ No newline at end of file diff --git a/其他程序/GetApiData/GetApiData/Properties/Settings.settings b/其他程序/GetApiData/GetApiData/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/其他程序/GetApiData/GetApiData/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + +