diff --git a/AsbCloudApp/Services/IProcessMapService.cs b/AsbCloudApp/Services/IProcessMapService.cs index 25e1d2f1..3534b2e2 100644 --- a/AsbCloudApp/Services/IProcessMapService.cs +++ b/AsbCloudApp/Services/IProcessMapService.cs @@ -17,14 +17,5 @@ namespace AsbCloudApp.Services /// /// Task> GetProcessMapReportAsync(int idWell, CancellationToken token); - - /// - /// Удаление записи РТК - /// - /// - /// - /// - /// - Task DeleteAsync(int id, int idWell, CancellationToken token); } } diff --git a/AsbCloudInfrastructure/Services/ProcessMap/ProcessMapService.cs b/AsbCloudInfrastructure/Services/ProcessMap/ProcessMapService.cs index 9b296f85..a2193fd3 100644 --- a/AsbCloudInfrastructure/Services/ProcessMap/ProcessMapService.cs +++ b/AsbCloudInfrastructure/Services/ProcessMap/ProcessMapService.cs @@ -54,16 +54,6 @@ namespace AsbCloudInfrastructure.Services.ProcessMap return result; } - public async Task DeleteAsync(int id, int idWell, CancellationToken token) - { - var processMap = await processMapPlanRepository.GetOrDefaultAsync(id, token); - - if (processMap?.IdWell != idWell) - throw new ArgumentInvalidException("Запись РТК принадлежит другой скважине", nameof(idWell)); - - return await processMapPlanRepository.DeleteAsync(id, token); - } - private IEnumerable CalcByIntervals(IEnumerable processMapPlan, TelemetryDataSaubStatDto[] telemetryDataStat) { var processMapIntervals = CalcDepthIntervals(processMapPlan); diff --git a/AsbCloudWebApi/Controllers/ProcessMapController.cs b/AsbCloudWebApi/Controllers/ProcessMapController.cs index 6eccb152..18110908 100644 --- a/AsbCloudWebApi/Controllers/ProcessMapController.cs +++ b/AsbCloudWebApi/Controllers/ProcessMapController.cs @@ -250,16 +250,6 @@ namespace AsbCloudWebApi.Controllers var fileName = $"РТК-план по скважине {well.Caption} куст {well.Cluster}.xlsx"; return File(stream, "application/octet-stream", fileName); } - - [HttpDelete("{id}/{idWell}")] - [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] - public async Task> DeleteAsync(int id, int idWell, CancellationToken cancellationToken) - { - if (!await CanUserEditProcessMapAsync(idWell, cancellationToken)) - return Forbid(); - - return await processMapService.DeleteAsync(id, idWell, cancellationToken); - } private async Task CanUserEditProcessMapAsync(int idWell, CancellationToken token) {