| | |
| | | List<DtStockInfo> stockInfoList = stockInfos.Values.ToList(); |
| | | var result = new DtStockInfo(); |
| | | |
| | | if (stockInfoList.IsNullOrEmpty()) |
| | | { |
| | | stockInfoList = await _stockInfoRepository.Db.Queryable<DtStockInfo>() |
| | | .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock).IncludesAllFirstLayer().ToListAsync(); |
| | | } |
| | | //if (stockInfoList.IsNullOrEmpty()) |
| | | //{ |
| | | // stockInfoList = await _stockInfoRepository.Db.Queryable<DtStockInfo>() |
| | | // .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock).IncludesAllFirstLayer().ToListAsync(); |
| | | //} |
| | | |
| | | result = stockInfoList.Where(x => x.AreaCode == areaCode && x.OutboundTime < DateTime.Now && x.IsFull) |
| | | .WhereIF(!productionLine.IsNullOrEmpty(), x => x.ProductionLine == productionLine) |
| | |
| | | if (result != null) |
| | | { |
| | | stockInfoList = stockInfoList.Where(x => x != result).ToList(); |
| | | if (stockInfos.IsNullOrEmpty()) |
| | | { |
| | | foreach (var item in stockInfoList) |
| | | { |
| | | _simpleCacheService.HashAdd(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, item.PalletCode, item); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | _simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { result.PalletCode }); |
| | | } |
| | | _simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { result.PalletCode }); |
| | | } |
| | | |
| | | return result; |