RejectedPushJob.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace App\Jobs;
  3. use Illuminate\Bus\Queueable;
  4. use Illuminate\Contracts\Queue\ShouldQueue;
  5. use Illuminate\Foundation\Bus\Dispatchable;
  6. use Illuminate\Queue\InteractsWithQueue;
  7. use Illuminate\Queue\SerializesModels;
  8. use Illuminate\Support\Facades\Http;
  9. class RejectedPushJob implements ShouldQueue
  10. {
  11. use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
  12. public $tries = 5;
  13. public $timeout = 120;
  14. /**
  15. * type: 推单,上架
  16. * [
  17. * ['logisticNumberReturn' => '75603675975072', 'asnNo' => 'asn002', 'type' => '推单'],
  18. * ['logisticNumberReturn' => '75603675975072', 'asnNo' => 'asn002', 'type' => '推单'],
  19. * ]
  20. */
  21. private $pushData;
  22. /**
  23. * @param array $pushData
  24. */
  25. public function __construct(array $pushData)
  26. {
  27. $this->pushData = $pushData;
  28. }
  29. /**
  30. * Execute the job.
  31. *
  32. * @return void
  33. */
  34. public function handle()
  35. {
  36. $url = config('api.java.wms.rejectedPushTask.receivePush');
  37. dump($url);
  38. $response = Http::post($url, $this->pushData);
  39. dump($response->body());
  40. }
  41. }