update composer
This commit is contained in:
parent
3ac3c884f0
commit
bc1c6b85bc
@ -5,9 +5,9 @@ php_version: "8.2"
|
|||||||
webserver_type: apache-fpm
|
webserver_type: apache-fpm
|
||||||
router_http_port: "80"
|
router_http_port: "80"
|
||||||
router_https_port: "443"
|
router_https_port: "443"
|
||||||
xdebug_enabled: false
|
xdebug_enabled: true
|
||||||
additional_hostnames: []
|
additional_hostnames: [ ]
|
||||||
additional_fqdns: []
|
additional_fqdns: [ ]
|
||||||
database:
|
database:
|
||||||
type: mariadb
|
type: mariadb
|
||||||
version: "10.4"
|
version: "10.4"
|
||||||
@ -15,7 +15,7 @@ nfs_mount_enabled: false
|
|||||||
mutagen_enabled: false
|
mutagen_enabled: false
|
||||||
use_dns_when_possible: true
|
use_dns_when_possible: true
|
||||||
composer_version: "2"
|
composer_version: "2"
|
||||||
web_environment: []
|
web_environment: [ ]
|
||||||
nodejs_version: "16"
|
nodejs_version: "16"
|
||||||
|
|
||||||
# Key features of ddev's config.yaml:
|
# Key features of ddev's config.yaml:
|
||||||
|
798
composer.lock
generated
798
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -27,6 +27,9 @@ class SlackNotifySubscriber implements EventSubscriberInterface
|
|||||||
public function __construct(string $slackWebhookUrl, ProductRepository $productRepository, StockRepository $stockRepository, WarehouseRepository $warehouseRepository)
|
public function __construct(string $slackWebhookUrl, ProductRepository $productRepository, StockRepository $stockRepository, WarehouseRepository $warehouseRepository)
|
||||||
{
|
{
|
||||||
$this->slackWebhookUrl = $slackWebhookUrl;
|
$this->slackWebhookUrl = $slackWebhookUrl;
|
||||||
|
$this->productRepository = $productRepository;
|
||||||
|
$this->stockRepository = $stockRepository;
|
||||||
|
$this->warehouseRepository = $warehouseRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getSubscribedEvents(): array
|
public static function getSubscribedEvents(): array
|
||||||
@ -44,7 +47,6 @@ class SlackNotifySubscriber implements EventSubscriberInterface
|
|||||||
public function sendSlack(ViewEvent $event): void
|
public function sendSlack(ViewEvent $event): void
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
$order = $event->getControllerResult();
|
$order = $event->getControllerResult();
|
||||||
$method = $event->getRequest()->getMethod();
|
$method = $event->getRequest()->getMethod();
|
||||||
|
|
||||||
@ -53,21 +55,20 @@ class SlackNotifySubscriber implements EventSubscriberInterface
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if (is_array($order->getData()[0]['positions'] != null)) {
|
||||||
foreach ($order->getData()[0]['positions'] as $item) {
|
foreach ($order->getData()[0]['positions'] as $item) {
|
||||||
if ($item['menge'] > 0 && strlen($item['sku']) > 0) {
|
if ($item['menge'] > 0) {
|
||||||
|
|
||||||
$warehouse = $this->getWarehouseByGtin($item['sku']);
|
$warehouse = $this->getWarehouseByGtin($item['gtin']);
|
||||||
|
|
||||||
$slack = new Client($this->slackWebhookUrl, [
|
$slack = new Client($this->slackWebhookUrl, [
|
||||||
'username' => 'CDS-Notify',
|
'username' => 'CDS-Notify',
|
||||||
'channel' => '#online-verkäufe' . '_' . $warehouse,
|
'channel' => '#online_verkäufe' . '_' . $warehouse,
|
||||||
'link_names' => true,
|
'link_names' => true,
|
||||||
'icon' => ':robot_face:',
|
'icon' => ':robot_face:',
|
||||||
'allow_markdown' => true,
|
'allow_markdown' => true,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
$msg = "Bestellung {$order->getOrderId()}: \n";
|
$msg = "Bestellung {$order->getOrderId()}: \n";
|
||||||
$msg .= $item['name'];
|
$msg .= $item['name'];
|
||||||
$msg .= ' ' . $item['sku'];
|
$msg .= ' ' . $item['sku'];
|
||||||
@ -79,19 +80,27 @@ class SlackNotifySubscriber implements EventSubscriberInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $gtin
|
||||||
|
* @return string|null
|
||||||
|
*/
|
||||||
private function getWarehouseByGtin(string $gtin)
|
private function getWarehouseByGtin(string $gtin)
|
||||||
{
|
{
|
||||||
|
if ($gtin == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$product = $this->productRepository->findOneBy(['gtin' => $gtin]);
|
$product = $this->productRepository->findOneBy(['gtin' => $gtin]);
|
||||||
|
|
||||||
if ($product) {
|
if ($product) {
|
||||||
$stock = $this->stockRepository->findOneBy(['product_id' => $product->getId()]);
|
$stock = $this->stockRepository->findOneBy(['product_id' => $product->getId()]);
|
||||||
|
|
||||||
if ($stock) {
|
if ($stock) {
|
||||||
$warehouse = $this->warehouseRepository->findOneBy(['id' => $stock->getWarehouseId()]);
|
$warehouse = $this->warehouseRepository->findOneBy(['id' => $stock->getWarehouse()->getId()]);
|
||||||
return $warehouse->getName();
|
return $warehouse->getName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,15 +85,10 @@ class Jtl
|
|||||||
//Wenn Product nicht gefunden werden kann, dann setzte Bestand auf Null
|
//Wenn Product nicht gefunden werden kann, dann setzte Bestand auf Null
|
||||||
$this->logger->info('No stock for warehouse ' . $w->getName());
|
$this->logger->info('No stock for warehouse ' . $w->getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
// if ($p->getGtin() == '0193128415983') {
|
|
||||||
// dump($data[$p->getId() . $warehousesName]);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user