示例#1
0
//        /// <summary>
//        /// 通过事务编号获取入库单明细
//        /// </summary>
//        /// <param name="transactionSysNo">事务编号</param>
//        /// <returns>返回入库单明细,包含入库商品列表</returns>
//        /// <remarks>2013-06-08 周唐炬 创建</remarks>
//        public override WhStockIn GetWhStockInByTransactionSysNo(string transactionSysNo)
//        {
//            return Context.Sql(@"SELECT * FROM WhStockIn WHERE transactionSysNo =@TransactionSysNo")
//                .Parameter("TransactionSysNo", transactionSysNo)
//                .QuerySingle<WhStockIn>();
//        }

        #endregion

        #region 商品出库
        ///// <summary>
        ///// 商品入库
        ///// </summary>
        ///// <param name="model">入库单明细</param>
        ///// <returns>返回受影响行</returns>
        ///// <remarks>2013-06-08 周唐炬 创建</remarks>
        //public override int InsertWhStockInItem(WhStockInItem model)
        //{
        //    if (model.StockInSysNo <= 0)
        //    {
        //        throw new Exception("入库单明细的入库单系统编号不能小于等于0");
        //    }
        //    var id = Context.Insert<WhStockInItem>("WhStockInItem", model)
        //        .AutoMap(x => x.SysNo)
        //        .ExecuteReturnLastId<int>("SysNo");
        //    return id;
        //}

        /// <summary>
        /// 更新商品出库信息
        /// </summary>
        /// <param name="model">出库单明细</param>
        /// <returns>返回受影响行</returns>
        /// <remarks>2016-06-24 王耀发 创建</remarks>
        public override int UpdateWhInventoryOutItem(WhInventoryOutItem model)
        {
            var rowsAffected = Context.Update <WhInventoryOutItem>("WhInventoryOutItem", model)
                               .AutoMap(x => x.SysNo).Where(x => x.SysNo)
                               .Execute();

            return(rowsAffected);
        }
示例#2
0
        /// <summary>
        /// 商品出库
        /// </summary>
        /// <param name="model">出库单明细</param>
        /// <returns>返回受影响行</returns>
        /// <remarks>2016-06-24 王耀发 创建</remarks>
        public override int InsertWhInventoryOutItem(WhInventoryOutItem model)
        {
            if (model.InventoryOutSysNo <= 0)
            {
                throw new Exception("入库单明细的入库单系统编号不能小于等于0");
            }
            var id = Context.Insert <WhInventoryOutItem>("WhInventoryOutItem", model)
                     .AutoMap(x => x.SysNo)
                     .ExecuteReturnLastId <int>("SysNo");

            return(id);
        }
示例#3
0
        /// <summary>
        /// 生成调拨出库单
        /// </summary>
        /// <param name="atAllocationSysNo"></param>
        /// <returns></returns>
        /// <remarks>2016-06-30 陈海裕 创建</remarks>
        public int CreateALCInventoryOutOrder(int atAllocationSysNo)
        {
            var atAllocationEntity = BLL.Warehouse.AtAllocationBo.Instance.GetAtAllocationEntity(atAllocationSysNo);
            var itemList           = BLL.Warehouse.AtAllocationBo.Instance.GetAtAllocationProducts(atAllocationSysNo);

            if (atAllocationEntity == null || itemList == null || !itemList.Any())
            {
                return(0);
            }

            WhInventoryOut invenOutEntity = new WhInventoryOut();

            invenOutEntity.CreatedBy        = BLL.Authentication.AdminAuthenticationBo.Instance.Current == null ? 12 : BLL.Authentication.AdminAuthenticationBo.Instance.Current.Base.SysNo;
            invenOutEntity.CreatedDate      = DateTime.Now;
            invenOutEntity.DeliveryType     = 0;
            invenOutEntity.IsPrinted        = 0;
            invenOutEntity.LastUpdateBy     = invenOutEntity.CreatedBy;
            invenOutEntity.LastUpdateDate   = invenOutEntity.CreatedDate;
            invenOutEntity.Remarks          = "调拨出库";
            invenOutEntity.SourceSysNO      = atAllocationEntity.SysNo;
            invenOutEntity.SourceType       = (int)WarehouseStatus.出库单来源.调货单;
            invenOutEntity.Stamp            = (DateTime)System.Data.SqlTypes.SqlDateTime.MinValue;
            invenOutEntity.Status           = (int)WarehouseStatus.采购退货出库单状态.待出库;
            invenOutEntity.TransactionSysNo = BLL.Basic.ReceiptNumberBo.Instance.GetAllocationOutNo();
            invenOutEntity.WarehouseSysNo   = atAllocationEntity.OutWarehouseSysNo;
            invenOutEntity.ItemList         = new List <WhInventoryOutItem>();
            foreach (var item in itemList)
            {
                var productName         = BLL.Product.PdProductBo.Instance.GetProductEasName(item.ProductSysNo);
                WhInventoryOutItem temp = new WhInventoryOutItem();
                temp.CreatedBy            = invenOutEntity.CreatedBy;
                temp.CreatedDate          = invenOutEntity.CreatedDate;
                temp.LastUpdateBy         = invenOutEntity.CreatedBy;
                temp.LastUpdateDate       = invenOutEntity.CreatedDate;
                temp.ProductName          = productName;
                temp.ProductSysNo         = item.ProductSysNo;
                temp.RealStockOutQuantity = item.Quantity;  //0
                temp.Remarks          = "";
                temp.SourceItemSysNo  = item.SysNo;
                temp.StockOutQuantity = item.Quantity;
                invenOutEntity.ItemList.Add(temp);
            }

            return(WhInventoryOutBo.Instance.CreateWhInventoryOut(invenOutEntity));
        }
示例#4
0
 /// <summary>
 /// 更新商品出库信息
 /// </summary>
 /// <param name="model">出库单明细</param>
 /// <returns>返回受影响行</returns>
 /// 2016-06-24 王耀发 创建
 public int UpdateWhInventoryOutItem(WhInventoryOutItem model)
 {
     return(IWhInventoryOutDao.Instance.UpdateWhInventoryOutItem(model));
 }
示例#5
0
 /// <summary>
 /// 商品出库
 /// </summary>
 /// <param name="model">出库单明细</param>
 /// <returns>返回受影响行</returns>
 /// <remarks>2016-06-24 王耀发 创建</remarks>
 public abstract int InsertWhInventoryOutItem(WhInventoryOutItem model);
示例#6
0
        ///// <summary>
        ///// 通过事务编号获取入库单明细
        ///// </summary>
        ///// <param name="transactionSysNo">事务编号</param>
        ///// <returns>返回入库单明细,包含入库商品列表</returns>
        ///// <remarks>2013-06-08 周唐炬 创建</remarks>
        //public abstract WhStockIn GetWhStockInByTransactionSysNo(string transactionSysNo);

        ///// <summary>
        ///// 商品入库
        ///// </summary>
        ///// <param name="model">入库单明细</param>
        ///// <returns>返回受影响行</returns>
        ///// <remarks>2013-06-08 周唐炬 创建</remarks>
        //public abstract int InsertWhStockInItem(WhStockInItem model);

        /// <summary>
        /// 更新商品出库信息
        /// </summary>
        /// <param name="model">出库单明细</param>
        /// <returns>返回受影响行</returns>
        /// <remarks>2016-06-24 王耀发 创建</remarks>
        public abstract int UpdateWhInventoryOutItem(WhInventoryOutItem model);