From 461ebae47c5d8688ba8350fd89db44bcdce5f182 Mon Sep 17 00:00:00 2001
From: Marko <52066939+HeX87@users.noreply.github.com>
Date: Thu, 6 Jun 2024 10:18:48 +0200
Subject: [PATCH] add Manual
---
.idea/CdsConnector.iml | 1 +
.idea/php.xml | 1 +
README.md | 47 +++++++++++++++++++++++++++++++-------
composer.json | 3 ++-
composer.lock | 45 +++++++++++++++++++++++++++++++++++-
deploy.php | 22 ++++++++++++++++++
deploy.yaml | 21 -----------------
jtlscript/import_delta.bat | 13 +++++++++++
jtlscript/import_full.bat | 13 +++++++++++
src/Helper/Hiltes.php | 9 +++-----
10 files changed, 138 insertions(+), 37 deletions(-)
create mode 100644 deploy.php
delete mode 100644 deploy.yaml
create mode 100644 jtlscript/import_delta.bat
create mode 100644 jtlscript/import_full.bat
diff --git a/.idea/CdsConnector.iml b/.idea/CdsConnector.iml
index f671e11..9d12cc6 100644
--- a/.idea/CdsConnector.iml
+++ b/.idea/CdsConnector.iml
@@ -3,6 +3,7 @@
+
diff --git a/.idea/php.xml b/.idea/php.xml
index 672c04f..1bfa4c6 100644
--- a/.idea/php.xml
+++ b/.idea/php.xml
@@ -166,6 +166,7 @@
+
diff --git a/README.md b/README.md
index 5589560..fd39da6 100644
--- a/README.md
+++ b/README.md
@@ -9,14 +9,14 @@ Connector zwischen Hiltes und JTL Wawi
--------------
> git clone https://gitbase.de/OrangeJungle/CdsConnector.git
-
-> cd CdsConnector
+
+> cd CdsConnector
Installiere Abhängigkeiten
> make install
Erstelle .env.local Datei und füge folgendes ein:
-> DATABASE_URL=mysql://root:root@mysql:3306/cds_connector
+> DATABASE_URL=mysql://root:root@mysql:3306/cds_connector
Starte MySQL-Server:
> docker compose up
@@ -31,16 +31,47 @@ Update der Datenbank
> bin/console doctrine:migrations:execute
Starte Server
-> make dev-server
+> make dev-server
API-Übersicht
> https://127.0.0.1:8000/api
-
-Update Symphony
+
+Update Symphony
> composer update
+
# Benutzen
--------------
-Hiltes Import
-> bin/console hiltes:import
\ No newline at end of file
+Hiltes Import full Import
+Kompletter Abgleich aller Bestände
+> bin/console hiltes:import
+
+Delta Import
+Die Delta Datei baut sich über den Tag auf und enthält alle Änderungen seit dem letzten full export von Hiltes
+> bin/console hiltes:import --d
+
+# Hosting
+--------------
+
+https://cloud.iteckse.de/
+
+hier laufen 2 Cronjobs:
+
+Täglich um 01:01 Uhr der full Import
+> /home/users/orangejungle/www/bin/console hiltes:import
+
+Alle 5 Minuten der Delta Import
+> 1-56/5 0-1,2-23 * * * /home/users/orangejungle/www/bin/console hiltes:import --d
+
+# JTL
+--------------
+In Windows Aufgabenplanung die Aufgabe JTL Bestandsimport alle 5 Minuten ausgeführt
+Diese ruft das Script C:\CloudFTP\import_delta.bat auf
+
+Einmal um 01:008 Uhr läuft die Aufgabe für den komplett Import diese ruft das Script C:\CloudFTP\import_full.bat auf
+
+die Scripte sind im Order "jtlscript" zu finden
+
+# Slack
+--------------
\ No newline at end of file
diff --git a/composer.json b/composer.json
index 5f3aea5..3ea15a7 100644
--- a/composer.json
+++ b/composer.json
@@ -42,6 +42,7 @@
"symfony/yaml": "6.3.*"
},
"require-dev": {
+ "deployer/deployer": "^7.3",
"phpunit/phpunit": "^9",
"symfony/browser-kit": "6.3.*",
"symfony/css-selector": "6.3.*",
@@ -105,4 +106,4 @@
"require": "6.3.*"
}
}
-}
\ No newline at end of file
+}
diff --git a/composer.lock b/composer.lock
index 20d9595..8ba96a9 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "99e32124704ffee3e733c369423458e6",
+ "content-hash": "77d5a0ad3536fb001401c6d4748464b8",
"packages": [
{
"name": "api-platform/core",
@@ -8488,6 +8488,49 @@
}
],
"packages-dev": [
+ {
+ "name": "deployer/deployer",
+ "version": "v7.3.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/deployphp/deployer.git",
+ "reference": "3535bdb2f6360662bd95f6e26fce31dbc269af64"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/deployphp/deployer/zipball/3535bdb2f6360662bd95f6e26fce31dbc269af64",
+ "reference": "3535bdb2f6360662bd95f6e26fce31dbc269af64",
+ "shasum": ""
+ },
+ "bin": [
+ "dep"
+ ],
+ "type": "library",
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Anton Medvedev",
+ "email": "anton@medv.io"
+ }
+ ],
+ "description": "Deployment Tool",
+ "homepage": "https://deployer.org",
+ "support": {
+ "docs": "https://deployer.org/docs",
+ "issues": "https://github.com/deployphp/deployer/issues",
+ "source": "https://github.com/deployphp/deployer"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sponsors/antonmedv",
+ "type": "github"
+ }
+ ],
+ "time": "2023-11-07T10:27:12+00:00"
+ },
{
"name": "masterminds/html5",
"version": "2.8.1",
diff --git a/deploy.php b/deploy.php
new file mode 100644
index 0000000..b10a8c5
--- /dev/null
+++ b/deploy.php
@@ -0,0 +1,22 @@
+set('remote_user', 'orangejungle')
+ ->set('deploy_path', '~/CdsConnector');
+
+// Hooks
+
+after('deploy:failed', 'deploy:unlock');
\ No newline at end of file
diff --git a/deploy.yaml b/deploy.yaml
deleted file mode 100644
index 1850776..0000000
--- a/deploy.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-import:
- - recipe/symfony.php
-
-config:
- repository: 'https://mmoeller:Linchen90@gitbase.de/OrangeJungle/CdsConnector.git'
-
-
-
-hosts:
- 192.168.178.95:
- alias: 'staging'
- remote_user: pi
- deploy_path: '~/CdsConnector'
-
-tasks:
- build:
- - cd: '{{release_path}}'
- - run: 'make install'
-
-after:
- deploy:failed: deploy:unlock
diff --git a/jtlscript/import_delta.bat b/jtlscript/import_delta.bat
new file mode 100644
index 0000000..fd4a350
--- /dev/null
+++ b/jtlscript/import_delta.bat
@@ -0,0 +1,13 @@
+@echo off
+
+set "AMEISE_PATH=C:\Program Files (x86)\JTL-Software\JTL-wawi-ameise.exe"
+set "AMEISE_ARGS=-s c12465.servers.ecomdata.de\JTLWAWI -d eazybusiness -u sa -p IuCWdx-4xCo3 -t IMP10 --loglevel=5 --log=stock-standard_delta.log --writeLogAtEnd"
+
+
+"%AMEISE_PATH%" %AMEISE_ARGS% -i stock_standard_delta.csv
+
+set "AMEISE_ARGS=-s c12465.servers.ecomdata.de\JTLWAWI -d eazybusiness -u sa -p IuCWdx-4xCo3 -t IMP16 --loglevel=5 --log=stock-wms_delta.log --writeLogAtEnd"
+
+"%AMEISE_PATH%" %AMEISE_ARGS% -i stock_wms_delta.csv
+
+exit
\ No newline at end of file
diff --git a/jtlscript/import_full.bat b/jtlscript/import_full.bat
new file mode 100644
index 0000000..7491442
--- /dev/null
+++ b/jtlscript/import_full.bat
@@ -0,0 +1,13 @@
+@echo off
+
+set "AMEISE_PATH=C:\Program Files (x86)\JTL-Software\JTL-wawi-ameise.exe"
+set "AMEISE_ARGS=-s c12465.servers.ecomdata.de\JTLWAWI -d eazybusiness -u sa -p IuCWdx-4xCo3 -t IMP10"
+
+
+"%AMEISE_PATH%" %AMEISE_ARGS% -i stock_standard.csv >> stock-standard_full.log
+
+set "AMEISE_ARGS=-s c12465.servers.ecomdata.de\JTLWAWI -d eazybusiness -u sa -p IuCWdx-4xCo3 -t IMP16"
+
+"%AMEISE_PATH%" %AMEISE_ARGS% -i stock_wms.csv >> stock-wms_full.log
+
+exit
\ No newline at end of file
diff --git a/src/Helper/Hiltes.php b/src/Helper/Hiltes.php
index 8203d2b..e5de590 100644
--- a/src/Helper/Hiltes.php
+++ b/src/Helper/Hiltes.php
@@ -173,7 +173,7 @@ class Hiltes
);
//$data = $this->createJson($arr);
- $this->logger->info(var_export($arr, 1));
+ //$this->logger->info(var_export($arr, 1));
try {
return $this->sendOrderToHiltes($arr);
@@ -350,10 +350,7 @@ class Hiltes
public function sendOrderToHiltes($data): bool
{
$url = $this->hiltesApiUrl . '/api/WebSale/import';
-
- $param = $data;
- //dump($param);
- $r = $this->sendToHiltes($url, $param, true);
+ $r = $this->sendToHiltes($url, $data, true);
//$r = true;
if ($r === false) {
@@ -366,7 +363,7 @@ class Hiltes
try {
$order = $this->orderRepository->findOneBy(array('orderId' => $data['SaleList'][0]['OrderNumber']));
$order->setStatus(3);
- $order->setHiltes(var_export($r, 1));
+ $order->setHiltes($t);
$this->orderRepository->update($order, true);
} catch (\Exception $exception) {