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="leDate"></param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <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>
|
/// <summary>
|
||||||
/// Период за который есть данные по скважине
|
/// Период за который есть данные по скважине
|
||||||
|
@ -205,7 +205,7 @@ namespace AsbCloudInfrastructure.Services.SAUB
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <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)
|
var telemetry = telemetryService.GetOrDefaultTelemetryByIdWell(idWell)
|
||||||
?? throw new ArgumentInvalidException(nameof(idWell), $"По скважине id:{idWell} нет телеметрии");
|
?? throw new ArgumentInvalidException(nameof(idWell), $"По скважине id:{idWell} нет телеметрии");
|
||||||
@ -242,7 +242,9 @@ namespace AsbCloudInfrastructure.Services.SAUB
|
|||||||
MaxDate = group.Max(entity => entity.DateTime),
|
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
|
var range = new DatesRangeDto
|
||||||
{
|
{
|
||||||
|
@ -136,6 +136,8 @@ namespace AsbCloudWebApi.Controllers.SAUB
|
|||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet("{idWell}/dateRange")]
|
[HttpGet("{idWell}/dateRange")]
|
||||||
|
[ProducesResponseType(typeof(DatesRangeDto), (int)System.Net.HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)System.Net.HttpStatusCode.NotFound)]
|
||||||
public virtual async Task<ActionResult<DatesRangeDto?>> GetRangeAsync(
|
public virtual async Task<ActionResult<DatesRangeDto?>> GetRangeAsync(
|
||||||
[FromRoute] int idWell,
|
[FromRoute] int idWell,
|
||||||
[Required] DateTimeOffset geDate,
|
[Required] DateTimeOffset geDate,
|
||||||
@ -167,7 +169,8 @@ namespace AsbCloudWebApi.Controllers.SAUB
|
|||||||
[HttpGet("{idWell}/datesRange")]
|
[HttpGet("{idWell}/datesRange")]
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(DatesRangeDto), (int)System.Net.HttpStatusCode.OK)]
|
[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)
|
CancellationToken token)
|
||||||
{
|
{
|
||||||
int? idCompany = User.GetCompanyId();
|
int? idCompany = User.GetCompanyId();
|
||||||
|
Loading…
Reference in New Issue
Block a user