Jelajahi Sumber

修改绑定工单的

callm 1 hari lalu
induk
melakukan
64df86f0a2

+ 38 - 5
UAS_MES_ZT/FunctionCode/Special/Special_ReSNBD.Designer.cs

@@ -38,6 +38,8 @@
             this.Lock = new UAS_MES_NEW.CustomControl.CustomCheckBox.LockCheckBox();
             this.Lock = new UAS_MES_NEW.CustomControl.CustomCheckBox.LockCheckBox();
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
             this.ma_code_label = new System.Windows.Forms.Label();
             this.ma_code_label = new System.Windows.Forms.Label();
+            this.ms_prodcode_label = new System.Windows.Forms.Label();
+            this.ma_prodcode = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).BeginInit();
             this.SuspendLayout();
             this.SuspendLayout();
             // 
             // 
@@ -45,7 +47,7 @@
             // 
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.OperateResult.Location = new System.Drawing.Point(16, 108);
             this.OperateResult.Location = new System.Drawing.Point(16, 108);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
             this.OperateResult.Name = "OperateResult";
             this.OperateResult.Name = "OperateResult";
             this.OperateResult.Size = new System.Drawing.Size(1351, 467);
             this.OperateResult.Size = new System.Drawing.Size(1351, 467);
             this.OperateResult.TabIndex = 3;
             this.OperateResult.TabIndex = 3;
@@ -71,7 +73,7 @@
             this.ClearSn_code.Cursor = System.Windows.Forms.Cursors.Hand;
             this.ClearSn_code.Cursor = System.Windows.Forms.Cursors.Hand;
             this.ClearSn_code.Image = global::UAS_MES_NEW.Properties.Resources.bindingNavigatorDeleteItem_Image;
             this.ClearSn_code.Image = global::UAS_MES_NEW.Properties.Resources.bindingNavigatorDeleteItem_Image;
             this.ClearSn_code.Location = new System.Drawing.Point(543, 660);
             this.ClearSn_code.Location = new System.Drawing.Point(543, 660);
-            this.ClearSn_code.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.ClearSn_code.Margin = new System.Windows.Forms.Padding(5);
             this.ClearSn_code.Name = "ClearSn_code";
             this.ClearSn_code.Name = "ClearSn_code";
             this.ClearSn_code.Size = new System.Drawing.Size(32, 32);
             this.ClearSn_code.Size = new System.Drawing.Size(32, 32);
             this.ClearSn_code.TabIndex = 151;
             this.ClearSn_code.TabIndex = 151;
@@ -86,7 +88,7 @@
             this.show_sncode.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.show_sncode.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.show_sncode.ID = null;
             this.show_sncode.ID = null;
             this.show_sncode.Location = new System.Drawing.Point(177, 655);
             this.show_sncode.Location = new System.Drawing.Point(177, 655);
-            this.show_sncode.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.show_sncode.Margin = new System.Windows.Forms.Padding(5);
             this.show_sncode.Name = "show_sncode";
             this.show_sncode.Name = "show_sncode";
             this.show_sncode.Power = null;
             this.show_sncode.Power = null;
             this.show_sncode.Size = new System.Drawing.Size(316, 43);
             this.show_sncode.Size = new System.Drawing.Size(316, 43);
@@ -113,7 +115,7 @@
             this.sncode.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.sncode.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.sncode.ID = null;
             this.sncode.ID = null;
             this.sncode.Location = new System.Drawing.Point(177, 721);
             this.sncode.Location = new System.Drawing.Point(177, 721);
-            this.sncode.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.sncode.Margin = new System.Windows.Forms.Padding(5);
             this.sncode.Name = "sncode";
             this.sncode.Name = "sncode";
             this.sncode.Power = "ifread";
             this.sncode.Power = "ifread";
             this.sncode.Size = new System.Drawing.Size(316, 43);
             this.sncode.Size = new System.Drawing.Size(316, 43);
@@ -179,11 +181,40 @@
             this.ma_code_label.TabIndex = 183;
             this.ma_code_label.TabIndex = 183;
             this.ma_code_label.Text = "归属工单";
             this.ma_code_label.Text = "归属工单";
             // 
             // 
