StationTypeService.php 987 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App\Services;
  3. use App\Batch;
  4. use App\StationRuleBatch;
  5. use App\StationType;
  6. class StationTypeService
  7. {
  8. /** @var StationRuleBatchService $stationRuleBatchService */
  9. private $stationRuleBatchService;
  10. public function __construct()
  11. {
  12. $this->stationRuleBatchService=null;
  13. }
  14. function getByBatch(Batch $batch)
  15. {
  16. $this->app($this->stationRuleBatchService,app('StationRuleBatchService'));
  17. return StationType::query()->where('name','料箱监视器')->first();
  18. }
  19. function getForCommodity(): StationType
  20. {
  21. /** @var StationType $stationType */
  22. $stationType= StationType::query()->firstOrCreate(['name'=>'料箱监视器']);
  23. return $stationType;
  24. }
  25. function getForMaterialBox_onBatchProcess(): StationType
  26. {
  27. /** @var StationType $stationType */
  28. $stationType= StationType::query()->firstOrCreate(['name'=>'料箱监视器']);
  29. return $stationType;
  30. }
  31. }