Browse Source

栈板拆解功能

章政 8 years ago
parent
commit
95a9f6ab3b

+ 71 - 3
UAS-MES/FunctionCode/Special/Special_BoxSplit.Designer.cs

@@ -28,19 +28,87 @@
         /// </summary>
         private void InitializeComponent()
         {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Special_BoxSplit));
+            this.Split = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.Pallet_label = new System.Windows.Forms.Label();
+            this.Pallate = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.OperatResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.SuspendLayout();
             // 
-            // 拆箱处理
+            // Split
+            // 
+            this.Split.AllPower = null;
+            this.Split.BackColor = System.Drawing.Color.Transparent;
+            this.Split.DownImage = ((System.Drawing.Image)(resources.GetObject("Split.DownImage")));
+            this.Split.Image = null;
+            this.Split.IsShowBorder = true;
+            this.Split.Location = new System.Drawing.Point(356, 166);
+            this.Split.MoveImage = ((System.Drawing.Image)(resources.GetObject("Split.MoveImage")));
+            this.Split.Name = "Split";
+            this.Split.NormalImage = ((System.Drawing.Image)(resources.GetObject("Split.NormalImage")));
+            this.Split.Power = null;
+            this.Split.Size = new System.Drawing.Size(75, 28);
+            this.Split.TabIndex = 0;
+            this.Split.Text = "拆解";
+            this.Split.UseVisualStyleBackColor = false;
+            this.Split.Click += new System.EventHandler(this.Split_Click);
+            // 
+            // Pallet_label
+            // 
+            this.Pallet_label.AutoSize = true;
+            this.Pallet_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Pallet_label.Location = new System.Drawing.Point(24, 164);
+            this.Pallet_label.Name = "Pallet_label";
+            this.Pallet_label.Size = new System.Drawing.Size(72, 27);
+            this.Pallet_label.TabIndex = 1;
+            this.Pallet_label.Text = "栈板号";
+            // 
+            // Pallate
+            // 
+            this.Pallate.AllPower = null;
+            this.Pallate.BackColor = System.Drawing.Color.White;
+            this.Pallate.ID = null;
+            this.Pallate.Location = new System.Drawing.Point(121, 166);
+            this.Pallate.Name = "Pallate";
+            this.Pallate.Power = null;
+            this.Pallate.Size = new System.Drawing.Size(196, 25);
+            this.Pallate.Str = null;
+            this.Pallate.Str1 = null;
+            this.Pallate.Str2 = null;
+            this.Pallate.TabIndex = 2;
+            // 
+            // OperatResult
+            // 
+            this.OperatResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.OperatResult.Location = new System.Drawing.Point(490, 75);
+            this.OperatResult.Name = "OperatResult";
+            this.OperatResult.Size = new System.Drawing.Size(270, 386);
+            this.OperatResult.TabIndex = 3;
+            this.OperatResult.Text = "";
+            // 
+            // Special_BoxSplit
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1324, 679);
-            this.Name = "拆箱处理";
+            this.ClientSize = new System.Drawing.Size(922, 659);
+            this.Controls.Add(this.OperatResult);
+            this.Controls.Add(this.Pallate);
+            this.Controls.Add(this.Pallet_label);
+            this.Controls.Add(this.Split);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Name = "Special_BoxSplit";
             this.Text = "拆箱处理";
+            this.Load += new System.EventHandler(this.Special_BoxSplit_Load);
             this.ResumeLayout(false);
+            this.PerformLayout();
 
         }
 
         #endregion
+
+        private CustomControl.ButtonUtil.NormalButton Split;
+        private System.Windows.Forms.Label Pallet_label;
+        private CustomControl.TextBoxWithIcon.EnterTextBox Pallate;
+        private CustomControl.RichText.RichTextAutoBottom OperatResult;
     }
 }

+ 72 - 1
UAS-MES/FunctionCode/Special/Special_BoxSplit.cs

@@ -6,14 +6,85 @@ using System.Drawing;
 using System.Linq;
 using System.Text;
 using System.Windows.Forms;
