Commit dbdff9b2 LN

入库时若托盘库位不对应,直接清除入库任务。

1 个父辈 35d6abe0
......@@ -777,9 +777,12 @@ namespace OnlineStore.DeviceLibrary
LogInfo(" IsReviceInPosId 正在入库中:" + MoveInfo.MoveParam.ToStr());
isReviceInfo = true;
}
if (!isReviceInfo && moveEquip.waitInStoreList.Count > 0)
//TODO 如果已经收到同库位的入库任务,
List<InOutParam> inStoreList = new List<InOutParam>(moveEquip.waitInStoreList);
if (!isReviceInfo && inStoreList.Count > 0)
{
foreach (InOutParam inout in moveEquip.waitInStoreList)
foreach (InOutParam inout in inStoreList)
{
if (inout.PosId.Equals(posId) && (!inout.WareCode.Equals("")))
{
......
......@@ -183,8 +183,10 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(LineMoveStep.MO_58_CylinderDown))
{
OutLog("出库 " + MoveInfo.SLog + ": 夹料气缸放松,更新托盘【" + MoveInfo.MoveParam.TrayNumber + "】,有料盘,OutStore,【" + MoveInfo.MoveParam.ToStr() + "】");
TrayManager.UpdateTrayInfo(MoveInfo.MoveParam.TrayNumber, true, ReelType.OutStore, MoveInfo.MoveParam.Clone());
TrayInfo tray = TrayManager.GetTrayInfo(MoveInfo.MoveParam.TrayNumber);
LogInfo("出库 " + MoveInfo.SLog + ": 夹料气缸放松,更新托盘信息 " +tray.ToStr()+ "");
//出库全部完成
MoveInfo.NextMoveStep(LineMoveStep.MO_59_CylinderRelax);
CylinderMove(MoveInfo, IO_Type.ClampCylinder_Work, IO_Type.ClampCylinder_Relax);
......@@ -482,7 +484,10 @@ namespace OnlineStore.DeviceLibrary
return false;
}
bool isFull = TrayManager.TrayIsFull(currTrayNum);
if (isFull)
{
return false ;
}
bool moveOk = (IsBigStore() && MoveInfo.MoveStep >= LineMoveStep.MO_55_CylinderUp) || MoveInfo.MoveStep >= LineMoveStep.MO_57_CylinderAfter;
if (MoveInfo.MoveType.Equals(LineMoveType.OutStore) && moveOk
&& (!MoveInfo.IsStep(LineMoveStep.MO_60_CylinderUp)))
......@@ -539,10 +544,7 @@ namespace OnlineStore.DeviceLibrary
InOutParam currCode = null;
TrayInfo tray = TrayManager.GetTrayInfo(currTrayNum);
if (tray.InoutPar.InStoreNg)
{
return false;
}
if (waitInStoreList.Count > 0)
{
lock (waitInListLock)
......@@ -553,48 +555,47 @@ namespace OnlineStore.DeviceLibrary
{
InOutParam cc = waitInStoreList[i];
if (cc.TrayNumber.Equals(currTrayNum) && (!cc.WareCode.Equals("")))
//if (cc.TrayNumber.Equals(currTrayNum) && (!cc.WareCode.Equals("")) && LineServer.RightInPosId(DeviceID, cc.PosId))
{
if (cc.PosId.Equals(tray.InoutPar.PosId))
{
reIndex = i;
currCode = cc;
SecondMoveInfo.MoveParam = new InOutParam(cc.TrayNumber, cc.WareCode, cc.PosId, cc.PlateH, cc.PlateW, cc.InStoreNg);
break;
}
else
{
LogUtil.error(Name + "托盘信息 " + tray.ToStr() + " 与入库任务 " + cc.ToStr() + " 不一致,请检查托盘");
}
reIndex = i;
currCode = cc;
SecondMoveInfo.MoveParam = new InOutParam(cc.TrayNumber, cc.WareCode, cc.PosId, cc.PlateH, cc.PlateW, cc.InStoreNg);
break;
}
}
if (reIndex >= 0)
{
if (!LineServer.BoxCanInStore(DeviceID))
{
LogInfo("*******托盘" + currTrayNum + "需要入库【" + currCode.ToStr() + "】,BoxCanInStore验证失败,先放托盘通过");
return false;
}
else
if (currCode.PosId.Equals(tray.InoutPar.PosId) && tray.InOrOutStore.Equals(1) && tray.InoutPar.InStoreNg.Equals(false))
{
//判断是否验证成功,如果验证失败,不入库
if (LineServer.RightInPosId(DeviceID, currCode.PosId))
if (!LineServer.BoxCanInStore(DeviceID))
{
//waitInStoreList.RemoveAt(reIndex);
LogInfo("*******托盘" + currTrayNum + "需要入库【" + currCode.ToStr() + "】 ,开始入库移栽");
return true;
LogInfo("*******托盘" + currTrayNum + "需要入库【" + currCode.ToStr() + "】,BoxCanInStore验证失败,先放托盘通过");
return false;
}
else
{
LogUtil.error(Name + "托盘号【" + currTrayNum + "】入库信息【" + currCode.ToStr() + "】料仓未验证成功,不拦截托盘,更新此托盘为NG,从waitInStoreList中删除,取消入库任务");
TrayManager.UpdateInStoreNG(currTrayNum, true, "Box验证入库失败");
waitInStoreList.RemoveAt(reIndex);
SServerManager.cancelPutInTask(Name, currCode.WareCode);
return false;
//判断是否验证成功,如果验证失败,不入库
if (LineServer.RightInPosId(DeviceID, currCode.PosId))
{
//waitInStoreList.RemoveAt(reIndex);
LogInfo("*******托盘" + currTrayNum + "需要入库【" + currCode.ToStr() + "】 ,开始入库移栽");
return true;
}
else
{
LogUtil.error(Name + "托盘号【" + currTrayNum + "】入库信息【" + currCode.ToStr() + "】料仓未验证成功,更新为入库NG料,从waitInStoreList中删除" + reIndex + ",取消入库任务");
TrayManager.UpdateInStoreNG(currTrayNum, true, "Box验证入库失败");
waitInStoreList.RemoveAt(reIndex);
SServerManager.cancelPutInTask(Name, currCode.WareCode);
return false;
}
}
}
else
{
LogUtil.error(Name + "托盘信息 " + tray.ToStr() + " 与入库任务 " + currCode.ToStr() + " 不一致,从waitInStoreList中删除" + reIndex + ",取消入库任务");
waitInStoreList.RemoveAt(reIndex);
SServerManager.cancelPutInTask(Name, currCode.WareCode);
return false;
}
}
}
......
......@@ -373,7 +373,7 @@ namespace OnlineStore.DeviceLibrary
string resultStr = HttpHelper.Post(server, "");
LogUtil.info(deviceName + "cancelPutInTask " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
RfidData data = JsonHelper.DeserializeJsonToObject<RfidData>(resultStr);
CancelData data = JsonHelper.DeserializeJsonToObject<CancelData>(resultStr);
if (data == null)
{
......@@ -646,7 +646,16 @@ namespace OnlineStore.DeviceLibrary
public string msg { get; set; }
public Dictionary<string,string> data { get; set; }
public Dictionary<string, string> data { get; set; }
}
public class CancelData
{
//{"code":0,"msg":"ok","data":"7"}
public int code { get; set; }
public string msg { get; set; }
public object data { get; set; }
}
public class LocStatus
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!