forked from ddrilling/AsbCloudServer
Смена типов дат для TelemetryMessageDto и TelemetryWirelineRunOutBaseDto
This commit is contained in:
parent
15b74da498
commit
3def1ad101
@ -15,7 +15,7 @@ namespace AsbCloudApp.Data.SAUB
|
||||
/// <summary>
|
||||
/// отметка времени
|
||||
/// </summary>
|
||||
public DateTime Date { get; set; }
|
||||
public DateTimeOffset Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// глубина забоя
|
||||
|
@ -10,7 +10,7 @@ namespace AsbCloudApp.Data.SAUB
|
||||
/// <summary>
|
||||
/// отметка времени
|
||||
/// </summary>
|
||||
public DateTime DateTime { get; set; }
|
||||
public DateTimeOffset DateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Наработка талевого каната с момента перетяжки каната, т*км
|
||||
|
@ -5,6 +5,7 @@ using AsbCloudApp.Services;
|
||||
using AsbCloudDb.Model;
|
||||
using Mapster;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
@ -93,14 +94,14 @@ namespace AsbCloudInfrastructure.Repository
|
||||
{
|
||||
var entity = dto.Adapt<TelemetryWirelineRunOut>();
|
||||
entity.IdTelemetry = idTelemetry;
|
||||
entity.DateTime = dto.DateTime.ToUtcDateTimeOffset(timezoneOffset);
|
||||
entity.DateTime = dto.DateTime.ToOffset(TimeSpan.FromHours(timezoneOffset));
|
||||
return entity;
|
||||
}
|
||||
|
||||
private static TelemetryWirelineRunOutDto Convert(TelemetryWirelineRunOut entity, WellDto well, double timezoneOffset)
|
||||
{
|
||||
var dto = entity.Adapt<TelemetryWirelineRunOutDto>();
|
||||
dto.DateTime = entity.DateTime.ToRemoteDateTime(timezoneOffset);
|
||||
dto.DateTime = entity.DateTime.ToOffset(TimeSpan.FromHours(timezoneOffset));
|
||||
dto.WellInfo = well;
|
||||
return dto;
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ namespace AsbCloudInfrastructure.Services.SAUB
|
||||
var entity = dto.Adapt<TelemetryMessage>();
|
||||
entity.Id = 0;
|
||||
entity.IdTelemetry = telemetry.Id;
|
||||
entity.DateTime = dto.Date.ToUtcDateTimeOffset(timezone.Hours);
|
||||
entity.DateTime = dto.Date.ToOffset(TimeSpan.FromHours(timezone.Hours));
|
||||
db.TelemetryMessages.Add(entity);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user