WIP: D3 importer
This commit is contained in:
@@ -40,13 +40,13 @@ public class MorskaD3Importer(
|
||||
throw new Exception($"DataInbox not found, {type}");
|
||||
}
|
||||
var data = Convert.FromBase64String(dataInbox.Data);
|
||||
var tst = Encoding.UTF8.GetString(data);
|
||||
var records = JsonSerializer.Deserialize<List<Record>>(Encoding.UTF8.GetString(data));
|
||||
if (records == null)
|
||||
{
|
||||
throw new Exception($"DataInbox.Data is empty, {dataInbox.Name}");
|
||||
}
|
||||
year = "2024";
|
||||
records = records.Where(x => x.Code!.EndsWith($"{year}{month}")).ToList();
|
||||
records = records.Where(x => x.Code!.StartsWith($"{year}{month}")).ToList();
|
||||
if (records.Count == 0)
|
||||
{
|
||||
throw new Exception($"No records found for {year}{month}");
|
||||
@@ -72,6 +72,6 @@ public class MorskaD3Importer(
|
||||
|
||||
db.Layers.Add(layer);
|
||||
controller.SaveRecords(layer.Id, records, Guid.Parse("F392209E-123E-4651-A5A4-0B1D6CF9FF9D"));
|
||||
//db.SaveChanges();
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user