forked from ddrilling/AsbCloudServer
TelemetryDataBaseService.GetRangeAsync восстановлен для Witsml.
This commit is contained in:
parent
17216acb80
commit
05de113e9e
@ -44,7 +44,7 @@ namespace AsbCloudApp.Services
|
||||
/// <param name="leDate"></param>
|
||||
/// <param name="token"></param>
|
||||
/// <returns></returns>
|
||||
Task<DatesRangeDto> GetRangeAsync(int idWell, DateTimeOffset geDate, DateTimeOffset? leDate, CancellationToken token);
|
||||
Task<DatesRangeDto?> GetRangeAsync(int idWell, DateTimeOffset geDate, DateTimeOffset? leDate, CancellationToken token);
|
||||
|
||||
/// <summary>
|
||||
/// Период за который есть данные по скважине
|
||||
|
@ -205,7 +205,7 @@ namespace AsbCloudInfrastructure.Services.SAUB
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async Task<DatesRangeDto> GetRangeAsync(int idWell, DateTimeOffset geDate, DateTimeOffset? leDate, CancellationToken token)
|
||||
public async Task<DatesRangeDto?> GetRangeAsync(int idWell, DateTimeOffset geDate, DateTimeOffset? leDate, CancellationToken token)
|
||||
{
|
||||
var telemetry = telemetryService.GetOrDefaultTelemetryByIdWell(idWell)
|
||||
?? throw new ArgumentInvalidException(nameof(idWell), $"По скважине id:{idWell} нет телеметрии");
|
||||
@ -242,7 +242,9 @@ namespace AsbCloudInfrastructure.Services.SAUB
|
||||
MaxDate = group.Max(entity => entity.DateTime),
|
||||
});
|
||||
|
||||
var result = await gquery.FirstAsync(token);
|
||||
var result = await gquery.FirstOrDefaultAsync(token);
|
||||
if (result is null)
|
||||
return null;
|
||||
|
||||
var range = new DatesRangeDto
|
||||
{
|
||||
|
@ -136,6 +136,8 @@ namespace AsbCloudWebApi.Controllers.SAUB
|
||||
/// <param name="token"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{idWell}/dateRange")]
|
||||
[ProducesResponseType(typeof(DatesRangeDto), (int)System.Net.HttpStatusCode.OK)]
|
||||
[ProducesResponseType((int)System.Net.HttpStatusCode.NotFound)]
|
||||
public virtual async Task<ActionResult<DatesRangeDto?>> GetRangeAsync(
|
||||
[FromRoute] int idWell,
|
||||
[Required] DateTimeOffset geDate,
|
||||
@ -167,7 +169,8 @@ namespace AsbCloudWebApi.Controllers.SAUB
|
||||
[HttpGet("{idWell}/datesRange")]
|
||||
[Permission]
|
||||
[ProducesResponseType(typeof(DatesRangeDto), (int)System.Net.HttpStatusCode.OK)]
|
||||
public virtual async Task<ActionResult<DatesRangeDto>> GetDataDatesRangeAsync(int idWell,
|
||||
[ProducesResponseType((int)System.Net.HttpStatusCode.NotFound)]
|
||||
public virtual async Task<ActionResult<DatesRangeDto?>> GetDataDatesRangeAsync(int idWell,
|
||||
CancellationToken token)
|
||||
{
|
||||
int? idCompany = User.GetCompanyId();
|
||||
|
Loading…
Reference in New Issue
Block a user