入库接口调整
This commit is contained in:
@@ -66,12 +66,12 @@ namespace WMS.Web.Repositories
|
||||
query = query.Where(w => w.detail.StockId == dto.StockId.Value);
|
||||
|
||||
if (dto.Type.HasValue)
|
||||
query = query.Where(w => (int)w.order.Type == dto.Type);
|
||||
query = query.Where(w => (int)w.order.Type == dto.Type.Value);
|
||||
|
||||
if (dto.CreateBeginDate != null)
|
||||
query = query.Where(w => w.order.CreateTime >= dto.CreateBeginDate);
|
||||
query = query.Where(w => w.order.CreateTime >= dto.CreateBeginDate.Value);
|
||||
if (dto.CreateEndDate != null)
|
||||
query = query.Where(w => w.order.CreateTime <= dto.CreateEndDate);
|
||||
query = query.Where(w => w.order.CreateTime <= dto.CreateEndDate.Value);
|
||||
|
||||
var response = new ResultPagedList<InStockQueryResponse>();
|
||||
int total = await query.CountAsync();
|
||||
|
||||
@@ -47,6 +47,29 @@ namespace WMS.Web.Repositories
|
||||
if (!string.IsNullOrEmpty(dto.SourceBillNo))
|
||||
query = query.Where(w => EF.Functions.Like(w.detail.SourceBillNo, "%" + dto.SourceBillNo + "%"));
|
||||
|
||||
//if (!string.IsNullOrEmpty(dto.MaterialNumber))
|
||||
// query = query.Where(w => EF.Functions.Like(w.detail.BillNo, "%" + dto.BillNo + "%"));
|
||||
|
||||
if (dto.SupplierId.HasValue)
|
||||
query = query.Where(w => w.detail.SupplierId == dto.SupplierId.Value);
|
||||
|
||||
if (dto.OrgId.HasValue)
|
||||
query = query.Where(w => w.detail.OrgId == dto.OrgId.Value);
|
||||
|
||||
if (dto.StockId.HasValue)
|
||||
query = query.Where(w => w.detail.StockId == dto.StockId.Value);
|
||||
|
||||
if (dto.Type.HasValue)
|
||||
query = query.Where(w => (int)w.order.Type == dto.Type.Value);
|
||||
|
||||
if (dto.Status.HasValue)
|
||||
query = query.Where(w => (int)w.order.Status == dto.Status.Value);
|
||||
|
||||
if (dto.CreateBeginDate != null)
|
||||
query = query.Where(w => w.order.ShelfTime >= dto.CreateBeginDate.Value);
|
||||
if (dto.CreateEndDate != null)
|
||||
query = query.Where(w => w.order.ShelfTime <= dto.CreateEndDate.Value);
|
||||
|
||||
var response = new ResultPagedList<InStockTaskQueryResponse>();
|
||||
int total = await query.CountAsync();
|
||||
response.TotalCount = total;
|
||||
@@ -71,8 +94,8 @@ namespace WMS.Web.Repositories
|
||||
RealityQty = s.detail.RealityQty,
|
||||
Receiver = "",
|
||||
ReceiveTime = s.order.ReceiveTime,
|
||||
Operator = "",
|
||||
OperateTime = s.order.OperateTime,
|
||||
Shelfer = "",
|
||||
ShelfTime = s.order.ShelfTime,
|
||||
CreateTime = s.detail.CreateTime,
|
||||
}).OrderByDescending(x => x.Id).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
|
||||
|
||||
@@ -80,6 +103,31 @@ namespace WMS.Web.Repositories
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 详情
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<InStockTask> Get(int id)
|
||||
{
|
||||
return await _context.InStockTask
|
||||
.Include(s => s.Details)
|
||||
.FirstOrDefaultAsync(f => f.Id == id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 列表
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<InStockTask>> GetList(List<int> ids)
|
||||
{
|
||||
return await _context.InStockTask
|
||||
.Include(s => s.Details)
|
||||
.Where(f => ids.Contains(f.Id))
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量添加
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user