| | |
| | | }); |
| | | try |
| | | { |
| | | //using (_simpleCacheService.AcquireLock(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, 2000)) |
| | | //{ |
| | | _simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { stock.PalletCode }); |
| | | //} |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogFactory.GetLog("删除缓存失败").Error(true, $"{stock.PalletCode}_删除缓存失败,异常信息:{ex.Message}"); |
| | | //using (_simpleCacheService.AcquireLock(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, 2000)) |
| | | //{ |
| | | //} |
| | | } |
| | | |
| | | return content.OK("任务完成成功", task.Remark); |
| | |
| | | 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 (areaCode == "CH001") |
| | | { |
| | | LogFactory.GetLog("CH001").Info(true, JsonConvert.SerializeObject(stockInfoList[0], Formatting.Indented)); |
| | | } |
| | | |
| | | result = stockInfoList.Where(x => x.AreaCode == areaCode && x.OutboundTime < DateTime.Now && x.IsFull) |
| | | .WhereIF(!productionLine.IsNullOrEmpty(), x => x.ProductionLine == productionLine) |
| | |
| | | .OrderBy(x => x.OutboundTime) |
| | | .FirstOrDefault(); |
| | | |
| | | |
| | | if (result != null) |
| | | _simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { result.PalletCode }); |
| | | else |
| | | ConsoleHelper.WriteErrorLine("QueryStockInfoForRealTrayAsync查询实盘库存信息失败:未找到符合条件的数据"); |
| | | ConsoleHelper.WriteErrorLine($"{areaCode}-{productionLine}查询实盘库存信息失败:未找到符合条件的数据"); |
| | | |
| | | return result; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | ConsoleHelper.WriteErrorLine("QueryStockInfoForRealTrayAsync查询实盘库存信息失败:" + ex.Message + "\r\n" + ex.StackTrace); |
| | | ConsoleHelper.WriteErrorLine("查询实盘库存信息失败:" + ex.Message + "\r\n" + ex.StackTrace); |
| | | return null; |
| | | } |
| | | } |