protected function execute(InputInterface $input, OutputInterface $output) { $utility = $this->getContainer()->get('sportmaster_utility'); if (true === $utility->isFileLockExist()) { return; } $path = $utility->getDistinationPath(); $folderName = date('d_m_Y', time()); $params['dir'] = $input->getOption('from'); $params['uploadPath'] = 'web/uploads/Sportmaster/SPM/shipment/' . $folderName; $params['distinationPath'] = $path['shipment_from_spm']; $process = new Import\EventProcessFactory($params, $this->getContainer(), 'EEM_SHIPMENT'); $process->run(); $utility->removeProcessLockFile(); }
protected function execute(InputInterface $input, OutputInterface $output) { $distinationPath = $this->getContainer()->get('sportmaster_utility')->getDistinationPath(); try { $folderName = date('d_m_Y', time()); $params['dir'] = $input->getOption('ackn_from_spm'); $params['uploadPath'] = 'web/uploads/Sportmaster/SPM/ackno/' . $folderName; $params['distinationPath'] = $distinationPath['ackn_from_spm']; $process = new Import\EventProcessFactory($params, $this->getContainer(), 'ACKN'); $process->run(); $params['dir'] = $input->getOption('po_from_spm'); $params['uploadPath'] = 'web/uploads/Sportmaster/SPM/order/' . $folderName; $params['distinationPath'] = $distinationPath['po_from_spm']; $process = new Import\EventProcessFactory($params, $this->getContainer(), 'PO'); $process->run(); $params['dir'] = $input->getOption('shipment_to_spm'); $params['uploadPath'] = 'web/uploads/Sportmaster/PAC/shipment/' . $folderName; $params['distinationPath'] = $distinationPath['shipment_to_spm']; $process = new Import\EventProcessFactory($params, $this->getContainer(), 'SCA_SHIPMENT'); $process->run(); $params['dir'] = $input->getOption('event_to_spm'); $params['uploadPath'] = 'web/uploads/Sportmaster/PAC/shipment/' . $folderName; $params['distinationPath'] = $distinationPath['event_to_spm']; $process = new Import\EventProcessFactory($params, $this->getContainer(), 'SCA_SHIPMENT'); $process->run(); $params['dir'] = $input->getOption('booking_to_spm'); $params['uploadPath'] = 'web/uploads/Sportmaster/PAC/booking/' . $folderName; $params['distinationPath'] = $distinationPath['booking_to_spm']; $process = new Import\EventProcessFactory($params, $this->getContainer(), 'SPM_BOOKING'); $process->run(); $process = new Import\ScaEventResend($this->getContainer()); $process->run(); $process = new Import\Transport($this->getContainer()); $process->run(); } catch (\Exception $ex) { $message = 'Exception occured at file: ' . $ex->getFile() . ' on line: ' . $ex->getLine() . ' message: ' . $ex->getMessage(); $logger = $this->getContainer()->get('logger'); $logger->error($message); @mail('ivan.popov@panalpina.com,stanislav.biryukov@panalpina.com', 'Exception occured', $message); } }