盘点单
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
using AutoMapper;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WMS.Web.Core.Dto.TakeStock;
|
||||
using WMS.Web.Domain.Entitys;
|
||||
using WMS.Web.Domain.Infrastructure;
|
||||
using WMS.Web.Repositories.Configuration;
|
||||
@@ -57,5 +60,43 @@ namespace WMS.Web.Repositories
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 盘点单列表
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<(List<TakeStockQueryInfoResponse> list, int total)> GetListAsync(TakeStockQueryRequest dto)
|
||||
{
|
||||
var query = _context.TakeStock
|
||||
.OrderByDescending(o => o.Id)
|
||||
.Where(adv => 1 == 1);
|
||||
|
||||
if (dto.DateBeginDate != null)
|
||||
query = query.Where(w => w.Date >= dto.DateBeginDate);
|
||||
if (dto.DateEndDate != null)
|
||||
query = query.Where(w => w.Date <= dto.DateEndDate);
|
||||
//组装
|
||||
int total = await query.CountAsync();
|
||||
var list = await query.Select(s => new TakeStockQueryInfoResponse()
|
||||
{
|
||||
#region dto组装
|
||||
DetailId = 0,
|
||||
BillNo = "",
|
||||
Unit = "",
|
||||
Stock = "",
|
||||
SubStock = "",
|
||||
BeforeQty = 0,
|
||||
AfterQty = 0,
|
||||
FinalQty = 0,
|
||||
ResultType="",
|
||||
Remark="",
|
||||
Creator = "",
|
||||
Date = s.Date,
|
||||
SuccessSync=s.SuccessSync
|
||||
#endregion
|
||||
|
||||
}).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
|
||||
return (list, total);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user