/// <summary> /// 查询库存清单数据 /// </summary> /// <param name="entity"></param> /// <param name="pageInfo"></param> /// <returns></returns> public List <LocalProductEntity> GetList(LocalProductEntity entity, ref PageInfo pageInfo) { entity.IncludeAll(); entity.Where(item => item.CompanyID == this.CompanyID).And(item => item.Num > 0); entity.OrderBy(item => item.ID, EOrderBy.DESC); if (entity.StorageNum.IsNotEmpty()) { entity.And(item => item.StorageNum == entity.StorageNum); } if (entity.LocalType > 0) { entity.And(item => item.LocalType == entity.LocalType); } if (entity.LocalNum.IsNotEmpty()) { entity.And(item => item.LocalNum == entity.LocalNum); } if (entity.BarCode.IsNotEmpty()) { entity.And("BarCode", ECondition.Like, "%" + entity.BarCode + "%"); } if (entity.ProductName.IsNotEmpty()) { entity.And("ProductName", ECondition.Like, "%" + entity.ProductName + "%"); } if (entity.BatchNum.IsNotEmpty()) { entity.And("BatchNum", ECondition.Like, "%" + entity.BatchNum + "%"); } int rowCount = 0; List <LocalProductEntity> listResult = this.LocalProduct.GetList(entity, pageInfo.PageSize, pageInfo.PageIndex, out rowCount); pageInfo.RowCount = rowCount; if (!listResult.IsNullOrEmpty()) { ProductProvider productProvider = new ProductProvider(this.CompanyID); foreach (LocalProductEntity item in listResult) { ProductEntity product = productProvider.GetProduct(item.ProductNum); if (product != null) { item.Size = product.Size; item.CateNum = product.CateNum; item.CateName = product.CateName; item.AvgPrice = product.AvgPrice; item.MinNum = product.MinNum; item.MaxNum = product.MaxNum; item.UnitNum = product.UnitNum; item.UnitName = product.UnitName; } } } return(listResult); }