forked from ddrilling/AsbCloudServer
Пакетное удаление операций по скважине
This commit is contained in:
parent
75743c3cfa
commit
794831699d
@ -250,6 +250,29 @@ public class WellOperationController : ControllerBase
|
|||||||
return Ok(result);
|
return Ok(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Удаляет выбранные операции по скважине
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idWell">id скважины</param>
|
||||||
|
/// <param name="ids">ids выбранных операций</param>
|
||||||
|
/// <param name="token">Токен отмены задачи</param>
|
||||||
|
/// <returns>Количество удаленных из БД строк</returns>
|
||||||
|
[HttpDelete]
|
||||||
|
[ProducesResponseType(typeof(int), StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)]
|
||||||
|
public async Task<IActionResult> DeleteRangeAsync([FromRoute] int idWell, IEnumerable<int> ids, CancellationToken token)
|
||||||
|
{
|
||||||
|
if (!await CanUserAccessToWellAsync(idWell, token))
|
||||||
|
return Forbid();
|
||||||
|
|
||||||
|
if (!await CanUserEditWellOperationsAsync(idWell, token))
|
||||||
|
return Forbid();
|
||||||
|
|
||||||
|
var result = await wellOperationRepository.DeleteRangeAsync(ids, token);
|
||||||
|
|
||||||
|
return Ok(result);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Формирование excel файла с операциями на скважине
|
/// Формирование excel файла с операциями на скважине
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user