From 46ba61974b88fa75d1bcdad26709f2c3a945051e Mon Sep 17 00:00:00 2001 From: xxyy <cathay_xy@163.com> Date: 星期五, 07 三月 2025 09:43:08 +0800 Subject: [PATCH] 新增 API 方法并实现请求节流机制 --- Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/AspNetCoreSchedule.cs | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/AspNetCoreSchedule.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/AspNetCoreSchedule.cs index 3a75882..271e0af 100644 --- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/AspNetCoreSchedule.cs +++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/AspNetCoreSchedule.cs @@ -36,7 +36,7 @@ public Task StartAsync(CancellationToken cancellationToken) { - _timer = new Timer(DoWork, null, TimeSpan.Zero, TimeSpan.FromMinutes(20)); + _timer = new Timer(DoWork, null, TimeSpan.Zero, TimeSpan.FromMinutes(5)); return Task.CompletedTask; } @@ -51,9 +51,8 @@ IDictionary<string, DtStockInfo>? stockInfos = _simpleCacheService.HashGetAll<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo); List<DtStockInfo> stockInfoList = stockInfos.Values.ToList(); - var stockInfo = stockInfoList.Where(x => x.AreaCode == area.AreaCode && x.OutboundTime < DateTime.Now && x.IsFull == true) // 杩囨护鏉′欢 - .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID) // 杩囨护鏉′欢 + .Where(x => x.LocationInfo != null && x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID) // 杩囨护鏉′欢 .OrderBy(x => x.OutboundTime) // 鎺掑簭 .ToList(); // 鑾峰彇绗竴涓厓绱� @@ -140,7 +139,7 @@ Creater = "System", // 淇鎷煎啓閿欒 CreateDate = DateTime.Now, TaskId = 0, - ProductionLine= stockInfo.ProductionLine, + ProductionLine = stockInfo.ProductionLine, ProcessCode = stockInfo.ProcessCode, }; } -- Gitblit v1.9.3