| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace App\Jobs;
- use Illuminate\Bus\Queueable;
- use Illuminate\Contracts\Queue\ShouldQueue;
- use Illuminate\Foundation\Bus\Dispatchable;
- use Illuminate\Queue\InteractsWithQueue;
- use Illuminate\Queue\SerializesModels;
- use Illuminate\Support\Facades\Http;
- use Illuminate\Support\Facades\Log;
- class RejectedPushJob implements ShouldQueue
- {
- use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
- public $tries = 5;
- public $timeout = 120;
- /**
- * type: 推单,上架
- * [
- * ['sku' => '75603675975072','taskNum' => 'JI20220316211', 'asnNo' => 'asn002', 'type' => '推单'],
- * ['sku' => '75603675975072','taskNum' => 'JI20220316211', 'asnNo' => 'asn002', 'type' => '推单'],
- * ]
- */
- private $pushData;
- /**
- * @param array $pushData
- */
- public function __construct(array $pushData)
- {
- $this->pushData = $pushData;
- }
- /**
- * Execute the job.
- *
- * @return void
- */
- public function handle()
- {
- $url = config('api.java.wms.rejectedPushTask.receivePush');
- $response = Http::post($url, $this->pushData);
- Log::info("推送信息!", ['res' => $response->body(), 'req' => $this->pushData]);
- }
- }
|