Exemplo n.º 1
0
        /// <summary>
        /// 获取需要打包的库存数量
        /// </summary>
        /// <param name="Customer_Id">客户标识</param>
        /// <param name="User_Id">用户标识</param>
        /// <param name="Unit_Id">组织标识</param>
        /// <returns></returns>
        public int GetStockBalanceCount(string Customer_Id, string User_Id, string Unit_Id)
        {
            LoggingSessionInfo loggingSessionInfo = GetLoggingSessionInfo(Customer_Id, User_Id, Unit_Id);
            int iCount = 0;
            StockBalanceService stockBalanceService = new StockBalanceService();

            iCount = stockBalanceService.GetStockBalanceCountByUnitId(loggingSessionInfo, Unit_Id);
            return(iCount);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 需要打包的库存集合
        /// </summary>
        /// <param name="Customer_Id">客户标识</param>
        /// <param name="User_Id">用户标识</param>
        /// <param name="Unit_Id">组织标识</param>
        /// <param name="startRow">开始行</param>
        /// <param name="rowsCount">每页行数</param>
        /// <returns>未打包的库存集合</returns>
        public IList <StockBalanceInfo> GetStockBalanceList(string Customer_Id, string User_Id, string Unit_Id, int startRow, int rowsCount)
        {
            IList <StockBalanceInfo> stockBalanceInfoList = new List <StockBalanceInfo>();
            LoggingSessionInfo       loggingSessionInfo   = GetLoggingSessionInfo(Customer_Id, User_Id, Unit_Id);
            StockBalanceService      stockBalanceService  = new StockBalanceService();

            stockBalanceInfoList = stockBalanceService.GetStockBalanceByUnitId(loggingSessionInfo, Unit_Id, rowsCount, startRow);
            return(stockBalanceInfoList);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 批量保存调整单
        /// </summary>
        /// <param name="loggingSessionInfo">登录model</param>
        /// <param name="inoutInfoList">调整单集合</param>
        /// <returns></returns>
        public bool SetAJInfoList(LoggingSessionInfo loggingSessionInfo, IList <InoutInfo> inoutInfoList)
        {
            MSSqlMapper.Instance(loggingSessionInfo.CurrentLoggingManager).BeginTransaction();
            string strError = string.Empty;

            try
            {
                bool bReturn = false;

                foreach (InoutInfo inoutInfo in inoutInfoList)
                {
                    //新建
                    bReturn = SetAJInfo(loggingSessionInfo, false, inoutInfo, out strError);
                    if (!bReturn)
                    {
                        break;
                    }
                    //审批
                    if (new cBillService().CanApproveBill(loggingSessionInfo, "", inoutInfo.order_id))
                    {
                        bReturn = new InoutService().SetInoutOrderStatus(loggingSessionInfo, inoutInfo.order_id, BillActionType.Approve, out strError);
                        if (!bReturn)
                        {
                            break;
                        }
                    }
                    //影响库存
                    bReturn = new StockBalanceService().SetStockBalance(loggingSessionInfo, inoutInfo.order_id);
                    if (!bReturn)
                    {
                        break;
                    }
                }
                MSSqlMapper.Instance(loggingSessionInfo.CurrentLoggingManager).CommitTransaction();
                return(true);
            }
            catch (Exception ex) {
                MSSqlMapper.Instance(loggingSessionInfo.CurrentLoggingManager).RollBackTransaction();
                throw (ex);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 获取单个SKU库存
        /// </summary>
        public string GetStockNumData()
        {
            var     stockService = new StockBalanceService(CurrentUserInfo);
            decimal num          = 0;

            string key          = string.Empty;
            string content      = string.Empty;
            string unit_id      = string.Empty;
            string warehouse_id = string.Empty;

            if (Request("id") != null && Request("id") != string.Empty)
            {
                key = Request("id").ToString().Trim();
            }
            if (Request("unit_id") != null && Request("unit_id") != string.Empty)
            {
                unit_id = Request("unit_id").ToString().Trim();
            }
            if (Request("warehouse_id") != null && Request("warehouse_id") != string.Empty)
            {
                warehouse_id = Request("warehouse_id").ToString().Trim();
            }
            var stockInfo = stockService.GetStockBalanceListByUnitIdWarehouseId(unit_id, warehouse_id, null, key, 1, 0);

            if (stockInfo != null && stockInfo.StockBalanceInfoList != null &&
                stockInfo.StockBalanceInfoList.Count > 0)
            {
                num = stockInfo.StockBalanceInfoList[0].end_qty;
            }

            var jsonData = new JsonData();

            jsonData.totalCount = "1";
            jsonData.data       = num;
            content             = jsonData.ToJSON();
            return(content);
        }