优化接口
This commit is contained in:
@@ -204,10 +204,18 @@ namespace WMS.Web.Api.Controllers
|
|||||||
|
|
||||||
//找到已入库的箱子
|
//找到已入库的箱子
|
||||||
var instockBoxList= await _inStockRepositories.GetInstockBox(taskId);
|
var instockBoxList= await _inStockRepositories.GetInstockBox(taskId);
|
||||||
|
var remobox = new List<ReceiveBoxResponse>();
|
||||||
if (receiveBoxList.Count!=0 && instockBoxList.Count != 0)
|
if (receiveBoxList.Count!=0 && instockBoxList.Count != 0)
|
||||||
{
|
{
|
||||||
//剔除已入库的箱子
|
//剔除已入库的箱子
|
||||||
foreach (var item in instockBoxList.Distinct().ToList())
|
foreach (var boxid in instockBoxList.Distinct().ToList())
|
||||||
|
{
|
||||||
|
remobox.Add(receiveBoxList.Where(x => x.BoxId == boxid).First());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (remobox.Count != 0)
|
||||||
|
{
|
||||||
|
foreach (var item in remobox)
|
||||||
{
|
{
|
||||||
receiveBoxList.Remove(item);
|
receiveBoxList.Remove(item);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ namespace WMS.Web.Domain.Infrastructure
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="taskId"></param>
|
/// <param name="taskId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<List<ReceiveBoxResponse>> GetInstockBox(int taskId);
|
Task<List<int>> GetInstockBox(int taskId);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取最新的erp明细
|
/// 获取最新的erp明细
|
||||||
|
|||||||
@@ -260,13 +260,9 @@ namespace WMS.Web.Repositories
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="taskId"></param>
|
/// <param name="taskId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<List<ReceiveBoxResponse>> GetInstockBox(int taskId)
|
public async Task<List<int>> GetInstockBox(int taskId)
|
||||||
{
|
{
|
||||||
return await _context.InStockDetails.Where(x => x.TaskId == taskId).Select(x => new ReceiveBoxResponse()
|
return await _context.InStockDetails.Where(x => x.TaskId == taskId).Select(x => x.BoxId).ToListAsync();
|
||||||
{
|
|
||||||
TaskId = x.TaskId,
|
|
||||||
BoxId = x.BoxId
|
|
||||||
}).ToListAsync();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user