From e4f3adb101fe8c7dbbaaff6d822d86cdce374b9f Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Mon, 1 Apr 2024 16:17:52 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20=D0=B1?= =?UTF-8?q?=D0=B0=D0=B3=D0=B0=20=D0=BF=D0=BE=D0=BB=D1=83=D1=87=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BD=D0=B0=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=BF=D0=BE=20=D0=B1=D1=83=D1=80=D0=B8=D0=BB=D1=8C?= =?UTF-8?q?=D1=89=D0=B8=D0=BA=D0=B0=D0=BC=20=D0=B8=20=D1=81=D0=BA=D0=B2?= =?UTF-8?q?=D0=B0=D0=B6=D0=B8=D0=BD=D0=B0=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/Subsystems/SubsystemService.cs | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/AsbCloudInfrastructure/Services/Subsystems/SubsystemService.cs b/AsbCloudInfrastructure/Services/Subsystems/SubsystemService.cs index ed2571a9..d2400ba3 100644 --- a/AsbCloudInfrastructure/Services/Subsystems/SubsystemService.cs +++ b/AsbCloudInfrastructure/Services/Subsystems/SubsystemService.cs @@ -67,22 +67,16 @@ internal class SubsystemService : ISubsystemService var detectedOperations = await detectedOperationService .GetOperationsAsync(byWellRequest, token); + var detectedOperationsByCurrentDriller = detectedOperations.Where(d => d.Driller?.Id == schedule.IdDriller); - var groupByDriller = detectedOperations - .Where(operation => operation.Driller is not null) - .GroupBy(operation => operation.Driller); - - foreach (var entry in groupByDriller) + var drillerOperationsStat = await CalcStatAsync(detectedOperationsByCurrentDriller, token); + var dto = new DrillerDetectedOperationStatDto { - var drillerOperationsStat = await CalcStatAsync(entry, token); - var dto = new DrillerDetectedOperationStatDto - { - Statistic = drillerOperationsStat, - Schedule = schedule, - Well = well, - }; - result.Add(dto); - } + Statistic = drillerOperationsStat, + Schedule = schedule, + Well = well, + }; + result.Add(dto); } return result;