| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace App\Services;
- use App\Batch;
- use App\StationRuleBatch;
- use App\StationType;
- class StationTypeService
- {
- /** @var StationRuleBatchService $stationRuleBatchService */
- private $stationRuleBatchService;
- public function __construct()
- {
- $this->stationRuleBatchService=null;
- }
- function getByBatch(Batch $batch): StationType
- {
- $this->stationRuleBatchService=app('StationRuleBatchService');
- $stationRuleBatch=$this->stationRuleBatchService->getByBatch($batch);
- return $stationRuleBatch['stationType'];
- }
- function getForCommodity(): StationType
- {
- /** @var StationType $stationType */
- $stationType= StationType::query()->firstOrCreate(['name'=>'料箱监视器']);
- return $stationType;
- }
- function getForMaterialBox_onBatchProcess(): StationType
- {
- /** @var StationType $stationType */
- $stationType= StationType::query()->firstOrCreate(['name'=>'料箱监视器']);
- return $stationType;
- }
- }
|