| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 | <?phpnamespace App\Jobs;use App\Service\DwyService;use App\Service\LabelDealService;use Illuminate\Bus\Queueable;use Illuminate\Contracts\Queue\ShouldQueue;use Illuminate\Foundation\Bus\Dispatchable;use Illuminate\Queue\InteractsWithQueue;use Illuminate\Queue\SerializesModels;use Symfony\Component\Console\Output\ConsoleOutput;use Symfony\Component\Console\Output\OutputInterface;class LabelDealJob implements ShouldQueue{    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;    protected $data;    protected $header;    protected $id;    /**     * Create a new job instance.     *     * @return void     */    public function __construct($data,$header,$id)    {        $this->data = $data;        $this->header = $header;        $this->id = $id;    }    /**     * Execute the job.     *     * @return void     */    public function handle()    {        $data = $this->data;        $dv = $data['key'];        $return = $box_list = [];        //处理数据        LabelDealService::getInstance()->clearData($data,$return,$box_list);        //调用外部方法        $result = DwyService::getInstance()->setBoxData($this->header,$dv,$return,$box_list,$data);        //调用保存接口        LabelDealService::getInstance()->boxOut($data,$this->header,$result,$this->id);    }    protected function echoMessage(OutputInterface $output)    {        $output->writeln($this->data);    }}
 |