update packinglists from vt portal jobs and schedule

This commit is contained in:
omair saleh
2021-08-30 00:23:22 +08:00
parent b5e2f47b31
commit 32d3523190
2 changed files with 12 additions and 6 deletions
@@ -162,12 +162,14 @@ class FetchLoadedContainersFromVTPortalProcessor
$marking = explode('/', explode('CIEF/', $packingList[13])[1]);
if(!array_key_exists(1, $marking)){
Log::error('unknown order number');
continue;
}
$orderNumber = $marking[1];
if(!$packingList[22]){
Log::error('no quantity');
continue;
}
@@ -175,6 +177,7 @@ class FetchLoadedContainersFromVTPortalProcessor
/** @var Order $order */
$order = $this->fetchesOrder->execute(['reference' => $orderNumber]);
} catch (ResourceNotFoundException $exception){
Log::error('order doesnt exist');
continue;
}
@@ -203,6 +206,7 @@ class FetchLoadedContainersFromVTPortalProcessor
/** @var PackingList $packingList */
$packingList = $this->createPackingListProcessor->execute($packingListObject, $order);
Log::error($packingList);
$container->packingLists()->attach($packingList);
foreach($contractObligations as $obligation) {
+8 -6
View File
@@ -21,12 +21,14 @@ class OrdersTableSeeder extends Seeder
*/
public function run()
{
FetchWarehouseReceiveListFromVTPortalJob::withChain([
new FetchLoadedContainersFromVTPortalJob,
new FetchPackingListFromVTPortalJob,
new FetchContainersStatusUpdateFromVTPortalJob,
new FetchDeliveryListFromVTPortalJob
])->dispatch();
FetchLoadedContainersFromVTPortalJob::dispatch();
//
// FetchWarehouseReceiveListFromVTPortalJob::withChain([
// new FetchLoadedContainersFromVTPortalJob,
// new FetchPackingListFromVTPortalJob,
// new FetchContainersStatusUpdateFromVTPortalJob,
// new FetchDeliveryListFromVTPortalJob
// ])->dispatch();
}
}