xiaojiao
2026-03-12 b174ea476eb1afd872985b2c261241a814e0185d
项目代码/WMS/WIDESEA_WMSServer/WIDESEA.Services/Common/GetEmptyLocationAction.cs
@@ -59,20 +59,25 @@
                }
            }
            //          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_type == TaskType.TaskType_Box_Pallet_Measure_Back.ToString())
            && (r.task_state != TaskState.TaskState_Create.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());
            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();
            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());
                outboundTask.AddRange(outboundcCrteateTask);
            }
            //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)
@@ -88,6 +93,8 @@
                    listLayer.Remove(layer);
                }
            }
            List<int> rgvLayer = new List<int>();
            WebResponseContent resultcontent = RGVAPIInvokeGetRgvInfo.GetRgvInfo();
            if (resultcontent.Status)
@@ -114,7 +121,7 @@
                    !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)