data = $data; $this->header = $header; $this->id = $id; } public function handle() { try { $data = $this->data; $dv = $data['key']; $return = $box_list = []; //处理数据 LabelDealService::getInstance()->clearData($data,$return,$box_list); file_put_contents('msg_result.txt',date('Y-m-d H:i:s') . "清洗数据:" . json_encode($return) . PHP_EOL,8); //调用外部方法 list($lead_bind,$lead_out) = DwyService::getInstance()->setBoxData($this->header,$dv,$return,$box_list,$data); //删除限制 DwyService::getInstance()->delLimitForBoxOut($lead_bind); //调用保存接口 LabelDealService::getInstance()->boxOut($lead_bind,$lead_out,$this->header,$this->id); }catch (\Throwable $exception){ file_put_contents('msg_result.txt',date('Y-m-d H:i:s') . "队列捕获:" . $exception->getFile() . "|" . $exception->getLine() . "|" . $exception->getMessage(). "|" . $exception->getCode(). PHP_EOL,8); $this->delete(); } } protected function echoMessage(OutputInterface $output) { $output->writeln($this->data); } }