Browse Source

箱号装栈板连号管控

callm 3 days ago
parent
commit
4899b24c42

+ 38 - 7
UAS_MES_HYSX/FunctionCode/Packing/Packing_PalletCollectionZX.Designer.cs

@@ -85,7 +85,10 @@
             this.PrintList1 = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.PrinterCombox();
             this.PrintList1 = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.PrinterCombox();
             this.label8 = new System.Windows.Forms.Label();
             this.label8 = new System.Windows.Forms.Label();
             this.CheckBox = new System.Windows.Forms.CheckBox();
             this.CheckBox = new System.Windows.Forms.CheckBox();
+            this.palletnum = new System.Windows.Forms.NumericUpDown();
+            this.label1 = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.PackageInf)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.PackageInf)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.palletnum)).BeginInit();
             this.SuspendLayout();
             this.SuspendLayout();
             // 
             // 
             // pa_outboxcode_label
             // pa_outboxcode_label
@@ -227,7 +230,7 @@
             // 
             // 
             this.pa_status.AutoSize = true;
             this.pa_status.AutoSize = true;
             this.pa_status.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.pa_status.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_status.Location = new System.Drawing.Point(1736, 348);
+            this.pa_status.Location = new System.Drawing.Point(1653, 348);
             this.pa_status.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pa_status.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pa_status.Name = "pa_status";
             this.pa_status.Name = "pa_status";
             this.pa_status.Size = new System.Drawing.Size(0, 41);
             this.pa_status.Size = new System.Drawing.Size(0, 41);
@@ -605,7 +608,7 @@
             // AutoPrint
             // AutoPrint
             // 
             // 
             this.AutoPrint.Checked = true;
             this.AutoPrint.Checked = true;
-            this.AutoPrint.Location = new System.Drawing.Point(1520, 283);
+            this.AutoPrint.Location = new System.Drawing.Point(1430, 296);
             this.AutoPrint.Margin = new System.Windows.Forms.Padding(6, 8, 6, 8);
             this.AutoPrint.Margin = new System.Windows.Forms.Padding(6, 8, 6, 8);
             this.AutoPrint.Name = "AutoPrint";
             this.AutoPrint.Name = "AutoPrint";
             this.AutoPrint.Size = new System.Drawing.Size(168, 44);
             this.AutoPrint.Size = new System.Drawing.Size(168, 44);
@@ -683,7 +686,7 @@
             this.PrintNum1.AllPower = null;
             this.PrintNum1.AllPower = null;
             this.PrintNum1.BackColor = System.Drawing.Color.White;
             this.PrintNum1.BackColor = System.Drawing.Color.White;
             this.PrintNum1.ID = null;
             this.PrintNum1.ID = null;
-            this.PrintNum1.Location = new System.Drawing.Point(1799, 357);
+            this.PrintNum1.Location = new System.Drawing.Point(1887, 367);
             this.PrintNum1.Margin = new System.Windows.Forms.Padding(6);
             this.PrintNum1.Margin = new System.Windows.Forms.Padding(6);
             this.PrintNum1.Name = "PrintNum1";
             this.PrintNum1.Name = "PrintNum1";
             this.PrintNum1.Negative = false;
             this.PrintNum1.Negative = false;
@@ -699,7 +702,7 @@
             // 
             // 
             this.label3.AutoSize = true;
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(1694, 354);
+            this.label3.Location = new System.Drawing.Point(1787, 360);
             this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label3.Name = "label3";
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(82, 41);
             this.label3.Size = new System.Drawing.Size(82, 41);
@@ -713,7 +716,7 @@
             this.PrintSecond.CheckState = System.Windows.Forms.CheckState.Checked;
             this.PrintSecond.CheckState = System.Windows.Forms.CheckState.Checked;
             this.PrintSecond.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.PrintSecond.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.PrintSecond.ForeColor = System.Drawing.Color.Red;
             this.PrintSecond.ForeColor = System.Drawing.Color.Red;
-            this.PrintSecond.Location = new System.Drawing.Point(1520, 359);
+            this.PrintSecond.Location = new System.Drawing.Point(1434, 367);
             this.PrintSecond.Margin = new System.Windows.Forms.Padding(6);
             this.PrintSecond.Margin = new System.Windows.Forms.Padding(6);
             this.PrintSecond.Name = "PrintSecond";
             this.PrintSecond.Name = "PrintSecond";
             this.PrintSecond.Size = new System.Drawing.Size(162, 28);
             this.PrintSecond.Size = new System.Drawing.Size(162, 28);
@@ -770,7 +773,7 @@
             this.CheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CheckBox.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.CheckBox.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.CheckBox.ForeColor = System.Drawing.Color.Red;
             this.CheckBox.ForeColor = System.Drawing.Color.Red;