+            // ms_prodcode_label
+            // 
+            this.ms_prodcode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.ms_prodcode_label.AutoSize = true;
+            this.ms_prodcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_prodcode_label.Location = new System.Drawing.Point(627, 33);
+            this.ms_prodcode_label.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+            this.ms_prodcode_label.Name = "ms_prodcode_label";
+            this.ms_prodcode_label.Size = new System.Drawing.Size(146, 41);
+            this.ms_prodcode_label.TabIndex = 187;
+            this.ms_prodcode_label.Text = "产品编号";
+            // 
+            // ma_prodcode
+            // 
+            this.ma_prodcode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.ma_prodcode.AutoSize = true;
+            this.ma_prodcode.CutLength = null;
+            this.ma_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_prodcode.Location = new System.Drawing.Point(819, 33);
+            this.ma_prodcode.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+            this.ma_prodcode.MaximumSize = new System.Drawing.Size(300, 0);
+            this.ma_prodcode.Name = "ma_prodcode";
+            this.ma_prodcode.Size = new System.Drawing.Size(0, 41);
+            this.ma_prodcode.TabIndex = 186;
+            // 
             // Special_ReSNBD
             // Special_ReSNBD
             // 
             // 
             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(1384, 803);
             this.ClientSize = new System.Drawing.Size(1384, 803);
+            this.Controls.Add(this.ms_prodcode_label);
+            this.Controls.Add(this.ma_prodcode);
             this.Controls.Add(this.Lock);
             this.Controls.Add(this.Lock);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.ma_code_label);
             this.Controls.Add(this.ma_code_label);
@@ -195,7 +226,7 @@
             this.Controls.Add(this.sncode_label);
             this.Controls.Add(this.sncode_label);
             this.Controls.Add(this.OperateResult);
             this.Controls.Add(this.OperateResult);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "Special_ReSNBD";
             this.Name = "Special_ReSNBD";
             this.Tag = "Special!ReSNBD";
             this.Tag = "Special!ReSNBD";
             this.Text = "返修SN采集";
             this.Text = "返修SN采集";
@@ -218,5 +249,7 @@
         private CustomControl.CustomCheckBox.LockCheckBox Lock;
         private CustomControl.CustomCheckBox.LockCheckBox Lock;
         private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
         private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
         private System.Windows.Forms.Label ma_code_label;
         private System.Windows.Forms.Label ma_code_label;
+        private System.Windows.Forms.Label ms_prodcode_label;
+        private CustomControl.ValueLabel.ValueLabel ma_prodcode;
     }
     }
 }
 }

+ 12 - 10
UAS_MES_ZT/FunctionCode/Special/Special_ReSNBD.cs

@@ -141,8 +141,9 @@ namespace UAS_MES_NEW.Special
                             OperateResult.AppendText(">>不允许自己转自己\n", Color.Red, sncode);
                             OperateResult.AppendText(">>不允许自己转自己\n", Color.Red, sncode);
                             return;
                             return;
                         }
                         }
-                        Boolean CheckPass = false;
-                        DataTable dt = (DataTable)dh.ExecuteSql(" select max(psr_prefix)psr_prefix,max(PSR_LENGTH)PSR_LENGTH  from productsnrule where psr_prodcode=v_maprodcode  and psr_type='after'", "select");
+                        Boolean CheckPass = true;
+                        DataTable dt = (DataTable)dh.ExecuteSql(" select max(psr_prefix)psr_prefix,max(PSR_LENGTH)PSR_LENGTH  from productsnrule where psr_prodcode='" + ma_prodcode.Text + "'  and psr_type='after'", "select");
+                        string Err = "";
                         if (dt.Rows.Count > 0)
                         if (dt.Rows.Count > 0)
                         {
                         {
                             string psr_prefix = dt.Rows[0]["psr_prefix"].ToString();
                             string psr_prefix = dt.Rows[0]["psr_prefix"].ToString();
@@ -150,17 +151,13 @@ namespace UAS_MES_NEW.Special
 
 
                             if (!sncode.Text.StartsWith(psr_prefix))
                             if (!sncode.Text.StartsWith(psr_prefix))
                             {
                             {
-                                OperateResult.AppendText("序列号:" + sncode.Text + " 前缀错误,不满足产品防呆规则\n", Color.Red, sncode);
-                                return;
-
+                                Err = "序列号:" + sncode.Text + " 前缀错误,不满足产品防呆规则";
                             }
                             }
                             if (sncode.Text.Length != int.Parse(PSR_LENGTH))
                             if (sncode.Text.Length != int.Parse(PSR_LENGTH))
                             {
                             {
-                                OperateResult.AppendText("序列号:" + sncode.Text + " 长度错误,不满足产品防呆规则\n", Color.Red, sncode);
-                                return;
-
+                                Err = "序列号:" + sncode.Text + " 长度错误,不满足产品防呆规则\n";
                             }
                             }
-                            CheckPass = true;
+                            CheckPass = false;
                         }
                         }
                         if (!CheckPass)
                         if (!CheckPass)
                         {
                         {
@@ -169,12 +166,17 @@ namespace UAS_MES_NEW.Special
                                 OperateResult.AppendText(">>未包含工单号\n", Color.Red, sncode);
                                 OperateResult.AppendText(">>未包含工单号\n", Color.Red, sncode);
                                 return;
                                 return;
                             }
                             }
