|
|
@@ -28,18 +28,20 @@ class StationTaskMaterialBoxService
|
|
|
}
|
|
|
function createByBatches(array $batches,Collection $stationTasks_toAttach): Collection
|
|
|
{
|
|
|
- return $this->stationTaskService
|
|
|
+ $stationTaskMaterialBoxes = (function () use ($batches) {
|
|
|
+ $stationTaskMaterialBoxes_listByBatch = new Collection();
|
|
|
+ foreach ($batches as $batch) {
|
|
|
+ $stationTaskMaterialBoxes_listByBatch->push(
|
|
|
+ $this->createByBatch($batch)
|
|
|
+ );
|
|
|
+ }
|
|
|
+ return $stationTaskMaterialBoxes_listByBatch;
|
|
|
+ })();
|
|
|
+ $this->stationTaskService
|
|
|
->registerSubTasks(
|
|
|
$stationTasks_toAttach,
|
|
|
- (function()use($batches){
|
|
|
- $stationTaskMaterialBoxes_listByBatch=new Collection();
|
|
|
- foreach ($batches as $batch){
|
|
|
- $stationTaskMaterialBoxes_listByBatch->push(
|
|
|
- $this->createByBatch($batch)
|
|
|
- );
|
|
|
- }
|
|
|
- return $stationTaskMaterialBoxes_listByBatch;
|
|
|
- })());
|
|
|
+ $stationTaskMaterialBoxes);
|
|
|
+ return $stationTaskMaterialBoxes;
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -48,11 +50,13 @@ class StationTaskMaterialBoxService
|
|
|
$this->materialBoxService=app('MaterialBoxService');
|
|
|
$this->stationTypeService=app('StationTypeService');
|
|
|
$this->stationService=app('StationService');
|
|
|
+
|
|
|
$stationMaterialBoxes_toCreate=new Collection();
|
|
|
$order_ids=data_get($batch['orders'],'*.id');
|
|
|
$orderCommodities=OrderCommodity::query()->with('orderBin')->whereIn('order_id',$order_ids)->get();
|
|
|
+ if($orderCommodities->isEmpty())return ;
|
|
|
+ $stationType=$this->stationTypeService->getForMaterialBox_onBatchProcess();
|
|
|
foreach ($orderCommodities as $orderCommodity){
|
|
|
- $stationType=$this->stationTypeService->getForMaterialBox();
|
|
|
$station=$this->stationService->getStation_byType($stationType['name']);
|
|
|
$materialBox=$this->materialBoxService->firstOrCreate(['code' => $orderCommodity['location']]);
|
|
|
$stationMaterialBoxes_toCreate->push([
|
|
|
@@ -84,14 +88,21 @@ class StationTaskMaterialBoxService
|
|
|
return $inserted;
|
|
|
}
|
|
|
|
|
|
- function markHasPut($taskCode,$binCode){
|
|
|
- //如果
|
|
|
- //标记箱子任务处理中
|
|
|
- //标记箱子关联的商品任务处理中
|
|
|
- //标记波次处理中
|
|
|
+ function markHasPut($stationTaskMaterialBox){
|
|
|
+ //如果任务属于服务波次的
|
|
|
+ //交给波次服务处理
|
|
|
+ }
|
|
|
+
|
|
|
+ function markHasTaken($stationTaskMaterialBox){
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- function markHasTaken($taskCode,$binCode){
|
|
|
+ function getServingTaskType(StationTaskMaterialBox $stationTaskMaterialBox){
|
|
|
+// $isBatch;
|
|
|
+// $isStoring;
|
|
|
+ if($stationTaskMaterialBox['station_task_batch_id']){
|
|
|
|
|
|
+ }
|
|
|
+ $stationTaskMaterialBox->task();
|
|
|
}
|
|
|
}
|