diff --git a/src/OmniaMigrationTool/Services/ExportBlobsService.cs b/src/OmniaMigrationTool/Services/ExportBlobsService.cs index 3b0874b..fb69282 100644 --- a/src/OmniaMigrationTool/Services/ExportBlobsService.cs +++ b/src/OmniaMigrationTool/Services/ExportBlobsService.cs @@ -61,7 +61,8 @@ private async Task Process(string outputPath) { var file = (CloudBlockBlob) listBlobItem; var fileName = GetFileName("Binary", file.Name); - var destinationFile = Path.Combine(outputPath, $"files/{fileName}"); + fileName = fileName.Replace(":", "%3A"); + var destinationFile = Path.Combine(outputPath, $"files\\{fileName}"); Console.WriteLine("Downloading file {0}", fileName); using (var encryptedMemoryStream = new MemoryStream()) @@ -70,7 +71,6 @@ private async Task Process(string outputPath) var encryptedArray = encryptedMemoryStream.ToArray(); var decryptedStream = new MemoryStream(DecryptByteArray(encryptedArray, _encryptionKey)); - await File.WriteAllBytesAsync(destinationFile, decryptedStream.ToArray()); } } diff --git a/src/OmniaMigrationTool/Services/ExportService.cs b/src/OmniaMigrationTool/Services/ExportService.cs index e8061f4..3387e5e 100644 --- a/src/OmniaMigrationTool/Services/ExportService.cs +++ b/src/OmniaMigrationTool/Services/ExportService.cs @@ -522,6 +522,8 @@ object Map(object value) case EntityMapDefinition.AttributeMap.AttributeType.Decimal: if (value is decimal) return value; + if (value is string && value.ToString().Contains("%")) + return Convert.ToDecimal(value.ToString().Replace("%", "")); return Convert.ToDecimal(value); case EntityMapDefinition.AttributeMap.AttributeType.Date: @@ -535,6 +537,10 @@ object Map(object value) default: if (attribute.Target.Equals("_code")) return value.ToString().Substring(0, Math.Min(31, value.ToString().Length)); // TODO: Deal the the difference of size in codes + // Remove spaces from the IncidentCategory code + if (attribute.Target.Equals("IncidentCategory")) + return value.ToString().Replace(" ", ""); + return value.ToString(); } } diff --git a/src/OmniaMigrationTool/Services/ImportBlobsService.cs b/src/OmniaMigrationTool/Services/ImportBlobsService.cs index 59808ea..b4181be 100644 --- a/src/OmniaMigrationTool/Services/ImportBlobsService.cs +++ b/src/OmniaMigrationTool/Services/ImportBlobsService.cs @@ -63,11 +63,11 @@ private async Task Process(string mappingsFolderPath, string filesFolderPath) for (var f = 0; f f.EndsWith($"\\{sourceFileName}", StringComparison.InvariantCultureIgnoreCase)); + var exportedFilePath = exportedFiles.FirstOrDefault(newF => newF.EndsWith($"\\{sourceFileName}", StringComparison.InvariantCultureIgnoreCase)); if (string.IsNullOrEmpty(exportedFilePath)) { Console.WriteLine($"File not found in exported files folder - ignored.");