Fix SubsystemService.GetStatAsync(..)

This commit is contained in:
ngfrolov 2023-12-29 11:08:02 +05:00
parent 1c7423aaab
commit e0ddd26278
Signed by untrusted user who does not match committer: ng.frolov
GPG Key ID: E99907A0357B29A7

View File

@ -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;