rename some methods

This commit is contained in:
Фролов 2022-03-02 16:21:07 +05:00
parent 557d7af25a
commit bafa372d66
5 changed files with 7 additions and 8 deletions

View File

@ -10,7 +10,7 @@ namespace AsbCloudApp.Services
Task<ClusterRopStatDto> GetRopStatByIdWellAsync(int idWell, CancellationToken token); Task<ClusterRopStatDto> GetRopStatByIdWellAsync(int idWell, CancellationToken token);
Task<ClusterRopStatDto> GetRopStatByUidAsync(string uid, CancellationToken token); Task<ClusterRopStatDto> GetRopStatByUidAsync(string uid, CancellationToken token);
Task<StatClusterDto> GetStatClusterAsync(int idCluster, int idCompany, CancellationToken token = default); Task<StatClusterDto> GetStatClusterAsync(int idCluster, int idCompany, CancellationToken token = default);
Task<StatWellDto> GetStatWellAsync(int idWell, CancellationToken token = default); Task<StatWellDto> GetWellStatAsync(int idWell, CancellationToken token = default);
Task<IEnumerable<PlanFactPredictBase<WellOperationDto>>> GetTvdAsync(int idWell, CancellationToken token); Task<IEnumerable<PlanFactPredictBase<WellOperationDto>>> GetTvdAsync(int idWell, CancellationToken token);
Task<IEnumerable<StatWellDto>> GetWellsStatAsync(IEnumerable<int> idWells, CancellationToken token); Task<IEnumerable<StatWellDto>> GetWellsStatAsync(IEnumerable<int> idWells, CancellationToken token);
} }

View File

@ -16,7 +16,7 @@ namespace AsbCloudInfrastructure.Services.DrillingProgram
{ {
public class DrillingProgramService : IDrillingProgramService public class DrillingProgramService : IDrillingProgramService
{ {
private static Dictionary<string, DrillingProgramCreateError> drillingProgramCreateErrors = new Dictionary<string, DrillingProgramCreateError>(); private static readonly Dictionary<string, DrillingProgramCreateError> drillingProgramCreateErrors = new Dictionary<string, DrillingProgramCreateError>();
private readonly IAsbCloudDbContext context; private readonly IAsbCloudDbContext context;
private readonly IFileService fileService; private readonly IFileService fileService;

View File

@ -95,13 +95,13 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
foreach (var well in wells) foreach (var well in wells)
{ {
var statWellDto = await CalcStatWellAsync(well, token); var statWellDto = await CalcWellStatAsync(well, token);
statsWells.Add(statWellDto); statsWells.Add(statWellDto);
} }
return statsWells; return statsWells;
} }
public async Task<StatWellDto> GetStatWellAsync(int idWell, public async Task<StatWellDto> GetWellStatAsync(int idWell,
CancellationToken token = default) CancellationToken token = default)
{ {
var well = await db.Wells var well = await db.Wells
@ -109,7 +109,7 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
.FirstOrDefaultAsync(w => w.Id == idWell, token) .FirstOrDefaultAsync(w => w.Id == idWell, token)
.ConfigureAwait(false); .ConfigureAwait(false);
var statWellDto = await CalcStatWellAsync(well, token); var statWellDto = await CalcWellStatAsync(well, token);
return statWellDto; return statWellDto;
} }
@ -160,7 +160,7 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
return clusterRops; return clusterRops;
} }
private async Task<StatWellDto> CalcStatWellAsync(Well well, CancellationToken token = default) private async Task<StatWellDto> CalcWellStatAsync(Well well, CancellationToken token = default)
{ {
var wellType = await cacheWellType.FirstOrDefaultAsync(t => t.Id == well.IdWellType, token); var wellType = await cacheWellType.FirstOrDefaultAsync(t => t.Id == well.IdWellType, token);
var statWellDto = new StatWellDto() var statWellDto = new StatWellDto()

View File

@ -59,7 +59,6 @@ namespace AsbCloudWebApi.Controllers
/// <param name="token"> Токен отмены задачи </param> /// <param name="token"> Токен отмены задачи </param>
/// <returns> Возвращает файл программы бурения </returns> /// <returns> Возвращает файл программы бурения </returns>
[HttpGet] [HttpGet]
[Permission]
[ProducesResponseType(typeof(DrillingProgramStateDto), (int)System.Net.HttpStatusCode.OK)] [ProducesResponseType(typeof(DrillingProgramStateDto), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetStateAsync(int idWell, CancellationToken token) public async Task<IActionResult> GetStateAsync(int idWell, CancellationToken token)
{ {

View File

@ -126,7 +126,7 @@ namespace AsbCloudWebApi.Controllers
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
return Forbid(); return Forbid();
var result = await operationsStatService.GetStatWellAsync(idWell, token) var result = await operationsStatService.GetWellStatAsync(idWell, token)
.ConfigureAwait(false); .ConfigureAwait(false);
return Ok(result); return Ok(result);
} }