D1 Process worker fix

This commit is contained in:
Michał Zieliński
2025-06-10 18:37:11 +02:00
parent 80072dca59
commit 0c7ea660e8
5 changed files with 16 additions and 31 deletions

View File

@@ -261,6 +261,8 @@ public class MorskaT5LastValuesProcessor : MorskaBaseProcessor
ProcessHelper.SetValue(processedRecord, i, value); ProcessHelper.SetValue(processedRecord, i, value);
} }
} }
processedRecord.Desc1 = lastRecord.Desc1;
return processedRecord; return processedRecord;
} }

View File

@@ -277,7 +277,6 @@ public class LayersController : Controller
x.Name != null && x.Name.Contains(nameFilter) && x.Name != null && x.Name.Contains(nameFilter) &&
x.Records!.Any(y => y.Code == "Type" && y.Desc1 == "ImportWorker") && x.Records!.Any(y => y.Code == "Type" && y.Desc1 == "ImportWorker") &&
x.Records!.Any(y => y.Code == "IsEnabled" && y.Desc1 == "True" x.Records!.Any(y => y.Code == "IsEnabled" && y.Desc1 == "True"
&& x.Number == 5375
) )
) )
.OrderByDescending(x => x.CreatedAt) .OrderByDescending(x => x.CreatedAt)
@@ -330,12 +329,12 @@ public class LayersController : Controller
switch (type) switch (type)
{ {
case "D1": case "D1":
var d1importer = _pluginManager.GetImporter(plugin); 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");
} }
d1importer.Import(importWorker); d1Importer.Import(importWorker);
Thread.Sleep(5000); // be aware of GSheet API quota Thread.Sleep(5000); // be aware of GSheet API quota
_logger.LogInformation("AutoImport: Successfully processed D1 import for {LayerName} ({LayerId})", _logger.LogInformation("AutoImport: Successfully processed D1 import for {LayerName} ({LayerId})",
@@ -343,12 +342,12 @@ public class LayersController : Controller
break; break;
case "FK2": case "FK2":
var fk2importer = _pluginManager.GetImporter(plugin); 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");
} }
fk2importer.Import(importWorker); fk2Importer.Import(importWorker);
Thread.Sleep(5000); // be aware of GSheet API quota Thread.Sleep(5000); // be aware of GSheet API quota
_logger.LogInformation("AutoImport: Successfully processed FK2 import for {LayerName} ({LayerId})", _logger.LogInformation("AutoImport: Successfully processed FK2 import for {LayerName} ({LayerId})",

View File

@@ -31,10 +31,6 @@
</Content> </Content>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="plugins\" />
</ItemGroup>
<Target Name="CopyPlugins" AfterTargets="Build"> <Target Name="CopyPlugins" AfterTargets="Build">
<MSBuild Projects="../DiunaBI.Plugins.Morska/DiunaBI.Plugins.Morska.csproj" Properties="Configuration=$(Configuration);TargetFramework=$(TargetFramework)" /> <MSBuild Projects="../DiunaBI.Plugins.Morska/DiunaBI.Plugins.Morska.csproj" Properties="Configuration=$(Configuration);TargetFramework=$(TargetFramework)" />

View File

@@ -1,15 +1,14 @@
-- T3-MultiSourceSummary -- Create Dictionary
DECLARE @JustForDebug TINYINT = 0; DECLARE @JustForDebug TINYINT = 0;
-- SETUP VARIABLES -- SETUP VARIABLES
DECLARE @Number INT = (SELECT COUNT(id) + 1 FROM [diunabi-morska].[dbo].[Layers]); DECLARE @Number INT = (SELECT COUNT(id) + 1 FROM [diunabi-morska].[dbo].[Layers]);
DECLARE @CurrentTimestamp NVARCHAR(14) = FORMAT(GETDATE(), 'yyyyMMddHHmm');
DECLARE @Name NVARCHAR(50) = CONCAT( DECLARE @Name NVARCHAR(50) = CONCAT(
'L', @Number, '-D-D3_B2B-', @CurrentTimestamp 'L', @Number, '-D-DEPARTMENTS'
); );
DECLARE @LayerId UNIQUEIDENTIFIER = NEWID(); DECLARE @LayerId UNIQUEIDENTIFIER = NEWID();
SELECT @Name AS Name, @Query AS Query; SELECT @Name AS Name;
IF @JustForDebug = 1 IF @JustForDebug = 1
BEGIN BEGIN
@@ -28,21 +27,10 @@ DECLARE @Array TABLE (
INSERT INTO @Array (Code, Desc1) INSERT INTO @Array (Code, Desc1)
VALUES VALUES
('3089','402-2-001'), ('0', 'OTHER'),
('3084','402-2-002'), ('1','K5'),
('3045','402-2-003'), ('2','AK'),
('????','402-2-004', 'GODLEWSKA JOANNA'), ('3','PU')
('????','402-2-005', 'HABOWSKA URSZULA'),
('3010','JANCZEWSKA DOROTA'),
('????','402-2-007', 'PROMEDA SP ZOO'),
('3091','402-2-008'),
('3090','402-2-009'),
('3092','402-2-010'),
('????','402-2-011'),
('3093','402-2-012'),
('????','402-2-013', 'ŚWINIARSKA BEATA'),
('3094','402-2-014'),
('????','402-2-015', 'WIERZBOWSKA');
-- Loop through the array and insert into the target table -- Loop through the array and insert into the target table
DECLARE @Code NVARCHAR(50); DECLARE @Code NVARCHAR(50);

View File

@@ -1,3 +1,3 @@
DECLARE @LayerId UNIQUEIDENTIFIER = '41e7377c-aa8c-4528-843d-dcc3fe13b412'; DECLARE @LayerId UNIQUEIDENTIFIER = '986e8a71-8cad-4e57-8fce-243a9270b9dc';
DELETE FROM [diunabi-morska].[dbo].[Records] WHERE [LayerId] = @LayerId; DELETE FROM [diunabi-morska].[dbo].[Records] WHERE [LayerId] = @LayerId;
DELETE FROM [diunabi-morska].[dbo].[Layers] WHERE [Id] = @LayerId; DELETE FROM [diunabi-morska].[dbo].[Layers] WHERE [Id] = @LayerId;