Commit 3185ffb8 LN

修改BUG: 托盘一直显示有料

1 个父辈 5bd88572
...@@ -466,7 +466,7 @@ namespace OnlineStore.AssemblyLine ...@@ -466,7 +466,7 @@ namespace OnlineStore.AssemblyLine
StringBuilder sbResult = new StringBuilder(); StringBuilder sbResult = new StringBuilder();
PerformanceCounter pf1 = new PerformanceCounter("Process", "Working Set - Private", process.ProcessName); PerformanceCounter pf1 = new PerformanceCounter("Process", "Working Set - Private", process.ProcessName);
sbResult.AppendFormat(DateTime.Now.ToLongTimeString() + ", 名称:{0} 内存:{1}M ", process.ProcessName, Math.Round(pf1.NextValue() / 1024 / 1024F, 2)); sbResult.AppendFormat(DateTime.Now.ToLongTimeString() + ", 名称:{0} 内存:{1}M ", process.ProcessName, Math.Round(pf1.NextValue() / 1024 / 1024F, 2));
sbResult.AppendFormat(", CPU : {0} %", curtime.NextValue()); sbResult.AppendFormat(", CPU : {0} %", curtime.NextValue() / Environment.ProcessorCount);
LogUtil.info(sbResult.ToString()); LogUtil.info(sbResult.ToString());
} }
} }
......
20200529 20200603
入库时。料仓正好复位,导致未开始入库,入库信息丢失。
20200529
1.上料模块料架号增加缓存 1.上料模块料架号增加缓存
......
...@@ -77,23 +77,22 @@ namespace OnlineStore.Common ...@@ -77,23 +77,22 @@ 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, int timeOut = 5000) public static string Post(string url, string paramData, int timeOut = 5000)
{ {
return Post(url, paramData, Encoding.UTF8, timeOut); bool IsTimeOut = false;
return Post(url, paramData, Encoding.UTF8, timeOut,out IsTimeOut);
} }
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 Post(string url, string paramData, Encoding encoding, int timeOut = 5000) public static string Post(string url, string paramData, Encoding encoding, int timeOut ,out bool IsTimeOut)
{ {
//if (PingURLIP(url, 100).Equals(false)) IsTimeOut = false;
//{
// return "";
//}
if (isLog == 1) if (isLog == 1)
{ {
LOGGER.Info("给服务器发送数据【" + paramData + "】 "); LOGGER.Info("给服务器发送数据【" + paramData + "】 ");
} }
if (paramData != "null" && paramData != null) //if (paramData != "null" && paramData != null)
{ //{
// LogUtil.debug(LOGGER, "HTTP POST to " + url + " \n\t >> " + paramData); // LogUtil.debug(LOGGER, "HTTP POST to " + url + " \n\t >> " + paramData);
} //}
string result = ""; string result = "";
if (url.ToLower().IndexOf("https", System.StringComparison.Ordinal) > -1) if (url.ToLower().IndexOf("https", System.StringComparison.Ordinal) > -1)
...@@ -112,6 +111,11 @@ namespace OnlineStore.Common ...@@ -112,6 +111,11 @@ namespace OnlineStore.Common
result = wc.UploadString(url, "POST", paramData); result = wc.UploadString(url, "POST", paramData);
//LogUtil.info(result); //LogUtil.info(result);
} }
catch(WebException ex)
{
IsTimeOut = true;
LogUtil.error("POST WebException :" + ex .ToString(), 101);
}
catch (Exception e) catch (Exception e)
{ {
LogUtil.error("POST ERROR:" + e.ToString(), 101); LogUtil.error("POST ERROR:" + e.ToString(), 101);
......
...@@ -910,28 +910,29 @@ namespace OnlineStore.DeviceLibrary ...@@ -910,28 +910,29 @@ namespace OnlineStore.DeviceLibrary
TrayManager.UpdateTrayInfo(currTrayNum, true, ReelType.InStore, new InOutParam(currTrayNum, code, "", LastHeight, LastWidth, false), ""); TrayManager.UpdateTrayInfo(currTrayNum, true, ReelType.InStore, new InOutParam(currTrayNum, code, "", LastHeight, LastWidth, false), "");
getPosTask = Task.Factory.StartNew(delegate getPosTask = Task.Factory.StartNew(delegate
{ {
int sTrayNum = currTrayNum;
//更新托盘条码信息 //更新托盘条码信息
try try
{ {
if (code.Equals("")) if (code.Equals(""))
{ {
InOutParam param = new InOutParam(currTrayNum, code, "", LastHeight, LastWidth, true); InOutParam param = new InOutParam(sTrayNum, code, "", LastHeight, LastWidth, true);
TrayManager.UpdateTrayInfo(currTrayNum, true, ReelType.InStore, param, "扫码失败"); TrayManager.UpdateTrayInfo(sTrayNum, true, ReelType.InStore, param, "扫码失败");
} }
//从服务器获取库位号 //从服务器获取库位号
string result = SServerManager.CodeReceived(Name, currTrayNum, LastCodeList, LastHeight, LastWidth, CurrShelfId, DeviceID); string result = SServerManager.CodeReceived(Name, sTrayNum, LastCodeList, LastHeight, LastWidth, CurrShelfId, DeviceID);
if (!result.Equals("")) if (!result.Equals(""))
{ {
InOutParam param = new InOutParam(currTrayNum, code, "", LastHeight, LastWidth, true); InOutParam param = new InOutParam(sTrayNum, code, "", LastHeight, LastWidth, true);
param.rfid = CurrShelfId; param.rfid = CurrShelfId;
TrayManager.UpdateTrayInfo(currTrayNum, true, ReelType.InStore, param, result); TrayManager.UpdateTrayInfo(sTrayNum, true, ReelType.InStore, param, result);
// TrayManager.UpdateInStoreNG(currTrayNum, true, result); // TrayManager.UpdateInStoreNG(currTrayNum, true, result);
LogUtil.error(Name + "托盘【" + currTrayNum + "】" + result); LogUtil.error(Name + "托盘【" + sTrayNum + "】" + result);
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(Name + "托盘【" + currTrayNum + "】【" + code + "】获取库位号报错:" + ex.ToString()); LogUtil.error(Name + "托盘【" + sTrayNum + "】【" + code + "】获取库位号报错:" + ex.ToString());
} }
}); });
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!