Эх сурвалжийг харах

Merge repos.ubtob.net:usoft/mes-client

callm 1 өдөр өмнө
parent
commit
7836ded8f8

+ 41 - 2
UAS_MES_WEIP/FunctionCode/Make/Make_BakingManage.cs

@@ -39,7 +39,17 @@ namespace UAS_MES_NEW.Make
         }
         private void ReelNoVal_Leave(object sender, EventArgs e)
         {
-            UpdateMaterial("L", ReelNoVal.Text);
+            if (!string.IsNullOrEmpty(ReelNoVal.Text))
+            {
+                UpdateMaterial("L", ReelNoVal.Text);
+
+                dt = (DataTable)dh.ExecuteSql($"select * from barcode where bar_code = '{ReelNoVal.Text}'", "select");
+                if (dt.Rows.Count == 0)
+                {
+                    MessageBox.Show($"条码:{ReelNoVal.Text} 不是MES系统中库存条码");
+                    return;
+                }
+            }
         }
 
         private void ReelNoVal_KeyDown(object sender, KeyEventArgs e)
@@ -48,6 +58,15 @@ namespace UAS_MES_NEW.Make
 
             ReelNoVal.Text = ReelNoVal.Text.Trim();
 
+            if (!string.IsNullOrEmpty(ReelNoVal.Text))
+            {
+                dt = (DataTable)dh.ExecuteSql($"select * from barcode where bar_code = '{ReelNoVal.Text}'", "select");
+                if (dt.Rows.Count == 0)
+                {
+                    MessageBox.Show($"条码:{ReelNoVal.Text} 不是MES系统中库存条码");
+                }
+            }
+
             UpdateMaterial("L", ReelNoVal.Text);
         }
 
@@ -248,12 +267,32 @@ namespace UAS_MES_NEW.Make
 
             ReelNoVal1.Text = ReelNoVal1.Text.Trim();
 
+            if (!string.IsNullOrEmpty(ReelNoVal1.Text))
+            {
+                dt = (DataTable)dh.ExecuteSql($"select * from barcode where bar_code = '{ReelNoVal1.Text}'", "select");
+                if (dt.Rows.Count == 0)
+                {
+                    MessageBox.Show($"条码:{ReelNoVal1.Text} 不是MES系统中库存条码");
+                    return;
+                }
+            }
+
             UpdateMaterial("L", ReelNoVal1.Text);
         }
 
         private void ReelNoVal1_Leave(object sender, EventArgs e)
         {
-            UpdateMaterial("L", ReelNoVal1.Text);
+            if (!string.IsNullOrEmpty(ReelNoVal1.Text))
+            {
+                UpdateMaterial("L", ReelNoVal1.Text);
+
+                dt = (DataTable)dh.ExecuteSql($"select * from barcode where bar_code = '{ReelNoVal1.Text}'", "select");
+                if (dt.Rows.Count == 0)
+                {
+                    MessageBox.Show($"条码:{ReelNoVal1.Text} 不是MES系统中库存条码");
+                    return;
+                }
+            }
         }
     }
 }

+ 11 - 0
UAS_MES_WEIP/FunctionCode/Make/Make_BurnInfo.cs

@@ -142,6 +142,17 @@ namespace UAS_MES_NEW.Make
         {
             if (e.KeyCode != Keys.Enter) return;
 
+            BurnLotnoVal.Text = BurnLotnoVal.Text.Trim();
+            if (!string.IsNullOrEmpty(BurnLotnoVal.Text))
+            {
+                dt = (DataTable)dh.ExecuteSql($"select * from barcode where bar_code = '{BurnLotnoVal.Text}'", "select");
+                if (dt.Rows.Count == 0)
+                {
+                    ShowMsg(0, $"条码:{BurnLotnoVal.Text} 不是MES系统中库存条码");
+                    return;
+                }
+            }
+
             BurnSwVal.Focus();
             BurnSwVal.SelectAll();
         }

