新增舱位标签的controller

usertest
jianghaiqing 3 months ago
parent b37caf89df
commit f0aa90412a

@ -41,5 +41,12 @@ namespace DS.WMS.Core.Op.Interface
/// <param name="ids">标签主键组</param>
/// <returns></returns>
Task<DataResult<string>> Delete(long[] ids);
/// <summary>
/// 标签管理台账
/// </summary>
/// <param name="QuerySearch">查询条件</param>
/// <returns>返回台账列表</returns>
Task<DataResult<List<BookingLabelBaseDto>>> GetPageAsync(PageRequest QuerySearch);
}
}

@ -22,6 +22,7 @@ using NLog;
using DS.Module.RedisModule;
using MySqlConnector.Logging;
using Newtonsoft.Json;
using DS.Module.Core.Extensions;
namespace DS.WMS.Core.Op.Method
{
@ -125,20 +126,24 @@ namespace DS.WMS.Core.Op.Method
}
#endregion
#region 标签管理台账
/// <summary>
/// 标签管理台账
/// </summary>
/// <param name="QuerySearch">查询条件</param>
/// <returns>返回台账列表</returns>
public async Task<DataResult<List<BookingLabelBaseDto>>> GetPageAsync(PageRequest QuerySearch)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
//序列化查询条件
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(QuerySearch.QueryCondition);
///// <summary>
///// 分页获取全部或指定范围类型的标签列表
///// </summary>
//public async Task<SqlSugarPagedList<BookingLabelBaseDto>> PageList(BookingLabelPageListInput input)
//{
// var list = await _rep.AsQueryable()
// .WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name))
// .WhereIF(input.Scope != null, x => x.Scope == input.Scope)
// .ToPagedListAsync(input.PageNo, input.PageSize);
// var result = list.Adapt<SqlSugarPagedList<BookingLabelBaseDto>>();
// return result;
//}
var data = tenantDb.Queryable<BookingLabel>()
.Where(whereList)
.Select<BookingLabelBaseDto>().ToQueryPage(QuerySearch.PageCondition);
return data;
}
#endregion
#region 保存标签
/// <summary>

@ -0,0 +1,90 @@
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>
public class BookingLabelController : Controller
{
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
}
}
Loading…
Cancel
Save