Bläddra i källkod

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

callm 1 månad sedan
förälder
incheckning
eb270a9976

+ 42 - 42
UAS_MES_HYSX/FunctionCode/Make/Make_ParseLog.Designer.cs

@@ -47,14 +47,14 @@
             this.SN1 = new System.Windows.Forms.TextBox();
             this.onWatch = new System.Windows.Forms.Button();
             this.claerBtn = new System.Windows.Forms.Button();
-            this.LockMakeCode = new UAS_MES_NEW.CustomControl.CustomCheckBox.LockCheckBox();
-            this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
             this.allParse = new System.Windows.Forms.Button();
             this.label3 = new System.Windows.Forms.Label();
             this.lstOk = new System.Windows.Forms.ListBox();
             this.lstFiles = new System.Windows.Forms.ListBox();
             this.openFileDialog2 = new System.Windows.Forms.OpenFileDialog();
             this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+            this.LockMakeCode = new UAS_MES_NEW.CustomControl.CustomCheckBox.LockCheckBox();
+            this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
             this.panel1.SuspendLayout();
             this.FileBox.SuspendLayout();
             this.tableLayoutPanel1.SuspendLayout();
@@ -274,40 +274,6 @@
             this.claerBtn.UseVisualStyleBackColor = true;
             this.claerBtn.Click += new System.EventHandler(this.claerBtn_Click);
             // 
-            // LockMakeCode
-            // 
-            this.LockMakeCode.AutoSize = true;
-            this.LockMakeCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.LockMakeCode.LeaveEvent = false;
-            this.LockMakeCode.Location = new System.Drawing.Point(523, 30);
-            this.LockMakeCode.Margin = new System.Windows.Forms.Padding(4);
-            this.LockMakeCode.Name = "LockMakeCode";
-            this.LockMakeCode.Size = new System.Drawing.Size(72, 28);
-            this.LockMakeCode.TabIndex = 1;
-            this.LockMakeCode.Text = "锁定";
-            this.LockMakeCode.UseVisualStyleBackColor = true;
-            // 
-            // ma_code
-            // 
-            this.ma_code.AllPower = null;
-            this.ma_code.BackColor = System.Drawing.SystemColors.Control;
-            this.ma_code.Caller = null;
-            this.ma_code.Condition = null;
-            this.ma_code.DBTitle = null;
-            this.ma_code.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_code.FormName = null;
-            this.ma_code.Location = new System.Drawing.Point(193, 25);
-            this.ma_code.Margin = new System.Windows.Forms.Padding(4);
-            this.ma_code.Name = "ma_code";
-            this.ma_code.Power = null;
-            this.ma_code.ReturnData = null;
-            this.ma_code.SelectField = null;
-            this.ma_code.SetValueField = null;
-            this.ma_code.Size = new System.Drawing.Size(320, 42);
-            this.ma_code.TabIndex = 0;
-            this.ma_code.TableName = null;
-            this.ma_code.TextBoxEnable = true;
-            // 
             // allParse
             // 
             this.allParse.Cursor = System.Windows.Forms.Cursors.Hand;
@@ -338,7 +304,7 @@
             this.lstOk.ItemHeight = 28;
             this.lstOk.Location = new System.Drawing.Point(3, 3);
             this.lstOk.Name = "lstOk";
-            this.lstOk.Size = new System.Drawing.Size(1594, 235);
+            this.lstOk.Size = new System.Drawing.Size(1594, 296);
             this.lstOk.TabIndex = 1;
             // 
             // lstFiles
@@ -348,9 +314,9 @@
             this.lstFiles.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.lstFiles.FormattingEnabled = true;
             this.lstFiles.ItemHeight = 22;
-            this.lstFiles.Location = new System.Drawing.Point(3, 244);
+            this.lstFiles.Location = new System.Drawing.Point(3, 305);
             this.lstFiles.Name = "lstFiles";
-            this.lstFiles.Size = new System.Drawing.Size(1594, 357);
+            this.lstFiles.Size = new System.Drawing.Size(1594, 296);
             this.lstFiles.TabIndex = 0;
             this.lstFiles.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.lstFiles_DrawItem);
             // 
@@ -368,11 +334,45 @@
             this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 296);
             this.tableLayoutPanel1.Name = "tableLayoutPanel1";
             this.tableLayoutPanel1.RowCount = 2;
-            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 40F));
-            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 60F));
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
             this.tableLayoutPanel1.Size = new System.Drawing.Size(1600, 604);
             this.tableLayoutPanel1.TabIndex = 8;
             // 
