| | |
| | | using HslCommunication; |
| | | using Newtonsoft.Json; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | return BarcodeLockDict[barcode].Item1; |
| | | } |
| | | } |
| | | |
| | | public static bool KtpHkflag = false; // è®°å½ç©ºæçååºçé误 |
| | | public static DateTime curDate; // è®°å½é误åççæ¶é´ |
| | | public static void InboundRequestAction(IDt_TaskWCSinfoRepository taskWCSinfoRepository, IDt_TaskRGVinfoRepository taskRGVinfoRepository, PLCClient client) |
| | | { |
| | | try |
| | | { |
| | | if (KtpHkflag) |
| | | { |
| | | double secondsPassend = (DateTime.Now - curDate).TotalSeconds; |
| | | if (secondsPassend > 6) |
| | | { |
| | | client.WriteValue(CLineInfoDBName.W_Line_PLCDispatch.ToString(), ReInboundRequestStationNo, 1); |
| | | KtpHkflag = false; |
| | | } |
| | | } |
| | | |
| | | |
| | | int R_Line_PLCDispatch = int.Parse(client.ReadValue(CLineInfoDBName.W_Line_PLCDispatch.ToString(), ReInboundRequestStationNo).ToString()); |
| | | bool load = bool.Parse(client.ReadValue(CLineInfoDBName.R_Line_LoadSleep.ToString(), ReInboundRequestStationNo).ToString()); |
| | | if (R_Line_PLCDispatch == 1 && load) |
| | |
| | | WebResponseContent content = WMSApi.PostInboundRequstToWMS(barcode); |
| | | if (content.Status) |
| | | { |
| | | //WmsTaskInfo wmsTask = JsonConvert.DeserializeObject<WmsTaskInfo>(content.Data.ToString()); |
| | | //wcsInfo = CommonFunction.AddWCSEmptyInboundTask(wmsTask, taskWCSinfoRepository); |
| | | //taskWCSinfoRepository.Add(wcsInfo, true); |
| | | //client.WriteValue(CLineInfoDBName.W_Line_PLCDispatch.ToString(), ReInboundRequestStationNo, 2); |
| | | try |
| | | { |
| | | WmsTaskInfo wmsTask = JsonConvert.DeserializeObject<WmsTaskInfo>(content.Data.ToString()); |
| | |
| | | catch (Exception ex) |
| | | { |
| | | client.WriteValue(CLineInfoDBName.W_Line_PLCDispatch.ToString(), ReInboundRequestStationNo, 3); |
| | | KtpHkflag = true; |
| | | curDate = DateTime.Now; // æ¥éäºï¼è®°å½ä¸ä¸è¿ä¸ªéè¯¯åæ¶é´ï¼ |
| | | LogRecord.WriteLog(LogEnum.Errer, DateTime.Now.ToString() + ex.Message.ToString()); |
| | | |
| | | Console.Out.WriteLine(DateTime.Now + ex.Message); |
| | | } |
| | | } |