From bd40cc9e7dd6352915568ce49baa4accd1d9645b Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期六, 18 四月 2026 14:23:35 +0800
Subject: [PATCH] feat: 添加机器人任务处理逻辑和消息去重功能
---
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Flows/OutboundTaskFlowService.cs | 12 ++--
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotBarcodeGenerator.cs | 7 ++
Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Inbound.cs | 24 ++++----
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotWorkflowOrchestrator.cs | 42 +++++++++-----
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotTaskProcessor.cs | 5 +
Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Robot.cs | 6 +-
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotSocketState.cs | 10 +++
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/HostedService/ApiRouteCacheWarmupHostedService.cs | 10 +++
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json | 10 +-
Code/.omc/state/last-tool-error.json | 10 +-
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotSimpleCommandHandler.cs | 17 +++--
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.cs | 5 +
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.Messaging.cs | 6 ++
13 files changed, 108 insertions(+), 56 deletions(-)
diff --git a/Code/.omc/state/last-tool-error.json b/Code/.omc/state/last-tool-error.json
index 37ce3fc..c78317a 100644
--- a/Code/.omc/state/last-tool-error.json
+++ b/Code/.omc/state/last-tool-error.json
@@ -1,7 +1,7 @@
{
- "tool_name": "Read",
- "tool_input_preview": "{\"file_path\":\"D:\\\\Git\\\\ShanMeiXinNengYuan\\\\Code\\\\WCS\\\\WIDESEAWCS_Server\\\\WIDESEA_DTO\\\\Stock\\\\StockDTO.cs\"}",
- "error": "File does not exist. Note: your current working directory is D:\\Git\\ShanMeiXinNengYuan\\Code.",
- "timestamp": "2026-04-16T15:04:27.059Z",
- "retry_count": 2
+ "tool_name": "Bash",
+ "tool_input_preview": "{\"command\":\"node -e \\\"\\nconst f=require('fs'),p=require('path'),h=require('os').homedir();\\nconst d=process.env.CLAUDE_CONFIG_DIR||p.join(h,'.claude');\\nconst cf=p.join(d,'.omc-config.json');\\nconst e...",
+ "error": "Exit code 1\n<anonymous_script>:1\r\n\r\n\r\nSyntaxError: Unexpected end of JSON input\r\n at JSON.parse (<anonymous>)\r\n at [eval]:5:38\r\n at runScriptInThisContext (node:internal/vm:219:10)\r\n at node:internal/process/execution:451:12\r\n at [eval]-wrapper:6:24\r\n at runScriptInContext (node:internal/process/execution:449:60)\r\n at evalFunction (node:internal/process/execution:283:30)\r\n at evalTypeScript (node:internal/process/execution:295:3)\r\n at node:internal/main/eval_string:71:...",
+ "timestamp": "2026-04-18T06:15:45.665Z",
+ "retry_count": 1
}
\ No newline at end of file
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/HostedService/ApiRouteCacheWarmupHostedService.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/HostedService/ApiRouteCacheWarmupHostedService.cs
index 046380e..7c82c8c 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/HostedService/ApiRouteCacheWarmupHostedService.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/HostedService/ApiRouteCacheWarmupHostedService.cs
@@ -46,8 +46,16 @@
public Task StartAsync(CancellationToken cancellationToken)
{
+ const string cacheKey = $"{RedisPrefix.Code}";
+
+ _cache.RemoveByPrefix($"{cacheKey}");
+
+
+
const string cacheKeyPrefix = $"{RedisPrefix.Code}:{RedisName.API}:";
int warmedCount = 0;
+
+
foreach ((string configKey, string routePath) in ApiRouteMappings)
{
@@ -55,7 +63,7 @@
warmedCount++;
}
- _logger.LogInformation("锟斤拷API路锟缴伙拷锟斤拷预锟斤拷锟斤拷伞锟斤拷锟斤拷锟�={Count}", warmedCount);
+ _logger.LogInformation("API璺敱缂撳瓨棰勭儹瀹屾垚锛屽叡鍔犺浇={Count}涓矾鐢辨槧灏�", warmedCount);
return Task.CompletedTask;
}
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json
index bf7384c..2907e3e 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json
@@ -88,11 +88,11 @@
"110681": "Split"
},
"AddressRoadwayMap": { // 瀵瑰簲璁惧鍦板潃鏄犲皠
- "11001": "鎹㈢洏鏈烘鎵�",
- "11010": "鎹㈢洏鏈烘鎵�",
- "11068": "娉ㄦ恫缁勭洏鏈烘鎵�",
- "10010": "鎹㈢洏鏈烘鎵�",
- "10030": "鎹㈢洏鏈烘鎵�"
+ "11001": "HCSC1",
+ "11010": "HCSC1",
+ "11068": "GWSC1",
+ "10010": "GWSC1",
+ "10030": "GWSC1"
},
"AddressSourceLineNoMap": { // 瀵瑰簲杈撻�佺嚎缂栧彿鍦板潃鏄犲皠
"11001": "10010",
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Flows/OutboundTaskFlowService.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Flows/OutboundTaskFlowService.cs
index 5e1e70b..c1f3ba9 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Flows/OutboundTaskFlowService.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Flows/OutboundTaskFlowService.cs
@@ -93,12 +93,12 @@
if (task.TaskStatus == (int)TaskOutStatusEnum.Line_OutFinish && task.TaskType == (int)TaskOutboundTypeEnum.OutEmpty)
{
- WebResponseContent content = _robotTaskService.GetWMSRobotTask(task);
- if (!content.Status)
- {
- return content;
- }
- return OutboundFinishTaskTray(task);
+ return _robotTaskService.GetWMSRobotTask(task);
+ //if (!content.Status)
+ //{
+ // return content;
+ //}
+ //return OutboundFinishTaskTray(task);
}
if (task.TaskStatus == (int)TaskOutStatusEnum.Line_OutExecuting)
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotBarcodeGenerator.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotBarcodeGenerator.cs
index f40a882..06429dc 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotBarcodeGenerator.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotBarcodeGenerator.cs
@@ -1,4 +1,5 @@
using Masuit.Tools;
+using WIDESEAWCS_Communicator;
using WIDESEAWCS_QuartzJob;
namespace WIDESEAWCS_Tasks
@@ -18,7 +19,11 @@
var device = Storage.Devices.Where(d => d.DeviceName == "A鍖篲涓�娉ㄨ緭閫佺嚎").FirstOrDefault();
if (!device.IsNullOrEmpty() && device != null && device.Communicator.IsConnected)
{
- var trayBarcode = device.Communicator.Read<string>(prefix);
+ var trayBarcode = device.Communicator.Read<string>(prefix).Trim().Replace("\u0018", "").Replace("\u0006", "");
+ if(trayBarcode == "NoRead")
+ {
+ trayBarcode = "";
+ }
return trayBarcode;
}
return "";
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotSocketState.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotSocketState.cs
index ac3f7ad..66f25b9 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotSocketState.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotSocketState.cs
@@ -211,5 +211,15 @@
/// 鎷夊甫绾夸笂鐢佃姱鎵爜鏄惁NG銆�
/// </remarks>
public bool IsScanNG { get; set; } = false;
+
+
+
+ /// <summary>
+ /// 鏄惁鐢佃姱鍒颁綅
+ /// </summary>
+ /// <remarks>
+ /// 鎷夊甫绾夸笂鐢佃姱鏄惁鍒颁綅銆�
+ /// </remarks>
+ public bool BatteryArrived { get; set; } = false;
}
}
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotTaskProcessor.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotTaskProcessor.cs
index c50f942..2edc39f 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotTaskProcessor.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotTaskProcessor.cs
@@ -165,7 +165,7 @@
/// <param name="task">瑕佷笅鍙戠殑浠诲姟瀵硅薄</param>
/// <param name="state">鏈哄櫒浜哄綋鍓嶇姸鎬�</param>
/// <param name="isScanNG">鏄惁鎵爜NG</param>
- public async Task SendSocketRobotPickAsync(Dt_RobotTask task, RobotSocketState state, bool isScanNG)
+ public async Task SendSocketRobotPickAsync(Dt_RobotTask task, RobotSocketState state, bool isScanNG = false)
{
// 鏋勫缓鍙栬揣鎸囦护锛屾牸寮忥細Pickbattery,{婧愬湴鍧�}
string taskString = $"Pickbattery,{task.RobotSourceAddress}";
@@ -600,7 +600,8 @@
Channel = x,
// 鐢垫睜鏉$爜锛氬鏋滅姸鎬佷腑鏈夋潯鐮佸垪琛紝鍙栧搴斾綅缃殑鏉$爜锛涘惁鍒欎负绌�
- CellBarcode = state.CellBarcode?.Count > 0 ? state.CellBarcode[x - 1] : ""
+ //CellBarcode = state.CellBarcode?.Count > 0 ? state.CellBarcode[x - 1] : ""
+ CellBarcode = state.CellBarcode[idx].ToString()
})
.ToList()
};
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotSimpleCommandHandler.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotSimpleCommandHandler.cs
index e0b0a03..00abc18 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotSimpleCommandHandler.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotSimpleCommandHandler.cs
@@ -119,6 +119,11 @@
state.CurrentAction = "Putting";
return true;
+ // 鎵嬭噦鏃犵墿鏂欙紙鎵嬭噦绌洪棽锛�
+ case "batteryarrived":
+ state.BatteryArrived = true;
+ return true;
+
// ==================== 鍏ㄩ儴瀹屾垚鍛戒护 ====================
// 鍏ㄩ儴鍙栬揣瀹屾垚
@@ -251,12 +256,12 @@
if (robotTaskType == RobotTaskTypeEnum.GroupPallet)
{
// 璋冪敤鎵归噺缁勭洏纭鎺ュ彛
- var targetPallet = state.CurrentTask.RobotTargetAddressPalletCode;
- var confirmResult = _taskProcessor.PostGroupPalletConfirmAsync(targetPallet);
- if (!confirmResult.IsSuccess)
- {
- QuartzLogger.Error($"鎵归噺缁勭洏纭澶辫触: {confirmResult.ErrorMessage}", state.RobotCrane?.DeviceName ?? "Unknown");
- }
+ //var targetPallet = state.CurrentTask.RobotTargetAddressPalletCode;
+ //var confirmResult = _taskProcessor.PostGroupPalletConfirmAsync(targetPallet);
+ //if (!confirmResult.IsSuccess)
+ //{
+ // QuartzLogger.Error($"鎵归噺缁勭洏纭澶辫触: {confirmResult.ErrorMessage}", state.RobotCrane?.DeviceName ?? "Unknown");
+ //}
// 澶勭悊鍏ュ簱浠诲姟鍥炰紶
// useSourceAddress: false 琛ㄧず浣跨敤鐩爣鍦板潃锛堢粍鐩樺満鏅級
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotWorkflowOrchestrator.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotWorkflowOrchestrator.cs
index 2ddad09..05f2357 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotWorkflowOrchestrator.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotWorkflowOrchestrator.cs
@@ -112,7 +112,7 @@
// 1. 杩愯妯″紡涓鸿嚜鍔紙2锛�
// 2. 鎺у埗妯″紡涓哄鎴风鎺у埗锛�1锛�
// 3. 杩愯鐘舵�佹槸 Running
- if (latestState.RobotRunMode == 2 /*&& latestState.RobotControlMode == 1*/ && latestState.OperStatus == "Running" && latestState.Homed == "Homed")
+ if (latestState.RobotRunMode == 2 /*&& latestState.RobotControlMode == 1*/ && latestState.OperStatus == "Running" && (latestState.Homed == "Homed" || latestState.Homed.IsNullOrEmpty()))
{
// ========== 鍙栬揣瀹屾垚鍚庣殑鏀捐揣澶勭悊 ==========
// 鏉′欢锛�
@@ -120,11 +120,11 @@
// - 鎵嬭噦涓婃湁鐗╂枡锛圧obotArmObject == 1锛�
// - 浠诲姟鐘舵�佷负 RobotPickFinish锛堝凡璁板綍鍙栬揣瀹屾垚锛�
if ((latestState.CurrentAction == "PickFinished" || latestState.CurrentAction == "AllPickFinished")
- && latestState.RobotArmObject == 1
+ && (latestState.RobotArmObject.IsNullOrEmpty() || latestState.RobotArmObject == 1)
&& task.RobotTaskState == TaskRobotStatusEnum.RobotPickFinish.GetHashCode())
{
- _logger.LogInformation("ExecuteAsync锛氭弧瓒虫斁璐ф潯浠讹紝寮�濮嬪鐞嗗彇璐у畬鎴愶紝浠诲姟鍙�: {TaskNum}", task.RobotTaskNum);
- QuartzLogger.Info($"ExecuteAsync锛氭弧瓒虫斁璐ф潯浠讹紝寮�濮嬪鐞嗗彇璐у畬鎴�", latestState.RobotCrane?.DeviceName ?? ipAddress);
+ _logger.LogInformation("ExecuteAsync锛氭弧瓒虫斁璐ф潯浠讹紝寮�濮嬩笅鍙戞斁璐т换鍔★紝浠诲姟鍙�: {TaskNum}", task.RobotTaskNum);
+ QuartzLogger.Info($"ExecuteAsync锛氭弧瓒虫斁璐ф潯浠讹紝寮�濮嬩笅鍙戞斁璐т换鍔�", latestState.RobotCrane?.DeviceName ?? ipAddress);
// 鍙戦�佹斁璐ф寚浠�
await HandlePickFinishedStateAsync(task, ipAddress);
}
@@ -136,12 +136,12 @@
// - 鎵嬭噦涓婃棤鐗╂枡锛圧obotArmObject == 0锛�
// - 浠诲姟鐘舵�佷负 RobotPutFinish 鎴栦笉鏄� RobotExecuting
else if ((latestState.CurrentAction == "PutFinished" || latestState.CurrentAction == "AllPutFinished" || latestState.CurrentAction.IsNullOrEmpty())
- && latestState.RobotArmObject == 0
+ && (latestState.RobotArmObject.IsNullOrEmpty() || latestState.RobotArmObject == 0)
&& (task.RobotTaskState == TaskRobotStatusEnum.RobotPutFinish.GetHashCode()
|| task.RobotTaskState != TaskRobotStatusEnum.RobotExecuting.GetHashCode()))
{
- _logger.LogInformation("ExecuteAsync锛氭弧瓒冲彇璐ф潯浠讹紝寮�濮嬪鐞嗘斁璐у畬鎴愶紝浠诲姟鍙�: {TaskNum}", task.RobotTaskNum);
- QuartzLogger.Info($"ExecuteAsync锛氭弧瓒冲彇璐ф潯浠讹紝寮�濮嬪鐞嗘斁璐у畬鎴�", latestState.RobotCrane?.DeviceName ?? ipAddress);
+ _logger.LogInformation("ExecuteAsync锛氭弧瓒冲彇璐ф潯浠讹紝寮�濮嬩笅鍙戝彇璐т换鍔★紝浠诲姟鍙�: {TaskNum}", task.RobotTaskNum);
+ QuartzLogger.Info($"ExecuteAsync锛氭弧瓒冲彇璐ф潯浠讹紝寮�濮嬩笅鍙戝彇璐т换鍔�", latestState.RobotCrane?.DeviceName ?? ipAddress);
// 鍙戦�佸彇璐ф寚浠�
await HandlePutFinishedStateAsync(task, ipAddress);
}
@@ -236,7 +236,7 @@
// 缁勭洏浠诲姟锛氭斁璐ч渶鍒ゆ柇鏄惁NG锛屽鏋淣G鍒欐斁鍒癗G鍙�
if (state.IsScanNG)
{
- taskString = $"Putbattery,NG";
+ taskString = $"Putbattery,4";
}
else
{
@@ -316,6 +316,11 @@
// 濡傛灉鏄粍鐩樹换鍔�
if (task.RobotTaskType == RobotTaskTypeEnum.GroupPallet.GetHashCode())
{
+
+ //if (!stateForUpdate.BatteryArrived)
+ //{
+ // return;
+ //}
// 璇诲彇绾夸綋鐢佃姱鏉$爜
string trayBarcode1 = RobotBarcodeGenerator.GenerateTrayBarcode("DB40.990");
string trayBarcode2 = RobotBarcodeGenerator.GenerateTrayBarcode("DB40.1020");
@@ -331,15 +336,21 @@
// 鏉$爜閲嶅锛岃褰曢敊璇棩蹇楀苟鍋滄鍚庣画鎿嶄綔(鍚庣画鏀捐揣鏃朵細鐢ㄥ埌杩欎簺鏉$爜淇℃伅锛屼緵鍚庣画鏀捐揣鏃朵娇鐢紝璋冭瘯鍚庡彲鑳戒細鍙栨秷姝ら�昏緫)
// 鍙戦�佸彇璐ф寚浠� 鏍囪鎵爜NG锛屾斁璐ф椂涓嶄娇鐢ㄨ繖浜涙潯鐮侊紝骞舵斁鍏G鍙�
- await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate, true);
+ //await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate, true);
+ return;
}
else
{
_logger.LogInformation("HandlePutFinishedStateAsync锛氳鍙栫殑鎵樼洏鏉$爜鍞竴锛岀户缁墽琛岋紝浠诲姟鍙�: {TaskNum}", task.RobotTaskNum);
QuartzLogger.Info($"璇诲彇鐨勬墭鐩樻潯鐮佸敮涓�锛岀户缁墽琛�", stateForUpdate.RobotCrane.DeviceName);
+ stateForUpdate.CellBarcode = new List<string>()
+ {
+ trayBarcode1,trayBarcode2
+ };
+
// 灏嗘潯鐮佹坊鍔犲埌鐘舵�佷腑锛屼緵鍚庣画鏀捐揣鏃朵娇鐢�
- stateForUpdate.CellBarcode.Add(trayBarcode1);
- stateForUpdate.CellBarcode.Add(trayBarcode2);
+ //stateForUpdate.CellBarcode.Add(trayBarcode1);
+ //stateForUpdate.CellBarcode.Add(trayBarcode2);
}
@@ -348,7 +359,7 @@
QuartzLogger.Info($"璇诲彇鎵樼洏鏉$爜鎴愬姛: {trayBarcode1}+{trayBarcode2}", stateForUpdate.RobotCrane.DeviceName);
// 鍙戦�佸彇璐ф寚浠�
- await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate, false);
+ await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate);
}
else
{
@@ -358,7 +369,8 @@
// 鍙戦�佸彇璐ф寚浠� 鏍囪鎵爜NG锛屾斁璐ф椂涓嶄娇鐢ㄨ繖浜涙潯鐮侊紝骞舵斁鍏G鍙�
- await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate, true);
+ //await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate, true);
+ return;
}
}
else if (task.RobotTaskType == RobotTaskTypeEnum.ChangePallet.GetHashCode())
@@ -373,7 +385,7 @@
// 鐩爣鏁伴噺涓�48锛氱洿鎺ヨ蛋鍘熸湁閫昏緫锛屼笉杩涘叆鎵规妯″紡
if (targetNormalCount == targetTotal)
{
- await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate, false);
+ await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate);
return;
}
@@ -542,7 +554,7 @@
else
{
// 闈炵粍鐩樹换鍔★紝鐩存帴鍙戦�佸彇璐ф寚浠�
- await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate, false);
+ await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate);
}
}
}
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.Messaging.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.Messaging.cs
index 571cd45..5b0ba27 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.Messaging.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.Messaging.cs
@@ -59,6 +59,12 @@
break;
}
+ if(message == lastMessage)
+ {
+ // 閲嶅娑堟伅锛屽拷鐣�
+ continue;
+ }
+
// 鏇存柊瀹㈡埛绔姸鎬�
UpdateClientStatus(clientId, message);
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.cs
index e08d58f..1999ffd 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.cs
@@ -136,6 +136,11 @@
public bool IsRunning { get; private set; }
/// <summary>
+ /// 涓婃鎺ユ敹娑堟伅婧�
+ /// </summary>
+ public string lastMessage;
+
+ /// <summary>
/// 娑堟伅鎺ユ敹浜嬩欢
/// </summary>
/// <remarks>
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Inbound.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Inbound.cs
index b68c724..2ac74fe 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Inbound.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Inbound.cs
@@ -151,18 +151,18 @@
if (!updateLocationResult || !updateStockResult)
return WebResponseContent.Instance.Error("浠诲姟瀹屾垚澶辫触");
// 璋冪敤MES鎵樼洏杩涚珯
- var inboundRequest = new InboundInContainerRequest
- {
- EquipmentCode = "STK-GROUP-001",
- ResourceCode = "STK-GROUP-001",
- LocalTime = DateTime.Now,
- ContainerCode = taskDto.PalletCode
- };
- var inboundResult = _mesService.InboundInContainer(inboundRequest);
- if (inboundResult == null || inboundResult.Data == null || !inboundResult.Data.IsSuccess)
- {
- return content.Error($"浠诲姟瀹屾垚澶辫触锛歁ES杩涚珯澶辫触: {inboundResult?.Data?.Msg ?? inboundResult?.ErrorMessage ?? "鏈煡閿欒"}");
- }
+ //var inboundRequest = new InboundInContainerRequest
+ //{
+ // EquipmentCode = "STK-GROUP-001",
+ // ResourceCode = "STK-GROUP-001",
+ // LocalTime = DateTime.Now,
+ // ContainerCode = taskDto.PalletCode
+ //};
+ //var inboundResult = _mesService.InboundInContainer(inboundRequest);
+ //if (inboundResult == null || inboundResult.Data == null || !inboundResult.Data.IsSuccess)
+ //{
+ // return content.Error($"浠诲姟瀹屾垚澶辫触锛歁ES杩涚珯澶辫触: {inboundResult?.Data?.Msg ?? inboundResult?.ErrorMessage ?? "鏈煡閿欒"}");
+ //}
return await CompleteTaskAsync(task, "鍏ュ簱瀹屾垚");
});
}
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Robot.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Robot.cs
index c897ea3..46888d5 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Robot.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Robot.cs
@@ -129,9 +129,9 @@
Creater = "system"
};
- var result = await Repository.AddDataAsync(task) > 0;
- if (!result)
- return WebResponseContent.Instance.Error($"鏈烘鎵媨taskName}浠诲姟鍒涘缓澶辫触");
+ //var result = await Repository.AddDataAsync(task) > 0;
+ //if (!result)
+ // return WebResponseContent.Instance.Error($"鏈烘鎵媨taskName}浠诲姟鍒涘缓澶辫触");
var wmstaskDto = _mapper.Map<WMSTaskDTO>(task) ?? new WMSTaskDTO();
wmstaskDto.TaskQuantity = stock.Details?.Sum(d => d.Quantity) ?? 0;
--
Gitblit v1.9.3