示例#1
0
        /// <summary>
        /// 添加出库
        /// </summary>
        /// <param name="request"></param>
        public void AddOutBound(AddOutBoundRequest request)
        {
            InBound inBound = this.GetFirstInBound(request.ProductId, request.WarehouseId);

            if (inBound == null)
            {
                throw new EntityIsInvalidException <string>(request.ProductId.ToString());
            }
            InOutReason reason = this._inOutReasonService.GetInOutReason(request.InOutReasonId);

            if (reason == null)
            {
                throw new EntityIsInvalidException <string>(request.InOutReasonId.ToString());
            }
            Users users = this._usersService.GetUsers(request.CreateUserId);

            if (users == null)
            {
                throw new EntityIsInvalidException <string>(users.ToString());
            }

            inBound.AddOutBound(reason, request.Qty, request.Note, users);

            this._uow.Commit();
            this._spotInventoryService.OutSpotInventory(request.ProductId, request.WarehouseId, request.Qty);
        }
示例#2
0
 public HttpResponseMessage AddOutBound([FromUri] AddOutBoundRequest request)
 {
     this._inOutBoundService.AddOutBound(request);
     return(ToJson("出库成功"));
 }
 /// <summary>
 /// 出库
 /// </summary>
 /// <returns></returns>
 public JsonResult AddOutBound(AddOutBoundRequest request)
 {
     this._inOutBoundService.AddOutBound(request);
     return(Json("出库成功", JsonRequestBehavior.AllowGet));
 }