From aded48e0f32d28bf61479a3c50ac63946be6f469 Mon Sep 17 00:00:00 2001
From: xxyy <cathay_xy@163.com>
Date: 星期四, 06 三月 2025 17:28:46 +0800
Subject: [PATCH] 修复空指针异常的潜在问题
---
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