instant($this->stationTaskBatchService,'StationTaskBatchService'); $request->validate( ['station_task_batch_id'=>'required|exists:station_task_batches,id'] ); if(!$request['station_task_batch_id'])return [ 'success'=>false, 'errorMsg'=>'波次任务不能为空' ]; $batchTask=StationTaskBatch::query()->find($request['station_task_batch_id']); $batchesFailed=$this->stationTaskBatchService->runMany(collect([$batchTask]), $request->input("isCacheShelf") ? 'OUTBIN-CACHE-SHELF' : 'OUTBIN-U-SHAPE-LINE');//执行波次任务 if($batchesFailed && $batchesFailed->isNotEmpty()){ return [ 'success'=>false, 'errorMsg'=>'有部分失败波次:'.$batchesFailed->toJson() ]; } return ['success'=>true]; } }