Переглянути джерело

测采添加软件版本更新

yhluo 2 місяців тому
батько
коміт
7dca4430b0

+ 17 - 0
UAS_MES_BG/FunctionCode/Make/Make_TestCollection.Designer.cs

@@ -81,6 +81,7 @@
             this.mc_restqty_label = new System.Windows.Forms.Label();
             this.mcd_inqty_label = new System.Windows.Forms.Label();
             this.ob_checkno = new System.Windows.Forms.Label();
+            this.new_softversion = new System.Windows.Forms.TextBox();
             this.ob_sendqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.ob_batchqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.ob_nowcheckqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
@@ -209,6 +210,7 @@
             this.columnHeader9});
             this.WaitRejectList.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.WaitRejectList.FullRowSelect = true;
+            this.WaitRejectList.HideSelection = false;
             this.WaitRejectList.Location = new System.Drawing.Point(6, 423);
             this.WaitRejectList.Margin = new System.Windows.Forms.Padding(4);
             this.WaitRejectList.Name = "WaitRejectList";
@@ -290,6 +292,7 @@
             this.columnHeader8,
             this.columnHeader10});
             this.ChoosedRejectList.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ChoosedRejectList.HideSelection = false;
             this.ChoosedRejectList.Location = new System.Drawing.Point(552, 423);
             this.ChoosedRejectList.Margin = new System.Windows.Forms.Padding(4);
             this.ChoosedRejectList.Name = "ChoosedRejectList";
@@ -627,6 +630,17 @@
             this.ob_checkno.Tag = "ob_checkno";
             this.ob_checkno.Visible = false;
             // 
+            // new_softversion
+            // 
+            this.new_softversion.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.new_softversion.Enabled = false;
+            this.new_softversion.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.new_softversion.Location = new System.Drawing.Point(124, 169);
+            this.new_softversion.Name = "new_softversion";
+            this.new_softversion.Size = new System.Drawing.Size(237, 31);
+            this.new_softversion.TabIndex = 243;
+            this.new_softversion.KeyDown += new System.Windows.Forms.KeyEventHandler(this.new_softversion_KeyDown);
+            // 
             // ob_sendqty
             // 
             this.ob_sendqty.AutoSize = true;
@@ -798,6 +812,7 @@
             this.ma_softversion.Name = "ma_softversion";
             this.ma_softversion.Size = new System.Drawing.Size(0, 31);
             this.ma_softversion.TabIndex = 73;
+            this.ma_softversion.Visible = false;
             // 
             // Save
             // 
@@ -1007,6 +1022,7 @@
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.SystemColors.Control;
             this.ClientSize = new System.Drawing.Size(1291, 788);
+            this.Controls.Add(this.new_softversion);
             this.Controls.Add(this.ob_checkno);
             this.Controls.Add(this.ob_sendqty);
             this.Controls.Add(this.label12);
@@ -1168,5 +1184,6 @@
         private CustomControl.ValueLabel.ValueLabel mcd_inqty;
         private System.Windows.Forms.Label mcd_inqty_label;
         private System.Windows.Forms.Label ob_checkno;
+        private System.Windows.Forms.TextBox new_softversion;
     }
 }

+ 46 - 8
UAS_MES_BG/FunctionCode/Make/Make_TestCollection.cs

@@ -38,7 +38,7 @@ namespace UAS_MES_NEW.Make
         Boolean startcheck = false;
         int getcheck = 0;
 
-        Dictionary <string,DateTime> dateTimeDictionary = new Dictionary<string, DateTime>();
+        Dictionary<string, DateTime> dateTimeDictionary = new Dictionary<string, DateTime>();
         /// <summary>
         /// 已选的不良
         /// </summary>
@@ -53,7 +53,7 @@ namespace UAS_MES_NEW.Make
         bool LockSn = false;
 
         DataTable Dbfind;
-       
+
 
         public Make_TestCollection()
         {
@@ -89,7 +89,7 @@ namespace UAS_MES_NEW.Make
             StepCount.Start();
         }
 
-   
+
 
         private void text_getfocus(object sender, EventArgs e)
         {
@@ -223,6 +223,23 @@ namespace UAS_MES_NEW.Make
                                 LockMakeCode.Checked = true;
                             }
                         }
+                        string wo = string.IsNullOrEmpty(oMakeCode) ? ma_code.Text.Trim() : oMakeCode;
+                        dt = (DataTable)dh.ExecuteSql($"select ma_softversion from make where ma_code = '{wo}'", "select");
+                        if (dt.Rows.Count > 0)
+                        {
+                            string softversion = dt.Rows[0]["ma_softversion"].ToString();
+                            if (string.IsNullOrEmpty(softversion) && User.CurrentStepName == "程序烧写")
+                            {
+                                new_softversion.Enabled = true;
+                                new_softversion.Focus();
+                            }
+                            else
+                            {
+                                new_softversion.Enabled = false;
+                                new_softversion.Text = softversion;
+                            }
+                        }
+
                         dt = (DataTable)dh.ExecuteSql("select ms_nextstepcode,ms_sncode,ms_reworkstatus,nvl(ms_ifrework,0)ms_ifrework,ms_stepcode,ms_status,nvl(st_ifrepair,0) st_ifrepair from makeserial left join step on ms_stepcode=st_code where ms_id='" + oMSID + "'", "select");
                         string status = dt.Rows[0]["ms_status"].ToString();
                         reworkstatus = dt.Rows[0]["ms_reworkstatus"].ToString();
@@ -990,7 +1007,7 @@ namespace UAS_MES_NEW.Make
         {
             if (e.KeyCode == Keys.Enter)
             {
-                if (SMTBind.Checked&& GoodProduct.Checked)
+                if (SMTBind.Checked && GoodProduct.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)
@@ -1117,19 +1134,19 @@ namespace UAS_MES_NEW.Make
             if (e.ChangeType == WatcherChangeTypes.Changed || e.ChangeType == WatcherChangeTypes.Created)
             {
                 Stream stream = null;
-          
+
                 while (true)
                 {
                     try
                     {
                         using (stream = File.Open(e.FullPath, FileMode.Open, FileAccess.Read, FileShare.Read))
                         {
-                        
+
                             if (stream != null)
                                 stream.Close();
                             break;
                         }
-                    
+
                     }
                     catch (Exception ex)
                     {
@@ -1175,12 +1192,33 @@ namespace UAS_MES_NEW.Make
                         }
                     }
                 }
-              
+
                 _Sr.Close();
 
 
 
             }
         }
+
+        private void new_softversion_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                string sv = new_softversion.Text.Trim();
+                if (!string.IsNullOrEmpty(sv))
+                {
+                    dh.UpdateByCondition("make", $"ma_softversion='{sv}'", "ma_code='" + ma_code.Text.Trim() + "'");
+                    dh.UpdateByCondition("makeserial", $"MS_SOFTVERSION='{sv}'", "ms_id='" + oMSID + "'");
+
+                    new_softversion.Text = "";
+                    dt = (DataTable)dh.ExecuteSql($"SELECT ms_softversion FROM makeserial WHERE ms_id = '{oMSID}'", "select");
+                    new_softversion.Text = dt.Rows[0]["ms_softversion"].ToString();
+
+                    new_softversion.Enabled = false;
+                    ms_sncode.Focus();
+                    ms_sncode.SelectAll();
+                }
+            }
+        }
     }
 }