yhluo 1 개월 전
부모
커밋
be53000e90
2개의 변경된 파일11개의 추가작업 그리고 197개의 파일을 삭제
  1. 6 73
      UAS_MES_BG/FunctionCode/Make/Make_ParseLog.Designer.cs
  2. 5 124
      UAS_MES_BG/FunctionCode/Make/Make_ParseLog.cs

+ 6 - 73
UAS_MES_BG/FunctionCode/Make/Make_ParseLog.Designer.cs

@@ -34,10 +34,6 @@
             this.txtPath = new System.Windows.Forms.TextBox();
             this.Choose = new System.Windows.Forms.Button();
             this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
-            this.logList = new System.Windows.Forms.ListView();
-            this.sn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-            this.time = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-            this.fileName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.panel1 = new System.Windows.Forms.Panel();
             this.onWatch = new System.Windows.Forms.Button();
             this.claerBtn = new System.Windows.Forms.Button();
@@ -46,14 +42,10 @@
             this.allParse = new System.Windows.Forms.Button();
             this.label3 = new System.Windows.Forms.Label();
             this.panel2 = new System.Windows.Forms.Panel();
-            this.panel4 = new System.Windows.Forms.Panel();
-            this.lstFiles = new System.Windows.Forms.ListBox();
-            this.panel3 = new System.Windows.Forms.Panel();
             this.openFileDialog2 = new System.Windows.Forms.OpenFileDialog();
+            this.lstFiles = new System.Windows.Forms.ListBox();
             this.panel1.SuspendLayout();
             this.panel2.SuspendLayout();
-            this.panel4.SuspendLayout();
-            this.panel3.SuspendLayout();
             this.SuspendLayout();
             // 
             // Device
@@ -119,38 +111,6 @@
             this.openFileDialog1.FileName = "openFileDialog1";
             this.openFileDialog1.RestoreDirectory = true;
             // 
-            // logList
-            // 
-            this.logList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
-            this.sn,
-            this.time,
-            this.fileName});
-            this.logList.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.logList.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.logList.HideSelection = false;
-            this.logList.Location = new System.Drawing.Point(0, 0);
-            this.logList.Name = "logList";
-            this.logList.Size = new System.Drawing.Size(326, 530);
-            this.logList.TabIndex = 6;
-            this.logList.UseCompatibleStateImageBehavior = false;
-            this.logList.View = System.Windows.Forms.View.Details;
-            this.logList.Visible = false;
-            // 
-            // sn
-            // 
-            this.sn.Text = "序号";
-            this.sn.Width = 55;
-            // 
-            // time
-            // 
-            this.time.Text = "时间";
-            this.time.Width = 220;
-            // 
-            // fileName
-            // 
-            this.fileName.Text = "文件名称";
-            this.fileName.Width = 380;
-            // 
             // panel1
             // 
             this.panel1.BackColor = System.Drawing.SystemColors.Control;
@@ -252,22 +212,16 @@
             // 
             // panel2
             // 
-            this.panel2.Controls.Add(this.panel4);
-            this.panel2.Controls.Add(this.panel3);
+            this.panel2.Controls.Add(this.lstFiles);
             this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
             this.panel2.Location = new System.Drawing.Point(0, 296);
             this.panel2.Name = "panel2";
             this.panel2.Size = new System.Drawing.Size(1304, 530);
             this.panel2.TabIndex = 8;
             // 
-            // panel4
+            // openFileDialog2
             // 
-            this.panel4.Controls.Add(this.lstFiles);
-            this.panel4.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.panel4.Location = new System.Drawing.Point(0, 0);
-            this.panel4.Name = "panel4";
-            this.panel4.Size = new System.Drawing.Size(978, 530);
-            this.panel4.TabIndex = 2;
+            this.openFileDialog2.FileName = "openFileDialog2";
             // 
             // lstFiles
             // 
@@ -276,22 +230,9 @@
             this.lstFiles.ItemHeight = 18;
             this.lstFiles.Location = new System.Drawing.Point(0, 0);
             this.lstFiles.Name = "lstFiles";
