add fixed export
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Marko
2023-11-24 11:36:51 +01:00
parent 6e98fca7ad
commit 16aac3adc6
7 changed files with 193 additions and 94 deletions

View File

@@ -14,6 +14,7 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\HttpKernel\KernelInterface;
#[AsCommand(
name: 'hiltes:import',
@@ -50,11 +51,11 @@ class HiltesImportCommand extends Command
$io = new SymfonyStyle($input, $output);
$io->success('Start Hiltes Import');
$rootPath = $this->GetProjectRootDir();
/**
* @var HiltesImport
*/
$hiltesImport = new HiltesImport($this->productRepository, $this->warehouseRepository, $this->stockRepository, $this->logger);
$hiltesImport = new HiltesImport($this->productRepository, $this->warehouseRepository, $this->stockRepository, $this->logger, $rootPath);
$hiltesImport->startImport($input->getOption('delta'));
@@ -66,13 +67,31 @@ class HiltesImportCommand extends Command
} else {
$io->info('Start Hiltes Push JTL');
$jtl = new Jtl($this->productRepository, $this->warehouseRepository, $this->stockRepository, $this->logger);
$jtl = new Jtl($this->productRepository, $this->warehouseRepository, $this->stockRepository, $this->logger, $rootPath);
$jtl->createExportFile($jtl->getProducts(0), 'standard');
$jtl->createExportFile($jtl->getProducts(8), 'wms');
//Export für Standartlager
dump("Standard");
$jtl->createExportFile($jtl->getProducts(['1', '3', '5', '10']), 'standard');
dump("WMS");
//Export für WMS Lager
$jtl->createExportFile($jtl->getProducts(['8']), 'wms');
$io->success('Done.');
return Command::SUCCESS;
}
}
public static function GetProjectRootDir()
{
$dirFullPath = __DIR__;
//PRE: $dirs = /app/public/src/Helpers
$dirs = explode('/', $dirFullPath);
array_pop($dirs); //remove last element in array ('Helpers')
array_pop($dirs); //remove the next last element from array ('src')
//POST: $dirs = /app/public
return implode('/', $dirs);
}
}