Browse Source

优化卡通箱核对逻辑

callm 14 hours ago
parent
commit
a8906caab7

+ 2 - 25
UAS_MES_YDCY/FunctionCode/Make/Make_OutBoxSnCheck.Designer.cs

@@ -37,10 +37,8 @@
             this.pa_outboxcode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.pa_outboxcode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.label1 = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
             this.pd_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pd_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_fugelcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_colorcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_colorcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pd_checksn = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pd_checksn = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_checksn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.CheckSnDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.CheckSnDGV)).BeginInit();
             this.SuspendLayout();
             this.SuspendLayout();
             // 
             // 
@@ -105,10 +103,8 @@
             this.CheckSnDGV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.CheckSnDGV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.CheckSnDGV.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.CheckSnDGV.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.pd_barcode,
             this.pd_barcode,
-            this.pr_fugelcode,
             this.pr_colorcode,
             this.pr_colorcode,
-            this.pd_checksn,
-            this.pd_checksn1});
+            this.pd_checksn});
             this.CheckSnDGV.Location = new System.Drawing.Point(72, 137);
             this.CheckSnDGV.Location = new System.Drawing.Point(72, 137);
             this.CheckSnDGV.Name = "CheckSnDGV";
             this.CheckSnDGV.Name = "CheckSnDGV";
             this.CheckSnDGV.RowHeadersWidth = 82;
             this.CheckSnDGV.RowHeadersWidth = 82;
@@ -153,15 +149,6 @@
             this.pd_barcode.Name = "pd_barcode";
             this.pd_barcode.Name = "pd_barcode";
             this.pd_barcode.Width = 175;
             this.pd_barcode.Width = 175;
             // 
             // 
-            // pr_fugelcode
-            // 
-            this.pr_fugelcode.DataPropertyName = "pr_fugelcode";
-            this.pr_fugelcode.HeaderText = "pr_fugelcode";
-            this.pr_fugelcode.MinimumWidth = 10;
-            this.pr_fugelcode.Name = "pr_fugelcode";
-            this.pr_fugelcode.Visible = false;
-            this.pr_fugelcode.Width = 200;
-            // 
             // pr_colorcode
             // pr_colorcode
             // 
             // 
             this.pr_colorcode.DataPropertyName = "pr_colorcode";
             this.pr_colorcode.DataPropertyName = "pr_colorcode";
@@ -180,14 +167,6 @@
             this.pd_checksn.Name = "pd_checksn";
             this.pd_checksn.Name = "pd_checksn";
             this.pd_checksn.Width = 127;
             this.pd_checksn.Width = 127;
             // 
             // 
-            // pd_checksn1
-            // 
-            this.pd_checksn1.DataPropertyName = "pd_checksn1";
-            this.pd_checksn1.HeaderText = "机身SN";
-            this.pd_checksn1.MinimumWidth = 10;
-            this.pd_checksn1.Name = "pd_checksn1";
-            this.pd_checksn1.Width = 200;
-            // 
             // Make_OutBoxSnCheck
             // Make_OutBoxSnCheck
             // 
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
@@ -208,7 +187,7 @@
             this.Load += new System.EventHandler(this.Make_LabelCheck_Load);
             this.Load += new System.EventHandler(this.Make_LabelCheck_Load);
             this.SizeChanged += new System.EventHandler(this.Make_LabelCheck_SizeChanged);
             this.SizeChanged += new System.EventHandler(this.Make_LabelCheck_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.CheckSnDGV)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.CheckSnDGV)).EndInit();
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
             this.PerformLayout();
 
 
         }
         }
@@ -222,9 +201,7 @@
         private CustomControl.TextBoxWithIcon.SnCollectionBox pa_outboxcode;
         private CustomControl.TextBoxWithIcon.SnCollectionBox pa_outboxcode;
         private System.Windows.Forms.Label label1;
         private System.Windows.Forms.Label label1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_barcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_barcode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pr_fugelcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_colorcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_colorcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_checksn;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_checksn;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pd_checksn1;
     }
     }
 }
 }

+ 20 - 38
UAS_MES_YDCY/FunctionCode/Make/Make_OutBoxSnCheck.cs

@@ -40,13 +40,14 @@ namespace UAS_MES_NEW.Make
             asc.controlAutoSize(this);
             asc.controlAutoSize(this);
         }
         }
         bool FindColorSN = false;
         bool FindColorSN = false;
-        bool FindFugeSN = false;
         int RowIndex = 0;
         int RowIndex = 0;