-            this.lstFiles.Size = new System.Drawing.Size(978, 530);
+            this.lstFiles.Size = new System.Drawing.Size(1304, 530);
             this.lstFiles.TabIndex = 0;
             // 
-            // panel3
-            // 
-            this.panel3.Controls.Add(this.logList);
-            this.panel3.Dock = System.Windows.Forms.DockStyle.Right;
-            this.panel3.Location = new System.Drawing.Point(978, 0);
-            this.panel3.Name = "panel3";
-            this.panel3.Size = new System.Drawing.Size(326, 530);
-            this.panel3.TabIndex = 1;
-            // 
-            // openFileDialog2
-            // 
-            this.openFileDialog2.FileName = "openFileDialog2";
-            // 
             // Make_ParseLog
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
@@ -307,8 +248,6 @@
             this.panel1.ResumeLayout(false);
             this.panel1.PerformLayout();
             this.panel2.ResumeLayout(false);
-            this.panel4.ResumeLayout(false);
-            this.panel3.ResumeLayout(false);
             this.ResumeLayout(false);
 
         }
@@ -321,21 +260,15 @@
         private System.Windows.Forms.TextBox txtPath;
         private System.Windows.Forms.Button Choose;
         private System.Windows.Forms.OpenFileDialog openFileDialog1;
-        private System.Windows.Forms.ListView logList;
         private System.Windows.Forms.Panel panel1;
         private System.Windows.Forms.Panel panel2;
-        private System.Windows.Forms.ColumnHeader time;
-        private System.Windows.Forms.ColumnHeader fileName;
-        private System.Windows.Forms.ColumnHeader sn;
         private System.Windows.Forms.Label label3;
         private System.Windows.Forms.Button allParse;
         private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
         private CustomControl.CustomCheckBox.LockCheckBox LockMakeCode;
         private System.Windows.Forms.OpenFileDialog openFileDialog2;
-        private System.Windows.Forms.ListBox lstFiles;
         private System.Windows.Forms.Button claerBtn;
-        private System.Windows.Forms.Panel panel4;
-        private System.Windows.Forms.Panel panel3;
         private System.Windows.Forms.Button onWatch;
+        private System.Windows.Forms.ListBox lstFiles;
     }
 }

+ 5 - 124
UAS_MES_BG/FunctionCode/Make/Make_ParseLog.cs

@@ -115,6 +115,7 @@ namespace UAS_MES_NEW.Make
         {
             if (Device.SelectedIndex == -1) return;
 
+            SPITimer.Stop();
             switch (Device.SelectedIndex)
             {
                 case 0:
@@ -134,22 +135,18 @@ namespace UAS_MES_NEW.Make
                 case 2:
                     currFileType = "txt";
                     equiType = "AOI";
-                    SPITimer.Stop();
                     break;
                 case 3:
                     currFileType = "csv";
                     equiType = "印刷机";
-                    SPITimer.Stop();
                     break;
                 case 4:
                     currFileType = "xml";
                     equiType = "贴片机";
-                    SPITimer.Stop();
                     break;
                 case 5:
                     currFileType = "xml";
                     equiType = "贴片机";
-                    SPITimer.Stop();
                     break;
             }
 
@@ -162,13 +159,6 @@ namespace UAS_MES_NEW.Make
                 txtPath.SelectAll();
                 return;
             }
-            //if (string.IsNullOrEmpty(ma_code.Text))
-            //{
-            //    Device.SelectedIndex = -1;
-            //    txtPath.Text = "";
-            //    MessageBox.Show(this.ParentForm, "请选择工单", "提示");
-            //    return;
-            //}
 
             txtPath.Text = fileList[Device.SelectedIndex];
             txtPath.Focus();
