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) } } };