option('date') ?: now()->subDay()->toDateString())); try { $result = $importer->import( (string) $this->argument('path'), $date, (bool) $this->option('dry-run'), ); } catch (Throwable $exception) { $this->error('网商银行账单未导入,保留原有动账明细。' . $exception->getMessage()); return self::FAILURE; } $this->table( ['公司', '账户尾号', '页面笔数', '有效笔数', '收入合计', '支出合计'], array_map(static fn (array $row): array => [ $row['company'], $row['account_last4'], $row['expected_rows'] ?? '-', $row['rows'], number_format((float) $row['income'], 2), number_format((float) $row['expense'], 2), ], $result['accounts']), ); $this->info(sprintf( '%s网商银行账单:%d 个账户,%d 笔,收入 %.2f,支出 %.2f。', $result['dry_run'] ? '校验完成,' : '已接入财务台账动账明细,', count($result['accounts']), $result['rows'], $result['income'], $result['expense'], )); return self::SUCCESS; } }