@@ -284,7 +274,7 @@ namespace UAS_MES_NEW.Make
             try
             {
                 #region
-                /* 识别文件类型
+                /*
                 var txtFiles = Directory.GetFiles(txtPath.Text, "*.txt");
                 var csvFiles = Directory.GetFiles(txtPath.Text, "*.csv");
                 currFileType = txtFiles.Length > csvFiles.Length ? "txt" : "csv";
@@ -335,24 +325,6 @@ namespace UAS_MES_NEW.Make
                     };
                     foreach (DataRow dr in dt.Rows)
                     {
-                        #region
-                        /*var hasFileAry = Directory.GetFiles(outXmlFilePath, $"*.{currFileType}");
-                        string xmlName;
-                        if (hasFileAry.Length > 0)
-                        {
-                            var lastFile = Directory.GetFiles(outXmlFilePath).Select(f => new FileInfo(f))
-                                            .Where(f => f.CreationTime.Date == DateTime.Today)
-                                            .OrderByDescending(f => f.CreationTime).FirstOrDefault().Name;
-
-                            string seqNumStr = lastFile.Substring(lastFile.Length - 7, 3);
-                            string fileSeqNum = (int.Parse(seqNumStr) + 1).ToString().PadLeft(seqNumStr.Length, '0'); ;
-                            xmlName = $"1.08_{currentDate}_{currentDate}{fileSeqNum}__RequestTotalProduction.xml";
-                        }
-                        else
-                        {
-                            xmlName = $"1.08_{currentDate}_{currentDate}001__RequestTotalProduction.xml";
-                        }*/
-                        #endregion
                         string xmlName = $"1.08__{currentDate1}T101505_{currentDate}001__RequestTotalProduction.xml";
                         string fullPath = Path.Combine(outXmlFilePath, xmlName);
 
@@ -486,13 +458,7 @@ namespace UAS_MES_NEW.Make
                             {
                                 if (LogicHandler.SetStepResult(omakeCode, User.UserSourceCode, SN, "日志解析", "OK", User.UserCode, out oErrorMessage))
                                 {
-                                    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, ma_code.Text, User.UserLineCode, User.UserSourceCode, "日志解析", "日志解析成功", SN, "");
+                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, omakeCode, User.UserLineCode, User.UserSourceCode, "日志解析", "日志解析成功", SN, "");
                                     LogMessage($"处理过站成功");
                                 }
                                 else
@@ -520,83 +486,6 @@ namespace UAS_MES_NEW.Make
                                     File.Delete(file);
                                 }
                             }
