Save check for file already present
This commit is contained in:
parent
445a0ac773
commit
5448546b96
@ -182,6 +182,7 @@ public class FromIQS
|
|||||||
|
|
||||||
internal static void Save(string openInsightApiECDirectory, string openInsightApiIFXDirectory, Logistics logistics, string reportFullPath, string logisticLines, Stratus.Description description, string lines, long? subGroupId, string weekOfYear)
|
internal static void Save(string openInsightApiECDirectory, string openInsightApiIFXDirectory, Logistics logistics, string reportFullPath, string logisticLines, Stratus.Description description, string lines, long? subGroupId, string weekOfYear)
|
||||||
{
|
{
|
||||||
|
string checkFile;
|
||||||
string fileName = Path.GetFileName(reportFullPath);
|
string fileName = Path.GetFileName(reportFullPath);
|
||||||
string json = GetJson(logistics, logisticLines, description);
|
string json = GetJson(logistics, logisticLines, description);
|
||||||
string? ecPathRoot = Path.GetPathRoot(openInsightApiECDirectory);
|
string? ecPathRoot = Path.GetPathRoot(openInsightApiECDirectory);
|
||||||
@ -195,18 +196,24 @@ public class FromIQS
|
|||||||
_ = Directory.CreateDirectory(ecDirectory);
|
_ = Directory.CreateDirectory(ecDirectory);
|
||||||
if (ifxExists && !Directory.Exists(ifxDirectory))
|
if (ifxExists && !Directory.Exists(ifxDirectory))
|
||||||
_ = Directory.CreateDirectory(ifxDirectory);
|
_ = Directory.CreateDirectory(ifxDirectory);
|
||||||
if (ecExists)
|
checkFile = Path.Combine(ecDirectory, fileName);
|
||||||
File.Copy(reportFullPath, Path.Combine(ecDirectory, fileName));
|
if (ecExists && !File.Exists(checkFile))
|
||||||
if (ifxExists)
|
File.Copy(reportFullPath, checkFile);
|
||||||
File.Copy(reportFullPath, Path.Combine(ifxDirectory, fileName));
|
checkFile = Path.Combine(ifxDirectory, fileName);
|
||||||
if (ecExists)
|
if (ifxExists && !File.Exists(checkFile))
|
||||||
File.WriteAllText(Path.Combine(ecDirectory, $"{logistics.DateTimeFromSequence.Ticks}.txt"), lines);
|
File.Copy(reportFullPath, checkFile);
|
||||||
if (ifxExists)
|
checkFile = Path.Combine(ecDirectory, $"{logistics.DateTimeFromSequence.Ticks}.txt");
|
||||||
File.WriteAllText(Path.Combine(ifxDirectory, $"{logistics.DateTimeFromSequence.Ticks}.txt"), lines);
|
if (ecExists && !File.Exists(checkFile))
|
||||||
if (ecExists)
|
File.WriteAllText(checkFile, lines);
|
||||||
File.WriteAllText(Path.Combine(ecDirectory, $"{logistics.DateTimeFromSequence.Ticks}.json"), json);
|
checkFile = Path.Combine(ifxDirectory, $"{logistics.DateTimeFromSequence.Ticks}.txt");
|
||||||
if (ifxExists)
|
if (ifxExists && !File.Exists(checkFile))
|
||||||
File.WriteAllText(Path.Combine(ifxDirectory, $"{logistics.DateTimeFromSequence.Ticks}.json"), json);
|
File.WriteAllText(checkFile, lines);
|
||||||
|
checkFile = Path.Combine(ecDirectory, $"{logistics.DateTimeFromSequence.Ticks}.json");
|
||||||
|
if (ecExists && !File.Exists(checkFile))
|
||||||
|
File.WriteAllText(checkFile, json);
|
||||||
|
checkFile = Path.Combine(ifxDirectory, $"{logistics.DateTimeFromSequence.Ticks}.json");
|
||||||
|
if (ifxExists && !File.Exists(checkFile))
|
||||||
|
File.WriteAllText(checkFile, json);
|
||||||
}
|
}
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
Loading…
x
Reference in New Issue
Block a user