/// <summary> /// 根据盘点单唯一编号查询盘点单详细信息 /// </summary> /// <returns></returns> public ActionResult GetDetail() { string SnNum = WebUtil.GetFormValue <string>("SnNum"); string CompanyID = WebUtil.GetFormValue <string>("CompanyID", string.Empty); InventoryDetailEntity entity = new InventoryDetailEntity(); entity.OrderSnNum = SnNum; entity.CompanyID = CompanyID; Bill <InventoryOrderEntity, InventoryDetailEntity> bill = new CheckOrder(CompanyID); List <InventoryDetailEntity> list = bill.GetOrderDetail(entity); DataResult <List <InventoryDetailEntity> > dataResult = new DataResult <List <InventoryDetailEntity> >(); dataResult.Code = (int)EResponseCode.Success; dataResult.Message = "响应成功"; dataResult.Result = list; return(Content(JsonHelper.SerializeObject(dataResult))); }
public ActionResult Edit() { string orderNum = WebUtil.GetQueryStringValue <string>("OrderNum", string.Empty); Bill <CheckStockEntity, CheckStockInfoEntity> bill = new CheckOrder(); CheckStockEntity entity = new CheckStockEntity(); entity.OrderNum = orderNum; entity = bill.GetOrder(entity); if (entity.IsNull()) { return(Redirect("/Check/Product/List")); } string checkType = EnumHelper.GetOptions <ECheckType>(entity.Type); ViewBag.CheckType = checkType; ViewBag.ProductType = EnumHelper.GetOptions <EProductType>(entity.ProductType); ViewBag.Entity = entity; CheckStockInfoEntity info = new CheckStockInfoEntity(); info.OrderNum = orderNum; List <CheckStockInfoEntity> list = bill.GetOrderDetail(info); List <ProductEntity> ListProducts = new List <ProductEntity>(); List <ProductEntity> ListSource = new ProductProvider().GetListByCache(); if (!list.IsNullOrEmpty()) { Parallel.ForEach(list, item => { if (ListSource.Exists(a => a.SnNum == item.TargetNum)) { ProductEntity target = ListSource.FirstOrDefault(a => a.SnNum == item.TargetNum); ListProducts.Add(target); } }); } Session[CacheKey.JOOSHOW_CHECKDETAIL_CACHE] = ListProducts; return(View()); }
public ActionResult Edit() { string orderNum = WebUtil.GetQueryStringValue<string>("OrderNum", string.Empty); Bill<CheckStockEntity, CheckStockInfoEntity> bill = new CheckOrder(); CheckStockEntity entity = new CheckStockEntity(); entity.OrderNum = orderNum; entity = bill.GetOrder(entity); if (entity.IsNull()) { return Redirect("/Check/Product/List"); } string checkType = EnumHelper.GetOptions<ECheckType>(entity.Type); ViewBag.CheckType = checkType; ViewBag.ProductType = EnumHelper.GetOptions<EProductType>(entity.ProductType); ViewBag.Entity = entity; CheckStockInfoEntity info = new CheckStockInfoEntity(); info.OrderNum = orderNum; List<CheckStockInfoEntity> list = bill.GetOrderDetail(info); List<ProductEntity> ListProducts = new List<ProductEntity>(); List<ProductEntity> ListSource = new ProductProvider().GetListByCache(); if (!list.IsNullOrEmpty()) { Parallel.ForEach(list, item => { if (ListSource.Exists(a => a.SnNum == item.TargetNum)) { ProductEntity target = ListSource.FirstOrDefault(a => a.SnNum == item.TargetNum); ListProducts.Add(target); } }); } Session[CacheKey.JOOSHOW_CHECKDETAIL_CACHE] = ListProducts; return View(); }