Browse Source

测试采集增加SMT分板选项

caosy 4 years ago
parent
commit
249b47d339

+ 20 - 3
UAS_MES_NEW/FunctionCode/Make/Make_TestCollection.Designer.cs

@@ -71,6 +71,7 @@
             this.Lock_label = new System.Windows.Forms.Label();
             this.ma_salecode = new System.Windows.Forms.Label();
             this.pr_sendchecktype = new System.Windows.Forms.Label();
+            this.SMTBind = new System.Windows.Forms.CheckBox();
             this.StepCount = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SourceStepCount();
             this.Filter = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.TextBoxWithPlaceHolder();
             this.ma_softversion = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
@@ -467,7 +468,7 @@
             this.Lock_label.AutoSize = true;
             this.Lock_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Lock_label.ForeColor = System.Drawing.Color.Red;
-            this.Lock_label.Location = new System.Drawing.Point(569, 500);
+            this.Lock_label.Location = new System.Drawing.Point(739, 524);
             this.Lock_label.Name = "Lock_label";
             this.Lock_label.Size = new System.Drawing.Size(126, 21);
             this.Lock_label.TabIndex = 77;
@@ -492,6 +493,20 @@
             this.pr_sendchecktype.TabIndex = 79;
             this.pr_sendchecktype.Visible = false;
             // 
+            // SMTBind
+            // 
+            this.SMTBind.AutoSize = true;
+            this.SMTBind.Checked = true;
+            this.SMTBind.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.SMTBind.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.SMTBind.Location = new System.Drawing.Point(558, 500);
+            this.SMTBind.Margin = new System.Windows.Forms.Padding(2);
+            this.SMTBind.Name = "SMTBind";
+            this.SMTBind.Size = new System.Drawing.Size(101, 21);
+            this.SMTBind.TabIndex = 195;
+            this.SMTBind.Text = "SMT分板过站";
+            this.SMTBind.UseVisualStyleBackColor = true;
+            // 
             // StepCount
             // 
             this.StepCount.LineCode = null;
@@ -727,7 +742,7 @@
             this.CleanInfo.DownImage = ((System.Drawing.Image)(resources.GetObject("CleanInfo.DownImage")));
             this.CleanInfo.Image = ((System.Drawing.Image)(resources.GetObject("CleanInfo.Image")));
             this.CleanInfo.IsShowBorder = true;
-            this.CleanInfo.Location = new System.Drawing.Point(718, 497);
+            this.CleanInfo.Location = new System.Drawing.Point(720, 497);
             this.CleanInfo.MoveImage = ((System.Drawing.Image)(resources.GetObject("CleanInfo.MoveImage")));
             this.CleanInfo.Name = "CleanInfo";
             this.CleanInfo.NormalImage = ((System.Drawing.Image)(resources.GetObject("CleanInfo.NormalImage")));
@@ -798,7 +813,7 @@
             this.ms_sncode.Str2 = null;
             this.ms_sncode.TabIndex = 68;
             this.ms_sncode.Tag = "IfRead";
-            this.ms_sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ms_code_KeyDown);
+            this.ms_sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ms_code_KeyDown_one);
             // 
             // Make_TestCollection
             // 
@@ -806,6 +821,7 @@
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.SystemColors.Control;
             this.ClientSize = new System.Drawing.Size(862, 535);
+            this.Controls.Add(this.SMTBind);
             this.Controls.Add(this.StepCount);
             this.Controls.Add(this.pr_sendchecktype);
             this.Controls.Add(this.ma_salecode);
@@ -928,5 +944,6 @@
         private System.Windows.Forms.Label ma_salecode;
         private System.Windows.Forms.Label pr_sendchecktype;
         private CustomControl.TextBoxWithIcon.SourceStepCount StepCount;
+        private System.Windows.Forms.CheckBox SMTBind;
     }
 }

+ 29 - 1
UAS_MES_NEW/FunctionCode/Make/Make_TestCollection.cs

@@ -420,7 +420,7 @@ namespace UAS_MES_NEW.Make
                 return;
             }
             if (GoodProduct.Checked)
-                ms_code_KeyDown(sender, new KeyEventArgs(Keys.Enter));
+                ms_code_KeyDown_one(sender, new KeyEventArgs(Keys.Enter));
             else if (Reject.Checked)
             {
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
@@ -790,5 +790,33 @@ namespace UAS_MES_NEW.Make
                 }
             }
         }
+
+        private void ms_code_KeyDown_one(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                if (SMTBind.Checked)
+                {
+                    DataTable dt = (DataTable)dh.ExecuteSql("select A.SB_BARCODE from smtbind A LEFT JOIN SMTBIND B ON A.SB_MAINCODE = B.SB_MAINCODE WHERE B.SB_BARCODE = '" + ms_sncode.Text + "'", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        for (int i = 0; i < dt.Rows.Count; i++)
+                        {
+                            ms_sncode.Text = dt.Rows[i]["sb_barcode"].ToString();
+                            ms_code_KeyDown(sender, new KeyEventArgs(Keys.Enter));
+                        }
+                    }
+                    else
+                    {
+                        OperateResult.AppendText(">>SN" + ms_sncode.Text + "未进行分板绑定\n", Color.Red, ms_sncode);
+                    }
+                }
+                else
+                {
+                    ms_code_KeyDown(sender, new KeyEventArgs(Keys.Enter));
+                }
+            }
+
+        }
     }
 }

+ 3 - 1
UAS_MES_NEW/PublicMethod/LogicHandler.cs

@@ -782,6 +782,8 @@ namespace UAS_MES_NEW.PublicMethod
                 }
                 dh.ExecuteSql("delete from oqcbatchdetail where obd_sncode='" + iSnCode + "'", "delete");
             }
+            //删除SMT版绑定关系
+            dh.ExecuteSql("delete from smtbind where sb_barcode = '"+iSnCode+"' and sb_makecode = '"+ iMakeCode + "'", "delete");
             //之前保存的不良就不再调用
             DataTable dt = dh.getFieldsDataByCondition("makeserial", new string[] { "ms_stepcode", "nvl(ms_ifrework,0)ms_ifrework", "ms_status" }, "ms_sncode='" + iSnCode + "' and ms_makecode='" + iMakeCode + "'");
             if (dt.Rows.Count > 0)
@@ -1319,7 +1321,7 @@ namespace UAS_MES_NEW.PublicMethod
         public static bool CheckSnRule(string iMakeCode, string iProdCode, string iSN, out string oErrMsg)
         {
             oErrMsg = "";
-            DataTable dt = (DataTable)dh.ExecuteSql("select max(psr_prefix)psr_prefix,max(psr_length)psr_length from productsnrule where psr_prodcode='" + iProdCode + "'  and psr_type='before' ", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select psr_prefix,psr_length from productsnrule where psr_prodcode='" + iProdCode + "'  and psr_type='before' ", "select");
             if (dt.Rows.Count > 0)
             {
                 string psr_prefix = dt.Rows[0]["psr_prefix"].ToString();