1688 PO Automation Project

This commit is contained in:
Dillon Ngo
2026-01-15 04:11:52 +08:00
parent 5a8b92de5b
commit af1f4e787b
3 changed files with 4 additions and 9 deletions
@@ -75,7 +75,7 @@ class ETLPurchaseOrderTransactionV2CommandJob implements ShouldQueue
'file_count' => count($this->files),
]);
(App()->make(ETLPDFPurchaseOrderClaudeProcessor::class))->execute($this->files, $this->bookingId, $this->batchIndex !== 1, $this->isLast);
(App()->make(ETLPDFPurchaseOrderClaudeProcessor::class))->execute($this->files, $this->bookingId, $this->batchIndex !== 1);
$cacheKey = 'etl_finished_jobs_' . $this->groupId;
$lockKey = $cacheKey . '_lock';
@@ -166,8 +166,8 @@ class ImportPurchaseOrderTransactionLogic extends AbstractControllerLogic
if ($totalSize > $maxSize) {
// ETLPurchaseOrderTransactionV2CommandJob::dispatch($base64FilesEN, $request->route('id'));
$this->runAsJob($base64FilesEN, $request->route('id'));
// $this->notificationMessage = "Please dont refresh the page. The page will automatically update when the process is done.";
$this->notificationMessage = "Please refresh page in a few minutes";
$this->notificationMessage = "Please dont refresh the page. The page will automatically update when the process is done.";
// $this->notificationMessage = "Please refresh page in a few minutes";
return $this->response([]);
}
else{
@@ -49,7 +49,7 @@ class ETLPDFPurchaseOrderClaudeProcessor
* @param bool $append
* @return array|null
*/
public function execute(array $files, ?int $bookingId = null, bool $append = false, bool $broadcast = false): ?array
public function execute(array $files, ?int $bookingId = null, bool $append = false): ?array
{
$tempPaths = [];
@@ -132,7 +132,6 @@ class ETLPDFPurchaseOrderClaudeProcessor
});
Log::info('total: '. (string) $total);
Log::info('broadcast: '. json_encode($broadcast));
$object = new TransactionObject(
$billNumber,
@@ -154,10 +153,6 @@ class ETLPDFPurchaseOrderClaudeProcessor
);
$this->createPurchaseOrderTransactionProcessor->execute($booking, $object, $append);
// if($broadcast){
// ETLPurchaseOrderTransactionCompleteV2CommandJob::dispatch(true, $bookingId)->delay(now()->addSeconds(20));
// }
}
return $data;