| | |
| | | using AutoMapper; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_IStockService; |
| | |
| | | { |
| | | public partial class StockInfoService : ServiceBase<Dt_StockInfo, IRepository<Dt_StockInfo>>, IStockInfoService |
| | | { |
| | | private readonly IMapper _mapper; |
| | | |
| | | public IRepository<Dt_StockInfo> Repository => BaseDal; |
| | | |
| | | public StockInfoService(IRepository<Dt_StockInfo> BaseDal, IMapper mapper) : base(BaseDal) |
| | | public StockInfoService(IRepository<Dt_StockInfo> BaseDal) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取库存信息列表(出库日期小于当前时间且库存状态为入库完成的记录) |
| | | /// </summary> |
| | | public async Task<List<Dt_StockInfo>> GetStockInfoAsync() |
| | | { |
| | | return await BaseDal.QueryDataAsync(x => |
| | | x.OutboundDate < DateTime.Now && |
| | | x.StockStatus == StockStatusEmun.入库完成.GetHashCode()); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取库存信息列表(出库日期小于当前时间且库存状态为入库完成的记录,且仓库ID匹配) |
| | | /// </summary> |
| | | public async Task<List<Dt_StockInfo>> GetStockInfoAsync(int warehouseId) |
| | | { |
| | | return await BaseDal.QueryDataAsync(x => |
| | | x.OutboundDate < DateTime.Now && |
| | | x.StockStatus == StockStatusEmun.入库完成.GetHashCode() && |
| | | x.WarehouseId == warehouseId); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取库存信息(根据托盘码查询) |
| | | /// </summary> |
| | | public async Task<Dt_StockInfo> GetStockInfoAsync(string palletCode) |
| | | { |
| | | return await BaseDal.QueryFirstAsync(x => x.PalletCode == palletCode); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新库存数据 |
| | | /// </summary> |
| | | public async Task<bool> UpdateStockAsync(Dt_StockInfo stockInfo) |
| | | { |
| | | return await BaseDal.UpdateDataAsync(stockInfo); |
| | | } |
| | | } |
| | | } |