ProcessCreateInstantBill.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace App\Jobs;
  3. use App\Process;
  4. use App\Services\LogService;
  5. use App\Services\ProcessService;
  6. use Illuminate\Bus\Queueable;
  7. use Illuminate\Contracts\Queue\ShouldQueue;
  8. use Illuminate\Foundation\Bus\Dispatchable;
  9. use Illuminate\Queue\InteractsWithQueue;
  10. use Illuminate\Queue\SerializesModels;
  11. /**
  12. * @Deprecated 入库单生成即时账单
  13. */
  14. class ProcessCreateInstantBill implements ShouldQueue
  15. {
  16. use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
  17. protected $process;
  18. /**
  19. * Create a new job instance.
  20. *
  21. * @param Process $process
  22. * @return void
  23. */
  24. public function __construct(Process $process)
  25. {
  26. $this->process = $process;
  27. }
  28. /**
  29. * Execute the job.
  30. *
  31. * @param ProcessService $service
  32. * @return void
  33. * @throws
  34. */
  35. public function handle(ProcessService $service)
  36. {
  37. try{
  38. $service->createInstantBill($this->process);
  39. }catch (\Exception $e){
  40. LogService::log(__METHOD__,"ERROR-入库生成即时账单",$this->process->toJson()." | ".$e->getMessage());
  41. throw new \Exception($e->getMessage());
  42. }
  43. }
  44. }