Пример #1
0
 /// <summary>
 /// 用于判断该订单是否已经正在出库
 /// </summary>
 /// <returns></returns>
 public ReturnOrderEntity CheckOrder(string orderNum)
 {
     ReturnDetailEntity entity = new ReturnDetailEntity() { ContractOrder = orderNum };
     ReturnOrderEntity order = new ReturnOrderEntity();
     order.Where(a => a.Status == (int)EAudite.Wait);
     order.IncludeAll();
     entity.Left<ReturnOrderEntity>(order, new Params<string, string>() { Item1 = "OrderNum", Item2 = "OrderNum" });
     order = this.ReturnOrder.GetSingle(order);
     return order;
 }
Пример #2
0
        public ActionResult Detail()
        {
            string orderNum = WebUtil.GetQueryStringValue<string>("OrderNum", string.Empty);
            string flag = WebUtil.GetQueryStringValue<string>("flag", string.Empty);
            Bill<ReturnOrderEntity, ReturnDetailEntity> bill = new ReturnOrder();
            ReturnOrderEntity entity = new ReturnOrderEntity();
            entity.OrderNum = orderNum;
            entity = bill.GetOrder(entity);
            entity = entity.IsNull() ? new ReturnOrderEntity() : entity;
            ViewBag.Entity = entity;
            ViewBag.ReturnType = EnumHelper.GetEnumDesc<EReturnType>(entity.ReturnType);
            ViewBag.Status = EnumHelper.GetEnumDesc<EAudite>(entity.Status);

            ReturnDetailEntity detail = new ReturnDetailEntity();
            detail.OrderNum = orderNum;
            List<ReturnDetailEntity> list = bill.GetOrderDetail(detail);
            list = list.IsNull() ? new List<ReturnDetailEntity>() : list;
            ViewBag.Detail = list;
            ViewBag.Flag = flag;
            return View();
        }
Пример #3
0
 public static ReturnDetail_CE ToCE(ReturnDetailEntity item)
 {
     ReturnDetail_CE target = new ReturnDetail_CE();
     target.ID=item.ID;
     target.SnNum=item.SnNum;
     target.OrderNum=item.OrderNum;
     target.ContractOrder=item.ContractOrder;
     target.ProductName=item.ProductName;
     target.BarCode=item.BarCode;
     target.ProductNum=item.ProductNum;
     target.BatchNum=item.BatchNum;
     target.LocalNum=item.LocalNum;
     target.StorageNum=item.StorageNum;
     target.Num=item.Num;
     target.OutPrice=item.OutPrice;
     target.Amount=item.Amount;
     target.BackNum=item.BackNum;
     target.BackAmount=item.BackAmount;
     target.CreateTime=item.CreateTime;
     return target;
 }
Пример #4
0
        public ActionResult Edit()
        {
            //退货单号
            string OrderNum = WebUtil.GetFormValue<string>("OrderNum", string.Empty);
            if (!OrderNum.IsEmpty())
            {
                //退货单部分
                Bill<ReturnOrderEntity, ReturnDetailEntity> bill = new ReturnOrder();
                ReturnOrderEntity entity = new ReturnOrderEntity();
                entity.OrderNum = OrderNum;
                entity = bill.GetOrder(entity);
                if (entity.Status != (int)EAudite.Wait)
                {
                    this.ReturnJson.AddProperty("d", "1001");
                    return Content(this.ReturnJson.ToString());
                }
                ReturnDetailEntity detail = new ReturnDetailEntity();
                detail.OrderNum = OrderNum;
                List<ReturnDetailEntity> listDetails = bill.GetOrderDetail(detail);
                //出货单部分
                Bill<OutStorageEntity, OutStoDetailEntity> provider = new OutStorageOrder();
                OutStoDetailEntity items = new OutStoDetailEntity();
                items.OrderNum = entity.ContractOrder;
                List<OutStoDetailEntity> list = provider.GetOrderDetail(items);

                //已经退货部分
                ReturnProvider returnProvider = new ReturnProvider();
                List<ReturnDetailEntity> listResult = returnProvider.GetDetailByOrder(entity.ContractOrder);

                if (!list.IsNullOrEmpty())
                {
                    list.ForEach(a =>
                    {
                        ReturnDetailEntity item = listDetails.FirstOrDefault(b => b.BarCode == a.BarCode && b.ProductNum == a.ProductNum && b.LocalNum == a.LocalNum && b.StorageNum == a.StorageNum);
                        if (item != null)
                        {
                            a.Qty = item.BackNum;
                        }
                        a.BackNum = listResult.Where(b => b.BarCode == a.BarCode && b.ProductNum == a.ProductNum && b.LocalNum == a.LocalNum && b.StorageNum == a.StorageNum).Sum(b => b.BackNum);
                    });
                }
                Session[CacheKey.TEMPDATE_CACHE_RETURNPRODUCTDETAIL] = list;
                string json = ConvertJson.ListToJson<OutStoDetailEntity>(list, "List");
                this.ReturnJson.AddProperty("data", json);
            }
            return Content(this.ReturnJson.ToString());
        }
Пример #5
0
 /// <summary>
 /// 根据关联单号查询已经退货的的情况
 /// </summary>
 /// <param name="orderNum"></param>
 /// <returns></returns>
 public List<ReturnDetailEntity> GetDetailByOrder(string orderNum)
 {
     ReturnDetailEntity entity = new ReturnDetailEntity();
     entity.IncludeAll();
     ReturnOrderEntity order = new ReturnOrderEntity();
     entity.Left<ReturnOrderEntity>(order, new Params<string, string>() { Item1 = "OrderNum", Item2 = "OrderNum" });
     order.Where(a => a.Status == (int)EAudite.Pass);
     order.Where(a => a.ContractOrder == orderNum);
     List<ReturnDetailEntity> list = this.ReturnDetail.GetList(entity);
     return list;
 }
Пример #6
0
 /// <summary>
 /// 查询单据分页
 /// </summary>
 /// <param name="entity"></param>
 /// <param name="pageInfo"></param>
 /// <returns></returns>
 public List<ReturnOrderEntity> GetList(ReturnOrderEntity entity, ref PageInfo pageInfo)
 {
     entity.IncludeAll();
     entity.Where(a => a.IsDelete == (int)EIsDelete.NotDelete);
     entity.And("Status", ECondition.Eth, (int)EAudite.Pass);
     entity.OrderBy(a => a.ID, EOrderBy.DESC);
     ReturnDetailEntity detail = new ReturnDetailEntity();
     detail.Include(a => new { ProductName = a.ProductName, BarCode = a.BarCode, ProductNum = a.ProductNum });
     entity.Left<ReturnDetailEntity>(detail, new Params<string, string>() { Item1 = "OrderNum", Item2 = "OrderNum" });
     int rowCount = 0;
     List<ReturnOrderEntity> listResult = this.ReturnOrder.GetList(entity, pageInfo.PageSize, pageInfo.PageIndex, out rowCount);
     int allNum = GetAllNum();
     if (!listResult.IsNullOrEmpty())
     {
         foreach (ReturnOrderEntity item in listResult)
         {
             item.NumPCT = ((float)item.Num * 100.00f) / allNum;
         }
     }
     pageInfo.RowCount = rowCount;
     return listResult;
 }