them log, chinh upload
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Services\ActivityLogger;
|
||||
use App\Models\Contract;
|
||||
use App\Models\Customer;
|
||||
use App\Models\CustomerProduct;
|
||||
@@ -52,6 +53,8 @@ class ImportCskh extends Command
|
||||
$this->warn('=== DRY RUN MODE — No data will be written ===');
|
||||
}
|
||||
|
||||
$startTime = now();
|
||||
|
||||
$rows = SimpleExcelReader::create($filePath)->getRows();
|
||||
|
||||
$total = iterator_count($rows);
|
||||
@@ -94,6 +97,29 @@ class ImportCskh extends Command
|
||||
$this->newLine(2);
|
||||
$this->printSummary($rowCount, $dryRun);
|
||||
|
||||
$duration = now()->diffInSeconds($startTime);
|
||||
$modeLabel = $dryRun ? '[DRY RUN] ' : '';
|
||||
|
||||
ActivityLogger::log(
|
||||
'import',
|
||||
$modeLabel . __('feedback.log_import_done', ['file' => basename($filePath), 'rows' => $rowCount]),
|
||||
null,
|
||||
[
|
||||
'file' => $filePath,
|
||||
'total_rows' => $rowCount,
|
||||
'skipped' => $this->statsSkipped,
|
||||
'products' => $this->statsProducts,
|
||||
'customers' => $this->statsCustomers,
|
||||
'contracts' => $this->statsContracts,
|
||||
'handovers' => $this->statsHandovers,
|
||||
'services' => $this->statsServices,
|
||||
'feedbacks' => $this->statsFeedbacks,
|
||||
'interactions' => $this->statsInteractions,
|
||||
'duration_seconds' => $duration,
|
||||
'dry_run' => $dryRun,
|
||||
],
|
||||
);
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user