+        string ms_makecode = "";
         private void sncode_KeyDown(object sender, KeyEventArgs e)
         private void sncode_KeyDown(object sender, KeyEventArgs e)
         {
         {
             //判断是enter事件
             //判断是enter事件
             if (e.KeyCode == Keys.Enter)
             if (e.KeyCode == Keys.Enter)
             {
             {
+                string ErrorMessage = "";
                 if (sncode.Text == "")
                 if (sncode.Text == "")
                 {
                 {
                     OperateResult.AppendText("<<输入不能为空\n", Color.Red);
                     OperateResult.AppendText("<<输入不能为空\n", Color.Red);
@@ -54,58 +55,38 @@ namespace UAS_MES_NEW.Make
                 }
                 }
 
 
                 bool AllCheck = true;
                 bool AllCheck = true;
-                if (FindColorSN)
-                {
-                    object fugelcode = CheckSnDGV.Rows[RowIndex].Cells["pr_fugelcode"].Value;
-                    if ((fugelcode != null ? fugelcode.ToString() : "") + CheckSnDGV.Rows[RowIndex].Cells["pd_barcode"].Value.ToString() == sncode.Text)
-                    {
-                        CheckSnDGV.Rows[RowIndex].Cells["pd_checksn1"].Value = sncode.Text;
-                        FindFugeSN = true;
-                    }
-                    else
-                    {
-                        OperateResult.AppendText("<<" + sncode.Text + "机身校验失败\n", Color.Red, sncode);
-                        return;
-                    }
-                }
                 for (int i = 0; i < CheckSnDGV.Rows.Count; i++)
                 for (int i = 0; i < CheckSnDGV.Rows.Count; i++)
                 {
                 {
-                    if (!FindColorSN)
+                    object colorcode = CheckSnDGV.Rows[RowIndex].Cells["pr_colorcode"].Value;
+                    if ((colorcode != null ? colorcode.ToString() : "") + CheckSnDGV.Rows[i].Cells["pd_barcode"].Value.ToString() == sncode.Text)
                     {
                     {
-                        object colorcode = CheckSnDGV.Rows[RowIndex].Cells["pr_colorcode"].Value;
-                        Console.WriteLine(CheckSnDGV.Rows[i].Cells["pd_barcode"].Value.ToString() + (colorcode != null ? colorcode.ToString() : ""));
-                        if ((colorcode != null ? colorcode.ToString() : "") + CheckSnDGV.Rows[i].Cells["pd_barcode"].Value.ToString() == sncode.Text)
-                        {
-                            CheckSnDGV.Rows[i].Cells["pd_checksn"].Value = sncode.Text;
-                            RowIndex = i;
-                            FindColorSN = true;
-                        }
-
+                        CheckSnDGV.Rows[i].Cells["pd_checksn"].Value = sncode.Text;
+                        RowIndex = i;
+                        FindColorSN = true;
                     }
                     }
-                    if (CheckSnDGV.Rows[i].Cells["pd_checksn"].Value == null || CheckSnDGV.Rows[i].Cells["pd_checksn1"].Value == null)
+                    if (CheckSnDGV.Rows[i].Cells["pd_checksn"].Value == null)
                     {
                     {
                         AllCheck = false;
                         AllCheck = false;
                     }
                     }
                 }
                 }
-                if (!FindColorSN && !FindFugeSN)
-                {
-                    OperateResult.AppendText("<<" + sncode.Text + "校验失败\n", Color.Red, sncode);
-                }
-                if (FindColorSN && !FindFugeSN)
+                if (FindColorSN)
                 {
                 {
                     OperateResult.AppendText("<<" + sncode.Text + "彩盒校验成功\n", Color.Green, sncode);
                     OperateResult.AppendText("<<" + sncode.Text + "彩盒校验成功\n", Color.Green, sncode);
                 }
                 }
-                if (FindFugeSN)
-                {
-                    FindColorSN = false;
-                    FindFugeSN = false;
-                    OperateResult.AppendText("<<" + sncode.Text + "机身校验成功\n", Color.Green, sncode);
-                }
                 if (AllCheck)
                 if (AllCheck)
                 {
                 {
                     SetCheck set = new SetCheck("OK", Color.Green);
                     SetCheck set = new SetCheck("OK", Color.Green);
                     BaseUtil.SetFormCenter(set);
                     BaseUtil.SetFormCenter(set);
                     set.ShowDialog();
                     set.ShowDialog();
+                    if (LogicHandler.OutBoxStepPass(pa_outboxcode.Text, ms_makecode, User.UserSourceCode, User.UserCode, "卡通箱:" + pa_outboxcode.Text + "整箱过站", "卡通箱整箱过站", out ErrorMessage))
+                    {
+                        dh.UpdateByCondition("package", "pa_nextstep='" + dh.getFieldDataByCondition("packagedetail left join makeserial on ms_sncode=pd_barcode and ms_makecode=pd_makecode", "max(ms_nextstepcode)", "pd_outboxcode='" + pa_outboxcode.Text + "'").ToString() + "', PA_CURRENTSTEP = '' ", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                        OperateResult.AppendText("<<" + pa_outboxcode.Text + "整箱校验通过\n", Color.Green, pa_outboxcode);
+                    }
+                    else
+                    {
+                        OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                    }
                     pa_outboxcode.Focus();
                     pa_outboxcode.Focus();
                 }
                 }
             }
             }
@@ -115,9 +96,10 @@ namespace UAS_MES_NEW.Make
         {
         {
             if (e.KeyCode == Keys.Enter)
             if (e.KeyCode == Keys.Enter)
             {
             {
-                dt = (DataTable)dh.ExecuteSql("select pd_barcode,PR_COLORCODE, PR_FUGELCODE from packagedetail left join product on pr_code=PD_PRODCODE where pd_outboxcode='" + pa_outboxcode.Text + "'", "select");
+                dt = (DataTable)dh.ExecuteSql("select pd_barcode,PR_COLORCODE,pd_makecode from packagedetail left join product on pr_code=PD_PRODCODE where pd_outboxcode='" + pa_outboxcode.Text + "'", "select");
                 if (dt.Rows.Count > 0)
                 if (dt.Rows.Count > 0)
                 {
                 {
+                    ms_makecode = dt.Rows[0]["pd_makecode"].ToString();
                     BaseUtil.FillDgvWithDataTable(CheckSnDGV, dt);
                     BaseUtil.FillDgvWithDataTable(CheckSnDGV, dt);
                     sncode.Focus();
                     sncode.Focus();
                 }
                 }

+ 0 - 6
UAS_MES_YDCY/FunctionCode/Make/Make_OutBoxSnCheck.resx

@@ -159,16 +159,10 @@
   <metadata name="pd_barcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   <metadata name="pd_barcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
     <value>True</value>
   </metadata>
   </metadata>
-  <metadata name="pr_fugelcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <metadata name="pr_colorcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   <metadata name="pr_colorcode.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_checksn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   <metadata name="pd_checksn.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_checksn1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
 </root>
 </root>