|
|
@@ -51,9 +51,10 @@ class CacheShelfTaskJob implements ShouldQueue
|
|
|
$tasks = TaskTransaction::query()->with("task")
|
|
|
->where("type","出库")->whereHas("task",function ($query){
|
|
|
$query->where("status","待处理");
|
|
|
- })->where("status",3)
|
|
|
+ })->where("status",3)->lockForUpdate()
|
|
|
->where("mark",2)->groupBy("task_id")->get(); //检索等待的队列事务来获取对应任务
|
|
|
if (!$tasks->count())return;
|
|
|
+ $tasks = $tasks->where("task.station_task_batch_id",$tasks[0]->task->station_task_batch_id);//仅处理同波次
|
|
|
if ($tasks->count()>count($available))$tasks = $tasks->slice(0,count($available));//事务过多切割部分处理
|
|
|
$toLocation = collect();
|
|
|
$task = collect();
|