Пример #1
0
 public Stock CheckGetStockTop(uint trackid)
 {
     if (!StockList.Exists(c => c.track_id == trackid && c.PosType == StockPosE.顶部))
     {
         List <Stock> stocks = StockList.FindAll(c => c.track_id == trackid);
         if (stocks.Count > 0)
         {
             stocks.Sort((x, y) => x.pos.CompareTo(y.pos));
             SetStockTop(stocks[0]);
             return(stocks[0]);
         }
     }
     return(StockList.Find(c => c.track_id == trackid && c.PosType == StockPosE.顶部));
 }
Пример #2
0
        /// <summary>
        /// 判断轨道
        /// 1.已存同品种
        /// 2.轨道为到达满砖数量
        /// </summary>
        /// <param name="trackid"></param>
        /// <param name="goodsid"></param>
        /// <returns></returns>
        private bool IsTrackFineToStore(uint trackid, uint goodsid, out uint storecount)
        {
            bool isok = StockList.Exists(c => c.track_id == trackid && c.goods_id == goodsid);

            if (isok)
            {
                int maxstore = PubMaster.Track.GetTrackMaxStore(trackid);
                storecount = StockSumList.Find(c => c.track_id == trackid)?.count ?? 0;
                if (storecount < maxstore)
                {
                    return(true);
                }
            }
            storecount = 0;
            return(false);
        }
Пример #3
0
        /// <summary>
        /// 获取轨道库存最大规格
        /// </summary>
        /// <param name="trackid"></param>
        /// <returns></returns>
        private Goods GetTrackGoods(uint trackid)
        {
            uint goodsid = StockList.Find(c => c.track_id == trackid)?.goods_id ?? 0;

            if (goodsid != 0)
            {
                //是否存在不同规格的库存在同一个轨道
                if (StockList.Exists(c => c.track_id == trackid && c.goods_id != goodsid))
                {
                    var goodsids = StockList.FindAll(c => c.track_id == trackid)
                                   .GroupBy(x => new { x.goods_id })
                                   .Select(t => t.Key.goods_id);
                    foreach (var goodid in goodsids)
                    {
                        if (CampareGoodWidth(goodsid, goodid))
                        {
                            goodsid = goodid;
                        }
                    }
                }
                return(GoodsList.Find(c => c.id == goodsid));
            }
            return(null);
        }
Пример #4
0
 public bool IsStockWithGood(uint stockid, uint goodsId)
 {
     return(StockList.Exists(c => c.id == stockid && c.goods_id == goodsId));
 }
Пример #5
0
 /// <summary>
 /// 判断轨道是否没有库存
 /// </summary>
 /// <param name="trackid"></param>
 /// <returns></returns>
 public bool IsTrackStockEmpty(uint trackid)
 {
     return(!StockList.Exists(c => c.track_id == trackid));
 }
Пример #6
0
 public bool ExistStockInTrackByGid(uint goodid)
 {
     return(StockList.Exists(c => c.goods_id == goodid &&
                             (c.TrackType == TrackTypeE.储砖_入 || c.TrackType == TrackTypeE.储砖_出 || c.TrackType == TrackTypeE.储砖_出入)));
 }
Пример #7
0
 public bool ExistStockInTrack(uint trackid, uint goodid)
 {
     return(StockList.Exists(c => c.track_id == trackid && c.goods_id == goodid));
 }
Пример #8
0
 public bool ExistStockInTrack(uint trackid)
 {
     return(StockList.Exists(c => c.track_id == trackid));
 }