From 0b201eb98881f4381893c9765b530fa5d19e41ea Mon Sep 17 00:00:00 2001
From: xiazhengtongxue <133085197+xiazhengtongxue@users.noreply.github.com>
Date: 星期五, 01 五月 2026 10:56:20 +0800
Subject: [PATCH] 1
---
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotTaskProcessor.cs | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 49 insertions(+), 0 deletions(-)
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotTaskProcessor.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotTaskProcessor.cs
index 93fc738..7332c59 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotTaskProcessor.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotTaskProcessor.cs
@@ -714,7 +714,56 @@
.ToList()
};
}
+ /// <summary>
+ /// 鏋勫缓搴撳瓨鍥炰紶 DTO
+ /// </summary>
+ /// <remarks>
+ /// 鐢ㄤ簬鎷嗙洏鍜岀粍鐩樻搷浣滄椂锛屽悜 WMS 鍥炰紶搴撳瓨淇℃伅銆�
+ /// DTO 鍖呭惈婧愯揣浣嶃�佺洰鏍囪揣浣嶃�佹墭鐩樼爜浠ュ強姣忎釜浣嶇疆鐨勭數姹犳潯鐮併��
+ /// </remarks>
+ /// <param name="state">鏈哄櫒浜哄綋鍓嶇姸鎬�</param>
+ /// <param name="positions">鐢垫睜浣嶇疆鏁扮粍</param>
+ /// <returns>鏋勫缓濂界殑搴撳瓨 DTO</returns>
+ public static StockDTO BuildStockDTO1(RobotSocketState state, int[] positions)
+ {
+ return new StockDTO
+ {
+ // 婧愯緭閫佺嚎缂栧彿
+ SourceLineNo = state.CurrentTask.RobotSourceAddressLineCode,
+ // 婧愭墭鐩樺彿
+ SourcePalletNo = state.CurrentTask.RobotSourceAddressPalletCode,
+
+ // 鐩爣鎵樼洏鍙�
+ TargetPalletNo = state.CurrentTask.RobotTargetAddressPalletCode,
+
+ // 鐩爣杈撻�佺嚎缂栧彿
+ TargetLineNo = state.CurrentTask.RobotTargetAddressLineCode,
+
+ // 宸烽亾缂栧彿(鏈哄櫒浜哄悕绉�)
+ Roadway = state.CurrentTask.RobotRoadway,
+
+ // 鐢垫睜浣嶇疆璇︽儏鍒楄〃
+ // 杩囨护鎺変綅缃负 0 鎴栬礋鏁扮殑鏃犳晥鏁版嵁
+ // 鎸変綅缃紪鍙锋帓搴�
+ // 涓烘瘡涓綅缃敓鎴愬搴旂殑搴撳瓨璇︽儏
+ Details = positions
+ .Where(x => x > 0) // 杩囨护鏃犳晥浣嶇疆
+ .OrderBy(x => x) // 鎸変綅缃帓搴�
+ .Select((x, idx) => new StockDetailDTO
+ {
+ // 鏁伴噺锛氬鏋滃凡鏈変换鍔℃�绘暟锛屼娇鐢ㄤ换鍔℃�绘暟+褰撳墠浣嶇疆鏁帮紱鍚﹀垯鍙娇鐢ㄥ綋鍓嶄綅缃暟
+ Quantity = 1,
+
+ // 閫氶亾/浣嶇疆缂栧彿
+ Channel = x,
+
+ // 鐢垫睜鏉$爜锛氬彇褰撳墠鎵规鏉$爜鍒楄〃鐨勬渶鍚� N 涓紙N = 鏈夋晥浣嶇疆鏁帮級
+ CellBarcode = !state.CurrentBatchBarcodes.IsNullOrEmpty() ? state.CurrentBatchBarcodes[^(positions.Count(p => p > 0) - idx)].ToString() ?? string.Empty : string.Empty
+ })
+ .ToList()
+ };
+ }
/// <summary>
/// 璋冪敤鎷嗙洏 API
/// </summary>
--
Gitblit v1.9.3