namespace WIDESEA_StorageOutOrderRepository; public class Dt_OutOrderAndStockRepository : RepositoryBase, IDt_OutOrderAndStockRepository { public Dt_OutOrderAndStockRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) { } /// /// 根据特定条件获取出库物料信息 /// /// 货位ID /// 出库订单 /// 托盘号 /// 出库物料信息 public async Task GetOrderAndStock(string locationID = null, string orderNum = null, string palletCode = null) { return await Db.Queryable() .Includes(x => x.OrderList) .Includes(x => x.StockList) .Includes(x => x.OrderDetailList) .Includes(x => x.StockDetailList) .Includes(x => x.LocationList) .WhereIF(locationID != null, x => x.LocationCode == locationID) .WhereIF(orderNum != null, x => x.OrderNumber == orderNum) .WhereIF(palletCode != null, x => x.PalletCode == palletCode) .FirstAsync(); } /// /// 导航删除 /// /// 出库物料信息 /// 成功/失败 public bool DeleteNavOrderStock(Dt_OutOrderAndStock stock) { return Db.DeleteNav(x => x.Id == stock.Id) .Include(x => x.OrderDetailList) .Include(x => x.OrderList) .Include(x => x.StockDetailList) .Include(x => x.StockList) .ExecuteCommand(); } /// /// 导航更新 /// /// 出库物料信息 /// 成功/失败 public bool UpdateNavOrderStock(Dt_OutOrderAndStock stock) { return Db.UpdateNav(stock) .Include(x => x.OrderDetailList) .Include(x => x.OrderList) .Include(x => x.StockDetailList) .Include(x => x.StockList) .ExecuteCommand(); } }