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

This commit is contained in:
Olga Nemt 2024-03-22 17:59:03 +05:00
parent 86674ba263
commit 72341e76d2
4 changed files with 11 additions and 9 deletions

View File

@ -44,7 +44,7 @@ public class ProcessMapReportDataSaubStatDto
/// на начало интервала
/// </para>
/// </summary>
public DateTime DateStart { get; set; }
public DateTimeOffset DateStart { get; set; }
/// <summary>
/// Режим бурения (Ротор/слайд/ручной)

View File

@ -106,10 +106,11 @@ public class DailyReportService : IDailyReportService
IdWell = well.Id
};
var geDate = dailyReport.Date.ToDateTime(TimeOnly.MinValue, DateTimeKind.Unspecified);
var ltDate = dailyReport.Date.AddDays(1).ToDateTime(TimeOnly.MinValue, DateTimeKind.Unspecified);
var factOperationRequest = new WellOperationRequest
var offsetHours = wellService.GetTimezone(dailyReport.IdWell).Hours;
var geDate = new DateTimeOffset(dailyReport.Date, TimeOnly.MinValue, TimeSpan.FromHours(offsetHours));
var ltDate = new DateTimeOffset(dailyReport.Date.AddDays(1), TimeOnly.MinValue, TimeSpan.FromHours(offsetHours));
var factOperationRequest = new WellOperationRequest
{
IdWell = idWell,
OperationType = WellOperation.IdOperationTypeFact,
@ -369,8 +370,9 @@ public class DailyReportService : IDailyReportService
private async Task AddProcessMapWellDrillingBlockAsync(DailyReportDto dailyReport, CancellationToken cancellationToken)
{
var geDate = dailyReport.Date.ToDateTime(TimeOnly.MinValue, DateTimeKind.Unspecified);
var leDate = dailyReport.Date.AddDays(1).ToDateTime(TimeOnly.MinValue, DateTimeKind.Unspecified);
var offsetHours = wellService.GetTimezone(dailyReport.IdWell).Hours;
var geDate = new DateTimeOffset(dailyReport.Date, TimeOnly.MinValue, TimeSpan.FromHours(offsetHours));
var leDate = new DateTimeOffset(dailyReport.Date.AddDays(1), TimeOnly.MinValue, TimeSpan.FromHours(offsetHours));
var request = new DataSaubStatRequest();
dailyReport.ProcessMapWellDrillingBlock = (await processMapReportDrillingService.GetAsync(dailyReport.IdWell, request,

View File

@ -174,7 +174,7 @@ public class ProcessMapReportDrillingService : IProcessMapReportDrillingService
var result = new ProcessMapReportDataSaubStatDto()
{
IdWellSectionType = wellSectionType.Id,
DateStart = firstElemInInterval.DateStart.DateTime,
DateStart = firstElemInInterval.DateStart,
WellSectionTypeName = wellSectionType.Caption,
DepthStart = firstElemInInterval.DepthStart,
DepthEnd = lastElemInInterval.DepthEnd,

View File

@ -113,7 +113,7 @@ public class DailyReportServiceTest
private readonly ProcessMapReportDataSaubStatDto fakeProcessMapReportWellDrilling = new()
{
DrillingMode = "Ротор",
DateStart = new DateTime(2023, 10, 26),
DateStart = new DateTimeOffset(2023, 10, 26, 0, 0, 0, TimeSpan.Zero),
DeltaDepth = 500,
Rop = new PlanFactDto<double?>
{