Skip to content

Commit

Permalink
Check sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryba1986 committed Nov 10, 2023
1 parent 5c5ebdf commit 947d353
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/Phoenix.Services/Reports/Plcs/ClimatixPlcProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ public async Task FillDataAsync(UnitOfWork uow, ExcelWorksheets sheets, DateOnly
IReadOnlyDictionary<int, ClimatixReportDto[]> plcData = await PlcHandlerHelper.GetPlcDataAsync(uow.Climatix, range, typeProcessor, ClimatixMappings.ToClimatixReportDto, cancellationToken);
foreach (KeyValuePair<int, ClimatixReportDto[]> plc in plcData)
{
FillData(sheets[plc.Key.ToString()], plc.Value, typeProcessor);
ExcelWorksheet? sheet = sheets.FirstOrDefault(x => x.Name == plc.Key.ToString());
if (sheet is null)
{
continue;
}

FillData(sheet, plc.Value, typeProcessor);
}
}

Expand Down
8 changes: 7 additions & 1 deletion src/Phoenix.Services/Reports/Plcs/KamstrupPlcProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ public async Task FillDataAsync(UnitOfWork uow, ExcelWorksheets sheets, DateOnly
IReadOnlyDictionary<int, KamstrupReportDto[]> plcData = await PlcHandlerHelper.GetPlcDataAsync(uow.Kamstrup, range, typeProcessor, KamstrupMappings.ToKamstrupReportDto, cancellationToken);
foreach (KeyValuePair<int, KamstrupReportDto[]> plc in plcData)
{
ExcelWorksheet? sheet = sheets.FirstOrDefault(x => x.Name == plc.Key.ToString());
if (sheet is null)
{
continue;
}

KamstrupDto before = await GetBeforeDataAsync(uow, plc.Key, range.Item1, cancellationToken);
FillData(sheets[plc.Key.ToString()], before, plc.Value, typeProcessor);
FillData(sheet, before, plc.Value, typeProcessor);
}
}

Expand Down
8 changes: 7 additions & 1 deletion src/Phoenix.Services/Reports/Plcs/Rvd145PlcProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ public async Task FillDataAsync(UnitOfWork uow, ExcelWorksheets sheets, DateOnly
IReadOnlyDictionary<int, Rvd145ReportDto[]> plcData = await PlcHandlerHelper.GetPlcDataAsync(uow.Rvd145, range, typeProcessor, Rvd145Mappings.ToRvd145ReportDto, cancellationToken);
foreach (KeyValuePair<int, Rvd145ReportDto[]> plc in plcData)
{
FillData(sheets[plc.Key.ToString()], plc.Value, typeProcessor);
ExcelWorksheet? sheet = sheets.FirstOrDefault(x => x.Name == plc.Key.ToString());
if (sheet is null)
{
continue;
}

FillData(sheet, plc.Value, typeProcessor);
}
}

Expand Down

0 comments on commit 947d353

Please sign in to comment.