| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace App\Jobs;
- use App\Exceptions\WarningException;
- use App\Services\LaborApplyService;
- 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\Log;
- /**
- * @Deprecated 临时工分配记录
- */
- class LaborApplyRecordJob implements ShouldQueue
- {
- use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
- /** @var $service LaborApplyService */
- private $service;
- //是否为追加
- private $isAppend = false;
- /**
- * Create a new job instance.
- *
- * @return void
- */
- public function __construct(bool $isAppend = false)
- {
- $this->service = app('LaborApplyService');
- $this->isAppend = $isAppend;
- }
- /**
- * Execute the job.
- * @return void
- * @throws WarningException
- */
- public function handle()
- {
- $response = $this->service->allocationLaborToLaborCompany($this->isAppend);
- if (!$response['success']) throw new WarningException($response['error_message']);
- }
- }
|