From b54877f2400f752f5b9a1c8aef39c4aa9e851ac5 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期三, 11 三月 2026 09:54:19 +0800
Subject: [PATCH] docs: 添加WCS系统DDD重构设计文档
---
Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs | 37 ++++++++++++++++++++++++++++---------
1 files changed, 28 insertions(+), 9 deletions(-)
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
index 710c4f9..db2cb23 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -8,6 +8,7 @@
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
+using WIDESEA_Core.Core;
using WIDESEA_DTO;
using WIDESEA_DTO.Task;
using WIDESEA_IBasicService;
@@ -209,6 +210,7 @@
var r when r.Contains("CW") => DateTime.Now.AddHours(1),
_ => DateTime.Now
};
+ stockInfo.StockStatus = StockStatusEmun.鍏ュ簱瀹屾垚.GetHashCode();
location.LocationStatus = LocationStatusEnum.InStock.GetHashCode();
@@ -383,20 +385,37 @@
}
/// <summary>
- /// 鏍规嵁宸烽亾纭畾鐩爣鍦板潃
+ /// 鏍规嵁宸烽亾纭畾鐩爣鍦板潃锛堟敮鎸佸鍑哄簱鍙h疆璇級
/// </summary>
- private string DetermineTargetAddress(string roadway, Dictionary<string, string> addressMap)
+ private string DetermineTargetAddress(string roadway, Dictionary<string, List<string>> addressMap)
{
if (string.IsNullOrWhiteSpace(roadway))
- return "10080"; // 榛樿鍦板潃
+ return "10080";
+ // 鏌ユ壘鍖归厤鐨勫贩閬撳墠缂�
+ string matchedPrefix = null;
foreach (var kvp in addressMap)
{
if (roadway.Contains(kvp.Key))
- return kvp.Value;
+ {
+ matchedPrefix = kvp.Key;
+ break;
+ }
}
- return "10080"; // 榛樿鍦板潃
+ if (matchedPrefix == null)
+ return "10080";
+
+ var addresses = addressMap[matchedPrefix];
+ if (addresses == null || addresses.Count == 0)
+ return "10080";
+
+ // 鍗曚釜鍦板潃锛岀洿鎺ヨ繑鍥�
+ if (addresses.Count == 1)
+ return addresses[0];
+
+ // 澶氫釜鍦板潃锛屼娇鐢ㄨ疆璇㈡湇鍔�
+ return _roundRobinService.GetNextAddress(matchedPrefix, addresses);
}
/// <summary>
@@ -475,8 +494,8 @@
// 4. 鑾峰彇閰嶇疆鐨勭洰鏍囧湴鍧�鏄犲皠
var targetAddressMap = _configuration.GetSection("AutoOutboundTask:TargetAddresses")
- .Get<Dictionary<string, string>>()
- ?? new Dictionary<string, string>();
+ .Get<Dictionary<string, List<string>>>()
+ ?? new Dictionary<string, List<string>>();
// 5. 鎵归噺鍒涘缓浠诲姟
var taskList = new List<Dt_Task>();
@@ -500,7 +519,7 @@
TaskType = TaskTypeEnum.Outbound.GetHashCode(),
TaskStatus = TaskStatusEnum.New.GetHashCode(),
Grade = 1,
- TaskNum = 0, // 浣跨敤 0 璁╂暟鎹簱鑷姩鐢熸垚浠诲姟鍙�
+ TaskNum = await BaseDal.GetTaskNo(),
Creater = "system_auto"
};
taskList.Add(task);
@@ -521,7 +540,7 @@
{
var wmstaskDto = _mapper.Map<WMSTaskDTO>(task);
_httpClientHelper.Post<WebResponseContent>(
- "http://logistics-service/api/logistics/notifyoutbound",
+ "http://localhost:9292/api/Task/ReceiveTask",
JsonSerializer.Serialize(wmstaskDto));
}
catch (Exception ex)
--
Gitblit v1.9.3