From 36ec92f055ca5b1d286f58c225e9fe34db21fc03 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=20=D0=90=D0=BB=D0=B5=D0=BA?= =?UTF-8?q?=D1=81=D0=B0=D0=BD=D0=B4=D1=80=D0=BE=D0=B2=D0=B8=D1=87?= Date: Tue, 15 Aug 2023 13:39:04 +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 --- .../AutoGeneratedDailyReportService.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutoGeneratedDailyReportService.cs b/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutoGeneratedDailyReportService.cs index edf3641b..03a19c44 100644 --- a/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutoGeneratedDailyReportService.cs +++ b/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutoGeneratedDailyReportService.cs @@ -149,8 +149,8 @@ public class AutoGeneratedDailyReportService : IAutoGeneratedDailyReportService return new DatesRangeDto { - From = factOperations.First().DateStart, - To = factOperations.Last().DateStart + From = factOperations.Min(o => o.DateStart), + To = factOperations.Max(o => o.DateStart) }; } @@ -209,7 +209,7 @@ public class AutoGeneratedDailyReportService : IAutoGeneratedDailyReportService }); } - private Task> GetFactOperationsAsync(int idWell, DateTime? startDate, + private async Task> GetFactOperationsAsync(int idWell, DateTime? startDate, DateTime? finishDate, CancellationToken cancellationToken) { var request = new WellOperationRequest @@ -221,7 +221,8 @@ public class AutoGeneratedDailyReportService : IAutoGeneratedDailyReportService SortFields = new[] { "DateStart asc" }, }; - return wellOperationRepository.GetAsync(request, cancellationToken); + return (await wellOperationRepository.GetAsync(request, cancellationToken)) + .OrderBy(w => w.DateStart); } private Task?> GetSubsystemStatsAsync(int idWell, DateTime startDate,