Смена типов дат для LimitingParameterDataDto

This commit is contained in:
Olga Nemt 2024-03-22 11:01:12 +05:00
parent 820e383e5b
commit d78209fa0b
4 changed files with 9 additions and 9 deletions

View File

@ -20,12 +20,12 @@ namespace AsbCloudApp.Data
/// <summary>
/// Дата начала ограничения
/// </summary>
public DateTime DateStart { get; set; }
public DateTimeOffset DateStart { get; set; }
/// <summary>
/// Дата окончания ограничения
/// </summary>
public DateTime DateEnd { get; set; }
public DateTimeOffset DateEnd { get; set; }
/// <summary>
/// Глубина начала ограничения

View File

@ -17,12 +17,12 @@ namespace AsbCloudApp.Requests
/// <summary>
/// Больше или равно дате
/// </summary>
public DateTime? GtDate { get; set; }
public DateTimeOffset? GtDate { get; set; }
/// <summary>
/// Меньше или равно дате
/// </summary>
public DateTime? LtDate { get; set; }
public DateTimeOffset? LtDate { get; set; }
/// <summary>
/// Больше или равно глубины забоя

View File

@ -39,8 +39,8 @@ namespace AsbCloudInfrastructure.Repository
IdWell = request.IdWell,
IdTelemetry = x.IdTelemetry,
IdFeedRegulator = x.IdFeedRegulator,
DateStart = DateTime.SpecifyKind(x.DateStart.UtcDateTime + timezoneSpan, DateTimeKind.Unspecified),
DateEnd = DateTime.SpecifyKind(x.DateEnd.UtcDateTime + timezoneSpan, DateTimeKind.Unspecified),
DateStart = x.DateStart.ToOffset(timezoneSpan),
DateEnd = x.DateEnd.ToOffset(timezoneSpan),
DepthStart = x.DepthStart,
DepthEnd = x.DepthEnd
});
@ -56,13 +56,13 @@ namespace AsbCloudInfrastructure.Repository
if (request.GtDate.HasValue)
{
var gtDate = request.GtDate.Value.ToUtcDateTimeOffset(timezoneHours);
var gtDate = request.GtDate.Value.ToUniversalTime();
query = query.Where(x => x.DateEnd >= gtDate);
}
if (request.LtDate.HasValue)
{
var ltDate = request.LtDate.Value.ToUtcDateTimeOffset(timezoneHours);
var ltDate = request.LtDate.Value.ToUniversalTime();
query = query.Where(x => x.DateStart <= ltDate);
}

View File

@ -106,7 +106,7 @@ namespace AsbCloudInfrastructure.Services
return (float)result;
}
private DateTime GetDate(double depth, LimitingParameterDataDto dto)
private DateTimeOffset GetDate(double depth, LimitingParameterDataDto dto)
{
var a = depth - dto.DepthStart;
var b = dto.DepthEnd - dto.DepthStart;