forked from ddrilling/AsbCloudServer
Merge pull request 'Правка бага: если с фронта не приходит период времени, то данные по наработке систем нужно выводить за всё время' (#330) from feature/#37115045-subsystems-operation-time into dev
Reviewed-on: https://test.digitaldrilling.ru:8443/DDrilling/AsbCloudServer/pulls/330
This commit is contained in:
commit
50f6c764ba
@ -9,7 +9,7 @@ namespace AsbCloudApp.Requests;
|
||||
/// </summary>
|
||||
public class SubsystemBaseRequest: RequestBase, IValidatableObject
|
||||
{
|
||||
private static readonly DateTimeOffset validationMinDate = new DateTimeOffset(2020,01,01,0,0,0, TimeSpan.Zero);
|
||||
public static readonly DateTimeOffset ValidationMinDate = new DateTimeOffset(2020,01,01,0,0,0, TimeSpan.Zero);
|
||||
|
||||
/// <summary>
|
||||
/// Больше или равно дате
|
||||
@ -34,9 +34,9 @@ public class SubsystemBaseRequest: RequestBase, IValidatableObject
|
||||
/// <inheritdoc/>
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if (GeDate.HasValue && GeDate < validationMinDate)
|
||||
if (GeDate.HasValue && GeDate < ValidationMinDate)
|
||||
yield return new ValidationResult(
|
||||
$"Должно быть больше {validationMinDate:O})",
|
||||
$"Должно быть больше {ValidationMinDate:O})",
|
||||
new[] { nameof(GeDate) });
|
||||
|
||||
if (LeDate.HasValue && GeDate.HasValue)
|
||||
|
@ -13,5 +13,6 @@ public class SubsystemPlanFactRequest: SubsystemBaseRequest
|
||||
/// <summary>
|
||||
/// идентификаторы скважин
|
||||
/// </summary>
|
||||
public IEnumerable<int> IdsWell { get; set; } = Enumerable.Empty<int>();
|
||||
[Required]
|
||||
public IEnumerable<int> IdsWell { get; set; } = null!;
|
||||
}
|
||||
|
@ -142,8 +142,8 @@ public class SubsystemService : ISubsystemService
|
||||
.ToDictionary(t => t.Id, t => t.IdWell);
|
||||
|
||||
var dtNow = DateTimeOffset.UtcNow;
|
||||
var geDate = request.GeDate ?? new DateTimeOffset(dtNow.Date);
|
||||
var leDate = request.LeDate ?? geDate.AddDays(1).AddMinutes(-1);
|
||||
var geDate = request.GeDate ?? SubsystemPlanFactRequest.ValidationMinDate;
|
||||
var leDate = request.LeDate ?? DateTimeOffset.UtcNow;
|
||||
var telemetryDataSaub = await telemetryDataSaubService.Get(telemetriesDict.Keys, false, geDate, leDate, 100_000, token);
|
||||
|
||||
var groupedTelemetryDataSaub = telemetryDataSaub
|
||||
|
Loading…
Reference in New Issue
Block a user