-                            if (sncode.Text.Substring(-1) != "Z" && sncode.Text.Substring(-1) != "W")
+                            if (sncode.Text.Substring(sncode.Text.Length - 1) != "Z" && sncode.Text.Substring(sncode.Text.Length - 1) != "W")
                             {
                             {
                                 OperateResult.AppendText(">>结尾非Z和W,不允许采集!\n", Color.Red, sncode);
                                 OperateResult.AppendText(">>结尾非Z和W,不允许采集!\n", Color.Red, sncode);
                                 return;
                                 return;
                             }
                             }
                         }
                         }
+                        else
+                        {
+                            OperateResult.AppendText(Err, Color.Red, sncode);
+                            return;
+                        }
 
 
 
 
                         if (!ChangeResult.Checked)
                         if (!ChangeResult.Checked)

+ 40 - 7
UAS_MES_ZT/FunctionCode/Special/Special_ReSNBDNoStep.Designer.cs

@@ -38,6 +38,8 @@
             this.Lock = new UAS_MES_NEW.CustomControl.CustomCheckBox.LockCheckBox();
             this.Lock = new UAS_MES_NEW.CustomControl.CustomCheckBox.LockCheckBox();
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
             this.ma_code_label = new System.Windows.Forms.Label();
             this.ma_code_label = new System.Windows.Forms.Label();
+            this.ms_prodcode_label = new System.Windows.Forms.Label();
+            this.ma_prodcode = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).BeginInit();
             this.SuspendLayout();
             this.SuspendLayout();
             // 
             // 
@@ -45,7 +47,7 @@
             // 
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.OperateResult.Location = new System.Drawing.Point(16, 108);
             this.OperateResult.Location = new System.Drawing.Point(16, 108);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
             this.OperateResult.Name = "OperateResult";
             this.OperateResult.Name = "OperateResult";
             this.OperateResult.Size = new System.Drawing.Size(1351, 467);
             this.OperateResult.Size = new System.Drawing.Size(1351, 467);
             this.OperateResult.TabIndex = 3;
             this.OperateResult.TabIndex = 3;
@@ -71,7 +73,7 @@
             this.ClearSn_code.Cursor = System.Windows.Forms.Cursors.Hand;
             this.ClearSn_code.Cursor = System.Windows.Forms.Cursors.Hand;
             this.ClearSn_code.Image = global::UAS_MES_NEW.Properties.Resources.bindingNavigatorDeleteItem_Image;
             this.ClearSn_code.Image = global::UAS_MES_NEW.Properties.Resources.bindingNavigatorDeleteItem_Image;
             this.ClearSn_code.Location = new System.Drawing.Point(543, 660);
             this.ClearSn_code.Location = new System.Drawing.Point(543, 660);
-            this.ClearSn_code.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.ClearSn_code.Margin = new System.Windows.Forms.Padding(5);
             this.ClearSn_code.Name = "ClearSn_code";
             this.ClearSn_code.Name = "ClearSn_code";
             this.ClearSn_code.Size = new System.Drawing.Size(32, 32);
             this.ClearSn_code.Size = new System.Drawing.Size(32, 32);
             this.ClearSn_code.TabIndex = 151;
             this.ClearSn_code.TabIndex = 151;
