RejectedBillCreateInstantBill.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace App\Jobs;
  3. use App\Components\ErrorPush;
  4. use App\RejectedBill;
  5. use Illuminate\Bus\Queueable;
  6. use Illuminate\Contracts\Queue\ShouldQueue;
  7. use Illuminate\Foundation\Bus\Dispatchable;
  8. use Illuminate\Queue\InteractsWithQueue;
  9. /**
  10. * @Deprecated 退货生成即时账单
  11. */
  12. class RejectedBillCreateInstantBill implements ShouldQueue
  13. {
  14. use Dispatchable, InteractsWithQueue, Queueable, ErrorPush;
  15. protected $rejected;
  16. /**
  17. * Create a new job instance.
  18. *
  19. * @return void
  20. *
  21. * @param RejectedBill $rejectedBill
  22. */
  23. public function __construct(RejectedBill $rejectedBill)
  24. {
  25. $this->rejected = $rejectedBill;
  26. }
  27. /**
  28. * Execute the job.
  29. *
  30. * @return void
  31. * @throws
  32. */
  33. public function handle()
  34. {
  35. try{
  36. app("RejectedBillService")->buildInstantBill($this->rejected);
  37. }catch(\Exception $exception){
  38. $this->push(__METHOD__."->".__LINE__,"退货单建立即时账单",$exception->getMessage()." | ".json_encode($this->rejected));
  39. }
  40. }
  41. }