+ 69 - 22
UAS_MES_WEIP/FunctionCode/Make/Make_EquiConnect.Designer.cs

@@ -42,10 +42,12 @@
             this.txtPath = new System.Windows.Forms.TextBox();
             this.LineLab = new System.Windows.Forms.Label();
             this.LineVal = new System.Windows.Forms.ComboBox();
-            this.OK = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
-            this.NG = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.SNVal = new System.Windows.Forms.TextBox();
             this.SNLab = new System.Windows.Forms.Label();
+            this.OkBox = new System.Windows.Forms.CheckBox();
+            this.NgBox = new System.Windows.Forms.CheckBox();
+            this.OK = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.NG = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.OperatResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             this.SNDetails = new UAS_MES_NEW.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
             this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
@@ -59,6 +61,7 @@
             this.label3 = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
             this.serialNumber = new System.Windows.Forms.Label();
+            this.TestLab = new System.Windows.Forms.Label();
             this.Container.SuspendLayout();
             this.panel1.SuspendLayout();
             this.SNDetails.SuspendLayout();
@@ -85,6 +88,9 @@
             // 
             // panel1
             // 
+            this.panel1.Controls.Add(this.OkBox);
+            this.panel1.Controls.Add(this.TestLab);
+            this.panel1.Controls.Add(this.NgBox);
             this.panel1.Controls.Add(this.EmployeeVal);
             this.panel1.Controls.Add(this.EmployeeLab);
             this.panel1.Controls.Add(this.onWatch);
@@ -211,7 +217,7 @@
             // 
             this.LineLab.AutoSize = true;
             this.LineLab.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.LineLab.Location = new System.Drawing.Point(49, 61);
+            this.LineLab.Location = new System.Drawing.Point(49, 93);
             this.LineLab.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.LineLab.Name = "LineLab";
             this.LineLab.Size = new System.Drawing.Size(54, 28);
@@ -221,11 +227,54 @@
             // LineVal
             // 
             this.LineVal.FormattingEnabled = true;
-            this.LineVal.Location = new System.Drawing.Point(101, 61);
+            this.LineVal.Location = new System.Drawing.Point(101, 93);
             this.LineVal.Name = "LineVal";
             this.LineVal.Size = new System.Drawing.Size(164, 32);
             this.LineVal.TabIndex = 168;
             // 
+            // SNVal
+            // 
+            this.SNVal.Location = new System.Drawing.Point(101, 133);
+            this.SNVal.Name = "SNVal";
+            this.SNVal.Size = new System.Drawing.Size(243, 31);
+            this.SNVal.TabIndex = 164;
+            this.SNVal.KeyDown += new System.Windows.Forms.KeyEventHandler(this.SNVal_KeyDown);
+            // 
+            // SNLab
+            // 
+            this.SNLab.AutoSize = true;
+            this.SNLab.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.SNLab.Location = new System.Drawing.Point(39, 133);
+            this.SNLab.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.SNLab.Name = "SNLab";
+            this.SNLab.Size = new System.Drawing.Size(75, 28);
+            this.SNLab.TabIndex = 163;
+            this.SNLab.Text = "序列号";
+            // 
+            // OkBox
+            // 
+            this.OkBox.AutoSize = true;
+            this.OkBox.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.OkBox.Location = new System.Drawing.Point(101, 61);
+            this.OkBox.Name = "OkBox";
+            this.OkBox.Size = new System.Drawing.Size(62, 28);
+            this.OkBox.TabIndex = 178;
+            this.OkBox.Text = "OK";
+            this.OkBox.UseVisualStyleBackColor = true;
+            this.OkBox.Click += new System.EventHandler(this.OkBox_Click);
+            // 
+            // NgBox
+            // 
+            this.NgBox.AutoSize = true;
+            this.NgBox.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.NgBox.Location = new System.Drawing.Point(169, 61);
+            this.NgBox.Name = "NgBox";
+            this.NgBox.Size = new System.Drawing.Size(64, 28);
+            this.NgBox.TabIndex = 179;
+            this.NgBox.Text = "NG";
+            this.NgBox.UseVisualStyleBackColor = true;
+            this.NgBox.Click += new System.EventHandler(this.NgBox_Click);
+            // 
             // OK
             // 
             this.OK.AllPower = null;
