Commit 35a504a0 LN

增加取消任务接口调用

1 个父辈 e9880b04
......@@ -514,9 +514,12 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogUtil.error(Name + "托盘号【" + currTrayNum + "】入库信息【" + currCode.ToStr() + "】料仓未验证成功,不拦截托盘,更新此托盘为NG,从waitInStoreList中删除");
LogUtil.error(Name + "托盘号【" + currTrayNum + "】入库信息【" + currCode.ToStr() + "】料仓未验证成功,不拦截托盘,更新此托盘为NG,从waitInStoreList中删除,取消入库任务");
TrayManager.UpdateInStoreNG(currTrayNum, true, "Box验证入库失败");
waitInStoreList.RemoveAt(reIndex);
Task.Factory.StartNew(delegate {
SServerManager.cancelPutInTask(Name, currCode.WareCode);
});
return false;
}
......
......@@ -177,7 +177,7 @@ namespace OnlineStore.DeviceLibrary
outSize = 0;
string msg = "";
try
{
{
if (String.IsNullOrEmpty(codeStr))
{
return msg = deviceName + "未扫到条码";
......@@ -259,7 +259,7 @@ namespace OnlineStore.DeviceLibrary
}
return msg;
}
private static string Addr_clearPutInRfid = "/service/store/qisda/clearPutInRfid";
public static string clearPutInRfid(string deviceName, string rfid)
{
......@@ -347,10 +347,10 @@ namespace OnlineStore.DeviceLibrary
string resultStr = HttpHelper.Post(server, "");
if (barcode != "")
{
LogUtil.info(deviceName+ "afterPutCut " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
LogUtil.info(deviceName + "afterPutCut " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
}
else
{
{
LogUtil.debug(deviceName + "afterPutCut " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
}
//> 返回:
......@@ -383,7 +383,7 @@ namespace OnlineStore.DeviceLibrary
return msg;
}
// 分盘料/紧急料启动时获取料架的虚拟RFID调用 地址: /rest/api/qisda/device/findTempRfid
private static string Addr_findTempRfid = "/rest/api/qisda/device/findTempRfid";
public static string findTempRfid(string deviceName, string rfid, out string tempRfid)
......@@ -404,7 +404,7 @@ namespace OnlineStore.DeviceLibrary
string server = GetAddr(Addr_findTempRfid, paramMap);
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, "");
LogUtil.info("findTempRfid " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
LogUtil.info(deviceName + "findTempRfid " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
RfidData data = JsonHelper.DeserializeJsonToObject<RfidData>(resultStr);
......@@ -418,7 +418,7 @@ namespace OnlineStore.DeviceLibrary
}
if (data.data != null && data.data.ContainsKey("tempRfid"))
{
tempRfid= data.data["tempRfid"];
tempRfid = data.data["tempRfid"];
}
return "";
}
......@@ -429,6 +429,42 @@ namespace OnlineStore.DeviceLibrary
return msg;
}
// 取消任务地址: /cancelPutInTask //参数: barcode
private static string Addr_cancelPutInTask = "/cancelPutInTask";
public static string cancelPutInTask(string deviceName, string barcode)
{
string msg = "";
try
{
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("barcode", barcode);
string server = GetAddr(Addr_cancelPutInTask, paramMap);
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, "");
LogUtil.info(deviceName + "cancelPutInTask " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
RfidData data = JsonHelper.DeserializeJsonToObject<RfidData>(resultStr);
if (data == null)
{
return msg = deviceName + "cancelPutInTask【 " + barcode + "】 没有收到服务器反馈";
}
else if (data.code.Equals(0).Equals(false))
{
return msg = deviceName + " cancelPutInTask【 " + barcode + "】 :" + data.msg;
}
return "";
}
catch (Exception ex)
{
LogUtil.error(deviceName + " " + ex.ToString());
}
return msg;
}
}
public class RfidData
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!