/// <summary> /// 所有仓库的正式库位和待入库位货品数量的总和 /// 不区分仓库,不区分库位 /// </summary> /// <param name="entity"></param> /// <param name="pageInfo"></param> /// <returns></returns> public List <V_LocalProductEntity> GetList(V_LocalProductEntity entity, ref PageInfo pageInfo) { V_LocalProductEntity Entity = new V_LocalProductEntity(); Entity.IncludeAll(); Entity.OrderBy(a => a.ID, EOrderBy.ASC); Entity.Where(a => a.CompanyID == this.CompanyID).And(item => item.Num > 0); if (entity.BarCode.IsNotEmpty()) { Entity.Where("BarCode", ECondition.Like, "%" + entity.BarCode + "%"); } if (entity.ProductName.IsNotEmpty()) { Entity.Where("ProductName", ECondition.Like, "%" + entity.ProductName + "%"); } if (entity.Size.IsNotEmpty()) { Entity.Where("Size", ECondition.Like, "%" + entity.Size + "%"); } if (entity.CateNum.IsNotEmpty()) { ProductCategoryProvider provider = new ProductCategoryProvider(this.CompanyID); List <ProductCategoryEntity> listCate = provider.GetChildList(entity.CateNum); string[] items = null; if (!listCate.IsNullOrEmpty()) { items = listCate.Select(item => item.SnNum).ToArray(); } else { items = new string[] { "" }; } Entity.And("CateNum", ECondition.In, items); } int rowCount = 0; List <V_LocalProductEntity> listResult = this.V_LocalProduct.GetList <V_LocalProductEntity>(Entity, pageInfo.PageSize, pageInfo.PageIndex, out rowCount); pageInfo.RowCount = rowCount; return(listResult); }
/// <summary> /// 查询所有的仓库库存数据总和 /// </summary> /// <returns></returns> public ActionResult GetLocalProduct() { string CompanyID = WebUtil.GetFormValue <string>("CompanyID", string.Empty); string BarCode = WebUtil.GetFormValue <string>("BarCode", string.Empty); string ProductName = WebUtil.GetFormValue <string>("ProductName", string.Empty); string Size = WebUtil.GetFormValue <string>("Size", string.Empty); string CateNum = WebUtil.GetFormValue <string>("CateNum", string.Empty); int PageIndex = WebUtil.GetFormValue <int>("PageIndex", 1); int PageSize = WebUtil.GetFormValue <int>("PageSize", 10); V_LocalProductEntity entity = new V_LocalProductEntity(); entity.CompanyID = CompanyID; entity.BarCode = BarCode; entity.ProductName = ProductName; entity.Size = Size; entity.CateNum = CateNum; PageInfo pageInfo = new PageInfo() { PageIndex = PageIndex, PageSize = PageSize }; LocalProductProvider provider = new LocalProductProvider(CompanyID); List <V_LocalProductEntity> listResult = provider.GetList(entity, ref pageInfo); DataListResult <V_LocalProductEntity> dataResult = new DataListResult <V_LocalProductEntity>() { Code = (int)EResponseCode.Success, Message = "响应成功", Result = listResult, PageInfo = pageInfo }; return(Content(JsonHelper.SerializeObject(dataResult))); }