搜索出库增加仓库

This commit is contained in:
18942506660
2024-07-27 11:34:10 +08:00
parent 18a01836d3
commit 5c566a9e47
6 changed files with 14 additions and 5 deletions

View File

@@ -209,7 +209,7 @@ namespace WMS.Web.Api.Controllers
if (loginInfo == null || loginInfo.UserInfo == null)
return ResultPagedList<string>.ReFailure(ResultCodes.Token_Invalid_Error);
var res = await _repositories.GetOutStockTaskNosByNo(dto.BillNo);
var res = await _repositories.GetOutStockTaskNosByNo(dto.BillNo,dto.StockCode);
int total = res.Count();
res = res.OrderByDescending(o => o).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToList();

View File

@@ -4954,6 +4954,11 @@
单号
</summary>
</member>
<member name="P:WMS.Web.Core.Dto.OutStockTask.GetOutStockTaskNosByNoRequest.StockCode">
<summary>
仓库编码
</summary>
</member>
<member name="T:WMS.Web.Core.Dto.OutStockTask.OutStockTaskInfoDetailsResponse">
<summary>
出库任务单对应出库明细

View File

@@ -13,5 +13,9 @@ namespace WMS.Web.Core.Dto.OutStockTask
/// 单号
/// </summary>
public string BillNo { get; set; }
/// <summary>
/// 仓库编码
/// </summary>
public string StockCode { get; set; }
}
}

View File

@@ -47,7 +47,7 @@ namespace WMS.Web.Domain.Infrastructure
//根据订单号获取订单信息
Task<List<GetOutStockTaskByNoResponse>> GetOutStockTaskListByNo(string billNo);
//模糊搜索订单号
Task<List<string>> GetOutStockTaskNosByNo(string billNo);
Task<List<string>> GetOutStockTaskNosByNo(string billNo, string stockCode);
//根据订单号获取订单信息
Task<GetOutStockTaskByNoResponse> GetOutStockTaskByNo(string billNo);
}

View File

@@ -520,18 +520,18 @@ namespace WMS.Web.Repositories
}
}
public async Task<List<string>> GetOutStockTaskNosByNo(string billNo)
public async Task<List<string>> GetOutStockTaskNosByNo(string billNo, string stockCode)
{
var res = await _context.OutStockTask.Include(x => x.Details.Where(w => w.IsRepeal != true)).ThenInclude(s => s.ErpDetails)
.Where(f => EF.Functions.Like(f.BillNo, "%" + billNo + "%") &&
(f.Status == OutStockStatus.Part || f.Status == OutStockStatus.Wait))
(f.Status == OutStockStatus.Part || f.Status == OutStockStatus.Wait) && f.StockCode.Equals(stockCode))
.OrderByDescending(o => o.Id)
.Select(s => s.BillNo)
.ToListAsync();
var ress = await _context.OutStockTask.Include(x => x.Details.Where(w => w.IsRepeal != true)).ThenInclude(s => s.ErpDetails)
.Where(f => (f.Details.SelectMany(s => s.ErpDetails).Where(w => EF.Functions.Like(w.SourceBillNo, "%" + billNo + "%")).Any()) &&
(f.Status == OutStockStatus.Part || f.Status == OutStockStatus.Wait))
(f.Status == OutStockStatus.Part || f.Status == OutStockStatus.Wait) && f.StockCode.Equals(stockCode))
.OrderByDescending(o => o.Id)
.Select(s => s.BillNo)
.ToListAsync();