Commit 1cf23ae2 张东亮

锁定料架扫码

1 个父辈 65166571
...@@ -1081,9 +1081,20 @@ namespace OnlineStore.ACPackingStore ...@@ -1081,9 +1081,20 @@ namespace OnlineStore.ACPackingStore
{ {
if (BoxBean.MoveInfo.MoveStep.Equals(StoreMoveStep.SO_07_CheckComSig)) if (BoxBean.MoveInfo.MoveStep.Equals(StoreMoveStep.SO_07_CheckComSig))
{ {
LogUtil.info("手动忽略料叉信号,BoxBean.MoveInfo.EndStepWait(); 重置BoxBean.IsIgnoreComSig = true ");
BoxBean.IsIgnoreComSig = true; BoxBean.IsIgnoreComSig = true;
BoxBean.MoveInfo.EndStepWait(); BoxBean.MoveInfo.EndStepWait();
} }
} }
/// <summary>
/// 锁定的料架扫码
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void chbLockedShelf_CheckedChanged(object sender, EventArgs e)
{
BoxBean.IsScanCodeWithLockedShelf = chbLockedShelf.Checked;
}
} }
} }
...@@ -21,7 +21,41 @@ namespace OnlineStore.Common ...@@ -21,7 +21,41 @@ namespace OnlineStore.Common
// public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public static string Post(string url, string paramData) public static string Post(string url, string paramData)
{ {
return Post(url, paramData, Encoding.UTF8); string postRes = "";
DateTime startTime = DateTime.Now;
System.Threading.Tasks.Task postTask = new System.Threading.Tasks.Task(delegate
{
while ((DateTime.Now - startTime).TotalMinutes < 60)
{
postRes = Post(url, paramData, Encoding.UTF8, out bool isTimeOut);
ResponseData data = JsonHelper.DeserializeJsonToObject<ResponseData>(postRes);
if (data != null)
{
if (data.code.Equals(99) || data.code.Equals(100))
{
LogUtil.info("Response Code=" + data.code + " 系统正在更新。。。3秒后重试");
System.Threading.Thread.Sleep(3000);
}
else if (isTimeOut.Equals(true))
{
LogUtil.info(" 从服务器获取信息超时。。。3秒后重试");
System.Threading.Thread.Sleep(3000);
}
else
{
break;
}
}
else if (isTimeOut.Equals(true))
{
LogUtil.info(" 从服务器获取信息超时。。。3秒后重试");
System.Threading.Thread.Sleep(3000);
}
}
});
postTask.Wait();
return postRes;
} }
//public static bool PingURLIP(string url, int ms=100) //public static bool PingURLIP(string url, int ms=100)
//{ //{
...@@ -114,13 +148,13 @@ namespace OnlineStore.Common ...@@ -114,13 +148,13 @@ namespace OnlineStore.Common
} }
private static int isLog = ConfigAppSettings.GetIntValue(Setting_Init.Server_Log_Open); private static int isLog = ConfigAppSettings.GetIntValue(Setting_Init.Server_Log_Open);
public static string LastServerMsg = ""; public static string LastServerMsg = "";
public static string Post(string url, string paramData, Encoding encoding) public static string Post(string url, string paramData, Encoding encoding, out bool isTimeOut)
{ {
//if (PingURLIP(url, 100).Equals(false)) //if (PingURLIP(url, 100).Equals(false))
//{ //{
// return null; // return null;
//} //}
isTimeOut = false;
if (isLog == 1) if (isLog == 1)
{ {
LogUtil.info("给服务器发送数据【" + paramData + "】 "); LogUtil.info("给服务器发送数据【" + paramData + "】 ");
...@@ -147,10 +181,16 @@ namespace OnlineStore.Common ...@@ -147,10 +181,16 @@ namespace OnlineStore.Common
result = wc.UploadString(url, "POST", paramData); result = wc.UploadString(url, "POST", paramData);
//LogUtil.info(result); //LogUtil.info(result);
} }
catch (Exception e) catch (WebException e)
{
isTimeOut = true;
LogUtil.error("POST TimeOut:" + e.ToString(), 1);
}
catch (Exception ex)
{ {
LogUtil.error("POST ERROR:" + e.ToString(), 1); LogUtil.error("POST ERROR:" + ex.ToString(), 1);
} }
if (!result.Contains("null") && result.Length != 0) if (!result.Contains("null") && result.Length != 0)
{ {
//LogUtil.debug(LOGGER,"receive << " + result); //LogUtil.debug(LOGGER,"receive << " + result);
...@@ -192,5 +232,15 @@ namespace OnlineStore.Common ...@@ -192,5 +232,15 @@ namespace OnlineStore.Common
} }
return ""; return "";
} }
}
internal class ResponseData
{
//{"code":0,"msg":"ok","data":"7"}
public int code { get; set; }
public string msg { get; set; }
public Dictionary<string, string> data { get; set; }
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -16,6 +16,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -16,6 +16,7 @@ namespace OnlineStore.DeviceLibrary
#region 出入库结果验证 #region 出入库结果验证
public bool CompressSigTimeOut = false; public bool CompressSigTimeOut = false;
public bool IsScanCodeWithLockedShelf = true; //锁定的料架是否扫码
private void CheckWait() private void CheckWait()
{ {
List<WaitResultInfo> list = MoveInfo.WaitList; List<WaitResultInfo> list = MoveInfo.WaitList;
...@@ -76,6 +77,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -76,6 +77,11 @@ namespace OnlineStore.DeviceLibrary
{ {
ConfigIO io = Config.getWaitIO(wait.IoType); ConfigIO io = Config.getWaitIO(wait.IoType);
WarnMsg = Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "] 等待(" + io.DisplayStr + "=" + wait.IoValue + ") 超时"; WarnMsg = Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "] 等待(" + io.DisplayStr + "=" + wait.IoValue + ") 超时";
if (WarnMsg.Contains(IO_Type.Compress_Check) && MoveInfo.MoveStep.Equals(StoreMoveStep.SO_07_CheckComSig))
{
CompressSigTimeOut = true;
WarnMsg += "出库时料叉未检测到信号!";
}
Alarm(StoreAlarmType.IoSingleTimeOut, io.ElectricalDefinition, WarnMsg, MoveInfo.MoveType); Alarm(StoreAlarmType.IoSingleTimeOut, io.ElectricalDefinition, WarnMsg, MoveInfo.MoveType);
LogUtil.error(Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "] 等待(" + io.DisplayStr + "=" + wait.IoValue + ") 超时", logType + 14); LogUtil.error(Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "] 等待(" + io.DisplayStr + "=" + wait.IoValue + ") 超时", logType + 14);
if (!MoveInfo.OneWaitCanEndStep) if (!MoveInfo.OneWaitCanEndStep)
...@@ -83,10 +89,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -83,10 +89,6 @@ namespace OnlineStore.DeviceLibrary
isOk = false; isOk = false;
break; break;
} }
if (wait.IoType.Equals(IO_Type.Compress_Check) && MoveInfo.MoveStep.Equals(StoreMoveStep.SO_07_CheckComSig))
{
CompressSigTimeOut = true;
}
} }
} }
else if (wait.WaitType.Equals(WaitEnum.W003_Time)) else if (wait.WaitType.Equals(WaitEnum.W003_Time))
...@@ -188,10 +190,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -188,10 +190,15 @@ namespace OnlineStore.DeviceLibrary
} }
else if (span.TotalSeconds > MoveInfo.TimeOutSeconds) else if (span.TotalSeconds > MoveInfo.TimeOutSeconds)
{ {
WarnMsg = Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "]等待" + NotOkMsg if (NotOkMsg.Contains(IO_Type.Compress_Check) && MoveInfo.MoveStep.Equals(StoreMoveStep.SO_07_CheckComSig))
{
CompressSigTimeOut = true;
NotOkMsg += "出库时料叉未检测到信号!";
}
WarnMsg = Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "]等待 " + NotOkMsg
+ "超时[" + Math.Round(span.TotalSeconds, 1) + "]秒"; + "超时[" + Math.Round(span.TotalSeconds, 1) + "]秒";
int second = 10; int second = 10;
second = (int)(MoveInfo.TimeOutSeconds / span.TotalSeconds) * 10; second = (int)(MoveInfo.TimeOutSeconds / span.TotalSeconds) * 10;
if (second > 120) if (second > 120)
{ {
...@@ -372,7 +379,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -372,7 +379,10 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.NextMoveStep(StoreMoveStep.BI_71_ToNGDoor); MoveInfo.NextMoveStep(StoreMoveStep.BI_71_ToNGDoor);
InOutStoreLog("送出料盘 " + MoveInfo.SLog + ":" + str + ",升降轴到NG门口高点P12,旋转轴到NG门口P11"); InOutStoreLog("送出料盘 " + MoveInfo.SLog + ":" + str + ",升降轴到NG门口高点P12,旋转轴到NG门口P11");
if(MoveInfo.IsShelfLocked)//锁定料架,扫码失败则清除当前位置
{
StoreManager.ClearLockLoc(Name, CurrShelfID, MoveInfo.currShelfIndex);
}
ACAxisMove(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P12, Config.UpDownAxis_P1_Speed); ACAxisMove(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P12, Config.UpDownAxis_P1_Speed);
ACAxisMove(Config.Middle_Axis, MoveInfo.MoveParam.MoveP.Middle_P11, Config.MiddleAxis_P1_Speed); ACAxisMove(Config.Middle_Axis, MoveInfo.MoveParam.MoveP.Middle_P11, Config.MiddleAxis_P1_Speed);
} }
...@@ -503,7 +513,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -503,7 +513,7 @@ namespace OnlineStore.DeviceLibrary
//单盘入库,不需要扫码 //单盘入库,不需要扫码
StartMoveToBag(); StartMoveToBag();
} }
else if(MoveInfo.IsShelfLocked) else if(MoveInfo.IsShelfLocked && !IsScanCodeWithLockedShelf)
{ {
//该料架已锁定库位,不需要扫码,直接查询服务器 //该料架已锁定库位,不需要扫码,直接查询服务器
GetPosId(); GetPosId();
...@@ -612,11 +622,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -612,11 +622,11 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.NextMoveStep(StoreMoveStep.BI_30_SetInstoreParam); MoveInfo.NextMoveStep(StoreMoveStep.BI_30_SetInstoreParam);
InOutStoreLog("扫码 " + MoveInfo.SLog + ": 获取库位号"); InOutStoreLog("扫码 " + MoveInfo.SLog + ": 获取库位号");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime((int)TimeSpan.FromMinutes(75).TotalMilliseconds));
bool result = GetPosIdByCode(MoveInfo.currShelfIndex, out CodeResultType codeResult); bool result = GetPosIdByCode(MoveInfo.currShelfIndex, out CodeResultType codeResult);
if (!result)//获取库位失败 if (!result)//获取库位失败
{ {
if (codeResult == CodeResultType.NotFoundPos)//库位不在该料仓,将该料盘放回料架 if (codeResult == CodeResultType.NotPosForPutIn)//库位不在该料仓,将该料盘放回料架
{ {
//MoveInfo.MoveParam.PosID = ""; //MoveInfo.MoveParam.PosID = "";
StartMoveTrayBack("此料盘不属于该仓库,放回料架"); StartMoveTrayBack("此料盘不属于该仓库,放回料架");
...@@ -1021,6 +1031,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1021,6 +1031,7 @@ namespace OnlineStore.DeviceLibrary
{ {
IsIgnoreComSig = false; IsIgnoreComSig = false;
CompressSigTimeOut = false; CompressSigTimeOut = false;
LogUtil.info("出库步骤 SO_07_CheckComSig :IsIgnoreComSig = false, CompressSigTimeOut = false");
MoveInfo.NextMoveStep(StoreMoveStep.SO_08_ToShelfPosition); MoveInfo.NextMoveStep(StoreMoveStep.SO_08_ToShelfPosition);
InOutStoreLog("出库 " + MoveInfo.SLog + ":走到料架位置,旋转轴至P101,升降轴至P102 "); InOutStoreLog("出库 " + MoveInfo.SLog + ":走到料架位置,旋转轴至P101,升降轴至P102 ");
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_HP102, Config.UpDownAxis_P102_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_HP102, Config.UpDownAxis_P102_Speed);
......
...@@ -123,7 +123,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -123,7 +123,7 @@ namespace OnlineStore.DeviceLibrary
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); AgvClient.SetStatus(Config.AgvNodeName, mark);
// CylinderMove(MoveInfo, IO_Type.LocationCylinder_Down, IO_Type.LocationCylinder_Up); // CylinderMove(MoveInfo, IO_Type.LocationCylinder_Down, IO_Type.LocationCylinder_Up);
if (!instoreShelf) if (!instoreShelf)
...@@ -162,14 +162,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -162,14 +162,17 @@ namespace OnlineStore.DeviceLibrary
if (instoreShelf) if (instoreShelf)
{ {
MoveInfo.NextMoveStep(StoreMoveStep.BI_10_StartGetTray); MoveInfo.NextMoveStep(StoreMoveStep.BI_10_StartGetTray);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime((int)TimeSpan.FromMinutes(75).TotalMilliseconds));
//获取料架的锁定状态 //获取料架的锁定状态
bool lockState = StoreManager.GetShelfLockInfo(Name,CID, CurrShelfID, out MoveInfo.shelfLockDatas); bool lockState = StoreManager.GetShelfLockInfo(Name, CID, CurrShelfID, out MoveInfo.shelfLockDatas);
if (lockState && MoveInfo.shelfLockDatas != null) if (lockState && MoveInfo.shelfLockDatas != null)
{ {
MoveInfo.IsShelfLocked = true; MoveInfo.IsShelfLocked = true;
if (MoveInfo.shelfLockDatas.Count.Equals(0))
InOutStoreLog(moveName + MoveInfo.SLog + "该锁定料架上的料盘不属于该料仓,即将送出锁定料架");
else
InOutStoreLog(moveName + MoveInfo.SLog + "开始到料架指定位置取料盘 "); InOutStoreLog(moveName + MoveInfo.SLog + "开始到料架指定位置取料盘 ");
} }
else else
...@@ -721,7 +724,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -721,7 +724,7 @@ namespace OnlineStore.DeviceLibrary
//发送扫码内容到服务器进行入库操作 //发送扫码内容到服务器进行入库操作
Operation operation = getLineBoxStatus(); Operation operation = getLineBoxStatus();
operation.op = 1; operation.op = 1;
operation.data = new Dictionary<string, string>() { { "code", message }, { "boxId", 1.ToString() }, { ParamDefine.rfid, CurrShelfID }}; operation.data = new Dictionary<string, string>() { { "code", message }, { "boxId", 1.ToString() }, { ParamDefine.rfid, CurrShelfID } };
string server = ConfigAppSettings.GetValue(Setting_Init.http_server); string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
Operation resultOperation = HttpHelper.Post(StoreManager.GetPostApi(server), operation, false); Operation resultOperation = HttpHelper.Post(StoreManager.GetPostApi(server), operation, false);
if (resultOperation == null) if (resultOperation == null)
...@@ -784,23 +787,38 @@ namespace OnlineStore.DeviceLibrary ...@@ -784,23 +787,38 @@ namespace OnlineStore.DeviceLibrary
} }
/// <summary> /// <summary>
/// 扫码结果类型 /// 扫码枪数据接收
/// </summary> /// </summary>
enum CodeResultType /// <param name="codeResultType">扫码结果</param>
/// <returns></returns>
public enum CodeResultType
{ {
/// <summary>
/// 未扫到二维码
/// </summary>
NoCode, NoCode,
/// <summary>
/// 设备未启动
/// </summary>
DeviceNotOpen, DeviceNotOpen,
/// <summary>
///未收到服务器反馈
/// </summary>
NotResponseFromServer, NotResponseFromServer,
WarnMsg, WarnMsg,
/// <summary>
/// 未找到库位
/// </summary>
NotFoundPos, NotFoundPos,
/// <summary>
/// 不属于该仓位
/// </summary>
NotPosForPutIn,
Error, Error,
Success Success
} }
/// <summary>
/// 扫码枪数据接收
/// </summary>
/// <param name="codeResultType">扫码结果</param>
/// <returns></returns>
private bool GetPosIdByCode(int rfidLoc, out CodeResultType codeResultType) private bool GetPosIdByCode(int rfidLoc, out CodeResultType codeResultType)
{ {
try try
...@@ -828,14 +846,24 @@ namespace OnlineStore.DeviceLibrary ...@@ -828,14 +846,24 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(Name + "二维码【 " + message + "】,发送给服务器获取入库PosID"); LogUtil.info(Name + "二维码【 " + message + "】,发送给服务器获取入库PosID");
//查询该料盘所在料仓以及仓位 //查询该料盘所在料仓以及仓位
bool checkRelationship = StoreManager.GetPosForPutIn(Name, Config, message, CurrShelfID, rfidLoc); StoreManager.ResultType resultType = StoreManager.GetPosForPutIn(Name, Config, message, CurrShelfID, rfidLoc, out bool isLockInfoMatch);
if (!checkRelationship) if (resultType == StoreManager.ResultType.Error)
{ {
codeResultType = CodeResultType.NotFoundPos; codeResultType = CodeResultType.Error;
return false; return false;
} }
else if(resultType == StoreManager.ResultType.NotInThisBox)
{
codeResultType = CodeResultType.NotPosForPutIn;
return false;
}
if (!isLockInfoMatch && MoveInfo.IsShelfLocked)//锁定信息不匹配则从第一层开始重新取料,一个料架只重新开始一次
{
MoveInfo.IsShelfLocked = false;
MoveInfo.currShelfIndex = -1;
LogUtil.info(Name + "该锁定料架" + CurrShelfID + "上的料盘信息不匹配,即将从开始位置循环取料");
}
//发送扫码内容到服务器进行入库操作 //发送扫码内容到服务器进行入库操作
Operation operation = getLineBoxStatus(); Operation operation = getLineBoxStatus();
operation.op = 1; operation.op = 1;
......
...@@ -401,7 +401,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -401,7 +401,6 @@ namespace OnlineStore.DeviceLibrary
string server = GetAddr(Addr_clearPutInRfid, paramMap); string server = GetAddr(Addr_clearPutInRfid, paramMap);
string resultStr = HttpHelper.Post(server, ""); string resultStr = HttpHelper.Post(server, "");
LogUtil.info(deviceName + "clearPutInRfid 【" + server + "】【" + resultStr + "】"); LogUtil.info(deviceName + "clearPutInRfid 【" + server + "】【" + resultStr + "】");
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -618,9 +617,20 @@ namespace OnlineStore.DeviceLibrary ...@@ -618,9 +617,20 @@ namespace OnlineStore.DeviceLibrary
private static string Addr_PosForPutin = "/service/store/emptyPosForPutin"; //获取当前料盘属于的料仓编号 private static string Addr_PosForPutin = "/service/store/emptyPosForPutin"; //获取当前料盘属于的料仓编号
public static bool GetPosForPutIn(string deviceName, AC_BOX_Config boxConfig, string barcode, string rfid, int rfidLoc) /// <summary>
/// 查询仓位结果
/// </summary>
public enum ResultType
{
NotInThisBox,
Error,
Success
}
public static ResultType GetPosForPutIn(string deviceName, AC_BOX_Config boxConfig, string barcode, string rfid, int rfidLoc, out bool IsLockInfoMatch)
{ {
string msg = ""; string msg = "";
IsLockInfoMatch = true;//锁定信息是否匹配
try try
{ {
...@@ -645,15 +655,25 @@ namespace OnlineStore.DeviceLibrary ...@@ -645,15 +655,25 @@ namespace OnlineStore.DeviceLibrary
{ {
msg = deviceName + " 【" + barcode + "】结果:没有收到服务器反馈 "; msg = deviceName + " 【" + barcode + "】结果:没有收到服务器反馈 ";
LogUtil.info(msg); LogUtil.info(msg);
return false; return ResultType.Error;
} }
else if ((!string.IsNullOrEmpty(serverResult.msg)) || serverResult.result.Equals(0).Equals(false)) //else if ((!string.IsNullOrEmpty(serverResult.msg)))// || serverResult.result.Equals(0).Equals(false)
//{
// msg = deviceName + " 【" + barcode + "】结果:" + serverResult.msg;
// LogUtil.info(msg);
// // return false;
//}
else if (serverResult.result.Equals(-1))
{
IsLockInfoMatch = false;
}
else if (!serverResult.result.Equals(0))
{ {
msg = deviceName + " 【" + barcode + "】结果:" + serverResult.msg; msg = deviceName + " 【" + barcode + "】结果:" + serverResult.msg;
LogUtil.info(msg); LogUtil.info(msg);
return false; return ResultType.Error;
} }
if (serverResult.cid.Equals(boxConfig.CID)) //该料盘在此料仓 if (serverResult.cid.Equals(boxConfig.CID)) //该料盘在此料仓
{ {
// 仓位命名: 4D01020304 // 仓位命名: 4D01020304
...@@ -666,22 +686,70 @@ namespace OnlineStore.DeviceLibrary ...@@ -666,22 +686,70 @@ namespace OnlineStore.DeviceLibrary
//4D19050208 表示4楼19号料仓(包装料仓)第5列第2行架子上的第8个隔板位置 //4D19050208 表示4楼19号料仓(包装料仓)第5列第2行架子上的第8个隔板位置
msg = deviceName + " 料盘【" + barcode + "】属于该料仓【" + boxConfig.CID + "】"; msg = deviceName + " 料盘【" + barcode + "】属于该料仓【" + boxConfig.CID + "】";
LogUtil.info(msg); LogUtil.info(msg);
return true; return ResultType.Success;
} }
else else
{ {
msg = deviceName + " 料盘【" + barcode + "】不属于该料仓【" + boxConfig.CID + "】"; msg = deviceName + " 料盘【" + barcode + "】不属于该料仓【" + boxConfig.CID + "】";
LogUtil.info(msg); LogUtil.info(msg);
return false; return ResultType.NotInThisBox;
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(deviceName + " ", ex); LogUtil.error(deviceName + " ", ex);
} }
return ResultType.Error;
}
private static string Addr_clearLockLoc = "/rest/api/qisda/device/clearLockLoc";
/// <summary>
/// 清除料架指定位置的锁定信息
/// </summary>
/// <param name="rfid"></param>
/// <param name="rfidLoc"></param>
/// <returns></returns>
public static bool ClearLockLoc(string deviceName,string rfid, int rfidLoc)
{
string msg = "";
try
{
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add(ParamDefine.rfid, rfid);
paramMap.Add("rfidLoc", rfidLoc.ToString());
string server = GetAddr(Addr_clearLockLoc, paramMap);
DateTime startTime = DateTime.Now;
LogUtil.info("清除RFID="+ rfid+ ",rfidLoc="+ rfidLoc.ToString()+"的锁定信息");
string resultStr = HttpHelper.Post(server, "");
LogUtil.info(deviceName+" CodeReceived " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
RfidData data = JsonHelper.DeserializeJsonToObject<RfidData>(resultStr);
if (data == null)
{
msg = deviceName + " ClearLockLoc【 " + rfid + "-"+ rfidLoc + "】 没有收到服务器反馈";
LogUtil.info(msg);
return false; return false;
} }
else if (data.code.Equals(0).Equals(false))
{
msg = deviceName + " ClearLockLoc【 " + rfid +"-" + rfidLoc+"】:" + data.msg;
LogUtil.info(msg);
return false;
}
return true;
}
catch (Exception ex)
{
LogUtil.error(deviceName+" ClearLockLoc ", ex);
}
return false;
}
} }
public class AfterPutData public class AfterPutData
{ {
......
...@@ -125,6 +125,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -125,6 +125,7 @@ namespace OnlineStore.DeviceLibrary
LastSetpTime = DateTime.Now; LastSetpTime = DateTime.Now;
WaitList = new List<WaitResultInfo>(); WaitList = new List<WaitResultInfo>();
currShelfIndex = -1; currShelfIndex = -1;
lockShelfIndex = -1;
SingleInstore = false; SingleInstore = false;
} }
public void EndMove() public void EndMove()
...@@ -150,7 +151,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -150,7 +151,7 @@ namespace OnlineStore.DeviceLibrary
public List<string> ShelfPositionList = new List<string>(); public List<string> ShelfPositionList = new List<string>();
private string currShelfPosId = ""; private string currShelfPosId = "";
public int currShelfIndex = -1; public int currShelfIndex = -1;
private int lockShelfIndex = -1;
public bool NextShelfPos() public bool NextShelfPos()
{ {
currShelfIndex++; currShelfIndex++;
...@@ -168,24 +169,24 @@ namespace OnlineStore.DeviceLibrary ...@@ -168,24 +169,24 @@ namespace OnlineStore.DeviceLibrary
/// 入库时,料架已锁定库位的位置,无需扫码 /// 入库时,料架已锁定库位的位置,无需扫码
/// </summary> /// </summary>
public bool IsShelfLocked = false;//料架是否锁定 public bool IsShelfLocked = false;//料架是否锁定
/// <summary> /// <summary>
/// 料架锁定位置的料 /// 料架锁定位置的料
/// </summary> /// </summary>
public List<ShelfLockData> shelfLockDatas =null; public List<ShelfLockData> shelfLockDatas = null;
public bool NextLockedShelfPos() public bool NextLockedShelfPos()
{ {
lockShelfIndex++;
currShelfIndex++; if (lockShelfIndex >= shelfLockDatas.Count)
if (currShelfIndex >= shelfLockDatas.Count)
{ {
shelfLockDatas = null; shelfLockDatas = null;
return false; return false;
} }
currShelfPosId = ShelfPositionList[shelfLockDatas[currShelfIndex].rfidLoc]; currShelfIndex = shelfLockDatas[lockShelfIndex].rfidLoc;
currShelfPosId = ShelfPositionList[currShelfIndex];
//设置取料位置 //设置取料位置
MoveParam.UpdatePosIdAndShelfId(shelfLockDatas[currShelfIndex].barcode, MoveParam.UpdatePosIdAndShelfId(shelfLockDatas[lockShelfIndex].barcode,
shelfLockDatas[currShelfIndex].rfid, shelfLockDatas[lockShelfIndex].rfid,
shelfLockDatas[currShelfIndex].lockPos, currShelfPosId); shelfLockDatas[lockShelfIndex].lockPos, currShelfPosId);
return true; return true;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!