forked from ddrilling/AsbCloudServer
Merge branch 'feature/ban_adding_data' of http://test.digitaldrilling.ru:8080/DDrilling/AsbCloudServer into feature/ban_adding_data
This commit is contained in:
commit
dd9ffc57b3
@ -17,14 +17,5 @@ namespace AsbCloudApp.Services
|
|||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<IEnumerable<ProcessMapReportDto>> GetProcessMapReportAsync(int idWell, CancellationToken token);
|
Task<IEnumerable<ProcessMapReportDto>> GetProcessMapReportAsync(int idWell, CancellationToken token);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Удаление записи РТК
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="id"></param>
|
|
||||||
/// <param name="idWell"></param>
|
|
||||||
/// <param name="token"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<int> DeleteAsync(int id, int idWell, CancellationToken token);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,16 +54,6 @@ namespace AsbCloudInfrastructure.Services.ProcessMap
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<int> 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<ProcessMapReportDto> CalcByIntervals(IEnumerable<ProcessMapPlanDto> processMapPlan, TelemetryDataSaubStatDto[] telemetryDataStat)
|
private IEnumerable<ProcessMapReportDto> CalcByIntervals(IEnumerable<ProcessMapPlanDto> processMapPlan, TelemetryDataSaubStatDto[] telemetryDataStat)
|
||||||
{
|
{
|
||||||
var processMapIntervals = CalcDepthIntervals(processMapPlan);
|
var processMapIntervals = CalcDepthIntervals(processMapPlan);
|
||||||
|
@ -250,16 +250,6 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
var fileName = $"РТК-план по скважине {well.Caption} куст {well.Cluster}.xlsx";
|
var fileName = $"РТК-план по скважине {well.Caption} куст {well.Cluster}.xlsx";
|
||||||
return File(stream, "application/octet-stream", fileName);
|
return File(stream, "application/octet-stream", fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpDelete("{id}/{idWell}")]
|
|
||||||
[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)]
|
|
||||||
public async Task<ActionResult<int>> DeleteAsync(int id, int idWell, CancellationToken cancellationToken)
|
|
||||||
{
|
|
||||||
if (!await CanUserEditProcessMapAsync(idWell, cancellationToken))
|
|
||||||
return Forbid();
|
|
||||||
|
|
||||||
return await processMapService.DeleteAsync(id, idWell, cancellationToken);
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task<bool> CanUserEditProcessMapAsync(int idWell, CancellationToken token)
|
private async Task<bool> CanUserEditProcessMapAsync(int idWell, CancellationToken token)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user