|
|
@@ -39,6 +39,7 @@ namespace UAS_MES_NEW.Make
|
|
|
|
|
|
DataHelper dh;
|
|
|
string currFileType = "", equiType = "";
|
|
|
+ string ccdTestRes = "OK"; //两面都OK为OK,否则为NG
|
|
|
|
|
|
string SN, omakeCode, oMsid, oErrorMessage = "";
|
|
|
List<string> fileList = new List<string>();
|
|
|
@@ -405,39 +406,47 @@ namespace UAS_MES_NEW.Make
|
|
|
}
|
|
|
else if(equiType == "CCD")
|
|
|
{
|
|
|
+ // 有2面CCD图片开始处理
|
|
|
+ if (txtFiles.Length == 1) break;
|
|
|
+
|
|
|
foreach (var fileItem in txtFiles)
|
|
|
{
|
|
|
string imageName = Path.GetFileName(fileItem);
|
|
|
string iName = imageName.Split('_')[0];
|
|
|
- if (iName.Length > 14)
|
|
|
- {
|
|
|
- SN = iName.Length > 14 ? iName.Substring(3) : "";
|
|
|
- }
|
|
|
-
|
|
|
- if (imageName.ToUpper().Contains("NG"))
|
|
|
+ if (iName[0].ToString() == "A")
|
|
|
{
|
|
|
- if (txtFiles.Length != 3)
|
|
|
+ if (iName.ToUpper().Contains("NG"))
|
|
|
{
|
|
|
- SN = "";
|
|
|
- return;
|
|
|
+ SN = iName.Substring(3);
|
|
|
+ ccdTestRes = ccdTestRes == "NG" ? "NG" : "NG";
|
|
|
}
|
|
|
- }
|
|
|
- else if(imageName.ToUpper().Contains("OK"))
|
|
|
+ else if(iName.ToUpper().Contains("OK"))
|
|
|
+ {
|
|
|
+ SN = iName.Substring(1);
|
|
|
+ ccdTestRes = ccdTestRes == "NG" ? "NG" : "OK";
|
|
|
+ }
|
|
|
+ }else if(iName[0].ToString() == "B")
|
|
|
{
|
|
|
- if (txtFiles.Length != 2)
|
|
|
+ if (iName.ToUpper().Contains("NG"))
|
|
|
{
|
|
|
- SN = "";
|
|
|
- return;
|
|
|
+ ccdTestRes = ccdTestRes == "NG" ? "NG" : "NG";
|
|
|
+ }
|
|
|
+ else if (iName.ToUpper().Contains("OK"))
|
|
|
+ {
|
|
|
+ ccdTestRes = ccdTestRes == "NG" ? "NG" : "OK";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 创建logs目录
|
|
|
string parentPath = Path.GetDirectoryName(file);
|
|
|
string newFolderPath = Path.Combine(parentPath, "Logs");
|
|
|
if (!Directory.Exists(newFolderPath))
|
|
|
{
|
|
|
Directory.CreateDirectory(newFolderPath);
|
|
|
}
|
|
|
+
|
|
|
+ // logs目录下创建sn序列号目录
|
|
|
string changeName = Path.Combine(newFolderPath, SN);
|
|
|
if (!Directory.Exists(changeName))
|
|
|
{
|
|
|
@@ -445,7 +454,6 @@ namespace UAS_MES_NEW.Make
|
|
|
}
|
|
|
|
|
|
string result = Path.GetFileName(file).Split('_')[0];
|
|
|
-
|
|
|
if (result.ToUpper().Contains("NG"))
|
|
|
{
|
|
|
if (UploadImageToFtp(file, SN))
|
|
|
@@ -454,35 +462,37 @@ namespace UAS_MES_NEW.Make
|
|
|
VALUES (steptestmain_seq.NEXTVAL,'{SN}','{ma_code.Text}','{User.UserSourceCode}', sysdate,'CCD', 'http://192.168.1.5:8088/ftp/ccd/{SN}/{Path.GetFileName(file)}' )", "insert");
|
|
|
}
|
|
|
}
|
|
|
- string targetFile = Path.Combine(changeName, Path.GetFileName(file));
|
|
|
|
|
|
- if (File.Exists(targetFile))
|
|
|
+ if(Path.GetFileName(file).Split('_')[0].ToString() == "A") // 只有A面有序列号处理过站
|
|
|
{
|
|
|
- File.Delete(targetFile);
|
|
|
- }
|
|
|
- File.Move(file, targetFile);
|
|
|
-
|
|
|
- if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, SN, User.UserCode, out omakeCode, out oMsid, out oErrorMessage))
|
|
|
- {
|
|
|
- if (LogicHandler.SetStepResult(omakeCode, User.UserSourceCode, SN, "日志解析", "OK", User.UserCode, out oErrorMessage))
|
|
|
+ if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, SN, User.UserCode, out omakeCode, out oMsid, out oErrorMessage))
|
|
|
{
|
|
|
- LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, omakeCode, User.UserLineCode, User.UserSourceCode, "日志解析", "日志解析成功", SN, "");
|
|
|
- LogMessage(1, $"序列号: {SN} 已过站解析");
|
|
|
+ if (LogicHandler.SetStepResult(omakeCode, User.UserSourceCode, SN, "日志解析", "OK", User.UserCode, out oErrorMessage))
|
|
|
+ {
|
|
|
+ LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, omakeCode, User.UserLineCode, User.UserSourceCode, "日志解析", "日志解析成功", SN, "");
|
|
|
+ LogMessage(1, $"序列号: {SN} 已过站解析");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ LogMessage(0, $"序列号: {SN},处理过站NG:{oErrorMessage}");
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LogMessage(0, $"序列号: {SN},处理过站NG:{oErrorMessage}");
|
|
|
+ LogMessage(0, $"序列号: {SN},过站核对NG:{oErrorMessage}");
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
+
|
|
|
+ string targetFile = Path.Combine(changeName, Path.GetFileName(file));
|
|
|
+ if (File.Exists(targetFile))
|
|
|
{
|
|
|
- LogMessage(0, $"序列号: {SN},过站核对NG:{oErrorMessage}");
|
|
|
+ File.Delete(targetFile);
|
|
|
}
|
|
|
+ File.Move(file, targetFile);
|
|
|
}
|
|
|
}
|
|
|
if (equiType == "CCD")
|
|
|
{
|
|
|
-
|
|
|
LogMessage(1, $"序列号: {SN} 图片已处理");
|
|
|
}
|
|
|
}
|