Exemplo n.º 1
0
        /// <summary>  pass
        /// 更新门店采购申请状态
        /// </summary>
        /// <param name="applyId"></param>
        /// <param name="stockState"></param>
        /// <param name="remark"></param>
        /// <returns></returns>
        public bool UpdateShopApplyStockState(Guid applyId, int stockState, string remark)
        {
            string msg;
            var    applyStockBll = new ApplyStockBLL(GlobalConfig.DB.FromType.Write);
            var    applyInfo     = _applyStock.FindById(applyId);
            IDictionary <Guid, decimal> settleDics;

            return(applyStockBll.UpdateApplyStockState(applyInfo, stockState, false, out settleDics, out msg));
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="applyId"></param>
        /// <returns></returns>
        public IList <ApplyStockDetailInfo> FindDetailList(Guid applyId)
        {
            var infoList    = _applyStockDao.FindDetailList(applyId);
            var applyInfo   = _applyStockDao.FindById(applyId);
            var quantityDic = new Dictionary <Guid, int>();

            if (applyInfo != null)
            {
                quantityDic = WMSSao.GoodsEffitiveStockBySaleFilialeId(applyInfo.CompanyWarehouseId, null,
                                                                       infoList.GroupBy(ent => new { ent.GoodsId, ent.CompGoodsID }).ToDictionary(k => k.Key.GoodsId, v => v.Key.CompGoodsID), applyInfo.CompanyId);
                if (quantityDic == null)
                {
                    throw new ApplicationException("库存中心异常FindDetailList");
                }
            }
            foreach (var info in infoList)
            {
                info.GoodsStock = quantityDic.ContainsKey(info.GoodsId) ? quantityDic[info.GoodsId] : 0;
            }
            return(infoList);
        }