You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.8 KiB
C#

using DS.Module.Core;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.OpApi.Controllers
{
/// <summary>
/// 舱位标签管理
/// </summary>
3 months ago
public class BookingLabelController : ApiController
{
private readonly IBookingLabelService _bookingLabelService;
public BookingLabelController(IBookingLabelService bookingLabelService)
{
_bookingLabelService = bookingLabelService;
}
#region 获取全部或指定范围类型的标签列表
/// <summary>
/// 获取全部或指定范围类型的标签列表
/// </summary>
/// <param name="scope">标签使用范围 空-全部 1-舱位管理台账</param>
/// <returns>返回列表</returns>
[HttpGet]
[Route("List")]
public async Task<DataResult<List<BookingLabelBaseDto>>> List([FromQuery] int? scope)
{
return await _bookingLabelService.List(scope);
}
#endregion
#region 设定标签
/// <summary>
/// 设定标签
/// </summary>
/// <param name="input">请求参数</param>
/// <returns>返回回执</returns>
[HttpPost]
[Route("SetLabel")]
public async Task<DataResult<string>> SetLabel([FromBody] BindLabelDto input)
{
return await _bookingLabelService.SetLabel(input);
}
#endregion
#region 保存标签
/// <summary>
/// 保存标签
/// </summary>
/// <param name="input">请求参数</param>
/// <returns>返回标签主键</returns>
[HttpPost]
[Route("Save")]
public async Task<DataResult<long>> Save([FromBody] BookingLabelBaseDto input)
{
return await _bookingLabelService.Save(input);
}
#endregion
#region 删除标签信息
/// <summary>
/// 删除标签信息
/// </summary>
/// <param name="ids">标签主键组</param>
/// <returns></returns>
[HttpPost]
[Route("Delete")]
public async Task<DataResult<string>> Delete([FromBody] long[] ids)
{
return await _bookingLabelService.Delete(ids);
}
#endregion
#region 标签管理台账
/// <summary>
/// 标签管理台账
/// </summary>
/// <param name="QuerySearch">查询条件</param>
/// <returns>返回台账列表</returns>
[HttpPost]
[Route("GetPage")]
public async Task<DataResult<List<BookingLabelBaseDto>>> GetPageAsync([FromBody] PageRequest QuerySearch)
{
return await _bookingLabelService.GetPageAsync(QuerySearch);
}
#endregion
}
}