//using iWareSql.MyDbContext;
|
//using System;
|
//using System.Linq;
|
|
//namespace iWareCC.Common.Helper
|
//{
|
// /// <summary>
|
// /// 库存帮助类
|
// /// </summary>
|
// public class InventoryHelper
|
// {
|
// ///// <summary>
|
// ///// 获取当前可用于出库的库存(已经减去锁定数量)
|
// ///// </summary>
|
// ///// <param name="materialCode"></param>
|
// ///// <param name="_v_ware_inventory_for_out"></param>
|
// ///// <param name=""></param>
|
// ///// <returns></returns>
|
// //public static int GetInventoryQtyForOutByMaterialCode(string materialCode,
|
// // MyDbContext dbContext)
|
// //{
|
// // //计算可用于出库的库存 【Editby shaocx,2023-01-04】
|
// // var inventoryQty = GetInventoryQtyForOutByMaterialCodeWithNoLockData(materialCode, dbContext);
|
// // var lockedQty = GetInventoryQtyByMaterialCodeWithLock(materialCode, dbContext);
|
// // //var lockObj = dbContext.ware_material_locked.Where(x => x.MaterialCode == materialCode && x.IsDeleted == false).FirstOrDefault();
|
// // //if (lockObj != null)
|
// // //{
|
// // // inventoryQty = inventoryQty - lockObj.LockedQty;
|
// // //}
|
// // inventoryQty = inventoryQty - lockedQty;
|
// // return inventoryQty;
|
// //}
|
// ///// <summary>
|
// ///// 获取当前物料锁定库存(动态查询的)
|
// ///// </summary>
|
// ///// <param name="materialCode"></param>
|
// ///// <param name="_v_ware_inventory_for_out"></param>
|
// ///// <param name=""></param>
|
// ///// <returns></returns>
|
// //public static int GetInventoryQtyByMaterialCodeWithLock(string materialCode, MyDbContext dbContext)
|
// //{
|
// // //计算可用于出库的库存 【Editby shaocx,2023-01-04】
|
// // var LockedQty = dbContext.v_ware_inventory_for_out.Where(x => x.WareMaterialCode == materialCode).Sum(x => x.LockedQty);
|
// // return LockedQty.HasValue ? LockedQty.Value : 0;
|
// //}
|
|
// /// <summary>
|
// /// 获取当前可用于出库的库存(没有减去锁定数量)
|
// /// </summary>
|
// /// <param name="materialCode"></param>
|
// /// <param name="_v_ware_inventory_for_out"></param>
|
// /// <param name=""></param>
|
// /// <returns></returns>
|
// public static int GetInventoryQtyForOutByMaterialCodeWithNoLockData(string materialCode, MyDbContext dbContext)
|
// {
|
// //计算可用于出库的库存 【Editby shaocx,2023-01-04】
|
// var inventoryQty = dbContext.v_ware_inventory_for_out.Where(x => x.WareMaterialCode == materialCode).Sum(x => x.Qty);
|
// return inventoryQty == null ? 0 : Convert.ToInt32(inventoryQty);
|
// }
|
// }
|
//}
|