-            this.CheckBox.Location = new System.Drawing.Point(1701, 299);
+            this.CheckBox.Location = new System.Drawing.Point(1624, 367);
             this.CheckBox.Margin = new System.Windows.Forms.Padding(6);
             this.CheckBox.Margin = new System.Windows.Forms.Padding(6);
             this.CheckBox.Name = "CheckBox";
             this.CheckBox.Name = "CheckBox";
             this.CheckBox.Size = new System.Drawing.Size(138, 28);
             this.CheckBox.Size = new System.Drawing.Size(138, 28);
@@ -778,11 +781,36 @@
             this.CheckBox.Text = "连号检查";
             this.CheckBox.Text = "连号检查";
             this.CheckBox.UseVisualStyleBackColor = true;
             this.CheckBox.UseVisualStyleBackColor = true;
             // 
             // 
+            // palletnum
+            // 
+            this.palletnum.Location = new System.Drawing.Point(1731, 305);
+            this.palletnum.Maximum = new decimal(new int[] {
+            10000,
+            0,
+            0,
+            0});
+            this.palletnum.Name = "palletnum";
+            this.palletnum.Size = new System.Drawing.Size(120, 35);
+            this.palletnum.TabIndex = 222;
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label1.Location = new System.Drawing.Point(1617, 299);
+            this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(114, 41);
+            this.label1.TabIndex = 223;
+            this.label1.Text = "栈板号";
+            // 
             // Packing_PalletCollectionZX
             // Packing_PalletCollectionZX
             // 
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1994, 1104);
             this.ClientSize = new System.Drawing.Size(1994, 1104);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.palletnum);
             this.Controls.Add(this.CheckBox);
             this.Controls.Add(this.CheckBox);
             this.Controls.Add(this.PrintNum1);
             this.Controls.Add(this.PrintNum1);
             this.Controls.Add(this.label3);
             this.Controls.Add(this.label3);
@@ -841,7 +869,8 @@
             this.Load += new System.EventHandler(this.Make_PalletCollection_Load);
             this.Load += new System.EventHandler(this.Make_PalletCollection_Load);
             this.SizeChanged += new System.EventHandler(this.Make_PalletCollection_SizeChanged);
             this.SizeChanged += new System.EventHandler(this.Make_PalletCollection_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.PackageInf)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.PackageInf)).EndInit();
-            this.ResumeLayout(true);
+            ((System.ComponentModel.ISupportInitialize)(this.palletnum)).EndInit();
+            this.ResumeLayout(false);
             this.PerformLayout();
             this.PerformLayout();
 
 
         }
         }
@@ -902,5 +931,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn Column4;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column4;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
         private System.Windows.Forms.CheckBox CheckBox;
         private System.Windows.Forms.CheckBox CheckBox;
+        private System.Windows.Forms.NumericUpDown palletnum;
+        private System.Windows.Forms.Label label1;
     }
     }
 }
 }

+ 15 - 18
UAS_MES_HYSX/FunctionCode/Packing/Packing_PalletCollectionZX.cs

@@ -1,4 +1,5 @@
-using LabelManager2;
+using DevExpress.Printing.Core.PdfExport.Metafile;
+using LabelManager2;
 using Seagull.BarTender.Print;
 using Seagull.BarTender.Print;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
@@ -415,7 +416,8 @@ namespace UAS_MES_NEW.Packing
             {
             {
                 _dt = (DataTable)dh.ExecuteSql("select la_id,la_url,la_isdefault,replace(LA_SOFTTYPE,';',',')LA_SOFTTYPE from label where la_prodcode is null and la_templatetype='栈板标' and la_statuscode='AUDITED' order by la_isdefault", "select");
                 _dt = (DataTable)dh.ExecuteSql("select la_id,la_url,la_isdefault,replace(LA_SOFTTYPE,';',',')LA_SOFTTYPE from label where la_prodcode is null and la_templatetype='栈板标' and la_statuscode='AUDITED' order by la_isdefault", "select");
             }
             }
