From 84f0b2f3407192edf64a708868a9d3cae1db702c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD=D0=BE=D0=B2=20=D0=94?= =?UTF-8?q?=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Tue, 3 Sep 2024 11:52:10 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/WellReport/WellReportService.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/AsbCloudInfrastructure/Services/WellReport/WellReportService.cs b/AsbCloudInfrastructure/Services/WellReport/WellReportService.cs index 59626c04..aa2a318f 100644 --- a/AsbCloudInfrastructure/Services/WellReport/WellReportService.cs +++ b/AsbCloudInfrastructure/Services/WellReport/WellReportService.cs @@ -83,10 +83,10 @@ public class WellReportService : IWellReportService var planTrajectories = await trajectoryPlanRepository.GetAsync(idWell, token); var factTrajectories = await trajectoryFactRepository.GetAsync(idWell, token); - var factOperationsWithoutNpt = factWellOperations - .Where(x => x.NptHours == 0); + var factOperationsWithoutNpt = factWellOperations.Where(o => WellOperationCategory.NonProductiveTimeSubIds + .Any(x => x != o.IdCategory)); - return new WellReportDto + return new WellReportDto { Well = well, DateFrom = firstFactOperation?.DateStart, @@ -106,7 +106,7 @@ public class WellReportService : IWellReportService Plan = planTrajectories.Max(x => x.VerticalDepth), Fact = factTrajectories.Max(x => x.VerticalDepth) }, - WithoutNtpDays = factOperationsWithoutNpt.Sum(x => x.Day), + WithoutNtpDays = factOperationsWithoutNpt.Sum(x => x.NptHours) / 24, Contacts = contacts, SectionReports = sectionReports, DrillerReports = drillerReports, @@ -164,8 +164,8 @@ public class WellReportService : IWellReportService { Fact = new OperatingModeDto { - DepthStart = factWellOperations.Min(w => w.DepthStart), - DepthEnd = factWellOperations.Max(w => w.DepthEnd) + DepthStart = group.Min(w => w.DepthStart), + DepthEnd = group.Max(w => w.DepthEnd) } } };