| | |
| | | using HslCommunication; |
| | | using Newtonsoft.Json; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Numeric; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using WIDESEA_Common; |
| | | using WIDESEA_Common.CutomerModel; |
| | | using WIDESEA_Common.TaskEnum; |
| | | using WIDESEA_Common.Tools; |
| | | using WIDESEA_Core.Utilities; |
| | | using WIDESEA_Entity.DomainModels; |
| | |
| | | // } |
| | | //} |
| | | |
| | | //è·åä»»å¡ï¼çæå
¥åºä»»å¡ |
| | | public static void RGV_InboundKTP(IDt_TaskWCSinfoRepository taskWCSinfoRepository, IDt_TaskRGVinfoRepository taskRGVinfoRepository, PLCClient client) |
| | | { |
| | | Dt_TaskWCSinfo inboundTask = taskWCSinfoRepository.FindFirst(r => OutboundStationLayerNo.Contains(r.wcstask_endPoint) && r.wcstask_type == |
| | | TaskType.TaskType_Empty_Pallet_Inbound.ToString() && r.wcstask_state == TaskState.TaskState_HoisterExecuting.ToString()); |
| | | if(inboundTask == null) |
| | | { |
| | | //æ¥æ¾æ¯å¦æè¯¥æçæ¡ç ä»»å¡ï¼å¦ææ²¡æåè¿è¡æ·»å RGVä»»å¡ |
| | | Dt_TaskRGVinfo rgvInfo = taskRGVinfoRepository.FindFirst(r => r.rgvtask_barCode == inboundTask.wcstask_barcode |
| | | && r.rgvtask_wcsTaskNumber == inboundTask.wcstask_taskNumber); |
| | | |
| | | if (null == rgvInfo) |
| | | { |
| | | string rgvTaskType = RGVTaskType.RgvTaskType_Inbound.ToString(); |
| | | |
| | | rgvInfo = GetRGVTask(taskRGVinfoRepository, inboundTask, rgvTaskType); |
| | | taskRGVinfoRepository.Add(rgvInfo, true); |
| | | |
| | | inboundTask.wcstask_state = TaskState.TaskState_RGV_Received.ToString(); |
| | | taskWCSinfoRepository.Update(inboundTask, x => x.wcstask_state, true); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | //空æçå
¥åºä»»å¡ä¸å夿 |
| | | public static void ReInboundKTP(IDt_TaskWCSinfoRepository taskWCSinfoRepository, PLCClient client) |
| | | { |
| | | try |
| | | { |
| | | //å¯ä»¥è¿è¡å¤æä¸åå
¥åºä»»å¡ |
| | | Dt_TaskWCSinfo inboundTask = taskWCSinfoRepository.FindFirst(r => OutboundStationLayerNo.Contains(r.wcstask_endPoint) && r.wcstask_type == |
| | | TaskType.TaskType_Empty_Pallet_Inbound.ToString() && r.wcstask_state == TaskState.TaskState_Assigned.ToString()); |
| | | if(inboundTask != null) |
| | | { |
| | | //è·å车轴åºåº |
| | | List<Dt_TaskWCSinfo> executingTask = taskWCSinfoRepository.Find(r => (r.wcstask_type.Equals(TaskType.TaskType_Box_Pallet_Outbound.ToString()) || |
| | | r.wcstask_type.Equals(TaskType.TaskType_Empty_Pallet_Outbound.ToString())) && endStationNo.Contains(r.wcstask_endPoint)); |
| | | |
| | | //è·åæå¤å°æ¡åºåºçä»»å¡ |
| | | int LineExecucount = executingTask.Count(x => x.wcstask_state == TaskState.TaskState_Box_Out_Line_Executing.ToString()); |
| | | if (LineExecucount >= 4) |
| | | { |
| | | //夿æ¯å¦æå¯¹åºå±çåºåºä»»å¡ï¼ |
| | | int Assrscount = executingTask.Count(x => x.wcstask_endLocation == inboundTask.wcstask_startLocation && (x.wcstask_state != TaskState.TaskState_Box_Out_Line_Executing.ToString() |
| | | || x.wcstask_state == TaskState.TaskState_Assigned.ToString())); |
| | | if (Assrscount == 0) |
| | | { |
| | | ReInboundRequestStationAction(taskWCSinfoRepository, client, inboundTask); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //夿æå¤å°æ¡å¨ç¼åæ¶ç |
| | | int RGV_Finishedcount = executingTask.Count(x => x.wcstask_state != TaskState.TaskState_Box_Out_Line_Executing.ToString() |
| | | && x.wcstask_state != TaskState.TaskState_Assigned.ToString()); |
| | | if (RGV_Finishedcount == 0) |
| | | { |
| | | //å¯ä»¥è¿è¡å¤æä¸åå
¥åºä»»å¡ |
| | | int Assrscount = executingTask.Count(x => x.wcstask_endLocation == inboundTask.wcstask_startLocation && (x.wcstask_state != TaskState.TaskState_Box_Out_Line_Executing.ToString() |
| | | || x.wcstask_state == TaskState.TaskState_Assigned.ToString())); |
| | | if (Assrscount == 0) |
| | | { |
| | | ReInboundRequestStationAction(taskWCSinfoRepository, client, inboundTask); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | WriteLog.Info(ReInboundRequestStationNo).Write($"{DateTime.Now}ååºç«å°ä»»å¡ä¸å,è°åº¦å¤±è´¥:{ex.Message}", ReInboundRequestStationNo); |
| | | throw; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | public static void ReInboundRequestStationAction(IDt_TaskWCSinfoRepository taskWCSinfoRepository, PLCClient client, Dt_TaskWCSinfo wcsInfo) |