| | |
| | | using Org.BouncyCastle.Crypto; |
| | | using SqlSugar; |
| | | using SqlSugar.Extensions; |
| | | using System; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IStockRepository; |
| | | using WIDESEA_Model.Models; |
| | |
| | | { |
| | | public class StockInfoRepository : RepositoryBase<Dt_StockInfo>, IStockInfoRepository |
| | | { |
| | | public StockInfoRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) |
| | | private readonly IBasicRepository _basicRepository; |
| | | public StockInfoRepository(IUnitOfWorkManage unitOfWorkManage, IBasicRepository basicRepository) : base(unitOfWorkManage) |
| | | { |
| | | } |
| | | public Dt_StockInfo GetStockInfo(string palletCode) |
| | | { |
| | | return Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == palletCode).First(); |
| | | } |
| | | |
| | | public List<Dt_StockInfo> GetStockInfos(string materielCode) |
| | | { |
| | | return Db.Queryable<Dt_StockInfo>().Where(x => x.MaterielCode == materielCode).ToList(); |
| | | } |
| | | |
| | | public List<Dt_StockInfo> GetStockInfos(int materielId,decimal width, List<string> locationCodes) |
| | | { |
| | | List<Dt_StockInfo> stockInfos = Db.Queryable<Dt_StockInfo>().Where(x => locationCodes.Contains(x.LocationCode) && x.MaterielId == materielId && x.MaterielWide==width && x.StockOutLength<=0).OrderBy(x=>x.CreateDate).ToList(); |
| | | return stockInfos; |
| | | } |
| | | /// <summary> |
| | | /// è·åç管å¯ä½¿ç¨åºå |
| | | /// </summary> |
| | | public List<Dt_StockInfo> GetStockInfos(string materielCode, decimal width, List<string> locationCodes) |
| | | { |
| | | List<Dt_StockInfo> stockInfos = Db.Queryable<Dt_StockInfo>().Where(x => locationCodes.Contains(x.LocationCode) && x.MaterielCode.StartsWith(materielCode) && x.StockStatus == StockStatusEmun.å
¥åºå®æ.ObjToInt() && x.MaterielWide == width && x.StockOutLength <= 0 && x.StockLength > 0).OrderBy(x => x.CreateDate).ToList(); |
| | | return stockInfos; |
| | | } |
| | | |
| | | public List<Dt_StockInfo> GetStockInfos(string materielCode, List<string> locationCodes) |
| | | { |
| | | List<Dt_StockInfo> stockInfos = Db.Queryable<Dt_StockInfo>().Where(x => locationCodes.Contains(x.LocationCode) && x.MaterielCode == materielCode && x.StockStatus == StockStatusEmun.å
¥åºå®æ.ObjToInt() && x.StockOutLength <= 0 && x.StockLength > 0).OrderBy(x => x.CreateDate).ToList(); |
| | | return stockInfos; |
| | | } |
| | | |
| | | public List<Dt_StockInfo> GetStockInfosByIds(List<int> ids) |
| | | { |
| | | return Db.Queryable<Dt_StockInfo>().Where(x => ids.Contains(x.Id)).ToList(); |
| | | } |
| | | |
| | | public List<Dt_StockInfo> GetStockInfosByPalletCodes(List<string> palletCodes) |
| | | { |
| | | return Db.Queryable<Dt_StockInfo>().Where(x => palletCodes.Contains(x.PalletCode)).ToList(); |
| | | } |
| | | |
| | | public List<Dt_StockInfo> GetStockInfosExclude(string materielCode, List<string> palletCodes) |
| | | { |
| | | return Db.Queryable<Dt_StockInfo>().Where(x => !palletCodes.Contains(x.PalletCode) && x.MaterielCode == materielCode).ToList(); |
| | | _basicRepository = basicRepository; |
| | | } |
| | | } |
| | | } |
| | | } |