xxyy
2025-03-06 324a7b654f3ab96ad0274e96050fde4957749de3
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -1269,11 +1269,11 @@
        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)
@@ -1286,17 +1286,7 @@
        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;