|
@@ -156,18 +156,27 @@ class StationTaskMaterialBoxService
|
|
|
->groupBy('station_task_batch_id');
|
|
->groupBy('station_task_batch_id');
|
|
|
})();
|
|
})();
|
|
|
$stationTaskMaterialBoxes->each(function(&$groupByBatch){
|
|
$stationTaskMaterialBoxes->each(function(&$groupByBatch){
|
|
|
- $taskBatchId=$groupByBatch[0]['station_task_batch_id'];
|
|
|
|
|
- $groupByBatch->each(function (&$stationTaskMaterialBox){
|
|
|
|
|
- $stationTaskMaterialBox['status']='处理队列';
|
|
|
|
|
- });
|
|
|
|
|
- $processing=$this->getProcessing_byTaskBatch($taskBatchId);
|
|
|
|
|
- if(!$processing){
|
|
|
|
|
- $groupByBatch[0]['status']='处理中';
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ ($将所以要标记的箱任务先放在队列里=function()use(&$groupByBatch){
|
|
|
|
|
+ $groupByBatch->each(function (&$stationTaskMaterialBox){
|
|
|
|
|
+ $stationTaskMaterialBox['status']='处理队列';
|
|
|
|
|
+ });
|
|
|
|
|
+ })();
|
|
|
|
|
+ ($如果之前没有处理中则标记第一个为处理目标,并持久化=function()use(&$groupByBatch){
|
|
|
|
|
+ $taskBatchId=$groupByBatch[0]['station_task_batch_id'];
|
|
|
|
|
+ $processing=$this->getProcessing_byTaskBatch($taskBatchId);
|
|
|
|
|
+ if(!$processing){
|
|
|
|
|
+ $groupByBatch[0]['status']='处理中';
|
|
|
|
|
+ $groupByBatch[0]->update();
|
|
|
|
|
+ }
|
|
|
|
|
+ })();
|
|
|
});
|
|
});
|
|
|
- $stationTaskMaterialBoxes = data_get($stationTaskMaterialBoxes, '*.*');
|
|
|
|
|
- $stationTaskMaterialBoxes = $stationTaskMaterialBoxes->toArray();
|
|
|
|
|
- StationTaskMaterialBox::query()->update($stationTaskMaterialBoxes);
|
|
|
|
|
|
|
+ ($持久化处理队列的记录=function()use(&$stationTaskMaterialBoxes){
|
|
|
|
|
+ $toArray = $stationTaskMaterialBoxes->collapse();
|
|
|
|
|
+ $toArray=$toArray->where('status','处理队列');
|
|
|
|
|
+ $ids_toUpdate = data_get($toArray, '*.id');
|
|
|
|
|
+ if(count($ids_toUpdate))
|
|
|
|
|
+ StationTaskMaterialBox::query()->where('id',$ids_toUpdate)->update(['status'=>'处理队列']);
|
|
|
|
|
+ })();
|
|
|
// StationTaskMaterialBox::query()
|
|
// StationTaskMaterialBox::query()
|
|
|
// ->whereIn('id', data_get($stationTaskMaterialBoxes, '*.id'))
|
|
// ->whereIn('id', data_get($stationTaskMaterialBoxes, '*.id'))
|
|
|
// ->update(['status'=>'处理中']);
|
|
// ->update(['status'=>'处理中']);
|