@@ -247,6 +296,7 @@
             this.OK.Tag = "IfRead";
             this.OK.Text = "OK";
             this.OK.UseVisualStyleBackColor = false;
+            this.OK.Visible = false;
             this.OK.Click += new System.EventHandler(this.OK_Click);
             // 
             // NG
@@ -270,26 +320,9 @@
             this.NG.Tag = "IfRead";
             this.NG.Text = "NG";
             this.NG.UseVisualStyleBackColor = true;
+            this.NG.Visible = false;
             this.NG.Click += new System.EventHandler(this.NG_Click);
             // 
-            // SNVal
-            // 
-            this.SNVal.Location = new System.Drawing.Point(101, 99);
-            this.SNVal.Name = "SNVal";
-            this.SNVal.Size = new System.Drawing.Size(243, 31);
-            this.SNVal.TabIndex = 164;
-            // 
-            // SNLab
-            // 
-            this.SNLab.AutoSize = true;
-            this.SNLab.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SNLab.Location = new System.Drawing.Point(39, 99);
-            this.SNLab.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.SNLab.Name = "SNLab";
-            this.SNLab.Size = new System.Drawing.Size(75, 28);
-            this.SNLab.TabIndex = 163;
-            this.SNLab.Text = "序列号";
-            // 
             // OperatResult
             // 
             this.OperatResult.AcceptsTab = true;
@@ -452,6 +485,17 @@
             this.serialNumber.TabIndex = 4;
             this.serialNumber.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
             // 
+            // TestLab
+            // 
+            this.TestLab.AutoSize = true;
+            this.TestLab.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.TestLab.Location = new System.Drawing.Point(18, 61);
+            this.TestLab.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.TestLab.Name = "TestLab";
+            this.TestLab.Size = new System.Drawing.Size(96, 28);
+            this.TestLab.TabIndex = 180;
+            this.TestLab.Text = "判定结果";
+            // 
             // Make_EquiConnect
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
@@ -505,5 +549,8 @@
         private System.Windows.Forms.Label EmployeeLab;
         private System.Windows.Forms.Label label7;
         private System.Windows.Forms.Label TargetQty;
+        private System.Windows.Forms.CheckBox OkBox;
+        private System.Windows.Forms.CheckBox NgBox;
+        private System.Windows.Forms.Label TestLab;
     }
 }

+ 72 - 3
UAS_MES_WEIP/FunctionCode/Make/Make_EquiConnect.cs

@@ -90,9 +90,6 @@ namespace UAS_MES_NEW.Make
             dh.ExecuteSql(SQL.ToString(), "insert");
 
             ShowMsg(1, $"已记录 {SNVal.Text.Trim()},测试结果为 {resType}");
-
-            SNVal.Focus();
-            SNVal.SelectAll();
         }
 
         private void ShowMsg(int type, string msg)
@@ -176,6 +173,78 @@ namespace UAS_MES_NEW.Make
                 return;
             }
         }
