| | |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace Bro.M071.Process |
| | |
| | | sw.Start(); |
| | | //var result = _webApiHelper.dooPost(url, paraStr); |
| | | |
| | | object[] paras = new object[] { barcode, Config.StationCode }; |
| | | var result = IncomingCheckMethod?.Invoke(IncomingCheckObj, paras).ToString(); |
| | | object[] paras = new object[] { barcode, Config.StationCode, Config.ProjectCode }; |
| | | |
| | | if (Config.IsEnableMESLog) |
| | | { |
| | | LogAsync(DateTime.Now, $"MES入料检测", JsonConvert.SerializeObject(paras)); |
| | | } |
| | | |
| | | string result = "-3"; |
| | | |
| | | int repeatTime = 3; |
| | | |
| | | do |
| | | { |
| | | try |
| | | { |
| | | result = IncomingCheckMethod?.Invoke(IncomingCheckObj, paras).ToString(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogAsync(DateTime.Now, $"{barcode}产品条码检测异常", ex.GetExceptionMessage()); |
| | | repeatTime--; |
| | | |
| | | Thread.Sleep(100); |
| | | result = "-3"; |
| | | } |
| | | } while (repeatTime > 0); |
| | | var mesReturn = (MESIncomingCheckReturn)int.Parse(result); |
| | | sw.Stop(); |
| | | LogAsync(DateTime.Now, $"{barcode}产品条码检测,{result}|{mesReturn.ToString()}", $"耗时:{sw.ElapsedMilliseconds}ms"); |
| | |
| | | Config.IsDisableMultipleCheckTimes, |
| | | Config.ProjectCode, |
| | | pMeasure.Barcode, |
| | | checkTime.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | checkTime, |
| | | Config.StationCode, |
| | | pMeasure.PResult == "OK" ? "PASS" : "FAIL", |
| | | Config.LineCode, |
| | |
| | | GetNGKeys(pMeasure) |
| | | }; |
| | | |
| | | //LogAsync(DateTime.Now, $"{barcode}产品检测数据上传", JsonConvert.SerializeObject(paras)); |
| | | if (Config.IsEnableMESLog) |
| | | { |
| | | LogAsync(DateTime.Now, $"{pMeasure.Barcode}产品检测数据上传", JsonConvert.SerializeObject(paras)); |
| | | } |
| | | |
| | | var result = DataUploadMethod?.Invoke(DataUploadObj, paras).ToString(); |
| | | string result = "-3"; |
| | | |
| | | int repeatTime = 3; |
| | | do |
| | | { |
| | | try |
| | | { |
| | | result = DataUploadMethod?.Invoke(DataUploadObj, paras).ToString(); |
| | | repeatTime = -1; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogAsync(DateTime.Now, $"{barcode}产品检测数据上传异常", ex.GetExceptionMessage()); |
| | | repeatTime--; |
| | | |
| | | Thread.Sleep(100); |
| | | result = "-3"; |
| | | } |
| | | } while (repeatTime > 0); |
| | | |
| | | var mesReturn = (MESUploadReturn)int.Parse(result); |
| | | sw.Stop(); |
| | | LogAsync(DateTime.Now, $"{barcode}产品检测数据上传,{result}|{mesReturn.ToString()}", $"耗时:{sw.ElapsedMilliseconds}ms"); |