редактирование метода в контроллере

изменение интерфейса наработки подсистем
This commit is contained in:
eugeniy_ivanov 2022-10-31 18:59:08 +05:00
parent 3aa01ebe47
commit 562bf5b348
3 changed files with 19 additions and 5 deletions

View File

@ -46,7 +46,16 @@ namespace AsbCloudApp.Services.Subsystems
/// <param name="request"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<DatesRangeDto?> GetDateRangeOperationTimeAsync(SubsystemOperationTimeRequest request, CancellationToken token);
Task<DatesRangeDto?> GetDateRangeOperationTimeAsync(SubsystemOperationTimeRequest request, CancellationToken token);
/// <summary>
/// Получение статистики по наработке подсистем по активным скважинам
/// </summary>
/// <param name="idCompany"></param>
/// <param name="gtDate"></param>
/// <param name="ltDate"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<SubsystemActiveWellStatDto>?> GetStatByActiveWell(int idCompany, DateTime? gtDate, DateTime? ltDate, CancellationToken token);
}
#nullable disable
}

View File

@ -187,7 +187,7 @@ namespace AsbCloudInfrastructure.Services.Subsystems
private async Task<IEnumerable<WellDto>> GetSubsystemOperationTimeAll(int idCompany, CancellationToken token)
{
{
var listWell = await wellService.GetWellsByCompanyAsync(idCompany, token);
var active = listWell.Where(w => w.IdState == 1);
return active;

View File

@ -52,10 +52,15 @@ namespace AsbCloudWebApi.Controllers.Subsystems
[HttpGet("statByActiveWell")]
[ProducesResponseType(typeof(IEnumerable<SubsystemStatDto>), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetStatByWellAsync([FromQuery] DateTime? GtDate, DateTime? LtDate, CancellationToken token = default)
{
{
var idCompany = User.GetCompanyId();
if (idCompany.HasValue)
{
var subsystemResult = await subsystemOperationTimeService.GetStatByActiveWell(idCompany.Value, GtDate, LtDate, token);
return Ok(subsystemResult);
}
return Forbid();
var subsystemResult = await subsystemOperationTimeService.GetStatAsync(request, token);
return Ok(subsystemResult);
}
/// <summary>