+
+        private void NgBox_Click(object sender, EventArgs e)
+        {
+            OkBox.Checked = false;
+        }
+
+        private void OkBox_Click(object sender, EventArgs e)
+        {
+            NgBox.Checked = false;
+        }
+
+        private void SNVal_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode != Keys.Enter) return;
+
+            SNVal.Text = SNVal.Text.Trim();
+
+            if (string.IsNullOrEmpty(EmployeeVal.Text))
+            {
+                ShowMsg(0, "请输入抽检人员姓名");
+                return;
+            }
+
+            dt = (DataTable)dh.ExecuteSql($@"SELECT ms_makecode,ms_prodcode,cd_stepcode,cd_stepname,cd_stepno FROM makeserial,craft,craftdetail
+                WHERE ms_sncode = '{SNVal.Text}' AND ms_prodcode = cr_prodcode AND cr_id = cd_crid AND cd_stepno = 1 ORDER BY cd_stepno", "select");
+            if (dt.Rows.Count == 0)
+            {
+                ShowMsg(0, $"序列号:{SNVal.Text} 无归属记录,请过投入站后再采集Xray信息");
+                return;
+            }
+
+            dt = (DataTable)dh.ExecuteSql($@"SELECT mp_linecode FROM makeprocess WHERE mp_sncode = '{SNVal.Text}' AND mp_stepcode = '{dt.Rows[0]["cd_stepcode"]}'", "select");
+            if (dt.Rows.Count == 0)
+            {
+                ShowMsg(0, $"序列号:{SNVal.Text} 无投入过站记录,请过投入站后再采集Xray信息");
+                return;
+            }
+
+            for (int i = 0; i <= LineVal.Items.Count; i++)
+            {
+                string mplinecode = dt.Rows[0]["mp_linecode"].ToString();
+                string allLine = LineVal.Items[i].ToString();
+                if (mplinecode == allLine)
+                {
+                    LineVal.SelectedIndex = i;
+                    break;
+                }
+            }
+
+            if (string.IsNullOrEmpty(LineVal.Text))
+            {
+                ShowMsg(0, "请选择线体");
+                return;
+            }
+
+            if(!OkBox.Checked && !NgBox.Checked)
+            {
+                ShowMsg(0, "请勾选判定结果");
+                return;
+            }
+
+            if (string.IsNullOrEmpty(SNVal.Text))
+            {
+                ShowMsg(0, "请选择扫描序列号");
+                return;
+            }
+
+            InsertLog(OkBox.Checked ? "OK" : "NG");
+
+            SNVal.Focus();
+            SNVal.SelectAll();
+        }
     }
 }
 

+ 3 - 3
UAS_MES_WEIP/FunctionCode/Make/Make_SMTSStencil.cs

@@ -189,7 +189,7 @@ namespace UAS_MES_NEW.Make
                 }
                 else
                 {
-                    MessageBox.Show("人员编号" + em_code.Text + "不存在");
+                    MessageBox.Show("人员编号" + User.UserCode + "不存在");
                 }
     //        }
         }
@@ -220,7 +220,7 @@ namespace UAS_MES_NEW.Make
                     MessageBox.Show("刮刀编号" + SU_DEVCODE1.Text + "不存在或者未审核");
                 }
                 string St_USECOUNT = dt.Rows[0]["St_USECOUNT"].ToString();
-                dt = (DataTable)dh.ExecuteSql("select em_name from employee where em_code='" + em_code1.Text + "'", "select");
+                dt = (DataTable)dh.ExecuteSql("select em_name from employee where em_code='" + User.UserCode + "'", "select");
                 if (dt.Rows.Count > 0)
                 {
                     //if (int.Parse(st_combinenumber.Text) >= 0)
@@ -267,7 +267,7 @@ namespace UAS_MES_NEW.Make
                 }
                 else
                 {
-                    MessageBox.Show("人员编号" + em_code1.Text + "不存在");
+                    MessageBox.Show("人员编号" + User.UserCode + "不存在");
                 }
             }
             else

+ 2 - 2
UAS_MES_WEIP/FunctionCode/Make/Make_SMTStencil.cs

@@ -189,7 +189,7 @@ namespace UAS_MES_NEW.Make
                 }
                 else
                 {
-                    MessageBox.Show("人员编号" + em_code.Text + "不存在");
+                    MessageBox.Show("人员编号" + User.UserCode + "不存在");
                 }
           //  }
         }
@@ -268,7 +268,7 @@ namespace UAS_MES_NEW.Make
                 }
                 else
                 {
-                    MessageBox.Show("人员编号" + em_code1.Text + "不存在");
+                    MessageBox.Show("人员编号" + User.UserCode + "不存在");
                 }
             }
             else