forked from ddrilling/AsbCloudServer
Фикс сортировку операций
This commit is contained in:
parent
194df95d28
commit
7d172129e6
@ -161,7 +161,7 @@ public class WellOperationService : IWellOperationService
|
||||
var groupedByWellAndTypeDtos = wellOperationsBaseDtos
|
||||
.GroupBy(e => new { e.IdWell, e.IdType });
|
||||
|
||||
var result = new List<WellOperationDto>();
|
||||
var wellOperations = new List<WellOperationDto>();
|
||||
var count = 0;
|
||||
foreach (var wellOperationsWithTypeDto in groupedByWellAndTypeDtos)
|
||||
{
|
||||
@ -179,8 +179,6 @@ public class WellOperationService : IWellOperationService
|
||||
if (request.Take != null)
|
||||
filteredWellOperations = filteredWellOperations.Take((int)request.Take);
|
||||
|
||||
var timezoneOffset = wellService.GetTimezone(wellOperationsWithTypeDto.Key.IdWell).Offset;
|
||||
|
||||
var dtos = filteredWellOperations
|
||||
.Select(dto =>
|
||||
{
|
||||
@ -192,9 +190,14 @@ public class WellOperationService : IWellOperationService
|
||||
return newDto;
|
||||
});
|
||||
|
||||
result.AddRange(dtos);
|
||||
wellOperations.AddRange(dtos);
|
||||
}
|
||||
|
||||
var result =
|
||||
request.SortFields?.Any() is true ?
|
||||
wellOperations.AsQueryable().SortBy(request.SortFields) :
|
||||
wellOperations.AsQueryable().OrderBy(e => e.DateStart);
|
||||
|
||||
return (result, count);
|
||||
}
|
||||
|
||||
@ -308,10 +311,6 @@ public class WellOperationService : IWellOperationService
|
||||
var leDateUtc = request.LeDate.Value.UtcDateTime;
|
||||
dtos = dtos.Where(e => e.DateStart <= leDateUtc);
|
||||
}
|
||||
if (request.SortFields?.Any() is true)
|
||||
dtos = dtos.AsQueryable().SortBy(request.SortFields);
|
||||
else
|
||||
dtos = dtos.AsQueryable().OrderBy(e => e.DateStart);
|
||||
|
||||
return dtos;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user