diff --git a/AsbCloudInfrastructure/Services/Subsystems/SubsystemService.cs b/AsbCloudInfrastructure/Services/Subsystems/SubsystemService.cs index 34626f78..c5b38405 100644 --- a/AsbCloudInfrastructure/Services/Subsystems/SubsystemService.cs +++ b/AsbCloudInfrastructure/Services/Subsystems/SubsystemService.cs @@ -227,19 +227,17 @@ internal class SubsystemService : ISubsystemService var request = new DetectedOperationRequest { - IdsTelemetries = idsTelemetries, + IdWell = well.Id, IdsCategories = WellOperationCategory.MechanicalDrillingSubIds, GeDateStart = geDateStartUtc, LeDateEnd = leDateUtc, }; - var operations = await detectedOperationService + var telemetryOperations = await detectedOperationService .GetOperationsAsync(request, token); var wellStat = new SubsystemActiveWellStatDto { Well = well }; - var telemetryOperations = operations.Where(o => o.IdTelemetry == well.IdTelemetry); - if (!telemetryOperations.Any()) continue; @@ -250,6 +248,7 @@ internal class SubsystemService : ISubsystemService wellStat.SubsystemAPD = subsystemStat.FirstOrDefault(s => s.IdSubsystem == IdSubsystemAPD); wellStat.SubsystemOscillation = subsystemStat.FirstOrDefault(s => s.IdSubsystem == IdSubsystemOscillation); + wellsStat.Add(wellStat); } return wellsStat;