+            // LockMakeCode
+            // 
+            this.LockMakeCode.AutoSize = true;
+            this.LockMakeCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.LockMakeCode.LeaveEvent = false;
+            this.LockMakeCode.Location = new System.Drawing.Point(523, 30);
+            this.LockMakeCode.Margin = new System.Windows.Forms.Padding(4);
+            this.LockMakeCode.Name = "LockMakeCode";
+            this.LockMakeCode.Size = new System.Drawing.Size(72, 28);
+            this.LockMakeCode.TabIndex = 1;
+            this.LockMakeCode.Text = "锁定";
+            this.LockMakeCode.UseVisualStyleBackColor = true;
+            // 
+            // ma_code
+            // 
+            this.ma_code.AllPower = null;
+            this.ma_code.BackColor = System.Drawing.SystemColors.Control;
+            this.ma_code.Caller = null;
+            this.ma_code.Condition = null;
+            this.ma_code.DBTitle = null;
+            this.ma_code.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_code.FormName = null;
+            this.ma_code.Location = new System.Drawing.Point(193, 25);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(4);
+            this.ma_code.Name = "ma_code";
+            this.ma_code.Power = null;
+            this.ma_code.ReturnData = null;
+            this.ma_code.SelectField = null;
+            this.ma_code.SetValueField = null;
+            this.ma_code.Size = new System.Drawing.Size(320, 42);
+            this.ma_code.TabIndex = 0;
+            this.ma_code.TableName = null;
+            this.ma_code.TextBoxEnable = true;
+            // 
             // Make_ParseLog
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
@@ -412,7 +412,6 @@
         private System.Windows.Forms.Button claerBtn;
         private System.Windows.Forms.Button onWatch;
         private System.Windows.Forms.ListBox lstOk;
-        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
         private System.Windows.Forms.GroupBox FileBox;
         private System.Windows.Forms.TextBox SN1;
         private System.Windows.Forms.TextBox SN6;
@@ -423,5 +422,6 @@
         private System.Windows.Forms.Button Generate;
         private System.Windows.Forms.Button Delete;
         private System.Windows.Forms.Button Clear;
+        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
     }
 }

+ 23 - 19
UAS_MES_HYSX/FunctionCode/Make/Make_ParseLog.cs

@@ -286,7 +286,10 @@ namespace UAS_MES_NEW.Make
 
                         if (outFileMsg != "OK")
                         {
-                            LogMessage(0, outFileMsg);
+                            if(!outFileMsg.Contains("文件被占用"))
+                            {
+                                LogMessage(0, outFileMsg);
+                            }
                             continue;
                         }
                     }
@@ -427,6 +430,13 @@ namespace UAS_MES_NEW.Make
                 List<string> param = new List<string>() { };
                 foreach (var item in logs)
                 {
+                    dt = (DataTable)dh.ExecuteSql($"SELECT mp_id FROM makeprocess WHERE mp_sncode = '{item.SN}' AND mp_sourcecode = 'AOI'", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        LogMessage(1, $"序列号:{item.SN}已经过站并记录测试信息");
+                        continue;
+                    }
+
                     if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, item.SN, User.UserCode, out omakeCode, out oMsid, out oErrorMessage))
                     {
                         if (LogicHandler.SetStepResult(omakeCode, User.UserSourceCode, item.SN, "日志解析", "OK", User.UserCode, out oErrorMessage))
@@ -460,12 +470,6 @@ namespace UAS_MES_NEW.Make
 
                             if (logs.IndexOf(item) == logs.Count - 1)
                             {
-                                //string sqlStr = $@"select ma_code,nvl(mcd_okqty,0) mcd_okqty,ma_prodcode,pr_detail,ma_qty - nvl(mcd_okqty, 0) remain_qty 
-                                //                    from make left join makecraftdetail on mcd_maid=ma_id left join product on pr_code = ma_prodcode 
-                                //                    where ma_code='{omakeCode}' and mcd_stepcode='" + User.CurrentStepCode + "'";
-                                //dt = (DataTable)dh.ExecuteSql(sqlStr, "select");
-                                //BaseUtil.SetFormValue(Controls, dt);
-
                                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, omakeCode, User.UserLineCode, User.UserSourceCode, "日志解析", "日志解析过站成功", item.SN, "");
                                 return true;
                             }
@@ -692,12 +696,12 @@ namespace UAS_MES_NEW.Make
                 return;
             }
             List<string> DeleteList = new List<string>() { };
-            DeleteList.Add(SN1.Text);
-            DeleteList.Add(SN2.Text);
-            DeleteList.Add(SN3.Text);
-            DeleteList.Add(SN4.Text);
-            DeleteList.Add(SN5.Text);
-            DeleteList.Add(SN6.Text);
+            DeleteList.Add("1-1_" + SN1.Text);
+            DeleteList.Add("1-2_" + SN2.Text);
+            DeleteList.Add("1-3_" + SN3.Text);
+            DeleteList.Add("2-1_" + SN4.Text);
+            DeleteList.Add("2-2_" + SN5.Text);
+            DeleteList.Add("2-3_" + SN6.Text);
 
             string DeletePath;
             int DeleteCount = 0;
@@ -767,12 +771,12 @@ namespace UAS_MES_NEW.Make
             }
 
             List<string> GenerateList = new List<string>() { };
-            GenerateList.Add(SN1.Text);
-            GenerateList.Add(SN2.Text);
-            GenerateList.Add(SN3.Text);
-            GenerateList.Add(SN4.Text);
-            GenerateList.Add(SN5.Text);
-            GenerateList.Add(SN6.Text);
+            GenerateList.Add("1-1_" + SN1.Text);
+            GenerateList.Add("1-2_" + SN2.Text);
+            GenerateList.Add("1-3_" + SN3.Text);
+            GenerateList.Add("2-1_" + SN4.Text);
+            GenerateList.Add("2-2_" + SN5.Text);
+            GenerateList.Add("2-3_" + SN6.Text);
 
             string GeneratePath;
             int GenerateCount = 0;