using Microsoft.IdentityModel.Tokens; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WIDESEA_Common.CommonEnum; using WIDESEA_Common.StockEnum; using WIDESEA_Core.BaseRepository; using WIDESEA_Core.Helper; using WIDESEA_IBasicRepository; using WIDESEA_IStockRepository; using WIDESEA_Model.Models; namespace WIDESEA_StockRepository { public class ProStockInfoRepository : RepositoryBase, IProStockInfoRepository { private readonly IBasicRepository _basicRepository; public ProStockInfoRepository(IUnitOfWorkManage unitOfWorkManage,IBasicRepository basicRepository) : base(unitOfWorkManage) { _basicRepository = basicRepository; } public List GetStockInfos(string materielCode, List locationCodes) { List stockInfos = Db.Queryable().Where(x => locationCodes.Contains(x.LocationCode) && x.StockStatus == StockStatusEmun.入库完成.ObjToInt()).Includes(x => x.proStockInfoDetails) .Where(x => x.proStockInfoDetails .Any(v => v.ProductCode == materielCode && v.OutboundQuantity<=0) ).OrderBy(x=>x.CreateDate).ToList(); return stockInfos; } } }