AutoImoport/AutoProcess fix
This commit is contained in:
@@ -301,12 +301,20 @@ public class LayersController : Controller
|
|||||||
var type = importWorker.Records!.FirstOrDefault(x => x.Code == "ImportType")?.Desc1 ?? "Standard";
|
var type = importWorker.Records!.FirstOrDefault(x => x.Code == "ImportType")?.Desc1 ?? "Standard";
|
||||||
var source = importWorker.Records!.FirstOrDefault(x => x.Code == "Source")?.Desc1 ?? "GoogleSheet";
|
var source = importWorker.Records!.FirstOrDefault(x => x.Code == "Source")?.Desc1 ?? "GoogleSheet";
|
||||||
|
|
||||||
|
var plugin = importWorker.Records!.FirstOrDefault(x => x.Code == "Plugin")?.Desc1;
|
||||||
|
if (plugin == null)
|
||||||
|
{
|
||||||
|
_logger.LogError("AutoImport: Plugin not found for layer {LayerName} ({LayerId}), skipping",
|
||||||
|
importWorker.Name, importWorker.Id);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
_logger.LogInformation("AutoImport: Processing layer {LayerName} with type {ImportType} and source {Source}",
|
_logger.LogInformation("AutoImport: Processing layer {LayerName} with type {ImportType} and source {Source}",
|
||||||
importWorker.Name, type, source);
|
importWorker.Name, type, source);
|
||||||
|
|
||||||
if (source == "DataInbox" && type == "Import-D3")
|
if (source == "DataInbox" && type == "Import-D3")
|
||||||
{
|
{
|
||||||
var d3Importer = _pluginManager.GetImporter("MorskaD3");
|
var d3Importer = _pluginManager.GetImporter(plugin);
|
||||||
if (d3Importer == null)
|
if (d3Importer == null)
|
||||||
{
|
{
|
||||||
throw new Exception("MorskaD3 importer not found");
|
throw new Exception("MorskaD3 importer not found");
|
||||||
@@ -321,7 +329,7 @@ public class LayersController : Controller
|
|||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case "D1":
|
case "D1":
|
||||||
var d1importer = _pluginManager.GetImporter("MorskaD1");
|
var d1importer = _pluginManager.GetImporter(plugin);
|
||||||
if (d1importer == null)
|
if (d1importer == null)
|
||||||
{
|
{
|
||||||
throw new Exception("MorskaD1 importer not found");
|
throw new Exception("MorskaD1 importer not found");
|
||||||
@@ -334,7 +342,7 @@ public class LayersController : Controller
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "FK2":
|
case "FK2":
|
||||||
var fk2importer = _pluginManager.GetImporter("MorskaFK2");
|
var fk2importer = _pluginManager.GetImporter(plugin);
|
||||||
if (fk2importer == null)
|
if (fk2importer == null)
|
||||||
{
|
{
|
||||||
throw new Exception("MorskaFK2 importer not found");
|
throw new Exception("MorskaFK2 importer not found");
|
||||||
@@ -364,7 +372,7 @@ public class LayersController : Controller
|
|||||||
|
|
||||||
if (startDateParsed.Date <= DateTime.UtcNow.Date && endDateParsed.Date >= DateTime.UtcNow.Date)
|
if (startDateParsed.Date <= DateTime.UtcNow.Date && endDateParsed.Date >= DateTime.UtcNow.Date)
|
||||||
{
|
{
|
||||||
var importer = _pluginManager.GetImporter("MorskaImporter");
|
var importer = _pluginManager.GetImporter(plugin);
|
||||||
if (importer == null)
|
if (importer == null)
|
||||||
{
|
{
|
||||||
throw new Exception("MorskaImporter not found");
|
throw new Exception("MorskaImporter not found");
|
||||||
@@ -377,7 +385,7 @@ public class LayersController : Controller
|
|||||||
}
|
}
|
||||||
else if (IsImportedLayerUpToDate(importWorker) == false)
|
else if (IsImportedLayerUpToDate(importWorker) == false)
|
||||||
{
|
{
|
||||||
var importer = _pluginManager.GetImporter("MorskaImporter");
|
var importer = _pluginManager.GetImporter(plugin);
|
||||||
if (importer == null)
|
if (importer == null)
|
||||||
{
|
{
|
||||||
throw new Exception("MorskaImporter not found");
|
throw new Exception("MorskaImporter not found");
|
||||||
@@ -501,6 +509,12 @@ public class LayersController : Controller
|
|||||||
throw new Exception("Year record not found");
|
throw new Exception("Year record not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var plugin = processWorker.Records?.SingleOrDefault(x => x.Code == "Plugin")?.Desc1;
|
||||||
|
if (plugin == null)
|
||||||
|
{
|
||||||
|
throw new Exception("Plugin record not found");
|
||||||
|
}
|
||||||
|
|
||||||
var processType = processWorker.Records?.SingleOrDefault(x => x.Code == "ProcessType")?.Desc1;
|
var processType = processWorker.Records?.SingleOrDefault(x => x.Code == "ProcessType")?.Desc1;
|
||||||
switch (processType)
|
switch (processType)
|
||||||
{
|
{
|
||||||
@@ -508,7 +522,7 @@ public class LayersController : Controller
|
|||||||
throw new Exception("ProcessType record not found");
|
throw new Exception("ProcessType record not found");
|
||||||
case "T3-SourceYearSummary":
|
case "T3-SourceYearSummary":
|
||||||
{
|
{
|
||||||
var processor = _pluginManager.GetProcessor("T3.SourceYearSummary");
|
var processor = _pluginManager.GetProcessor(plugin);
|
||||||
if (processor == null)
|
if (processor == null)
|
||||||
{
|
{
|
||||||
throw new Exception("T3.SourceYearSummary processor not found");
|
throw new Exception("T3.SourceYearSummary processor not found");
|
||||||
@@ -518,7 +532,7 @@ public class LayersController : Controller
|
|||||||
}
|
}
|
||||||
case "T3-MultiSourceYearSummary":
|
case "T3-MultiSourceYearSummary":
|
||||||
{
|
{
|
||||||
var processor = _pluginManager.GetProcessor("T3.MultiSourceYearSummary");
|
var processor = _pluginManager.GetProcessor(plugin);
|
||||||
if (processor == null)
|
if (processor == null)
|
||||||
{
|
{
|
||||||
throw new Exception("T3.MultiSourceYearSummary processor not found");
|
throw new Exception("T3.MultiSourceYearSummary processor not found");
|
||||||
@@ -528,7 +542,7 @@ public class LayersController : Controller
|
|||||||
}
|
}
|
||||||
case "T3-MultiSourceCopySelectedCodesYearSummary":
|
case "T3-MultiSourceCopySelectedCodesYearSummary":
|
||||||
{
|
{
|
||||||
var processor = _pluginManager.GetProcessor("T3.MultiSourceCopySelectedCodesYearSummary");
|
var processor = _pluginManager.GetProcessor(plugin);
|
||||||
if (processor == null)
|
if (processor == null)
|
||||||
{
|
{
|
||||||
throw new Exception("T3.MultiSourceCopySelectedCodesYearSummary processor not found");
|
throw new Exception("T3.MultiSourceCopySelectedCodesYearSummary processor not found");
|
||||||
@@ -538,7 +552,7 @@ public class LayersController : Controller
|
|||||||
}
|
}
|
||||||
case "T1-R1":
|
case "T1-R1":
|
||||||
{
|
{
|
||||||
var processor = _pluginManager.GetProcessor("T1.R1");
|
var processor = _pluginManager.GetProcessor(plugin);
|
||||||
if (processor == null)
|
if (processor == null)
|
||||||
{
|
{
|
||||||
throw new Exception("T1.R1 processor not found");
|
throw new Exception("T1.R1 processor not found");
|
||||||
@@ -548,7 +562,7 @@ public class LayersController : Controller
|
|||||||
}
|
}
|
||||||
case "T4-R2":
|
case "T4-R2":
|
||||||
{
|
{
|
||||||
var processor = _pluginManager.GetProcessor("T4.R2");
|
var processor = _pluginManager.GetProcessor(plugin);
|
||||||
if (processor == null)
|
if (processor == null)
|
||||||
{
|
{
|
||||||
throw new Exception("T4.R2 processor not found");
|
throw new Exception("T4.R2 processor not found");
|
||||||
@@ -558,7 +572,7 @@ public class LayersController : Controller
|
|||||||
}
|
}
|
||||||
case "T1-R3":
|
case "T1-R3":
|
||||||
{
|
{
|
||||||
var processor = _pluginManager.GetProcessor("T1.R3");
|
var processor = _pluginManager.GetProcessor(plugin);
|
||||||
if (processor == null)
|
if (processor == null)
|
||||||
{
|
{
|
||||||
throw new Exception("T1.R3 processor not found");
|
throw new Exception("T1.R3 processor not found");
|
||||||
@@ -578,7 +592,7 @@ public class LayersController : Controller
|
|||||||
{
|
{
|
||||||
case "T3-SingleSource":
|
case "T3-SingleSource":
|
||||||
{
|
{
|
||||||
var t3SingleSource = _pluginManager.GetProcessor("T3.SingleSource");
|
var t3SingleSource = _pluginManager.GetProcessor(plugin);
|
||||||
if (t3SingleSource == null)
|
if (t3SingleSource == null)
|
||||||
{
|
{
|
||||||
throw new Exception("T3.SingleSource processor not found");
|
throw new Exception("T3.SingleSource processor not found");
|
||||||
@@ -588,7 +602,7 @@ public class LayersController : Controller
|
|||||||
}
|
}
|
||||||
case "T4-SingleSource":
|
case "T4-SingleSource":
|
||||||
{
|
{
|
||||||
var t4SingleSource = _pluginManager.GetProcessor("T4.SingleSource");
|
var t4SingleSource = _pluginManager.GetProcessor(plugin);
|
||||||
if (t4SingleSource == null)
|
if (t4SingleSource == null)
|
||||||
{
|
{
|
||||||
throw new Exception("T4.SingleSource processor not found");
|
throw new Exception("T4.SingleSource processor not found");
|
||||||
@@ -598,7 +612,7 @@ public class LayersController : Controller
|
|||||||
}
|
}
|
||||||
case "T5-LastValues":
|
case "T5-LastValues":
|
||||||
{
|
{
|
||||||
var t5LastValues = _pluginManager.GetProcessor("T5.LastValues");
|
var t5LastValues = _pluginManager.GetProcessor(plugin);
|
||||||
if (t5LastValues == null)
|
if (t5LastValues == null)
|
||||||
{
|
{
|
||||||
throw new Exception("T5.LastValues processor not found");
|
throw new Exception("T5.LastValues processor not found");
|
||||||
@@ -608,7 +622,7 @@ public class LayersController : Controller
|
|||||||
}
|
}
|
||||||
case "T3-MultiSourceSummary":
|
case "T3-MultiSourceSummary":
|
||||||
{
|
{
|
||||||
var t3MultiSourceSummary = _pluginManager.GetProcessor("T3.MultiSourceSummary");
|
var t3MultiSourceSummary = _pluginManager.GetProcessor(plugin);
|
||||||
if (t3MultiSourceSummary == null)
|
if (t3MultiSourceSummary == null)
|
||||||
{
|
{
|
||||||
throw new Exception("T3.MultiSourceSummary processor not found");
|
throw new Exception("T3.MultiSourceSummary processor not found");
|
||||||
@@ -618,7 +632,7 @@ public class LayersController : Controller
|
|||||||
}
|
}
|
||||||
case "T3-MultiSourceCopySelectedCodes":
|
case "T3-MultiSourceCopySelectedCodes":
|
||||||
{
|
{
|
||||||
var t3MultiSourceCopySelectedCode = _pluginManager.GetProcessor("T3.MultiSourceCopySelectedCodes");
|
var t3MultiSourceCopySelectedCode = _pluginManager.GetProcessor(plugin);
|
||||||
if (t3MultiSourceCopySelectedCode == null)
|
if (t3MultiSourceCopySelectedCode == null)
|
||||||
{
|
{
|
||||||
throw new Exception("T3.MultiSourceCopySelectedCodes processor not found");
|
throw new Exception("T3.MultiSourceCopySelectedCodes processor not found");
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
###
|
###
|
||||||
GET http://localhost:5400/api/Layers/CheckProcessors
|
GET http://localhost:5400/api/Layers/AutoProcess/10763478CB738D4ecb2h76g803478CB738D4e
|
||||||
Timeout: 500000
|
Timeout: 500000
|
||||||
|
|||||||
Reference in New Issue
Block a user