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))
|
||||
return null;
|
||||
|
||||
var from = cacheItem.FirstByDate?.DateTime;
|
||||
|
||||
if (!cacheItem.LastData.Any())
|
||||
return null;
|
||||
|
||||
var from = cacheItem.FirstByDate.DateTime;
|
||||
var to = cacheItem.LastData[^1].DateTime;
|
||||
from = from ?? cacheItem.LastData[0].DateTime;
|
||||
|
||||
return new DatesRangeDto {
|
||||
From = from.Value.ToUtcDateTimeOffset(cacheItem.TimezoneHours),
|
||||
To = to.ToUtcDateTimeOffset(cacheItem.TimezoneHours) };
|
||||
return new DatesRangeDto
|
||||
{
|
||||
From = new DateTimeOffset(from, TimeSpan.FromHours(cacheItem.TimezoneHours)),
|
||||
To = new DateTimeOffset(to, TimeSpan.FromHours(cacheItem.TimezoneHours))
|
||||
};
|
||||
}
|
||||
|
||||
public DatesRangeDto? GetOrDefaultCachedDateRange(int idTelemetry)
|
||||
|
@ -71,7 +71,7 @@ namespace AsbCloudInfrastructure.Services
|
||||
return DateTimeOffset.MinValue;
|
||||
|
||||
var datesRange = telemetryService.GetDatesRange(well.IdTelemetry.Value);
|
||||
return datesRange.To.DateTime;
|
||||
return datesRange.To;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
Loading…
Reference in New Issue
Block a user