Commit d31df789 LN

bug修改

1 个父辈 f0bd4276
......@@ -1274,7 +1274,7 @@ namespace OnlineStore.DeviceLibrary
{
return true;
}
if (IOValue(IO_Type.StopCylinder_Check2).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.StopCylinder_Check1).Equals(IO_VALUE.HIGH))
if (IOValue(IO_Type.StopCylinder_Check2).Equals(IO_VALUE.HIGH) )
{
return true;
}
......
......@@ -84,6 +84,8 @@ namespace OnlineStore.DeviceLibrary
private static bool CheckTrayNum(string ip, int num)
{
try
{
RFIDData data = new RFIDData(ip);
List<RfidCacheInfo> list = LastRfidMap.GetOrAdd(ip, new List<RfidCacheInfo>());
......@@ -126,10 +128,12 @@ namespace OnlineStore.DeviceLibrary
//更改状态
list[readNumIndex].Used = true;
LastRfidMap.AddOrUpdate(ip, list, (key, value) => value);
int preIndex = readNumIndex - 1;
//上一个已使用
if (list.Count > readNumIndex - 1)
if (list.Count > preIndex && preIndex >= 0)
{
if (!list[readNumIndex - 1].Used)
if (!list[preIndex].Used)
{
LogUtil.error("CheckTrayNum托盘号验证失败: [" + ip + "][" + num + "],缓存记录上一个托盘未使用,更新当前托盘为已用。缓存数据:" + listStr);
return false;
......@@ -148,6 +152,11 @@ namespace OnlineStore.DeviceLibrary
}
}
}
catch (Exception ex)
{
LogUtil.error(" CheckTrayNum [" + ip + "][" + num + "] 出错:" + ex.ToString());
}
return true;
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!