mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 12:33:56 +00:00
1688 PO Automation Project
This commit is contained in:
@@ -3,12 +3,14 @@
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use App\Classes\Modules\Transactions\Processors\ETLPDFPurchaseOrderClaudeProcessor;
|
||||
use App\Events\ETLPurchaseOrderTransactionCompleteEvent;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class ETLPurchaseOrderTransactionV2CommandJob implements ShouldQueue
|
||||
@@ -75,6 +77,12 @@ class ETLPurchaseOrderTransactionV2CommandJob implements ShouldQueue
|
||||
|
||||
(App()->make(ETLPDFPurchaseOrderClaudeProcessor::class))->execute($this->files, $this->bookingId, $this->batchIndex !== 1, $this->isLast);
|
||||
|
||||
$finished = Cache::increment('etl_finished_jobs_' . $this->groupId);
|
||||
if ($finished >= $this->totalBatches) {
|
||||
Log::info('All ETL jobs finished for group ' . $this->groupId . '. Last job finished at ' . now());
|
||||
event(new ETLPurchaseOrderTransactionCompleteEvent(true, $this->bookingId));
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - ETL Purchase Order Transaction. ElapsedTime: ' . $elapsedTime . '.');
|
||||
|
||||
@@ -155,9 +155,9 @@ class ETLPDFPurchaseOrderClaudeProcessor
|
||||
|
||||
$this->createPurchaseOrderTransactionProcessor->execute($booking, $object, $append);
|
||||
|
||||
if($broadcast){
|
||||
ETLPurchaseOrderTransactionCompleteV2CommandJob::dispatch(true, $bookingId)->delay(now()->addSeconds(20));
|
||||
}
|
||||
// if($broadcast){
|
||||
// ETLPurchaseOrderTransactionCompleteV2CommandJob::dispatch(true, $bookingId)->delay(now()->addSeconds(20));
|
||||
// }
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
||||
Reference in New Issue
Block a user