ソースを参照

优化设备一次性多条测试记录系统记录

yhluo 4 ヶ月 前
コミット
0c140d5a23
1 ファイル変更18 行追加1 行削除
  1. 18 1
      UAS_MES_BG/FunctionCode/Make/Make_ParseLog.cs

+ 18 - 1
UAS_MES_BG/FunctionCode/Make/Make_ParseLog.cs

@@ -916,6 +916,7 @@ namespace UAS_MES_NEW.Make
                     if (string.IsNullOrEmpty(item)) continue;
                     string[] currItem = item.Split(',');
                     string res = "",wo = "",detail = "",line = "",sn = "";
+                    bool hasSn = false;
                     sn = currItem[0];
                     if (string.IsNullOrEmpty(sn))
                     {
@@ -973,8 +974,24 @@ namespace UAS_MES_NEW.Make
                         Result = res,
                         Details = detail
                     };
-                    logArr.Add(itemLog);
 
+                    foreach (var appendItem in logArr)
+                    {
+                        if(appendItem.SN == sn)
+                        {
+                            if(itemLog.Result.ToUpper() != "PASS")
+                            {
+                                appendItem.Result = itemLog.Result;
+                                appendItem.Details = itemLog.Details;
+                            }
+                            hasSn = true;
+                        }
+                    }
+
+                    if (!hasSn) 
+                    {
+                        logArr.Add(itemLog);
+                    }
                 }
                 if (InsertDb(logArr, PathName, fileNum))
                 {