update slack msg

This commit is contained in:
Marko
2024-03-01 10:15:12 +01:00
parent bc1c6b85bc
commit b950238865
6 changed files with 129 additions and 53 deletions

View File

@@ -55,7 +55,6 @@ class SlackNotifySubscriber implements EventSubscriberInterface
return;
}
//if (is_array($order->getData()[0]['positions'] != null)) {
foreach ($order->getData()[0]['positions'] as $item) {
if ($item['menge'] > 0) {
@@ -70,18 +69,16 @@ class SlackNotifySubscriber implements EventSubscriberInterface
]);
$msg = "Bestellung {$order->getOrderId()}: \n";
($item['marke'] ?: $msg .= $item['marke'] . '-');
$msg .= $item['name'];
$msg .= ' ' . $item['sku'];
($item['han'] ?: $msg .= '-' . $item['han']);
$msg .= ' Menge: ' . $item['menge'] . "\n";
if ($order->getStatus() == 1) {
$slack->from('CDS-Notify')
->send($msg);
$slack->from('CDS-Notify')->send($msg);
}
}
}
// }
}
/**
@@ -90,10 +87,6 @@ class SlackNotifySubscriber implements EventSubscriberInterface
*/
private function getWarehouseByGtin(string $gtin)
{
if ($gtin == null) {
return false;
}
$product = $this->productRepository->findOneBy(['gtin' => $gtin]);
if ($product) {
@@ -108,5 +101,4 @@ class SlackNotifySubscriber implements EventSubscriberInterface
return null;
}
}

View File

@@ -79,16 +79,8 @@ class HiltesImport
*/
protected function getFiles(bool $delta = false): bool
{
$finder = Finder::create();
$finder
->in($this->currentDirPath . '/hiltes/h2c/')
->depth(0);
if ($delta) {
$finder->name('/_D/');
} else {
$finder->notName('/_D/');
}
$finder = Finder::create()->in($this->currentDirPath . '/hiltes/h2c/')->depth(0);
$delta ? $finder->name('/_D/') : $finder->notName('/_D/');
if ($finder->hasResults()) {
foreach ($finder as $file) {