|
|
|
@ -219,7 +219,7 @@ namespace SlnMesnac.TouchSocket
|
|
|
|
|
Ocr = scanLog.ocr,
|
|
|
|
|
Url = scanLog.url,
|
|
|
|
|
IsOk = scanLog.isOk,
|
|
|
|
|
Result = scanLog.result,
|
|
|
|
|
Result = scanLog.result
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ScanLogSocketAction?.Invoke(model);
|
|
|
|
@ -361,8 +361,7 @@ namespace SlnMesnac.TouchSocket
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if(string.IsNullOrEmpty(sourceImagePath))
|
|
|
|
|
if (string.IsNullOrEmpty(sourceImagePath))
|
|
|
|
|
{
|
|
|
|
|
throw new ArgumentNullException("全景图像路径为空");
|
|
|
|
|
}
|
|
|
|
@ -381,24 +380,49 @@ namespace SlnMesnac.TouchSocket
|
|
|
|
|
if (!Directory.Exists(destinationFolder))
|
|
|
|
|
{
|
|
|
|
|
Directory.CreateDirectory(destinationFolder);
|
|
|
|
|
|
|
|
|
|
// 创建 ok、ng、mul 文件夹
|
|
|
|
|
string okFolder = Path.Combine(destinationFolder, "ok");
|
|
|
|
|
string ngFolder = Path.Combine(destinationFolder, "ng");
|
|
|
|
|
string mulFolder = Path.Combine(destinationFolder, "mul");
|
|
|
|
|
Directory.CreateDirectory(okFolder);
|
|
|
|
|
Directory.CreateDirectory(ngFolder);
|
|
|
|
|
Directory.CreateDirectory(mulFolder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string sourceFileName = Path.GetFileName(sourceImagePath);
|
|
|
|
|
string extension = Path.GetExtension(sourceImagePath);
|
|
|
|
|
|
|
|
|
|
string newFileName = now.ToString("yyyyMMddHHmmss") + "-" + fileName + extension;
|
|
|
|
|
string newFileName = now.ToString("HHmmssfff") + "-" + fileName + extension;
|
|
|
|
|
|
|
|
|
|
destinationImagePath = Path.Combine(destinationFolder, newFileName);
|
|
|
|
|
string subFolder = DetermineSubFolder(fileName);
|
|
|
|
|
destinationImagePath = Path.Combine(destinationFolder, subFolder, newFileName);
|
|
|
|
|
|
|
|
|
|
File.Copy(sourceImagePath, destinationImagePath, true);
|
|
|
|
|
|
|
|
|
|
File.Delete(sourceImagePath);
|
|
|
|
|
//File.Delete(sourceImagePath);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
throw new InvalidOperationException($"将全景图像复制到指定路径处理异常:{ex.Message}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private string DetermineSubFolder(string fileName)
|
|
|
|
|
{
|
|
|
|
|
if (fileName.Contains("ead"))
|
|
|
|
|
{
|
|
|
|
|
return "ng";
|
|
|
|
|
}
|
|
|
|
|
else if (fileName.Contains("多条码"))
|
|
|
|
|
{
|
|
|
|
|
return "mul";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return "ok";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|