// src/mocks/data/financial.js // 财务数据相关的 Mock 数据 // 生成财务数据 export const generateFinancialData = (stockCode) => { const periods = ['2024-09-30', '2024-06-30', '2024-03-31', '2023-12-31']; return { stockCode, // 股票基本信息 stockInfo: { stock_code: stockCode, stock_name: stockCode === '000001' ? '平安银行' : '示例公司', industry: stockCode === '000001' ? '银行' : '制造业', list_date: '1991-04-03', market: 'SZ', // 关键指标 key_metrics: { eps: 2.72, roe: 16.23, gross_margin: 71.92, net_margin: 32.56, roa: 1.05 }, // 增长率 growth_rates: { revenue_growth: 8.2, profit_growth: 12.5, asset_growth: 5.6, equity_growth: 6.8 }, // 财务概要 financial_summary: { revenue: 162350, net_profit: 52860, total_assets: 5024560, total_liabilities: 4698880 }, // 最新业绩预告 latest_forecast: { forecast_type: '预增', content: '预计全年净利润同比增长10%-17%' } }, // 资产负债表 - 嵌套结构 balanceSheet: periods.map((period, i) => ({ period, assets: { current_assets: { cash: 856780 - i * 10000, trading_financial_assets: 234560 - i * 5000, notes_receivable: 12340 - i * 200, accounts_receivable: 45670 - i * 1000, prepayments: 8900 - i * 100, other_receivables: 23450 - i * 500, inventory: 156780 - i * 3000, contract_assets: 34560 - i * 800, other_current_assets: 67890 - i * 1500, total: 2512300 - i * 25000 }, non_current_assets: { long_term_equity_investments: 234560 - i * 5000, investment_property: 45670 - i * 1000, fixed_assets: 678900 - i * 15000, construction_in_progress: 123450 - i * 3000, right_of_use_assets: 34560 - i * 800, intangible_assets: 89012 - i * 2000, goodwill: 45670 - i * 1000, deferred_tax_assets: 12340 - i * 300, other_non_current_assets: 67890 - i * 1500, total: 2512260 - i * 25000 }, total: 5024560 - i * 50000 }, liabilities: { current_liabilities: { short_term_borrowings: 456780 - i * 10000, notes_payable: 23450 - i * 500, accounts_payable: 234560 - i * 5000, advance_receipts: 12340 - i * 300, contract_liabilities: 34560 - i * 800, employee_compensation_payable: 45670 - i * 1000, taxes_payable: 23450 - i * 500, other_payables: 78900 - i * 1500, non_current_liabilities_due_within_one_year: 89012 - i * 2000, total: 3456780 - i * 35000 }, non_current_liabilities: { long_term_borrowings: 678900 - i * 15000, bonds_payable: 234560 - i * 5000, lease_liabilities: 45670 - i * 1000, deferred_tax_liabilities: 12340 - i * 300, other_non_current_liabilities: 89012 - i * 2000, total: 1242100 - i * 13000 }, total: 4698880 - i * 48000 }, equity: { share_capital: 19405, capital_reserve: 89012 - i * 2000, surplus_reserve: 45670 - i * 1000, undistributed_profit: 156780 - i * 3000, treasury_stock: 0, other_comprehensive_income: 12340 - i * 300, parent_company_equity: 315680 - i * 1800, minority_interests: 10000 - i * 200, total: 325680 - i * 2000 } })), // 利润表 - 嵌套结构 incomeStatement: periods.map((period, i) => ({ period, revenue: { total_operating_revenue: 162350 - i * 4000, operating_revenue: 158900 - i * 3900, other_income: 3450 - i * 100 }, costs: { total_operating_cost: 93900 - i * 2500, operating_cost: 45620 - i * 1200, taxes_and_surcharges: 4560 - i * 100, selling_expenses: 12340 - i * 300, admin_expenses: 15670 - i * 400, rd_expenses: 8900 - i * 200, financial_expenses: 6810 - i * 300, interest_expense: 8900 - i * 200, interest_income: 2090 - i * 50, three_expenses_total: 34820 - i * 1000, four_expenses_total: 43720 - i * 1200, asset_impairment_loss: 1200 - i * 50, credit_impairment_loss: 2340 - i * 100 }, other_gains: { fair_value_change: 1230 - i * 50, investment_income: 3450 - i * 100, investment_income_from_associates: 890 - i * 20, exchange_income: 560 - i * 10, asset_disposal_income: 340 - i * 10 }, profit: { operating_profit: 68450 - i * 1500, total_profit: 69500 - i * 1500, income_tax_expense: 16640 - i * 300, net_profit: 52860 - i * 1200, parent_net_profit: 51200 - i * 1150, minority_profit: 1660 - i * 50, continuing_operations_net_profit: 52860 - i * 1200, discontinued_operations_net_profit: 0 }, non_operating: { non_operating_income: 1050 - i * 20, non_operating_expenses: 450 - i * 10 }, per_share: { basic_eps: 2.72 - i * 0.06, diluted_eps: 2.70 - i * 0.06 }, comprehensive_income: { other_comprehensive_income: 890 - i * 20, total_comprehensive_income: 53750 - i * 1220, parent_comprehensive_income: 52050 - i * 1170, minority_comprehensive_income: 1700 - i * 50 } })), // 现金流量表 - 嵌套结构 cashflow: periods.map((period, i) => ({ period, operating_activities: { inflow: { cash_from_sales: 178500 - i * 4500 }, outflow: { cash_for_goods: 52900 - i * 1500 }, net_flow: 125600 - i * 3000 }, investment_activities: { net_flow: -45300 - i * 1000 }, financing_activities: { net_flow: -38200 + i * 500 }, cash_changes: { net_increase: 42100 - i * 1500, ending_balance: 456780 - i * 10000 }, key_metrics: { free_cash_flow: 80300 - i * 2000 } })), // 财务指标 - 嵌套结构 financialMetrics: periods.map((period, i) => ({ period, profitability: { roe: 16.23 - i * 0.3, roe_deducted: 15.89 - i * 0.3, roe_weighted: 16.45 - i * 0.3, roa: 1.05 - i * 0.02, gross_margin: 71.92 - i * 0.5, net_profit_margin: 32.56 - i * 0.3, operating_profit_margin: 42.16 - i * 0.4, cost_profit_ratio: 115.8 - i * 1.2, ebit: 86140 - i * 1800 }, per_share_metrics: { eps: 2.72 - i * 0.06, basic_eps: 2.72 - i * 0.06, diluted_eps: 2.70 - i * 0.06, deducted_eps: 2.65 - i * 0.06, bvps: 16.78 - i * 0.1, operating_cash_flow_ps: 6.47 - i * 0.15, capital_reserve_ps: 4.59 - i * 0.1, undistributed_profit_ps: 8.08 - i * 0.15 }, growth: { revenue_growth: 8.2 - i * 0.5, net_profit_growth: 12.5 - i * 0.8, deducted_profit_growth: 11.8 - i * 0.7, parent_profit_growth: 12.3 - i * 0.75, operating_cash_flow_growth: 15.6 - i * 1.0, total_asset_growth: 5.6 - i * 0.3, equity_growth: 6.8 - i * 0.4, fixed_asset_growth: 4.2 - i * 0.2 }, operational_efficiency: { total_asset_turnover: 0.41 - i * 0.01, fixed_asset_turnover: 2.35 - i * 0.05, current_asset_turnover: 0.82 - i * 0.02, receivable_turnover: 12.5 - i * 0.3, receivable_days: 29.2 + i * 0.7, inventory_turnover: 0, // 银行无库存 inventory_days: 0, working_capital_turnover: 1.68 - i * 0.04 }, solvency: { current_ratio: 0.73 + i * 0.01, quick_ratio: 0.71 + i * 0.01, cash_ratio: 0.25 + i * 0.005, conservative_quick_ratio: 0.68 + i * 0.01, asset_liability_ratio: 93.52 + i * 0.05, interest_coverage: 8.56 - i * 0.2, cash_to_maturity_debt_ratio: 0.45 - i * 0.01, tangible_asset_debt_ratio: 94.12 + i * 0.05 }, expense_ratios: { selling_expense_ratio: 7.60 + i * 0.1, admin_expense_ratio: 9.65 + i * 0.1, financial_expense_ratio: 4.19 + i * 0.1, rd_expense_ratio: 5.48 + i * 0.1, three_expense_ratio: 21.44 + i * 0.3, four_expense_ratio: 26.92 + i * 0.4, cost_ratio: 28.10 + i * 0.2 } })), // 主营业务 mainBusiness: { by_product: [ { name: '对公业务', revenue: 68540, ratio: 42.2, yoy_growth: 6.8 }, { name: '零售业务', revenue: 81320, ratio: 50.1, yoy_growth: 11.2 }, { name: '金融市场业务', revenue: 12490, ratio: 7.7, yoy_growth: 3.5 } ], by_region: [ { name: '华南地区', revenue: 56800, ratio: 35.0, yoy_growth: 9.2 }, { name: '华东地区', revenue: 48705, ratio: 30.0, yoy_growth: 8.5 }, { name: '华北地区', revenue: 32470, ratio: 20.0, yoy_growth: 7.8 }, { name: '其他地区', revenue: 24375, ratio: 15.0, yoy_growth: 6.5 } ] }, // 业绩预告 forecast: { period: '2024', forecast_net_profit_min: 580000, // 百万元 forecast_net_profit_max: 620000, yoy_growth_min: 10.0, // % yoy_growth_max: 17.0, forecast_type: '预增', reason: '受益于零售业务快速增长及资产质量改善,预计全年业绩保持稳定增长', publish_date: '2024-10-15' }, // 行业排名 industryRank: { industry: '银行', total_companies: 42, rankings: [ { metric: '总资产', rank: 8, value: 5024560, percentile: 19 }, { metric: '营业收入', rank: 9, value: 162350, percentile: 21 }, { metric: '净利润', rank: 8, value: 52860, percentile: 19 }, { metric: 'ROE', rank: 12, value: 16.23, percentile: 29 }, { metric: '不良贷款率', rank: 18, value: 1.02, percentile: 43 } ] }, // 期间对比 periodComparison: { periods: ['Q3-2024', 'Q2-2024', 'Q1-2024', 'Q4-2023'], metrics: [ { name: '营业收入', unit: '百万元', values: [41500, 40800, 40200, 40850], yoy: [8.2, 7.8, 8.5, 9.2] }, { name: '净利润', unit: '百万元', values: [13420, 13180, 13050, 13210], yoy: [12.5, 11.2, 10.8, 12.3] }, { name: 'ROE', unit: '%', values: [16.23, 15.98, 15.75, 16.02], yoy: [1.2, 0.8, 0.5, 1.0] }, { name: 'EPS', unit: '元', values: [0.69, 0.68, 0.67, 0.68], yoy: [12.3, 11.5, 10.5, 12.0] } ] } }; };