-            if (PrintLabel.DataSource == null) {
+            if (PrintLabel.DataSource == null)
+            {
                 if (_dt.Rows.Count > 0)
                 if (_dt.Rows.Count > 0)
                 {
                 {
                     string la_id = _dt.Rows[0]["la_id"].ToString();
                     string la_id = _dt.Rows[0]["la_id"].ToString();
@@ -499,30 +501,25 @@ namespace UAS_MES_NEW.Packing
         }
         }
         private bool CheckBoxNum()
         private bool CheckBoxNum()
         {
         {
-            string maxbox = dh.getFieldDataByCondition("packagedetail left join package on PD_INNERBOXCODE=pa_outboxcode left join source on sc_code=pa_sccode", "max(pa_zxcode)", "pd_makecode='" + pa_makecode.Text + "' and sc_linecode='" + User.UserLineCode + "'").ToString();
-            //已经装箱的最大箱号
-            int maxnum = 0;
-            //当前装箱的箱号流水
-            int currentnum = 0;
-            if (maxbox != "")
+            decimal maxnum = palletnum.Value;
+            if (pa_standardqty.Text == "")
             {
             {
-                maxnum = int.Parse(maxbox.Substring(maxbox.Length - 4));
+                BaseUtil.ShowError("请输入栈板容量");
             }
             }
-            string currentbox = dh.getFieldDataByCondition("package left join source on sc_code=pa_sccode", "(pa_zxcode)", "pa_outboxcode='" + outboxcode.Text + "' and pa_makecode='"+pa_makecode.Text+"' and sc_linecode='" + User.UserLineCode + "'").ToString();
+            int standardqty = int.Parse(pa_standardqty.Text);
+            //当前装箱的箱号流水
+            int currentnum = 0;
+            string currentbox = dh.getFieldDataByCondition("package left join source on sc_code=pa_sccode", "(pa_zxcode)", "pa_outboxcode='" + outboxcode.Text + "' and pa_makecode='" + pa_makecode.Text + "'").ToString();
+            int pr_outboxinnerqty = int.Parse(dh.getFieldDataByCondition("make left join product on ma_prodcode=pr_code", "nvl(pr_outboxinnerqty,0)", "ma_code='" + pa_makecode.Text + "'").ToString());
             if (currentbox != "")
             if (currentbox != "")
             {
             {
                 currentnum = int.Parse(currentbox.Substring(currentbox.Length - 4));
                 currentnum = int.Parse(currentbox.Substring(currentbox.Length - 4));
             }
             }
-            //如果和前面的箱号连续
-            if ((maxnum + 1) == currentnum)
-            {
-                return true;
-            }
-            //如果是换线的话,比如从2001开始的流水
-            if (maxnum == 0 && currentnum > 1)
+            if (maxnum * (standardqty / pr_outboxinnerqty) < currentnum && currentnum <= (maxnum + 1) * (standardqty / pr_outboxinnerqty))
             {
             {
                 return true;
                 return true;
             }
             }
+            OperateResult.AppendText("栈板流水" + maxnum + "装箱号范围" + (maxnum * (standardqty / pr_outboxinnerqty) + 1) + " " + (maxnum + 1) * (standardqty / pr_outboxinnerqty));
             //outboxcode.Text
             //outboxcode.Text
             return false;
             return false;
         }
         }
@@ -584,6 +581,7 @@ namespace UAS_MES_NEW.Packing
         {
         {
             if (pa_outboxcode.Text != "")
             if (pa_outboxcode.Text != "")
             {
             {
+                HttpServer.GetPalletInfo(pa_outboxcode.Text);
                 sql.Clear();
                 sql.Clear();
                 sql.Append("select nvl(pa_status,0) pa_status from packagedetail left join package ");
                 sql.Append("select nvl(pa_status,0) pa_status from packagedetail left join package ");
                 sql.Append("on pa_id=pd_paid where pd_outboxcode='" + pa_outboxcode.Text + "'");
                 sql.Append("on pa_id=pd_paid where pd_outboxcode='" + pa_outboxcode.Text + "'");
@@ -595,7 +593,6 @@ namespace UAS_MES_NEW.Packing
                         string Seal = MessageBox.Show(this.ParentForm, "是否确认封栈板?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
                         string Seal = MessageBox.Show(this.ParentForm, "是否确认封栈板?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
                         if (Seal == "Yes")
                         if (Seal == "Yes")
                         {
                         {
-                            HttpServer.GetPalletInfo(pa_outboxcode.Text);
                             OperateResult.AppendText(">>栈板号" + pa_outboxcode.Text + "装栈板成功\n", Color.Green);
                             OperateResult.AppendText(">>栈板号" + pa_outboxcode.Text + "装栈板成功\n", Color.Green);
                             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "栈板采集", "封栈板" + pa_outboxcode.Text + "成功", outboxcode.Text, "");
                             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "栈板采集", "封栈板" + pa_outboxcode.Text + "成功", outboxcode.Text, "");
                             dh.ExecuteSql("update package set pa_status=1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
                             dh.ExecuteSql("update package set pa_status=1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");

+ 0 - 18
UAS_MES_HYSX/FunctionCode/Packing/Packing_PalletCollectionZX.resx

@@ -791,22 +791,4 @@
   <metadata name="Column5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   <metadata name="Column5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
     <value>True</value>
   </metadata>
   </metadata>
-  <metadata name="pd_outboxcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pazxcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pd_innerqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="Column4.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="Column5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
 </root>
 </root>