@@ -86,7 +88,7 @@
             this.show_sncode.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.show_sncode.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.show_sncode.ID = null;
             this.show_sncode.ID = null;
             this.show_sncode.Location = new System.Drawing.Point(177, 655);
             this.show_sncode.Location = new System.Drawing.Point(177, 655);
-            this.show_sncode.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.show_sncode.Margin = new System.Windows.Forms.Padding(5);
             this.show_sncode.Name = "show_sncode";
             this.show_sncode.Name = "show_sncode";
             this.show_sncode.Power = null;
             this.show_sncode.Power = null;
             this.show_sncode.Size = new System.Drawing.Size(316, 43);
             this.show_sncode.Size = new System.Drawing.Size(316, 43);
@@ -113,7 +115,7 @@
             this.sncode.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.sncode.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.sncode.ID = null;
             this.sncode.ID = null;
             this.sncode.Location = new System.Drawing.Point(177, 721);
             this.sncode.Location = new System.Drawing.Point(177, 721);
-            this.sncode.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.sncode.Margin = new System.Windows.Forms.Padding(5);
             this.sncode.Name = "sncode";
             this.sncode.Name = "sncode";
             this.sncode.Power = "ifread";
             this.sncode.Power = "ifread";
             this.sncode.Size = new System.Drawing.Size(316, 43);
             this.sncode.Size = new System.Drawing.Size(316, 43);
@@ -179,11 +181,40 @@
             this.ma_code_label.TabIndex = 183;
             this.ma_code_label.TabIndex = 183;
             this.ma_code_label.Text = "归属工单";
             this.ma_code_label.Text = "归属工单";
             // 
             // 
-            // Special_ReSNBD
+            // ms_prodcode_label
+            // 
+            this.ms_prodcode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.ms_prodcode_label.AutoSize = true;
+            this.ms_prodcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_prodcode_label.Location = new System.Drawing.Point(625, 33);
+            this.ms_prodcode_label.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+            this.ms_prodcode_label.Name = "ms_prodcode_label";
+            this.ms_prodcode_label.Size = new System.Drawing.Size(146, 41);
+            this.ms_prodcode_label.TabIndex = 189;
+            this.ms_prodcode_label.Text = "产品编号";
+            // 
+            // ma_prodcode
+            // 
+            this.ma_prodcode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.ma_prodcode.AutoSize = true;
+            this.ma_prodcode.CutLength = null;
+            this.ma_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_prodcode.Location = new System.Drawing.Point(817, 33);
+            this.ma_prodcode.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+            this.ma_prodcode.MaximumSize = new System.Drawing.Size(300, 0);
+            this.ma_prodcode.Name = "ma_prodcode";
+            this.ma_prodcode.Size = new System.Drawing.Size(0, 41);
+            this.ma_prodcode.TabIndex = 188;
+            // 
+            // Special_ReSNBDNoStep
             // 
             // 
             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(1384, 803);
             this.ClientSize = new System.Drawing.Size(1384, 803);
+            this.Controls.Add(this.ms_prodcode_label);
+            this.Controls.Add(this.ma_prodcode);
             this.Controls.Add(this.Lock);
             this.Controls.Add(this.Lock);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.ma_code_label);
             this.Controls.Add(this.ma_code_label);
@@ -195,8 +226,8 @@
             this.Controls.Add(this.sncode_label);
             this.Controls.Add(this.sncode_label);
             this.Controls.Add(this.OperateResult);
             this.Controls.Add(this.OperateResult);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.Name = "Special_ReSNBD";
+            this.Margin = new System.Windows.Forms.Padding(4);
+            this.Name = "Special_ReSNBDNoStep";
             this.Tag = "Special!ReSNBD";
             this.Tag = "Special!ReSNBD";
             this.Text = "返修SN采集";
             this.Text = "返修SN采集";
             this.Load += new System.EventHandler(this.Special_BoxSplit_Load);
             this.Load += new System.EventHandler(this.Special_BoxSplit_Load);
