option($option)) === '') { $this->error("缺少 --{$option},完整账单导入必须提供账期和三项权威控制数。"); return self::FAILURE; } } try { $result = $importer->import( (string) $this->argument('path'), (string) $this->option('from'), (string) $this->option('to'), (int) $this->option('expected-count'), (string) $this->option('expected-income'), (string) $this->option('expected-expense'), (int) $this->option('batch'), ); } catch (RuntimeException $exception) { $this->error($exception->getMessage()); return self::FAILURE; } catch (Throwable $exception) { report($exception); $this->error('拼多多完整货款账单导入失败,详细原因已记录到受保护日志。'); return self::FAILURE; } $this->table(['状态', '账单行数', '跳过行数', '店铺数', '账单项目数', '收入', '支出', '净额', '账期'], [[ $result['status'], $result['row_count'], $result['excluded_account_rows'], $result['store_count'], $result['bill_item_count'], $result['income_total'], $result['expense_total'], $result['net_total'], $result['period_start'] . ' 至 ' . $result['period_end'], ]]); $this->line('账户类型:' . collect($result['account_type_counts']) ->map(fn (int $count, string $account): string => "{$account} {$count}") ->implode(';')); $this->line('SHA-256: ' . $result['source_sha256']); return self::SUCCESS; } }