argument('file'); $forcedMonth = trim((string) ($this->option('month') ?? '')); try { $result = $importer->import($file, $forcedMonth); $this->info(sprintf( '导入完成:%d 行,仓库简称匹配上 %d 行,跳过 %d 行;库中该表共 %d 行', $result['imported'], $result['mapped'], $result['skipped'], $result['total'], )); return self::SUCCESS; } catch (Throwable $exception) { report($exception); $this->error('入库明细导入失败:' . $exception->getMessage()); $this->warn('已保留上一版有效数据。'); return self::FAILURE; } } }