-                            #region // 20250630 M 调整对接方式 
-                            /*List<SpiData> csvData; 
-                            //csvData = ParseCsvFile(file);
-                            csvData = ParseCsvFile<SpiData>(file, MapToSpiData);
-
-                            List<string> Barcode = new List<string>();
-                            List<string> Date = new List<string>();
-
-                            List<string> AreaPercent = new List<string>();
-                            List<string> Height = new List<string>();
-                            List<string> VolumePercent = new List<string>();
-                            List<string> XOffset = new List<string>();
-                            List<string> YOffset = new List<string>();
-                            List<string> PadSizeX = new List<string>();
-                            List<string> PadSizeY = new List<string>();
-                            List<string> Area = new List<string>();
-                            List<string> HeightPercent = new List<string>();
-                            List<string> Volume = new List<string>();
-                            List<string> Result = new List<string>();
-
-                            foreach (var item in csvData)
-                            {
-                                Barcode.Add(item.Barcode);
-                                Date.Add(item.Date);
-                                Result.Add(item.Result);
-
-                                AreaPercent.Add(item.AreaPercent);
-                                Height.Add(item.Height);
-                                VolumePercent.Add(item.VolumePercent);
-                                XOffset.Add(item.XOffset);
-                                YOffset.Add(item.YOffset);
-                                PadSizeX.Add(item.PadSizeX);
-                                PadSizeY.Add(item.PadSizeY);
-                                Area.Add(item.Area);
-                                HeightPercent.Add(item.HeightPercent);
-                                Volume.Add(item.Volume);
-                            }
-
-                            if (csvData.Count == 0)
-                            {
-                                LogMessage($"文件: {file},读取记录 {csvData.Count} 条");
-                                return;
-                            }
-
-                            sql.Clear();
-                            sql.Append($@"INSERT INTO steptestdetail (std_id,std_sn,std_makecode,
-                                                    std_testresult,std_class,std_actualvalue,
-                                                    std_rescode,STD_SUBCLASS1,STD_VALUE1,
-                                                    STD_VALUE2,STD_VALUE3,STD_VALUE4,
-                                                    STD_VALUE5,STD_VALUE6,STD_VALUE7,
-                                                    STD_VALUE8,STD_VALUE9,STD_VALUE10)
-                                                    (select steptestdetail_seq.nextval,:Barcode,'{ma_code.Text}',
-                                                    :Result,'{equiType}','notfound',
-                                                    '{User.UserSourceCode}','{equiType}',:AreaPercent,
-                                                    :Height,:VolumePercent,:XOffset,
-                                                    :YOffset,:PadSizeX,:PadSizeY,
-                                                    :Area,:HeightPercent,:Volume from dual)");
-
-                            dh.BatchInsert(sql.GetString(),
-                                new string[] { "Barcode", "Result", "AreaPercent",
-                                        "Height" ,"VolumePercent","XOffset",
-                                        "YOffset","PadSizeX","PadSizeY",
-                                        "Area","HeightPercent","Volume"},
-                                Barcode.ToArray(), Result.ToArray(), AreaPercent.ToArray(),
-                                Height.ToArray(), VolumePercent.ToArray(), XOffset.ToArray(),
-                                YOffset.ToArray(), PadSizeX.ToArray(), PadSizeY.ToArray(),
-                                Area.ToArray(), HeightPercent.ToArray(), Volume.ToArray());
-
-
-                            LogMessage($"文件: {file},共{csvData.Count}条记录,已解析");
-
-                            string xmlContent = File.ReadAllText(file);
-                            if (ConsoleLog(xmlContent, file))
-                            {
-                                File.Delete(file);
-                            }*/
-                            #endregion
                         }
                         else if (Device.SelectedIndex == 2) // AOI
                         {
@@ -775,9 +664,6 @@ namespace UAS_MES_NEW.Make
                             if (!dh.CheckExist("productsmt", "ps_prodcode='" + Part_ + "' and PS_LINECODE = '"+ lineId  + "'"))
                             {
                                 ps_id = dh.GetSEQ("productsmt_seq");
-                                /*dh.ExecuteSql("insert into productsmt(ps_id,ps_prodcode,ps_status,ps_statuscode,PS_LINECODE,PS_CODE,PS_TABLE,PS_INDATE,PS_AUDITDATE)" +
-                                    "values('" + ps_id + "','" + Part_ + "','在录入','ENTERING','" + lineId + "','" + PS_CODE + "','A',SYSDATE,SYSDATE)", "insert");*/
-
                                 dh.ExecuteSql("insert into productsmt(ps_id,ps_prodcode,ps_status,ps_statuscode,PS_LINECODE,PS_CODE,PS_TABLE,PS_INDATE,PS_AUDITDATE,PS_AUDITMAN)" +
                                     "values('" + ps_id + "','" + Part_ + "','已审核','AUDITED','" + lineId + "','" + PS_CODE + "','"+ Side_ + "',SYSDATE,SYSDATE,'"+ User.UserName +"')", "insert");
                             }
@@ -1070,16 +956,11 @@ namespace UAS_MES_NEW.Make
                             if (equiType == "AOI")
                             {
                                 passStationRes = item.Result == "PASS" ? "OK" : "NG";
+                                ma_code.Text = "";
                             }
                             if (LogicHandler.SetStepResult(omakeCode, User.UserSourceCode, item.SN, "日志解析", passStationRes, User.UserCode, out oErrorMessage))
                             {
-                                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, ma_code.Text, User.UserLineCode, User.UserSourceCode, "日志解析", "日志解析成功", item.SN, "");
+                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, omakeCode, User.UserLineCode, User.UserSourceCode, "日志解析", "日志解析成功", item.SN, "");
 
                                 param.Add(item.SN);
                                 param.Add(omakeCode);