forked from ddrilling/AsbCloudServer
Fix well service
This commit is contained in:
parent
7c88fb23de
commit
b734ed929e
@ -148,17 +148,18 @@ namespace AsbCloudInfrastructure.Services.SAUB
|
|||||||
{
|
{
|
||||||
if (!caches.TryGetValue(idTelemetry, out TelemetryDataCacheItem? cacheItem))
|
if (!caches.TryGetValue(idTelemetry, out TelemetryDataCacheItem? cacheItem))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var from = cacheItem.FirstByDate?.DateTime;
|
|
||||||
if (!cacheItem.LastData.Any())
|
if (!cacheItem.LastData.Any())
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
var from = cacheItem.FirstByDate.DateTime;
|
||||||
var to = cacheItem.LastData[^1].DateTime;
|
var to = cacheItem.LastData[^1].DateTime;
|
||||||
from = from ?? cacheItem.LastData[0].DateTime;
|
|
||||||
|
|
||||||
return new DatesRangeDto {
|
return new DatesRangeDto
|
||||||
From = from.Value.ToUtcDateTimeOffset(cacheItem.TimezoneHours),
|
{
|
||||||
To = to.ToUtcDateTimeOffset(cacheItem.TimezoneHours) };
|
From = new DateTimeOffset(from, TimeSpan.FromHours(cacheItem.TimezoneHours)),
|
||||||
|
To = new DateTimeOffset(to, TimeSpan.FromHours(cacheItem.TimezoneHours))
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public DatesRangeDto? GetOrDefaultCachedDateRange(int idTelemetry)
|
public DatesRangeDto? GetOrDefaultCachedDateRange(int idTelemetry)
|
||||||
|
@ -71,7 +71,7 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
return DateTimeOffset.MinValue;
|
return DateTimeOffset.MinValue;
|
||||||
|
|
||||||
var datesRange = telemetryService.GetDatesRange(well.IdTelemetry.Value);
|
var datesRange = telemetryService.GetDatesRange(well.IdTelemetry.Value);
|
||||||
return datesRange.To.DateTime;
|
return datesRange.To;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
Loading…
Reference in New Issue
Block a user