| | |
| | | List<Dt_taskinfo> inboundTask = Dt_taskinfoRepository.Instance.Find(r => r.task_type.Contains("Inbound")); |
| | | List<int> listLayer = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8 }; |
| | | |
| | | |
| | | //// æ´æ¹è·åè´§ä½çä¿¡æ¯ è¿éè¦åä¸ä¸ªå¾ªç¯ |
| | | //List<Dt_taskinfo> outboundTask_temp = Dt_taskinfoRepository.Instance.Find(x => x.task_tolocationid == "10301" || x.task_endstation == "10301"); |
| | | //if (outboundTask_temp != null) |
| | | //{ |
| | | // string temp_layer = ""; |
| | | |
| | | // foreach (var item in outboundTask_temp) |
| | | // { |
| | | |
| | | // } |
| | | //} |
| | | |
| | | if (null != inboundTask && inboundTask.Count > 0) |
| | | { |
| | | foreach (var item in inboundTask) |
| | |
| | | listLayer.Remove(layer); |
| | | } |
| | | } |
| | | //List<string> fromStation = inboundTask.Select(r => r.task_tolocationid).ToList(); |
| | | //foreach (var item in fromStation) |
| | | //{ |
| | | // string[] location = item.Split('-'); |
| | | // //è·åå½åæä»»å¡çå± |
| | | // int layer = int.Parse(location[0]); |
| | | // listLayer.Remove(layer); |
| | | //} |
| | | } |
| | | |
| | | List<Dt_taskinfo> outboundTask = Dt_taskinfoRepository.Instance.Find(r => ((r.task_type == TaskType.TaskType_Box_Pallet_Measure_Out.ToString() /*|| r.task_type == TaskType.TaskType_CheckOutbound.ToString()*/) |
| | | && |
| | | (r.task_state.Equals(TaskState.TaskState_RGV_Received.ToString()) || r.task_state.Equals(TaskState.TaskState_RGV_Finished.ToString()))) |
| | | || r.task_type == TaskType.TaskType_Box_Pallet_Measure_Back.ToString()); |
| | | // List<Dt_taskinfo> outboundTask = Dt_taskinfoRepository.Instance.Find(r => ((r.task_type == TaskType.TaskType_Box_Pallet_Measure_Out.ToString()) |
| | | // && (r.task_state.Equals(TaskState.TaskState_RGV_Received.ToString()) || r.task_state.Equals(TaskState.TaskState_RGV_Finished.ToString()))) |
| | | //|| r.task_type == TaskType.TaskType_Box_Pallet_Measure_Back.ToString()); |
| | | |
| | | List<Dt_taskinfo> outboundTask = Dt_taskinfoRepository.Instance.Find(r => ((r.task_type == TaskType.TaskType_Box_Pallet_Measure_Out.ToString()) |
| | | && (r.task_state == TaskState.TaskState_RGV_Received.ToString() || r.task_state == TaskState.TaskState_RGV_Finished.ToString())) |
| | | || r.task_type == TaskType.TaskType_Box_Pallet_Measure_Back.ToString()); |
| | | |
| | | //List<Dt_taskinfo> outboundTask = Dt_taskinfoRepository.Instance.Find(r =>(r.task_type == TaskType.TaskType_Box_Pallet_Measure_Out.ToString() || r.task_type == TaskType.TaskType_Box_Pallet_Measure_Back.ToString()) |
| | | //&& (r.task_state != TaskState.TaskState_Create.ToString())); |
| | | |
| | | //if (outboundTask.Count < 3) |
| | | //{ |
| | | // int crtacount = 3 - outboundTask.Count; |
| | | // List<Dt_taskinfo> outboundcCrteateTask = Dt_taskinfoRepository.Instance.Find(r => r.task_type == TaskType.TaskType_Box_Pallet_Measure_Out.ToString() |
| | | //&& r.task_state == TaskState.TaskState_Create.ToString()).OrderBy(r=>r.task_createtime).Take(crtacount).ToList(); |
| | | |
| | | // outboundTask.AddRange(outboundcCrteateTask); |
| | | //} |
| | | |
| | | |
| | | if (null != outboundTask && outboundTask.Count > 0) |
| | | { |
| | | List<string> fromStation = outboundTask.Select(r => r.task_fromlocationid).ToList(); |
| | | List<string> fromStation = outboundTask.Where(r=>r.task_type == TaskType.TaskType_Box_Pallet_Measure_Out.ToString()).Select(r => r.task_fromlocationid).ToList(); |
| | | fromStation.AddRange(outboundTask.Where(r => r.task_type == TaskType.TaskType_Box_Pallet_Measure_Back.ToString()).Select(r => r.task_tolocationid).ToList()); |
| | | |
| | | foreach (var item in fromStation) |
| | | { |
| | | string[] location = item.Split('-'); |
| | |
| | | listLayer.Remove(layer); |
| | | } |
| | | } |
| | | |
| | | |
| | | List<int> rgvLayer = new List<int>(); |
| | | WebResponseContent resultcontent = RGVAPIInvokeGetRgvInfo.GetRgvInfo(); |
| | | if (resultcontent.Status) |
| | |
| | | !locationId.Contains(x.location_id) && !x.location_islocked && rgvLayer.Contains(x.location_layer)).OrderBy(x => x.location_layer) |
| | | .ThenBy(x => x.location_column).FirstOrDefault(); |
| | | if (null != locationinfo) |
| | | return locationinfo; |
| | | return locationinfo; |
| | | else |
| | | locationinfo = Dt_locationinfoRepository.Instance.Find(x => x.location_state == LocationState.LocationState_Empty.ToString() && |
| | | !locationId.Contains(x.location_id) && !x.location_islocked && listLayer.Contains(x.location_layer)).OrderBy(x => x.location_layer) |
| | |
| | | |
| | | return locationinfo; |
| | | } |
| | | |
| | | //Dt_locationinfo locationinfo = Dt_locationinfoRepository.Instance.Find(x => x.location_state == LocationState.LocationState_Empty.ToString() && |
| | | //!locationId.Contains(x.location_id) && !x.location_islocked).OrderBy(x => x.location_layer).ThenBy(x => x.location_column).FirstOrDefault(); |
| | | //if (null != locationinfo) |
| | | // return locationinfo; |
| | | throw new Exception("ææ è´§ä½å¯åé
"); |
| | | } |
| | | } |