Смена даты для DrillTestReportInfoDto

This commit is contained in:
Olga Nemt 2024-03-21 11:08:48 +05:00
parent 62e30b0e8b
commit b66ca5a515
2 changed files with 4 additions and 4 deletions

View File

@ -24,6 +24,6 @@ namespace AsbCloudApp.Data.DrillTestReport
/// Дата и время
/// </summary>
[Required]
public DateTime DateTime { get; set; }
public DateTimeOffset DateTime { get; set; }
}
}

View File

@ -78,15 +78,15 @@ namespace AsbCloudInfrastructure.Services.DrillTestReport
var dtos = await drillTestRepository.GetAllAsync(telemetry.Id, request, cancellationToken);
foreach (var dto in dtos)
{
var remoteDateTime = dto.TimeStampStart.ToRemoteDateTime(timezone.Hours);
var remoteDateTime = dto.TimeStampStart.ToOffset(TimeSpan.FromHours(timezone.Hours));
reports.Add(new DrillTestReportInfoDto
{
FileName = string.Format("Drill_test_{0}", dto.TimeStampStart.DateTime),
FileName = string.Format("Drill_test_{0}", remoteDateTime),
DrillDepth = (dto.Params
.Where(p => p.DepthDrillStep.HasValue)
.Sum(x => x.DepthDrillStep) ?? 0) + dto.DepthStart,
DateTime = dto.TimeStampStart.DateTime,
DateTime = remoteDateTime,
Id = dto.Id,
});
}