From 1c637ea862816ae6fa53945fa0327b95c79aa18b Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期五, 22 八月 2025 16:20:27 +0800
Subject: [PATCH] 增强 WMS IP 地址处理逻辑的健壮性在 `TaskService.cs` 文件中,添加了对 `result` 是否为 `null` 的检查,以确保在反序列化之前 `result` 是有效的。同时,调整了对 `content.Data` 的检查逻辑,确保在 `content.Data` 不为空的情况下,才会进一步检查其值是否为 "NG"。如果是 "NG",则设置 `task.Remark` 为 "NG"。这些更改提高了代码的健壮性,避免了潜在的空引用异常。
---
CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs b/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs
index 7c2ccb6..f5235d1 100644
--- a/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs
+++ b/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs
@@ -3,7 +3,9 @@
using System.Threading.Tasks;
using WIDESEA_Common;
using WIDESEA_Core;
+using WIDESEA_Core.Const;
using WIDESEA_DTO;
+using WIDESEA_DTO.WMS;
using WIDESEA_IServices;
using WIDESEA_Model.Models;
@@ -124,6 +126,8 @@
return base.UpdateData(saveModel);
}
+
+
public WebResponseContent HandOutTask(int locationID)
{
LogFactory.GetLog("鎵嬪姩鍑哄簱浠诲姟").InfoFormat(true, "鎵嬪姩鍑哄簱浠诲姟", JsonConvert.SerializeObject(locationID), App.User.UserName);
@@ -137,12 +141,12 @@
{
Dt_Task task = new Dt_Task
{
- Grade = 1,
+ Grade = 3,
Roadway = location.RoadwayNo,
- TargetAddress = "001-035-001",
+ TargetAddress = "001-048-001",
Dispatchertime = DateTime.Now,
MaterialNo = "",
- NextAddress = "001-035-001",
+ NextAddress = "001-048-001",
OrderNo = null,
PalletCode = stock == null ? "M" + DateTime.Now.ToString("MMddHHmmss") + "-" + new Random().Next(100, 1000) : stock.PalletCode,
SourceAddress = location.LocationCode,
--
Gitblit v1.9.3