|
|
@@ -816,9 +816,11 @@ namespace UAS_MES_NEW.Make
|
|
|
List<Log> logArr = new List<Log>() { };
|
|
|
string[] lines = restOfStream.Split(new string[] { "\r\n" }, StringSplitOptions.None);
|
|
|
int fileNum = string.IsNullOrEmpty(lines[lines.Length - 1]) ? lines.Length - 1 : lines.Length;
|
|
|
+ int isItemErrorCount = 0, trueRows = 0;
|
|
|
foreach (var item in lines)
|
|
|
{
|
|
|
if (string.IsNullOrEmpty(item)) continue;
|
|
|
+ trueRows += 1;
|
|
|
string[] currItem = item.Split(',');
|
|
|
string res = "",wo = "",detail = "",line = "",sn = "";
|
|
|
bool hasSn = false;
|
|
|
@@ -859,8 +861,16 @@ namespace UAS_MES_NEW.Make
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LogMessage($"NG,文件{PathName} 序列号{currItem[0]}无归属过站记录");
|
|
|
- continue;
|
|
|
+ if(Regex.IsMatch(currItem[0], @"^[a-zA-Z]"))
|
|
|
+ {
|
|
|
+ LogMessage($"NG,文件{PathName} 序列号{currItem[0]}无归属过站记录");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ isItemErrorCount += 1;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (string.IsNullOrEmpty(wo) && string.IsNullOrEmpty(line))
|
|
|
@@ -916,6 +926,14 @@ namespace UAS_MES_NEW.Make
|
|
|
File.Delete(PathName);
|
|
|
}
|
|
|
}
|
|
|
+ if (trueRows == isItemErrorCount)
|
|
|
+ {
|
|
|
+ if (ConsoleLog(restOfStream, PathName))
|
|
|
+ {
|
|
|
+ File.WriteAllText(PathName, string.Empty);
|
|
|
+ File.Delete(PathName);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|