SendPieceOwnerJob.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace App\Jobs;
  3. use App\Services\WaveService;
  4. use App\WorkOrder;
  5. use Illuminate\Bus\Queueable;
  6. use Illuminate\Contracts\Queue\ShouldQueue;
  7. use Illuminate\Foundation\Bus\Dispatchable;
  8. use Illuminate\Queue\InteractsWithQueue;
  9. use Illuminate\Queue\SerializesModels;
  10. class SendPieceOwnerJob implements ShouldQueue
  11. {
  12. use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
  13. private $batchId;
  14. private $userId;
  15. private $warehouseId;
  16. private $ownerId;
  17. private $date;
  18. /**
  19. * Create a new job instance.
  20. *
  21. * @return void
  22. */
  23. public function __construct($batch_id,$userId, $warehouseId, $ownerId, $date)
  24. {
  25. $this->batchId = $batch_id;
  26. $this->userId = $userId;
  27. $this->warehouseId = $warehouseId;
  28. $this->ownerId = $ownerId;
  29. $this->date = $date;
  30. }
  31. /**
  32. * Execute the job.
  33. *
  34. * @return void
  35. */
  36. public function handle()
  37. {
  38. /** @var WaveService $service */
  39. $service = app(WaveService::class);
  40. $service->sendOwnerPiece($this->batchId,$this->userId,$this->warehouseId,$this->ownerId,$this->date);
  41. }
  42. }