diff --git a/AsbCloudInfrastructure/Services/WellReport/WellReportService.cs b/AsbCloudInfrastructure/Services/WellReport/WellReportService.cs index d196e55a..5d34fa14 100644 --- a/AsbCloudInfrastructure/Services/WellReport/WellReportService.cs +++ b/AsbCloudInfrastructure/Services/WellReport/WellReportService.cs @@ -76,8 +76,6 @@ public class WellReportService : IWellReportService var drillerReports = await GetDrillerReportsAsync(idWell, token); var firstFactOperation = factWellOperations.MinByOrDefault(x => x.DateStart); - var lastFactOperation = factWellOperations.MaxByOrDefault(x => x.DateStart); - var lastPlanOperation = planWellOperations.MaxByOrDefault(x => x.DateStart); var planTrajectories = await trajectoryPlanRepository.GetAsync(idWell, token); @@ -92,8 +90,8 @@ public class WellReportService : IWellReportService DateTo = lastPlanOperation?.DateStart.AddHours(lastPlanOperation.DurationHours), Days = new PlanFactDto { - Plan = lastPlanOperation?.Day, - Fact = lastFactOperation?.Day + Plan = planWellOperations.Sum(x => x.DurationHours) / 24, + Fact = factWellOperations.Sum(x => x.DurationHours) / 24 }, WellBoreDepth = new PlanFactDto {