From a95f32a6b0c3c23b612c986ed032d9b6551a59c9 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 18 Dec 2020 15:12:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- U8AppMain/Bom/Bom.cs | 2 +- U8AppMain/Bom/ComponentEnity.cs | 22 ++++++++++++++++++---- U8AppMain/Bom/ComponentOptEnity.cs | 17 ++++++++++------- U8AppMain/Bom/Version.cs | 6 +++--- U8AppMain/Bom/ufinterface.cs | 6 +++--- U8AppMain/FrmMain.Designer.cs | 12 ++++++++++++ U8AppMain/FrmMain.cs | 19 +++++++++++-------- 7 files changed, 58 insertions(+), 26 deletions(-) diff --git a/U8AppMain/Bom/Bom.cs b/U8AppMain/Bom/Bom.cs index d59fe6c..eacc516 100644 --- a/U8AppMain/Bom/Bom.cs +++ b/U8AppMain/Bom/Bom.cs @@ -36,7 +36,7 @@ namespace U8AppMain.Bom } [XmlElement(Type = typeof(ComponentRmkEnity))] - public List ComponentRmks + public List ComponentRmk { get { diff --git a/U8AppMain/Bom/ComponentEnity.cs b/U8AppMain/Bom/ComponentEnity.cs index 566b4a3..8bf3d1a 100644 --- a/U8AppMain/Bom/ComponentEnity.cs +++ b/U8AppMain/Bom/ComponentEnity.cs @@ -6,6 +6,20 @@ using System.Threading.Tasks; namespace U8AppMain.Bom { + + //10 + // 4 + // 10 + // 0000 + // 107001 + // 2000-01-07T00:00:00+08:00 + // 2099-12-31T00:00:00+08:00 + // 1 + // 1.000000 + // 1.000000 + // 0.000 + // false + // 10 public class ComponentEnity { @@ -14,16 +28,16 @@ namespace U8AppMain.Bom public string SortSeq { get; set; } - public string OpSeq { get; set; } + public string OpSeq { get; set; } = "000"; public string InvCode { get; set; } - public DateTime EffBegDate { get; set; } + public DateTime EffBegDate { get; set; } = DateTime.Today; - public DateTime EffEndDate { get; set; } + public DateTime EffEndDate { get; set; } = DateTime.Now.AddYears(50); - public int FVFlag { get; set; } + public int FVFlag { get; set; } = 1; public decimal BaseQtyN { get; set; } diff --git a/U8AppMain/Bom/ComponentOptEnity.cs b/U8AppMain/Bom/ComponentOptEnity.cs index a35b395..04f8444 100644 --- a/U8AppMain/Bom/ComponentOptEnity.cs +++ b/U8AppMain/Bom/ComponentOptEnity.cs @@ -12,12 +12,15 @@ namespace U8AppMain.Bom public int OptionsId { get; set; } public int Offset { get; set; } - public bool AccuCostFlag { get; set; } - public string DrawDeptCode { get; set; } - public string Whcode { get; set; } - public bool OptionalFlag { get; set; } - public int MutexRule { get; set; } - public decimal PlanFactor { get; set; } - + public bool AccuCostFlag { get; set; } = true; + public string DrawDeptCode { get; set; } = ""; + public string Whcode { get; set; } = ""; + public bool OptionalFlag { get; set; } = false; + public int MutexRule { get; set; } = 2; + public decimal PlanFactor { get; set; } = 100; + + + + } } diff --git a/U8AppMain/Bom/Version.cs b/U8AppMain/Bom/Version.cs index 4356e2d..cfa0827 100644 --- a/U8AppMain/Bom/Version.cs +++ b/U8AppMain/Bom/Version.cs @@ -9,12 +9,12 @@ namespace U8AppMain.Bom public class VersionEnity { public int BomId { get; set; } = 0; - public string BomType { get; set; } + public string BomType { get; set; } = "1"; public int Version { get; set; } - public String VersionDesc { get; set; } + public string VersionDesc { get; set; } public DateTime VersionEffDate { get; set; } = DateTime.Now; - public int Status { get; set; } + public int Status { get; set; } = 3; //1 // 70 diff --git a/U8AppMain/Bom/ufinterface.cs b/U8AppMain/Bom/ufinterface.cs index 7cba00a..8b2b7b1 100644 --- a/U8AppMain/Bom/ufinterface.cs +++ b/U8AppMain/Bom/ufinterface.cs @@ -11,11 +11,11 @@ namespace U8AppMain.Bom //sender="003" receiver="u8" roottag="Bom" docid="971742630" proc="add" codeexchanged="N" exportneedexch="N" paginate="0" display="物料清单" family="生产制造" timestamp="0x000000000027B6E6" [System.Xml.Serialization.XmlAttribute] - public string Sender { get; set; } = "003"; + public string sender { get; set; } = "003"; [System.Xml.Serialization.XmlAttribute] - public string receiver { get; set; } = "U8"; + public string receiver { get; set; } = "u8"; [System.Xml.Serialization.XmlAttribute] - public string roottag { get; set; } = "BOM"; + public string roottag { get; set; } = "Bom"; [System.Xml.Serialization.XmlAttribute] public string docid { get; set; } = "971742630"; diff --git a/U8AppMain/FrmMain.Designer.cs b/U8AppMain/FrmMain.Designer.cs index f52d3d1..c3bedab 100644 --- a/U8AppMain/FrmMain.Designer.cs +++ b/U8AppMain/FrmMain.Designer.cs @@ -34,6 +34,7 @@ namespace U8AppMain this.panel2 = new System.Windows.Forms.Panel(); this.kryptonDataGridView1 = new ComponentFactory.Krypton.Toolkit.KryptonDataGridView(); this.BtnImportExcel = new System.Windows.Forms.Button(); + this.textBox1 = new System.Windows.Forms.TextBox(); this.panel1.SuspendLayout(); this.panel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.kryptonDataGridView1)).BeginInit(); @@ -61,6 +62,7 @@ namespace U8AppMain // // panel2 // + this.panel2.Controls.Add(this.textBox1); this.panel2.Controls.Add(this.kryptonDataGridView1); this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; this.panel2.Location = new System.Drawing.Point(0, 42); @@ -92,6 +94,14 @@ namespace U8AppMain this.BtnImportExcel.UseVisualStyleBackColor = true; this.BtnImportExcel.Click += new System.EventHandler(this.BtnImportExcel_Click); // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(145, 193); + this.textBox1.Multiline = true; + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(515, 246); + this.textBox1.TabIndex = 1; + // // FrmMain // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -103,6 +113,7 @@ namespace U8AppMain this.Text = "Form1"; this.panel1.ResumeLayout(false); this.panel2.ResumeLayout(false); + this.panel2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.kryptonDataGridView1)).EndInit(); this.ResumeLayout(false); @@ -115,6 +126,7 @@ namespace U8AppMain private System.Windows.Forms.Panel panel2; private ComponentFactory.Krypton.Toolkit.KryptonDataGridView kryptonDataGridView1; private System.Windows.Forms.Button BtnImportExcel; + private System.Windows.Forms.TextBox textBox1; } } diff --git a/U8AppMain/FrmMain.cs b/U8AppMain/FrmMain.cs index 49de6a6..e4e3dda 100644 --- a/U8AppMain/FrmMain.cs +++ b/U8AppMain/FrmMain.cs @@ -53,8 +53,9 @@ namespace U8AppMain bom.Bom.Version.Version = Convert.ToInt32(row["版本号"]); bom.Bom.Version.VersionDesc = row.Field("版本说明"); bom.Bom.Parent.InvCode = row.Field("母件编码"); - bom.Bom.Version.VersionEffDate = DateTime.Parse(row.Field("版本生效日")); - bom.Bom.Version.BomType = row.Field("BOM类别"); + + bom.Bom.Version.VersionEffDate = DateTime.Parse(row["版本生效日"].ToString()); + //bom.Bom.Version.BomType ="1" row.Field("BOM类别"); bom.Bom.Parent.ParentScrap = decimal.Parse(row["母件损耗率"].ToString()); var strKey = $"{bom.Bom.Parent.InvCode}-{bom.Bom.Version.Version}"; if (bomLookup.ContainsKey(strKey)) @@ -65,17 +66,18 @@ namespace U8AppMain { bomLookup.Add(strKey, bom); } + comp.Component.OpComponentId = bom.Bom.ComponentBodies.Count; + comp.Component.EffBegDate = bom.Bom.Version.VersionEffDate; + comp.Component.InvCode = row.Field("子件编码"); comp.Component.SortSeq = row.Field("行号"); + comp.Component.OptionsId = bom.Bom.ComponentBodies.Count; comp.Component.BaseQtyN = decimal.Parse(row["基本用量分子"].ToString()); comp.Component.BaseQtyD = decimal.Parse(row["基础数量分母"].ToString()); comp.Component.CompScrap = decimal.Parse(row["子件损耗率"].ToString()); comp.ComponentOpt.WIPType = row["供应类型"].ToString(); - + comp.ComponentOpt.OptionsId = bom.Bom.ComponentBodies.Count; bom.Bom.ComponentBodies.Add(comp); - - - } @@ -88,8 +90,9 @@ namespace U8AppMain //bom.Bom.ComponentBodies.Add(new Bom.ComponentBody()); //bom.Bom.ComponentBodies.Add(new Bom.ComponentBody()); var strbody = XmlHelper.XmlSerialize(bomLookup.Values.ToList()[0], Encoding.UTF8); - var response = await HttpHelper.Post("", strbody); - MessageBox.Show(response); + //var response = await HttpHelper.Post("", strbody); + this.textBox1.Text = strbody; + MessageBox.Show(strbody); } private void BtnImportExcel_Click(object sender, EventArgs e)