调试中的修改
This commit is contained in:
@ -24,6 +24,25 @@ namespace WCS.BLL.Services.Service
|
||||
{
|
||||
public class SingleLightService : ISingleLightService
|
||||
{
|
||||
public string ExtractUntilSecondDashCorrect(string input)
|
||||
{
|
||||
int firstDashIndex = input.IndexOf('-');
|
||||
if (firstDashIndex == -1)
|
||||
{
|
||||
return string.Empty; // 如果没有找到第一个'-',则返回空字符串
|
||||
}
|
||||
|
||||
int secondDashIndex = input.IndexOf('-', firstDashIndex + 1);
|
||||
if (secondDashIndex == -1)
|
||||
{
|
||||
return input;
|
||||
}
|
||||
else
|
||||
{
|
||||
return input.Substring(0, secondDashIndex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 单灯 一个库位对应一个硬件
|
||||
/// </summary>
|
||||
@ -42,7 +61,12 @@ namespace WCS.BLL.Services.Service
|
||||
Message = "操作失败:没有需要控制的库位",
|
||||
};
|
||||
}
|
||||
|
||||
//瓦斯分院库位数与灯不匹配所以进行如下操作
|
||||
//处理传入的库位
|
||||
for (int i = 0; i < request.StoreCodes.Count; i++)
|
||||
{
|
||||
request.StoreCodes[i] = ExtractUntilSecondDashCorrect(request.StoreCodes[i]);
|
||||
}
|
||||
|
||||
//库位编码去重
|
||||
var storeCodes = request.StoreCodes.Distinct()
|
||||
@ -135,7 +159,7 @@ namespace WCS.BLL.Services.Service
|
||||
{
|
||||
try
|
||||
{
|
||||
tcpClient.Send(sendData,0,sendData.Length);
|
||||
tcpClient.Send(sendData, 0, sendData.Length);
|
||||
Logs.Write("【单灯单独控制】发送指令" + BitConverter.ToString(sendData));
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
Reference in New Issue
Block a user