@@ -218,5 +249,7 @@
         private CustomControl.CustomCheckBox.LockCheckBox Lock;
         private CustomControl.CustomCheckBox.LockCheckBox Lock;
         private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
         private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
         private System.Windows.Forms.Label ma_code_label;
         private System.Windows.Forms.Label ma_code_label;
+        private System.Windows.Forms.Label ms_prodcode_label;
+        private CustomControl.ValueLabel.ValueLabel ma_prodcode;
     }
     }
 }
 }

+ 11 - 10
UAS_MES_ZT/FunctionCode/Special/Special_ReSNBDNoStep.cs

@@ -141,8 +141,9 @@ namespace UAS_MES_NEW.Special
                             OperateResult.AppendText(">>不允许自己转自己\n", Color.Red, sncode);
                             OperateResult.AppendText(">>不允许自己转自己\n", Color.Red, sncode);
                             return;
                             return;
                         }
                         }
-                        Boolean CheckPass = false;
-                        DataTable dt = (DataTable)dh.ExecuteSql(" select max(psr_prefix)psr_prefix,max(PSR_LENGTH)PSR_LENGTH  from productsnrule where psr_prodcode=v_maprodcode  and psr_type='after'", "select");
+                        Boolean CheckPass = true;
+                        DataTable dt = (DataTable)dh.ExecuteSql(" select max(psr_prefix)psr_prefix,max(PSR_LENGTH)PSR_LENGTH  from productsnrule where psr_prodcode='"+ma_prodcode.Text+"'  and psr_type='after'", "select");
+                        string Err = "";
                         if (dt.Rows.Count > 0)
                         if (dt.Rows.Count > 0)
                         {
                         {
                             string psr_prefix = dt.Rows[0]["psr_prefix"].ToString();
                             string psr_prefix = dt.Rows[0]["psr_prefix"].ToString();
@@ -150,17 +151,13 @@ namespace UAS_MES_NEW.Special
 
 
                             if (!sncode.Text.StartsWith(psr_prefix))
                             if (!sncode.Text.StartsWith(psr_prefix))
                             {
                             {
-                                OperateResult.AppendText("序列号:" + sncode.Text + " 前缀错误,不满足产品防呆规则\n", Color.Red, sncode);
-                                return;
-
+                                Err = "序列号:" + sncode.Text + " 前缀错误,不满足产品防呆规则";
                             }
                             }
                             if (sncode.Text.Length != int.Parse(PSR_LENGTH))
                             if (sncode.Text.Length != int.Parse(PSR_LENGTH))
                             {
                             {
-                                OperateResult.AppendText("序列号:" + sncode.Text + " 长度错误,不满足产品防呆规则\n", Color.Red, sncode);
-                                return;
-
+                                Err = "序列号:" + sncode.Text + " 长度错误,不满足产品防呆规则\n";
                             }
                             }
-                            CheckPass = true;
+                            CheckPass = false;
                         }
                         }
                         if (!CheckPass)
                         if (!CheckPass)
                         {
                         {
@@ -169,12 +166,16 @@ namespace UAS_MES_NEW.Special
                                 OperateResult.AppendText(">>未包含工单号\n", Color.Red, sncode);
                                 OperateResult.AppendText(">>未包含工单号\n", Color.Red, sncode);
                                 return;
                                 return;
                             }
                             }
-                            if (sncode.Text.Substring(-1) != "Z" && sncode.Text.Substring(-1) != "W")
+                            if (sncode.Text.Substring(sncode.Text.Length - 1) != "Z" && sncode.Text.Substring(sncode.Text.Length - 1) != "W")
                             {
                             {
                                 OperateResult.AppendText(">>结尾非Z和W,不允许采集!\n", Color.Red, sncode);
                                 OperateResult.AppendText(">>结尾非Z和W,不允许采集!\n", Color.Red, sncode);
                                 return;
                                 return;
                             }
                             }
                         }
                         }
+                        else {
+                            OperateResult.AppendText(Err, Color.Red, sncode);
+                            return;
+                        }
 
 
                         if (!ChangeResult.Checked)
                         if (!ChangeResult.Checked)
                         {
                         {