优化
This commit is contained in:
@@ -100,6 +100,22 @@ namespace WMS.Web.Repositories
|
||||
return entitys;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据明细id查找
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<InStockTask>> GetListByDetailIds(List<int> ids)
|
||||
{
|
||||
var res = await _context.InStockTask
|
||||
.Include(s => s.Details)
|
||||
.Where(f => f.Details.Where(dw => ids.Contains(dw.Id)).Count() > 0)
|
||||
.ToListAsync();
|
||||
|
||||
return res.Clone();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 列表-根据明细中的来源单号
|
||||
/// </summary>
|
||||
@@ -147,7 +163,11 @@ namespace WMS.Web.Repositories
|
||||
var query = _context.InStockTaskDetails
|
||||
.GroupJoin(_context.InStockTask, detail => detail.Fid, order => order.Id, (detail, orders) => new { detail, orders })
|
||||
.SelectMany(x => x.orders.DefaultIfEmpty(), (p, order) => new { p.detail, order })
|
||||
.Where(w => EF.Functions.Like(w.order.SourceBillNo, "%" + dto.SourceBillNo + "%") && w.order.Type == InstockType.Purchase && (w.order.Status == InstockStatus.Part || w.order.Status == InstockStatus.Wait || w.order.Status== InstockStatus.WaitInStock) && w.detail.AccruedQty>0);
|
||||
.Where(w => EF.Functions.Like(w.order.SourceBillNo, "%" + dto.SourceBillNo + "%")
|
||||
&& w.order.Type == InstockType.Purchase
|
||||
&& (w.order.Status == InstockStatus.Part || w.order.Status == InstockStatus.Wait || w.order.Status== InstockStatus.WaitInStock)
|
||||
&& w.detail.AccruedQty>0
|
||||
&& w.detail.IsRepeal!=true);
|
||||
|
||||
//仓库
|
||||
if (!string.IsNullOrEmpty(dto.StockCode))
|
||||
@@ -223,7 +243,7 @@ namespace WMS.Web.Repositories
|
||||
{
|
||||
var ids = taskList.Select(x => x.Id).ToList();
|
||||
//找明细
|
||||
var query = _context.InStockTaskDetails.Where(x => ids.Contains(x.Fid) && x.AccruedQty>0);
|
||||
var query = _context.InStockTaskDetails.Where(x => ids.Contains(x.Fid) && x.AccruedQty>0 && x.IsRepeal!=true);
|
||||
|
||||
//仓库
|
||||
if (!string.IsNullOrEmpty(dto.StockCode))
|
||||
@@ -552,6 +572,7 @@ namespace WMS.Web.Repositories
|
||||
ShelfTime = s.order.ShelfTime.HasValue ? s.order.ShelfTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
|
||||
CreateTime = s.order.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
Remark = s.detail.Remark,
|
||||
IsRepeal = s.detail.IsRepeal ?? false,
|
||||
}).OrderByDescending(x => x.Id).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
|
||||
|
||||
return (list, total);
|
||||
|
||||
Reference in New Issue
Block a user