StationTypeService.php 1.1 KB

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