Commit 0701d40a 张东亮

入库料架锁定逻辑

1 个父辈 a6cff32e
正在显示 43 个修改的文件 包含 88 行增加14 行删除
文件属性发生变化
文件属性发生变化
文件属性发生变化
文件属性发生变化
文件属性发生变化
文件属性发生变化
文件属性发生变化
文件属性发生变化
文件属性发生变化
...@@ -379,7 +379,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -379,7 +379,7 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.NextMoveStep(StoreMoveStep.BI_71_ToNGDoor); MoveInfo.NextMoveStep(StoreMoveStep.BI_71_ToNGDoor);
InOutStoreLog(" NG料 " + MoveInfo.SLog + ":" + str + ",升降轴到NG门口高点P12,旋转轴到NG门口P11"); InOutStoreLog(" NG料 " + MoveInfo.SLog + ":" + str + ",升降轴到NG门口高点P12,旋转轴到NG门口P11");
if(MoveInfo.IsShelfLocked)//锁定料架,扫码失败则清除当前位置 //if(MoveInfo.IsShelfLocked)//锁定料架,扫码失败则清除当前位置
{ {
StoreManager.ClearLockLoc(Name, CurrShelfID, MoveInfo.currShelfIndex); StoreManager.ClearLockLoc(Name, CurrShelfID, MoveInfo.currShelfIndex);
} }
...@@ -702,6 +702,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -702,6 +702,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_55_GoBack)) else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_55_GoBack))
{ {
TimeSpan span = DateTime.Now - startInStoreTime; TimeSpan span = DateTime.Now - startInStoreTime;
StoreManager.ClearLockLoc(Name, CurrShelfID, MoveInfo.currShelfIndex);
if (MoveInfo.SingleInstore) if (MoveInfo.SingleInstore)
{ {
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : ""; string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : "";
......
...@@ -121,7 +121,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -121,7 +121,16 @@ namespace OnlineStore.DeviceLibrary
StartShelfOut(); StartShelfOut();
return; return;
} }
//如果该料架为入库料架,此时有出库任务,执行入库任务
if (StoreManager.CheckShelfInfo(CurrShelfID) && MoveInfo.MoveType.Equals(StoreMoveType.OutStore))
{
LogInfo(Name + "出库"+ mark + "->入库 料架号[" + CurrShelfID + "]为入库料架,进行入库");
MoveInfo.NewMove(StoreMoveType.InStore, new InOutParam());
MoveInfo.MoveParam.MoveP = new LineMoveP(Config);
MoveInfo.ShelfPositionList = new List<string>(ShelfPosList);
mark = "0";
instoreShelf = true;
}
MoveInfo.NextMoveStep(StoreMoveStep.BI_08_LocationUp); MoveInfo.NextMoveStep(StoreMoveStep.BI_08_LocationUp);
InOutStoreLog(moveName + MoveInfo.SLog + "停止线体,读取料架" + CurrShelfID + ",设置" + Config.AgvNodeName + "=None"); InOutStoreLog(moveName + MoveInfo.SLog + "停止线体,读取料架" + CurrShelfID + ",设置" + Config.AgvNodeName + "=None");
AgvClient.SetStatus(Config.AgvNodeName, mark); AgvClient.SetStatus(Config.AgvNodeName, mark);
......
...@@ -208,7 +208,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -208,7 +208,7 @@ namespace OnlineStore.DeviceLibrary
//加载位置 //加载位置
if (param.MoveP == null) if (param.MoveP == null)
{ {
LineMoveP p = new LineMoveP(); LineMoveP p = new LineMoveP();
if (sp != null) if (sp != null)
{ {
p.InOut_P101 = sp.InoutAxis_P101; p.InOut_P101 = sp.InoutAxis_P101;
...@@ -244,7 +244,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -244,7 +244,7 @@ namespace OnlineStore.DeviceLibrary
return true; return true;
} }
return true; return true;
} }
...@@ -600,11 +600,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -600,11 +600,17 @@ namespace OnlineStore.DeviceLibrary
if (item.cid.Equals(cid))//该料盘属于此料仓 if (item.cid.Equals(cid))//该料盘属于此料仓
{ {
shelfLockDatas.Add(item); shelfLockDatas.Add(item);
plates += item.lockPos + "# "; plates += item.lockPosName + "# ";
}
if (item.cid.Equals(rfid) && item.barcode.Equals(rfid))//该料盘属于此料仓
{
ClearLockLoc(deviceName, rfid, item.rfidLoc);
} }
} }
msg = deviceName + " 料架【" + rfid + "】 在该料仓锁定库位的有:【" + plates + "】"; msg = deviceName + " 料架【" + rfid + "】 在该料仓锁定库位的有:【" + plates + "】";
LogUtil.info(msg); LogUtil.info(msg);
if (plates.Equals(""))
return false;
return true; return true;
} }
} }
...@@ -615,6 +621,64 @@ namespace OnlineStore.DeviceLibrary ...@@ -615,6 +621,64 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
/// <summary>
/// 检查是否是入库料架
/// </summary>
/// <param name="deviceName"></param>
/// <param name="cid"></param>
/// <param name="rfid"></param>
/// <param name="shelfLockDatas"></param>
/// <returns></returns>
public static bool CheckShelfInfo(string rfid)
{
string msg = "";
try
{
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add(ParamDefine.rfid, rfid);
string server = GetAddr(Addr_getShelfLockInfo, paramMap);
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, "");
LogUtil.info(" 入库料架查询 " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
ShelfLockInfo serverResult = JsonHelper.DeserializeJsonToObject<ShelfLockInfo>(resultStr);
if (serverResult == null)
{
msg = " 没有收到服务器反馈";
LogUtil.info(msg);
return false;
}
if (serverResult.data.Count == 0) //该料架未锁定
{
msg = " 入库料架【" + rfid + "】 没有被锁定";
LogUtil.info(msg);
return false;
}
else //该料架存在锁定库位的料
{
foreach (ShelfLockData item in serverResult.data)
{
if (item.cid.Equals(rfid) && item.barcode.Equals(rfid))//该料盘属于此料仓
{
msg = " 料架【" + rfid + "】 用于入库,不可用于出库";
LogUtil.info(msg);
return ClearLockLoc("", rfid, 0);
}
}
return false;
}
}
catch (Exception ex)
{
LogUtil.error(" ", ex);
}
return false;
}
private static string Addr_PosForPutin = "/service/store/emptyPosForPutin"; //获取当前料盘属于的料仓编号 private static string Addr_PosForPutin = "/service/store/emptyPosForPutin"; //获取当前料盘属于的料仓编号
/// <summary> /// <summary>
...@@ -656,7 +720,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -656,7 +720,7 @@ namespace OnlineStore.DeviceLibrary
msg = deviceName + " 【" + barcode + "】结果:没有收到服务器反馈 "; msg = deviceName + " 【" + barcode + "】结果:没有收到服务器反馈 ";
LogUtil.info(msg); LogUtil.info(msg);
return ResultType.Error; return ResultType.Error;
} }
else if (serverResult.result.Equals(-1)) else if (serverResult.result.Equals(-1))
{ {
IsLockInfoMatch = false; IsLockInfoMatch = false;
...@@ -704,7 +768,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -704,7 +768,7 @@ namespace OnlineStore.DeviceLibrary
/// <param name="rfid"></param> /// <param name="rfid"></param>
/// <param name="rfidLoc"></param> /// <param name="rfidLoc"></param>
/// <returns></returns> /// <returns></returns>
public static bool ClearLockLoc(string deviceName,string rfid, int rfidLoc) public static bool ClearLockLoc(string deviceName, string rfid, int rfidLoc)
{ {
string msg = ""; string msg = "";
try try
...@@ -715,21 +779,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -715,21 +779,21 @@ namespace OnlineStore.DeviceLibrary
paramMap.Add("rfidLoc", rfidLoc.ToString()); paramMap.Add("rfidLoc", rfidLoc.ToString());
string server = GetAddr(Addr_clearLockLoc, paramMap); string server = GetAddr(Addr_clearLockLoc, paramMap);
DateTime startTime = DateTime.Now; DateTime startTime = DateTime.Now;
LogUtil.info("清除RFID="+ rfid+ ",rfidLoc="+ rfidLoc.ToString()+"的锁定信息"); LogUtil.info("清除RFID=" + rfid + ",rfidLoc=" + rfidLoc.ToString() + "的锁定信息");
string resultStr = HttpHelper.Post(server, ""); string resultStr = HttpHelper.Post(server, "");
LogUtil.info(deviceName+" CodeReceived " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】"); LogUtil.info(deviceName + " CodeReceived " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
RfidData data = JsonHelper.DeserializeJsonToObject<RfidData>(resultStr); RfidData data = JsonHelper.DeserializeJsonToObject<RfidData>(resultStr);
if (data == null) if (data == null)
{ {
msg = deviceName + " ClearLockLoc【 " + rfid + "-"+ rfidLoc + "】 没有收到服务器反馈"; msg = deviceName + " ClearLockLoc【 " + rfid + "-" + rfidLoc + "】 没有收到服务器反馈";
LogUtil.info(msg); LogUtil.info(msg);
return false; return false;
} }
else if (data.code.Equals(0).Equals(false)) else if (data.code.Equals(0).Equals(false))
{ {
msg = deviceName + " ClearLockLoc【 " + rfid +"-" + rfidLoc+"】:" + data.msg; msg = deviceName + " ClearLockLoc【 " + rfid + "-" + rfidLoc + "】:" + data.msg;
LogUtil.info(msg); LogUtil.info(msg);
return false; return false;
} }
...@@ -738,7 +802,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -738,7 +802,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(deviceName+" ClearLockLoc ", ex); LogUtil.error(deviceName + " ClearLockLoc ", ex);
} }
return false; return false;
} }
...@@ -892,7 +956,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -892,7 +956,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 库位中料盘的锁定库位 /// 库位中料盘的锁定库位
/// </summary> /// </summary>
public string lockPos { get; set; } public string lockPosName { get; set; }
} }
......
文件属性发生变化
...@@ -187,7 +187,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -187,7 +187,7 @@ namespace OnlineStore.DeviceLibrary
//设置取料位置 //设置取料位置
MoveParam.UpdatePosIdAndShelfId(shelfLockDatas[lockShelfIndex].barcode, MoveParam.UpdatePosIdAndShelfId(shelfLockDatas[lockShelfIndex].barcode,
shelfLockDatas[lockShelfIndex].rfid, shelfLockDatas[lockShelfIndex].rfid,
shelfLockDatas[lockShelfIndex].lockPos, currShelfPosId); shelfLockDatas[lockShelfIndex].lockPosName, currShelfPosId);
return true; return true;
......
文件属性发生变化
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!