增加配置库位编码接口

This commit is contained in:
hehaibing-1996
2025-06-06 14:33:30 +08:00
parent b64103e6f3
commit c78f0bfbe8
3 changed files with 95 additions and 1 deletions

View File

@ -289,6 +289,37 @@ namespace WCS.BLL
}
}
public void SendList(List<byte[]> messages, bool IsReSend = false)
{
try
{
lock (sendLockObject)
{
foreach (var message in messages)
{
var clientIpHost = tcpSendClient.IP + ":" + tcpSendClient.Port;
Logs.Write($"【发送{clientIpHost}】{BitConverter.ToString(message)}", LogsType.Instructions);
tcpReceiveClient.Send(message);
Thread.Sleep(3);
}
}
}
catch (Exception ex)
{
Logs.Write("【发送指令时发生异常】" + ex.Message, LogsType.Instructions);
//因异常断连时(网线已经被断了) 手动重连一次
if (ex is NotConnectedException)
{
IsReceivedClientOnline = false;
Task.Run(() =>
{
ReConnectAsync();
});
}
throw ex;
}
}
public void SendThenReturn(byte[] message, bool IsReSend = false)
{
try