+using UAS_MES.DataOperate;
+using UAS_MES.PublicMethod;
 
 namespace UAS_MES.Special
 {
     public partial class Special_BoxSplit : Form
     {
+        DataHelper dh;
+
+        LogStringBuilder sql = new LogStringBuilder();
+
         public Special_BoxSplit()
         {
             InitializeComponent();
         }
+
+        private void Special_BoxSplit_Load(object sender, EventArgs e)
+        {
+            dh = new DataHelper();
+        }
+
+        private void Split_Click(object sender, EventArgs e)
+        {
+            if (dh.CheckExist("package", "pa_outboxcode='" + Pallate.Text + "' and pa_type=3"))
+            {
+                sql.Clear();
+                sql.Append("select distinct ms_outboxcode from makeserial left join mes_package_view on v_makecode=ms_makecode and  ");
+                sql.Append("ms_sncode=v_barcode where v_outboxcode='" + Pallate.Text + "' and ms_outboxcode is not null");
+                //获取所有的卡通箱号
+                DataTable dt1 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                if (dt1.Rows.Count > 0)
+                {
+                    //获取卡通箱的外层箱号
+                    sql.Clear();
+                    sql.Append("select distinct pa_mothercode from package where pa_outboxcode in(select distinct ms_outboxcode ");
+                    sql.Append("from makeserial left join mes_package_view on v_makecode = ms_makecode and ms_sncode = v_barcode where ");
+                    sql.Append("v_outboxcode='" + Pallate.Text + "') and pa_mothercode is not null");
+                    DataTable  dt2 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                    if (dt2.Rows.Count > 0)
+                    {
+                        //获取外层箱号的外箱号
+                        sql.Clear();
+                        sql.Append("select pa_mothercode from package where pa_outboxcode in(");
+                        sql.Append("select distinct pa_mothercode from package where pa_outboxcode in(select distinct ms_outboxcode ");
+                        sql.Append("from makeserial left join mes_package_view on v_makecode = ms_makecode and ms_sncode = v_barcode where ");
+                        sql.Append("v_outboxcode='" + Pallate.Text + "')) and pa_mothercode is not null");
+                        DataTable dt3 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                        if (dt3.Rows.Count > 0)
+                        {
+                            //删除最外层的箱号
+                            List<string> outboxcode2 = new List<string>();
+                            for (int i = 0; i < dt3.Rows.Count; i++)
+                            {
+                                outboxcode2.Add(dt3.Rows[i]["pa_mothercode"].ToString());
+                            }
+                            dh.BatchInsert("delete from packagedetail where pd_outboxcode=:outboxcode2", new string[] { "outboxcode2" }, outboxcode2.ToArray());
+                            dh.BatchInsert("delete from package where pa_outboxcode=:outboxcode2", new string[] { "outboxcode2" }, outboxcode2.ToArray());
+                        }
+                        //删除内一层箱号
+                        List<string> outboxcode1 = new List<string>();
+                        for (int i = 0; i < dt2.Rows.Count; i++)
+                        {
+                            outboxcode1.Add(dt2.Rows[i]["pa_mothercode"].ToString());
+                        }
+                        dh.BatchInsert("delete from packagedetail where pd_outboxcode=:outboxcode1", new string[] { "outboxcode1" }, outboxcode1.ToArray());
+                        dh.BatchInsert("delete from package where pa_outboxcode=:outboxcode1", new string[] { "outboxcode1" }, outboxcode1.ToArray());
+                    }
+                    //删除卡通箱号
+                    List<string> outboxcode = new List<string>();
+                    for (int i = 0; i < dt1.Rows.Count; i++)
+                    {
+                        outboxcode.Add(dt1.Rows[i]["ms_outboxcode"].ToString());
+                    }
+                    dh.BatchInsert("delete from packagedetail where pd_outboxcode=:outboxcode", new string[] { "outboxcode" }, outboxcode.ToArray());
+                    dh.BatchInsert("delete from package where pa_outboxcode=:outboxcode", new string[] { "outboxcode" }, outboxcode.ToArray());
+                }
+                OperatResult.AppendText(">>栈板" + Pallate.Text + "拆解成功\n", Color.Green, Pallate);
+            }
+            else OperatResult.AppendText(">>栈板号" + Pallate.Text + "不存在\n", Color.Red, Pallate);
+        }
     }
-}
+}

+ 39 - 0
UAS-MES/FunctionCode/Special/Special_BoxSplit.resx

@@ -117,4 +117,43 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="Split.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
+        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
+        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
+        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
+        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
+        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
+        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="Split.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
+        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
+        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
+        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
+        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
+        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
+        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
+        gg==
+</value>
+  </data>
+  <data name="Split.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
+        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
+        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
+        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
+        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
+        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
+        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
+        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
 </root>