| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace App\Jobs;
- use App\Components\ErrorPush;
- use App\RejectedBill;
- use Illuminate\Bus\Queueable;
- use Illuminate\Contracts\Queue\ShouldQueue;
- use Illuminate\Foundation\Bus\Dispatchable;
- use Illuminate\Queue\InteractsWithQueue;
- class RejectedBillCreateInstantBill implements ShouldQueue
- {
- use Dispatchable, InteractsWithQueue, Queueable, ErrorPush;
- protected $rejected;
- /**
- * Create a new job instance.
- *
- * @return void
- *
- * @param RejectedBill $rejectedBill
- */
- public function __construct(RejectedBill $rejectedBill)
- {
- $this->rejected = $rejectedBill;
- }
- /**
- * Execute the job.
- *
- * @return void
- * @throws
- */
- public function handle()
- {
- try{
- app("RejectedBillService")->buildInstantBill($this->rejected);
- }catch(\Exception $exception){
- $this->push(__METHOD__."->".__LINE__,"退货单建立即时账单",$exception->getMessage()." | ".json_encode($this->rejected));
- }
- }
- }
|