|
|
@@ -63,21 +63,31 @@ Class BatchService
|
|
|
public function assignTasks(Collection $batches)
|
|
|
{
|
|
|
// $this->directTemp($batches);
|
|
|
+// LogService::log(__CLASS__,__FUNCTION__,'1');
|
|
|
$this->instant($this->stationTaskBatchService,'StationTaskBatchService');
|
|
|
$this->instant($this->stationRuleBatchService,'StationRuleBatchService');
|
|
|
$this->instant($this->stationTaskService,'StationTaskService');
|
|
|
$this->instant($this->stationTaskCommodityService,'StationTaskCommodityService');
|
|
|
$this->instant($this->stationTaskMaterialBoxService,'StationTaskMaterialBoxService');
|
|
|
|
|
|
+// LogService::log(__CLASS__,__FUNCTION__,'2'.$batches->toJson());
|
|
|
+
|
|
|
$batches_shouldProcess = $this->stationRuleBatchService->getBatches_shouldProcess($batches); //按规则过滤需要的波次
|
|
|
+// LogService::log(__CLASS__,__FUNCTION__,'3 $batches_shouldProcess:'.$batches_shouldProcess->toJson());
|
|
|
if($batches_shouldProcess->isEmpty()) return;
|
|
|
|
|
|
+// LogService::log(__CLASS__,__FUNCTION__,'4');
|
|
|
$stationTasks = $this->stationTaskService->create($batches_shouldProcess->count()); //生成总任务
|
|
|
+// LogService::log(__CLASS__,__FUNCTION__,'5'.$stationTasks->toJson());
|
|
|
$stationTaskBatches=$this->stationTaskBatchService->createByBatches($batches_shouldProcess,$stationTasks); //注册波次任务
|
|
|
- $this->stationTaskCommodityService->createByBatches($batches_shouldProcess,$stationTasks); //注册商品任务
|
|
|
- $this->stationTaskMaterialBoxService->createByBatches($batches_shouldProcess,$stationTasks); //注册料箱任务
|
|
|
+// LogService::log(__CLASS__,__FUNCTION__,'6'.$stationTaskBatches->toJson());
|
|
|
+ $stationTaskCommodities=$this->stationTaskCommodityService->createByBatches($batches_shouldProcess,$stationTasks); //注册商品任务
|
|
|
+// LogService::log(__CLASS__,__FUNCTION__,'7'.$stationTaskCommodities->toJson());
|
|
|
+ $stationTaskMaterialBoxes=$this->stationTaskMaterialBoxService->createByBatches($batches_shouldProcess,$stationTasks); //注册料箱任务
|
|
|
+// LogService::log(__CLASS__,__FUNCTION__,'8'.$stationTaskMaterialBoxes->toJson());
|
|
|
|
|
|
- $this->stationTaskBatchService->runMany($stationTaskBatches);//执行波次任务
|
|
|
+ $ran=$this->stationTaskBatchService->runMany($stationTaskBatches);//执行波次任务
|
|
|
+// LogService::log(__CLASS__,__FUNCTION__,'10'.json_encode([$ran]));
|
|
|
}
|
|
|
|
|
|
// public function directTemp($batches){
|