Compare commits

..

2 Commits

Author SHA1 Message Date
xucheng
a6fa109a1c 增加了商誉占比 2026-01-13 20:31:27 +08:00
xucheng
b2f2833025 增强google search 2026-01-13 19:46:39 +08:00
7 changed files with 210 additions and 18 deletions

1
.gitignore vendored
View File

@ -27,3 +27,4 @@ data/
reports/ reports/
logs/ logs/
tests/ tests/
backend/server.log

View File

@ -47,13 +47,17 @@ async def chat_with_ai(request: ChatRequest, db: AsyncSession = Depends(get_db))
# Search Configuration & System Prompt # Search Configuration & System Prompt
tools = [] tools = []
final_system_prompt = request.system_prompt or ""
if request.use_google_search: if request.use_google_search:
tools.append(types.Tool(google_search=types.GoogleSearch())) tools.append(types.Tool(google_search=types.GoogleSearch()))
# Inject strong instruction to force search usage
final_system_prompt += "\n\n[SYSTEM INSTRUCTION] You have access to Google Search. You MUST use it to verify any data or find the latest information before answering. Do not rely solely on your internal knowledge."
config = types.GenerateContentConfig( config = types.GenerateContentConfig(
tools=tools if tools else None, tools=tools if tools else None,
temperature=0.1, temperature=0.1,
system_instruction=request.system_prompt system_instruction=final_system_prompt
) )
start_time = time.time() start_time = time.time()

View File

@ -2806,3 +2806,161 @@ JSON_END
2026-01-13 14:07:21,494 - httpx - INFO - HTTP Request: POST https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse "HTTP/1.1 200 OK" 2026-01-13 14:07:21,494 - httpx - INFO - HTTP Request: POST https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse "HTTP/1.1 200 OK"
2026-01-13 14:07:48,005 - google_genai.models - INFO - AFC is enabled with max remote calls: 10. 2026-01-13 14:07:48,005 - google_genai.models - INFO - AFC is enabled with max remote calls: 10.
2026-01-13 14:08:04,297 - httpx - INFO - HTTP Request: POST https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse "HTTP/1.1 200 OK" 2026-01-13 14:08:04,297 - httpx - INFO - HTTP Request: POST https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse "HTTP/1.1 200 OK"
2026-01-13 19:33:03,102 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=93, Msg=正在初始化数据获取..., Progress=0%
2026-01-13 19:33:04,166 - app.clients.bloomberg_client - INFO - Connecting to Jupyter at http://192.168.3.161:8888...
2026-01-13 19:33:07,038 - app.clients.bloomberg_client - INFO - ✅ Authentication successful.
2026-01-13 19:33:07,064 - app.clients.bloomberg_client - INFO - ✅ Found existing kernel: bc27f3b1-b028-434a-99fa-c1cad4495a87 (remote_env)
2026-01-13 19:33:08,114 - app.clients.bloomberg_client - INFO - ✅ WebSocket connected.
2026-01-13 19:33:08,115 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=93, Msg=数据源连接成功, Progress=10%
2026-01-13 19:33:09,354 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=93, Msg=正在连接 Bloomberg 终端..., Progress=20%
2026-01-13 19:33:09,827 - app.clients.bloomberg_client - INFO - 🚀 Starting fetch for: 7741 JP Equity
2026-01-13 19:33:09,828 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=93, Msg=Starting Bloomberg session..., Progress=20%
2026-01-13 19:33:10,428 - app.clients.bloomberg_client - INFO - Using auto-detected currency: JPY
2026-01-13 19:33:10,429 - app.clients.bloomberg_client - INFO - Fetching Basic Data...
2026-01-13 19:33:10,429 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=93, Msg=Fetching Company Basic Info..., Progress=27%
2026-01-13 19:33:12,439 - app.clients.bloomberg_client - INFO - REMOTE RAW OUTPUT: JSON_START
[{"Company_code": "7741 JP Equity", "update_date": "2026-01-13 19:33:13", "currency": "JPY", "indicator": "company_name", "value": "HOYA CORP", "value_date": "2026-01-13 19:33:13"}, {"Company_code": "7741 JP Equity", "update_date": "2026-01-13 19:33:13", "currency": "JPY", "indicator": "pe_ratio", "value": "40.710103933692935", "value_date": "2026-01-13 19:33:13"}, {"Company_code": "7741 JP Equity", "update_date": "2026-01-13 19:33:13", "currency": "JPY", "indicator": "pb_ratio", "value": "8.375901653285727", "value_date": "2026-01-13 19:33:13"}, {"Company_code": "7741 JP Equity", "update_date": "2026-01-13 19:33:13", "currency": "JPY", "indicator": "Rev_Abroad", "value": "78.89373602822991", "value_date": "2026-01-13 19:33:13"}, {"Company_code": "7741 JP Equity", "update_date": "2026-01-13 19:33:13", "currency": "JPY", "indicator": "dividend_yield", "value": "0.9695011108866897", "value_date": "2026-01-13 19:33:13"}, {"Company_code": "7741 JP Equity", "update_date": "2026-0
2026-01-13 19:33:12,440 - app.clients.bloomberg_client - INFO - ✅ Parsed 6 items from remote.
2026-01-13 19:33:12,440 - app.clients.bloomberg_client - INFO - DEBUG: basic_data before save: [{'Company_code': '7741 JP Equity', 'update_date': '2026-01-13 19:33:13', 'currency': 'JPY', 'indicator': 'company_name', 'value': 'HOYA CORP', 'value_date': '2026-01-13 19:33:13'}, {'Company_code': '7741 JP Equity', 'update_date': '2026-01-13 19:33:13', 'currency': 'JPY', 'indicator': 'pe_ratio', 'value': '40.710103933692935', 'value_date': '2026-01-13 19:33:13'}, {'Company_code': '7741 JP Equity', 'update_date': '2026-01-13 19:33:13', 'currency': 'JPY', 'indicator': 'pb_ratio', 'value': '8.375901653285727', 'value_date': '2026-01-13 19:33:13'}, {'Company_code': '7741 JP Equity', 'update_date': '2026-01-13 19:33:13', 'currency': 'JPY', 'indicator': 'Rev_Abroad', 'value': '78.89373602822991', 'value_date': '2026-01-13 19:33:13'}, {'Company_code': '7741 JP Equity', 'update_date': '2026-01-13 19:33:13', 'currency': 'JPY', 'indicator': 'dividend_yield', 'value': '0.9695011108866897', 'value_date': '2026-01-13 19:33:13'}, {'Company_code': '7741 JP Equity', 'update_date': '2026-01-13 19:33:13', 'currency': 'JPY', 'indicator': 'market_cap', 'value': '8377446.4916', 'value_date': '2026-01-13 19:33:13'}]
2026-01-13 19:33:14,193 - app.clients.bloomberg_client - INFO - ✅ Saved 6 records to database.
2026-01-13 19:33:14,193 - app.clients.bloomberg_client - INFO - Fetching Currency Data...
2026-01-13 19:33:14,194 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=93, Msg=正在获取货币指标 (JPY)..., Progress=41%
2026-01-13 19:33:15,528 - app.clients.bloomberg_client - INFO - REMOTE RAW OUTPUT: JSON_START
[{"Company_code": "7741 JP Equity", "update_date": "2026-01-13 19:33:14", "currency": "JPY", "indicator": "Revenue", "value": "505714.0", "value_date": "2016-03-31"}, {"Company_code": "7741 JP Equity", "update_date": "2026-01-13 19:33:14", "currency": "JPY", "indicator": "Net_Income", "value": "93175.0", "value_date": "2016-03-31"}, {"Company_code": "7741 JP Equity", "update_date": "2026-01-13 19:33:14", "currency": "JPY", "indicator": "Cash_From_Operating", "value": "131889.0", "value_date": "2016-03-31"}, {"Company_code": "7741 JP Equity", "update_date": "2026-01-13 19:33:14", "currency": "JPY", "indicator": "Capital_Expenditure", "value": "-18184.0", "value_date": "2016-03-31"}, {"Company_code": "7741 JP Equity", "update_date": "2026-01-13 19:33:14", "currency": "JPY", "indicator": "Free_Cash_Flow", "value": "113705.0", "value_date": "2016-03-31"}, {"Company_code": "7741 JP Equity", "update_date": "2026-01-13 19:33:14", "currency": "JPY", "indicator": "Dividends_Paid", "v
2026-01-13 19:33:15,529 - app.clients.bloomberg_client - INFO - ✅ Parsed 250 items from remote.
2026-01-13 19:33:38,844 - app.clients.bloomberg_client - INFO - ✅ Saved 250 records to database.
2026-01-13 19:33:38,846 - app.clients.bloomberg_client - INFO - Fetching Non-Currency Data...
2026-01-13 19:33:38,846 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=93, Msg=正在获取非货币指标..., Progress=55%
2026-01-13 19:33:40,114 - app.clients.bloomberg_client - INFO - REMOTE RAW OUTPUT: JSON_START
[{"Company_code": "7741 JP Equity", "update_date": "2026-01-13 19:33:39", "currency": "JPY", "indicator": "ROE", "value": "17.2024", "value_date": "2016-03-31"}, {"Company_code": "7741 JP Equity", "update_date": "2026-01-13 19:33:39", "currency": "JPY", "indicator": "ROA", "value": "13.575", "value_date": "2016-03-31"}, {"Company_code": "7741 JP Equity", "update_date": "2026-01-13 19:33:39", "currency": "JPY", "indicator": "ROCE", "value": "17.5001", "value_date": "2016-03-31"}, {"Company_code": "7741 JP Equity", "update_date": "2026-01-13 19:33:39", "currency": "JPY", "indicator": "Gross_Margin", "value": "82.1978", "value_date": "2016-03-31"}, {"Company_code": "7741 JP Equity", "update_date": "2026-01-13 19:33:39", "currency": "JPY", "indicator": "EBITDA_margin", "value": "30.539", "value_date": "2016-03-31"}, {"Company_code": "7741 JP Equity", "update_date": "2026-01-13 19:33:39", "currency": "JPY", "indicator": "Net_Profit_Margin", "value": "18.4244", "value_date": "2016
2026-01-13 19:33:40,115 - app.clients.bloomberg_client - INFO - ✅ Parsed 200 items from remote.
2026-01-13 19:33:56,672 - app.clients.bloomberg_client - INFO - ✅ Saved 200 records to database.
2026-01-13 19:33:56,673 - app.clients.bloomberg_client - INFO - Fetching Price Data (Aligned)...
2026-01-13 19:33:56,673 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=93, Msg=正在获取价格指标..., Progress=69%
2026-01-13 19:33:57,442 - app.clients.bloomberg_client - INFO - Found 10 revenue reporting dates. Fetching aligned price data...
2026-01-13 19:34:09,872 - app.clients.bloomberg_client - INFO - REMOTE RAW OUTPUT: JSON_START
[{"Company_code": "7741 JP Equity", "update_date": "2026-01-13 19:33:57", "currency": "JPY", "indicator": "Last_Price", "value": "16780.0", "value_date": "2025-03-31"}, {"Company_code": "7741 JP Equity", "update_date": "2026-01-13 19:33:57", "currency": "JPY", "indicator": "Market_Cap", "value": "5803517.7116", "value_date": "2025-03-31"}, {"Company_code": "7741 JP Equity", "update_date": "2026-01-13 19:33:57", "currency": "JPY", "indicator": "Dividend_Yield", "value": "0.9535", "value_date": "2025-03-31"}, {"Company_code": "7741 JP Equity", "update_date": "2026-01-13 19:33:57", "currency": "JPY", "indicator": "Last_Price", "value": "18740.0", "value_date": "2024-03-31"}, {"Company_code": "7741 JP Equity", "update_date": "2026-01-13 19:33:57", "currency": "JPY", "indicator": "Market_Cap", "value": "6576966.4128", "value_date": "2024-03-31"}, {"Company_code": "7741 JP Equity", "update_date": "2026-01-13 19:33:57", "currency": "JPY", "indicator": "Dividend_Yield", "value": "0.
2026-01-13 19:34:09,873 - app.clients.bloomberg_client - INFO - ✅ Parsed 30 items from remote.
2026-01-13 19:34:14,847 - app.clients.bloomberg_client - INFO - ✅ Saved 30 records to database.
2026-01-13 19:34:14,848 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=93, Msg=Finalizing data..., Progress=82%
2026-01-13 19:34:15,878 - app.clients.bloomberg_client - INFO - ✅ Cleanup and View Refresh completed.
2026-01-13 19:34:15,881 - app.clients.bloomberg_client - INFO - ✅ Completed processing for 7741 JP Equity
2026-01-13 19:34:15,881 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=93, Msg=Bloomberg data sync complete, Progress=90%
2026-01-13 19:34:16,122 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=93, Msg=Bloomberg 数据同步完成, Progress=100%
2026-01-13 19:34:53,406 - google_genai.models - INFO - AFC is enabled with max remote calls: 10.
2026-01-13 19:34:59,317 - httpx - INFO - HTTP Request: POST https://generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:streamGenerateContent?alt=sse "HTTP/1.1 200 OK"
2026-01-13 19:37:11,575 - google_genai.models - INFO - AFC is enabled with max remote calls: 10.
2026-01-13 19:37:16,120 - httpx - INFO - HTTP Request: POST https://generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:streamGenerateContent?alt=sse "HTTP/1.1 200 OK"
2026-01-13 19:39:08,494 - google_genai.models - INFO - AFC is enabled with max remote calls: 10.
2026-01-13 19:39:11,414 - httpx - INFO - HTTP Request: POST https://generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:streamGenerateContent?alt=sse "HTTP/1.1 200 OK"
2026-01-13 19:39:28,515 - app.main - INFO - 🔍 [搜索] 开始搜索股票: 爱尔康
2026-01-13 19:39:28,517 - app.main - INFO - 🤖 [搜索-LLM] 调用 gemini-2.5-flash 进行股票搜索
2026-01-13 19:39:28,518 - google_genai.models - INFO - AFC is enabled with max remote calls: 10.
2026-01-13 19:39:35,569 - httpx - INFO - HTTP Request: POST https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent "HTTP/1.1 200 OK"
2026-01-13 19:39:35,576 - app.main - INFO - ✅ [搜索-LLM] 模型响应完成, 耗时: 7.06秒, Tokens: prompt=166, completion=72, total=238
2026-01-13 19:39:35,576 - app.main - INFO - ✅ [搜索] 搜索完成, 找到 1 个结果, 总耗时: 7.06秒
2026-01-13 19:39:41,162 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=94, Msg=正在初始化数据获取..., Progress=0%
2026-01-13 19:39:41,734 - app.clients.bloomberg_client - INFO - Connecting to Jupyter at http://192.168.3.161:8888...
2026-01-13 19:39:42,491 - app.clients.bloomberg_client - INFO - ✅ Authentication successful.
2026-01-13 19:39:42,516 - app.clients.bloomberg_client - INFO - ✅ Found existing kernel: bc27f3b1-b028-434a-99fa-c1cad4495a87 (remote_env)
2026-01-13 19:39:42,761 - app.clients.bloomberg_client - INFO - ✅ WebSocket connected.
2026-01-13 19:39:42,761 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=94, Msg=数据源连接成功, Progress=10%
2026-01-13 19:39:43,954 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=94, Msg=正在连接 Bloomberg 终端..., Progress=20%
2026-01-13 19:39:45,416 - app.clients.bloomberg_client - INFO - 🚀 Starting fetch for: ALC US Equity
2026-01-13 19:39:45,417 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=94, Msg=Starting Bloomberg session..., Progress=20%
2026-01-13 19:39:46,165 - app.clients.bloomberg_client - INFO - Using auto-detected currency: USD
2026-01-13 19:39:46,165 - app.clients.bloomberg_client - INFO - Fetching Basic Data...
2026-01-13 19:39:46,166 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=94, Msg=Fetching Company Basic Info..., Progress=27%
2026-01-13 19:39:48,993 - app.clients.bloomberg_client - INFO - REMOTE RAW OUTPUT: JSON_START
[{"Company_code": "ALC US Equity", "update_date": "2026-01-13 19:39:49", "currency": "USD", "indicator": "company_name", "value": "ALCON INC", "value_date": "2026-01-13 19:39:49"}, {"Company_code": "ALC US Equity", "update_date": "2026-01-13 19:39:49", "currency": "USD", "indicator": "pe_ratio", "value": "38.14150972186395", "value_date": "2026-01-13 19:39:49"}, {"Company_code": "ALC US Equity", "update_date": "2026-01-13 19:39:49", "currency": "USD", "indicator": "pb_ratio", "value": "1.7983533595854697", "value_date": "2026-01-13 19:39:49"}, {"Company_code": "ALC US Equity", "update_date": "2026-01-13 19:39:49", "currency": "USD", "indicator": "Rev_Abroad", "value": "99.20290586217334", "value_date": "2026-01-13 19:39:49"}, {"Company_code": "ALC US Equity", "update_date": "2026-01-13 19:39:49", "currency": "USD", "indicator": "dividend_yield", "value": "0.41175859416147403", "value_date": "2026-01-13 19:39:49"}, {"Company_code": "ALC US Equity", "update_date": "2026-01-13
2026-01-13 19:39:48,994 - app.clients.bloomberg_client - INFO - ✅ Parsed 6 items from remote.
2026-01-13 19:39:48,994 - app.clients.bloomberg_client - INFO - DEBUG: basic_data before save: [{'Company_code': 'ALC US Equity', 'update_date': '2026-01-13 19:39:49', 'currency': 'USD', 'indicator': 'company_name', 'value': 'ALCON INC', 'value_date': '2026-01-13 19:39:49'}, {'Company_code': 'ALC US Equity', 'update_date': '2026-01-13 19:39:49', 'currency': 'USD', 'indicator': 'pe_ratio', 'value': '38.14150972186395', 'value_date': '2026-01-13 19:39:49'}, {'Company_code': 'ALC US Equity', 'update_date': '2026-01-13 19:39:49', 'currency': 'USD', 'indicator': 'pb_ratio', 'value': '1.7983533595854697', 'value_date': '2026-01-13 19:39:49'}, {'Company_code': 'ALC US Equity', 'update_date': '2026-01-13 19:39:49', 'currency': 'USD', 'indicator': 'Rev_Abroad', 'value': '99.20290586217334', 'value_date': '2026-01-13 19:39:49'}, {'Company_code': 'ALC US Equity', 'update_date': '2026-01-13 19:39:49', 'currency': 'USD', 'indicator': 'dividend_yield', 'value': '0.41175859416147403', 'value_date': '2026-01-13 19:39:49'}, {'Company_code': 'ALC US Equity', 'update_date': '2026-01-13 19:39:49', 'currency': 'USD', 'indicator': 'market_cap', 'value': '40405.742', 'value_date': '2026-01-13 19:39:49'}]
2026-01-13 19:39:52,098 - app.clients.bloomberg_client - INFO - ✅ Saved 6 records to database.
2026-01-13 19:39:52,101 - app.clients.bloomberg_client - INFO - Fetching Currency Data...
2026-01-13 19:39:52,102 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=94, Msg=正在获取货币指标 (USD)..., Progress=41%
2026-01-13 19:39:54,081 - app.clients.bloomberg_client - INFO - REMOTE RAW OUTPUT: JSON_START
[{"Company_code": "ALC US Equity", "update_date": "2026-01-13 19:39:52", "currency": "USD", "indicator": "Revenue", "value": "6596.0", "value_date": "2016-12-31"}, {"Company_code": "ALC US Equity", "update_date": "2026-01-13 19:39:52", "currency": "USD", "indicator": "Net_Income", "value": "-170.0", "value_date": "2016-12-31"}, {"Company_code": "ALC US Equity", "update_date": "2026-01-13 19:39:52", "currency": "USD", "indicator": "Cash_From_Operating", "value": "1245.0", "value_date": "2016-12-31"}, {"Company_code": "ALC US Equity", "update_date": "2026-01-13 19:39:52", "currency": "USD", "indicator": "Capital_Expenditure", "value": "-476.0", "value_date": "2016-12-31"}, {"Company_code": "ALC US Equity", "update_date": "2026-01-13 19:39:52", "currency": "USD", "indicator": "Free_Cash_Flow", "value": "769.0", "value_date": "2016-12-31"}, {"Company_code": "ALC US Equity", "update_date": "2026-01-13 19:39:52", "currency": "USD", "indicator": "Dividends_Paid", "value": "0.0", "v
2026-01-13 19:39:54,082 - app.clients.bloomberg_client - INFO - ✅ Parsed 194 items from remote.
2026-01-13 19:40:15,455 - app.clients.bloomberg_client - INFO - ✅ Saved 194 records to database.
2026-01-13 19:40:15,457 - app.clients.bloomberg_client - INFO - Fetching Non-Currency Data...
2026-01-13 19:40:15,457 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=94, Msg=正在获取非货币指标..., Progress=55%
2026-01-13 19:40:17,637 - app.clients.bloomberg_client - INFO - REMOTE RAW OUTPUT: JSON_START
[{"Company_code": "ALC US Equity", "update_date": "2026-01-13 19:40:16", "currency": "USD", "indicator": "Gross_Margin", "value": "47.1649", "value_date": "2016-12-31"}, {"Company_code": "ALC US Equity", "update_date": "2026-01-13 19:40:16", "currency": "USD", "indicator": "EBITDA_margin", "value": "19.6938", "value_date": "2016-12-31"}, {"Company_code": "ALC US Equity", "update_date": "2026-01-13 19:40:16", "currency": "USD", "indicator": "Net_Profit_Margin", "value": "-2.5773", "value_date": "2016-12-31"}, {"Company_code": "ALC US Equity", "update_date": "2026-01-13 19:40:16", "currency": "USD", "indicator": "Tax_Rate", "value": "0.1792", "value_date": "2016-12-31"}, {"Company_code": "ALC US Equity", "update_date": "2026-01-13 19:40:16", "currency": "USD", "indicator": "Gross_Margin", "value": "47.1731", "value_date": "2017-12-31"}, {"Company_code": "ALC US Equity", "update_date": "2026-01-13 19:40:16", "currency": "USD", "indicator": "EBITDA_margin", "value": "18.5071", "
2026-01-13 19:40:17,638 - app.clients.bloomberg_client - INFO - ✅ Parsed 123 items from remote.
2026-01-13 19:40:29,712 - app.clients.bloomberg_client - INFO - ✅ Saved 123 records to database.
2026-01-13 19:40:29,713 - app.clients.bloomberg_client - INFO - Fetching Price Data (Aligned)...
2026-01-13 19:40:29,713 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=94, Msg=正在获取价格指标..., Progress=69%
2026-01-13 19:40:30,589 - app.clients.bloomberg_client - INFO - Found 9 revenue reporting dates. Fetching aligned price data...
2026-01-13 19:40:41,551 - app.clients.bloomberg_client - INFO - REMOTE RAW OUTPUT: JSON_START
[{"Company_code": "ALC US Equity", "update_date": "2026-01-13 19:40:30", "currency": "USD", "indicator": "Last_Price", "value": "84.89", "value_date": "2024-12-31"}, {"Company_code": "ALC US Equity", "update_date": "2026-01-13 19:40:30", "currency": "USD", "indicator": "Market_Cap", "value": "42419.533", "value_date": "2024-12-31"}, {"Company_code": "ALC US Equity", "update_date": "2026-01-13 19:40:30", "currency": "USD", "indicator": "Dividend_Yield", "value": "0.3118", "value_date": "2024-12-31"}, {"Company_code": "ALC US Equity", "update_date": "2026-01-13 19:40:30", "currency": "USD", "indicator": "Last_Price", "value": "78.12", "value_date": "2023-12-31"}, {"Company_code": "ALC US Equity", "update_date": "2026-01-13 19:40:30", "currency": "USD", "indicator": "Market_Cap", "value": "39036.564", "value_date": "2023-12-31"}, {"Company_code": "ALC US Equity", "update_date": "2026-01-13 19:40:30", "currency": "USD", "indicator": "Dividend_Yield", "value": "0.3018", "value_da
2026-01-13 19:40:41,553 - app.clients.bloomberg_client - INFO - ✅ Parsed 16 items from remote.
2026-01-13 19:40:43,095 - app.clients.bloomberg_client - INFO - ✅ Saved 16 records to database.
2026-01-13 19:40:43,096 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=94, Msg=Finalizing data..., Progress=82%
2026-01-13 19:40:44,353 - app.clients.bloomberg_client - INFO - ✅ Cleanup and View Refresh completed.
2026-01-13 19:40:44,354 - app.clients.bloomberg_client - INFO - ✅ Completed processing for ALC US Equity
2026-01-13 19:40:44,354 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=94, Msg=Bloomberg data sync complete, Progress=90%
2026-01-13 19:40:45,530 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=94, Msg=Bloomberg 数据同步完成, Progress=100%
2026-01-13 20:01:59,302 - google_genai.models - INFO - AFC is enabled with max remote calls: 10.
2026-01-13 20:02:05,051 - httpx - INFO - HTTP Request: POST https://generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:streamGenerateContent?alt=sse "HTTP/1.1 200 OK"
2026-01-13 20:03:07,139 - google_genai.models - INFO - AFC is enabled with max remote calls: 10.
2026-01-13 20:03:11,729 - httpx - INFO - HTTP Request: POST https://generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:streamGenerateContent?alt=sse "HTTP/1.1 200 OK"
2026-01-13 20:04:56,927 - google_genai.models - INFO - AFC is enabled with max remote calls: 10.
2026-01-13 20:05:03,581 - httpx - INFO - HTTP Request: POST https://generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:streamGenerateContent?alt=sse "HTTP/1.1 200 OK"
2026-01-13 20:23:36,883 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=95, Msg=正在初始化数据获取..., Progress=0%
2026-01-13 20:23:37,463 - app.services.data_fetcher_service - INFO - 📝 [数据获取] 股票代码格式化: 688029 -> 688029.SH
2026-01-13 20:23:37,463 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=95, Msg=数据获取失败: Data source 'Tushare' not supported in backend., Progress=0%
2026-01-13 20:23:50,636 - app.main - INFO - 🔍 [搜索] 开始搜索股票: 南微医学
2026-01-13 20:23:50,644 - app.main - INFO - 🤖 [搜索-LLM] 调用 gemini-3-flash-preview 进行股票搜索
2026-01-13 20:23:50,655 - google_genai.models - INFO - AFC is enabled with max remote calls: 10.
2026-01-13 20:23:56,156 - httpx - INFO - HTTP Request: POST https://generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:generateContent "HTTP/1.1 200 OK"
2026-01-13 20:23:56,178 - app.main - INFO - ✅ [搜索-LLM] 模型响应完成, 耗时: 5.53秒, Tokens: prompt=304, completion=29, total=333
2026-01-13 20:23:56,179 - app.main - INFO - ✅ [搜索] 搜索完成, 找到 1 个结果, 总耗时: 5.54秒
2026-01-13 20:24:08,551 - app.services.bloomberg_service - WARNING - No Bloomberg data found for symbol: 688029
2026-01-13 20:24:08,898 - app.services.bloomberg_service - WARNING - No Bloomberg data found for symbol: 688029
2026-01-13 20:24:11,878 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=96, Msg=正在初始化数据获取..., Progress=0%
2026-01-13 20:24:12,303 - app.clients.bloomberg_client - INFO - Connecting to Jupyter at http://192.168.3.161:8888...
2026-01-13 20:24:12,656 - app.clients.bloomberg_client - INFO - ✅ Authentication successful.
2026-01-13 20:24:12,681 - app.clients.bloomberg_client - INFO - ✅ Found existing kernel: bc27f3b1-b028-434a-99fa-c1cad4495a87 (remote_env)
2026-01-13 20:24:13,733 - app.clients.bloomberg_client - INFO - ✅ WebSocket connected.
2026-01-13 20:24:13,733 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=96, Msg=数据源连接成功, Progress=10%
2026-01-13 20:24:16,282 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=96, Msg=正在连接 Bloomberg 终端..., Progress=20%
2026-01-13 20:24:17,574 - app.clients.bloomberg_client - INFO - 🚀 Starting fetch for: 688029 CH Equity
2026-01-13 20:24:17,575 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=96, Msg=Starting Bloomberg session..., Progress=20%
2026-01-13 20:24:19,299 - app.clients.bloomberg_client - INFO - Using auto-detected currency: CNY
2026-01-13 20:24:19,299 - app.clients.bloomberg_client - INFO - Fetching Basic Data...
2026-01-13 20:24:19,299 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=96, Msg=Fetching Company Basic Info..., Progress=27%
2026-01-13 20:24:21,477 - app.clients.bloomberg_client - INFO - REMOTE RAW OUTPUT: JSON_START
[{"Company_code": "688029 CH Equity", "update_date": "2026-01-13 20:24:22", "currency": "CNY", "indicator": "company_name", "value": "MICRO-TECH NANJING CO LTD-A", "value_date": "2026-01-13 20:24:22"}, {"Company_code": "688029 CH Equity", "update_date": "2026-01-13 20:24:22", "currency": "CNY", "indicator": "pe_ratio", "value": "27.159974278374918", "value_date": "2026-01-13 20:24:22"}, {"Company_code": "688029 CH Equity", "update_date": "2026-01-13 20:24:22", "currency": "CNY", "indicator": "pb_ratio", "value": "4.086370642415248", "value_date": "2026-01-13 20:24:22"}, {"Company_code": "688029 CH Equity", "update_date": "2026-01-13 20:24:22", "currency": "CNY", "indicator": "Rev_Abroad", "value": "49.85044271634609", "value_date": "2026-01-13 20:24:22"}, {"Company_code": "688029 CH Equity", "update_date": "2026-01-13 20:24:22", "currency": "CNY", "indicator": "dividend_yield", "value": "1.693384511176338", "value_date": "2026-01-13 20:24:22"}, {"Company_code": "688029 CH Eq
2026-01-13 20:24:21,477 - app.clients.bloomberg_client - INFO - ✅ Parsed 7 items from remote.
2026-01-13 20:24:21,478 - app.clients.bloomberg_client - INFO - DEBUG: basic_data before save: [{'Company_code': '688029 CH Equity', 'update_date': '2026-01-13 20:24:22', 'currency': 'CNY', 'indicator': 'company_name', 'value': 'MICRO-TECH NANJING CO LTD-A', 'value_date': '2026-01-13 20:24:22'}, {'Company_code': '688029 CH Equity', 'update_date': '2026-01-13 20:24:22', 'currency': 'CNY', 'indicator': 'pe_ratio', 'value': '27.159974278374918', 'value_date': '2026-01-13 20:24:22'}, {'Company_code': '688029 CH Equity', 'update_date': '2026-01-13 20:24:22', 'currency': 'CNY', 'indicator': 'pb_ratio', 'value': '4.086370642415248', 'value_date': '2026-01-13 20:24:22'}, {'Company_code': '688029 CH Equity', 'update_date': '2026-01-13 20:24:22', 'currency': 'CNY', 'indicator': 'Rev_Abroad', 'value': '49.85044271634609', 'value_date': '2026-01-13 20:24:22'}, {'Company_code': '688029 CH Equity', 'update_date': '2026-01-13 20:24:22', 'currency': 'CNY', 'indicator': 'dividend_yield', 'value': '1.693384511176338', 'value_date': '2026-01-13 20:24:22'}, {'Company_code': '688029 CH Equity', 'update_date': '2026-01-13 20:24:22', 'currency': 'CNY', 'indicator': 'IPO_date', 'value': '2019-07-22', 'value_date': '2026-01-13 20:24:22'}, {'Company_code': '688029 CH Equity', 'update_date': '2026-01-13 20:24:22', 'currency': 'CNY', 'indicator': 'market_cap', 'value': '16639.525', 'value_date': '2026-01-13 20:24:22'}]
2026-01-13 20:24:23,015 - app.clients.bloomberg_client - INFO - ✅ Saved 7 records to database.
2026-01-13 20:24:23,016 - app.clients.bloomberg_client - INFO - Fetching Currency Data...
2026-01-13 20:24:23,016 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=96, Msg=正在获取货币指标 (CNY)..., Progress=41%
2026-01-13 20:24:24,452 - app.clients.bloomberg_client - INFO - REMOTE RAW OUTPUT: JSON_START
[{"Company_code": "688029 CH Equity", "update_date": "2026-01-13 20:24:23", "currency": "CNY", "indicator": "Revenue", "value": "414.3097", "value_date": "2016-12-31"}, {"Company_code": "688029 CH Equity", "update_date": "2026-01-13 20:24:23", "currency": "CNY", "indicator": "Net_Income", "value": "-36.4541", "value_date": "2016-12-31"}, {"Company_code": "688029 CH Equity", "update_date": "2026-01-13 20:24:23", "currency": "CNY", "indicator": "Cash_From_Operating", "value": "59.337", "value_date": "2016-12-31"}, {"Company_code": "688029 CH Equity", "update_date": "2026-01-13 20:24:23", "currency": "CNY", "indicator": "Capital_Expenditure", "value": "-35.8324", "value_date": "2016-12-31"}, {"Company_code": "688029 CH Equity", "update_date": "2026-01-13 20:24:23", "currency": "CNY", "indicator": "Free_Cash_Flow", "value": "23.5046", "value_date": "2016-12-31"}, {"Company_code": "688029 CH Equity", "update_date": "2026-01-13 20:24:23", "currency": "CNY", "indicator": "Dividends
2026-01-13 20:24:24,453 - app.clients.bloomberg_client - INFO - ✅ Parsed 222 items from remote.
2026-01-13 20:24:45,100 - app.clients.bloomberg_client - INFO - ✅ Saved 222 records to database.
2026-01-13 20:24:45,102 - app.clients.bloomberg_client - INFO - Fetching Non-Currency Data...
2026-01-13 20:24:45,102 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=96, Msg=正在获取非货币指标..., Progress=55%
2026-01-13 20:24:46,409 - app.clients.bloomberg_client - INFO - REMOTE RAW OUTPUT: JSON_START
[{"Company_code": "688029 CH Equity", "update_date": "2026-01-13 20:24:45", "currency": "CNY", "indicator": "ROE", "value": "-11.7949", "value_date": "2016-12-31"}, {"Company_code": "688029 CH Equity", "update_date": "2026-01-13 20:24:45", "currency": "CNY", "indicator": "ROA", "value": "-7.2528", "value_date": "2016-12-31"}, {"Company_code": "688029 CH Equity", "update_date": "2026-01-13 20:24:45", "currency": "CNY", "indicator": "Gross_Margin", "value": "57.2046", "value_date": "2016-12-31"}, {"Company_code": "688029 CH Equity", "update_date": "2026-01-13 20:24:45", "currency": "CNY", "indicator": "EBITDA_margin", "value": "-2.426", "value_date": "2016-12-31"}, {"Company_code": "688029 CH Equity", "update_date": "2026-01-13 20:24:45", "currency": "CNY", "indicator": "Net_Profit_Margin", "value": "-8.7988", "value_date": "2016-12-31"}, {"Company_code": "688029 CH Equity", "update_date": "2026-01-13 20:24:45", "currency": "CNY", "indicator": "Tax_Rate", "value": "0.15", "val
2026-01-13 20:24:46,410 - app.clients.bloomberg_client - INFO - ✅ Parsed 163 items from remote.
2026-01-13 20:25:05,444 - app.clients.bloomberg_client - INFO - ✅ Saved 163 records to database.
2026-01-13 20:25:05,456 - app.clients.bloomberg_client - INFO - Fetching Price Data (Aligned)...
2026-01-13 20:25:05,456 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=96, Msg=正在获取价格指标..., Progress=69%
2026-01-13 20:25:06,884 - app.clients.bloomberg_client - INFO - Found 9 revenue reporting dates. Fetching aligned price data...
2026-01-13 20:25:17,623 - app.clients.bloomberg_client - INFO - REMOTE RAW OUTPUT: JSON_START
[{"Company_code": "688029 CH Equity", "update_date": "2026-01-13 20:25:06", "currency": "CNY", "indicator": "Last_Price", "value": "67.59", "value_date": "2024-12-31"}, {"Company_code": "688029 CH Equity", "update_date": "2026-01-13 20:25:06", "currency": "CNY", "indicator": "Market_Cap", "value": "12696.6073", "value_date": "2024-12-31"}, {"Company_code": "688029 CH Equity", "update_date": "2026-01-13 20:25:06", "currency": "CNY", "indicator": "Dividend_Yield", "value": "2.2193", "value_date": "2024-12-31"}, {"Company_code": "688029 CH Equity", "update_date": "2026-01-13 20:25:06", "currency": "CNY", "indicator": "Last_Price", "value": "96.8", "value_date": "2023-12-31"}, {"Company_code": "688029 CH Equity", "update_date": "2026-01-13 20:25:06", "currency": "CNY", "indicator": "Market_Cap", "value": "18183.6304", "value_date": "2023-12-31"}, {"Company_code": "688029 CH Equity", "update_date": "2026-01-13 20:25:06", "currency": "CNY", "indicator": "Dividend_Yield", "value":
2026-01-13 20:25:17,624 - app.clients.bloomberg_client - INFO - ✅ Parsed 17 items from remote.
2026-01-13 20:25:22,020 - app.clients.bloomberg_client - INFO - ✅ Saved 17 records to database.
2026-01-13 20:25:22,026 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=96, Msg=Finalizing data..., Progress=82%
2026-01-13 20:25:24,501 - app.clients.bloomberg_client - INFO - ✅ Cleanup and View Refresh completed.
2026-01-13 20:25:24,502 - app.clients.bloomberg_client - INFO - ✅ Completed processing for 688029 CH Equity
2026-01-13 20:25:24,502 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=96, Msg=Bloomberg data sync complete, Progress=90%
2026-01-13 20:25:25,959 - app.services.data_fetcher_service - INFO - 🔄 [进度更新] ID=96, Msg=Bloomberg 数据同步完成, Progress=100%
2026-01-13 20:26:45,348 - google_genai.models - INFO - AFC is enabled with max remote calls: 10.
2026-01-13 20:26:52,042 - httpx - INFO - HTTP Request: POST https://generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:streamGenerateContent?alt=sse "HTTP/1.1 200 OK"
2026-01-13 20:27:39,016 - google_genai.models - INFO - AFC is enabled with max remote calls: 10.
2026-01-13 20:27:46,782 - httpx - INFO - HTTP Request: POST https://generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:streamGenerateContent?alt=sse "HTTP/1.1 200 OK"
2026-01-13 20:28:32,248 - google_genai.models - INFO - AFC is enabled with max remote calls: 10.
2026-01-13 20:28:39,401 - httpx - INFO - HTTP Request: POST https://generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:streamGenerateContent?alt=sse "HTTP/1.1 200 OK"

View File

@ -2,6 +2,7 @@
import { useState, useEffect } from "react" import { useState, useEffect } from "react"
import { useSearchParams } from "next/navigation" import { useSearchParams } from "next/navigation"
import { cn } from "@/lib/utils"
import { SearchStock } from "@/components/search-stock" import { SearchStock } from "@/components/search-stock"
import { HistoryList } from "@/components/history-list" import { HistoryList } from "@/components/history-list"
import { DataSourceSelector } from "@/components/data-source-selector" import { DataSourceSelector } from "@/components/data-source-selector"
@ -12,7 +13,7 @@ import { AnalysisReport } from "@/components/analysis-report"
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
import { Badge } from "@/components/ui/badge" import { Badge } from "@/components/ui/badge"
import { Button } from "@/components/ui/button" import { Button } from "@/components/ui/button"
import { ArrowLeft, Building2, RefreshCw, Loader2, CheckCircle2 } from "lucide-react" import { ArrowLeft, Building2, RefreshCw, Loader2, CheckCircle2, ChevronLeft, ChevronRight } from "lucide-react"
import type { SearchResult } from "@/lib/types" import type { SearchResult } from "@/lib/types"
import { useFinancialData } from "@/hooks/use-financial-data" import { useFinancialData } from "@/hooks/use-financial-data"
import { Progress } from "@/components/ui/progress" import { Progress } from "@/components/ui/progress"
@ -29,6 +30,7 @@ export default function Home() {
// 状态管理 // 状态管理
const [selectedCompany, setSelectedCompany] = useState<SearchResult | null>(null) const [selectedCompany, setSelectedCompany] = useState<SearchResult | null>(null)
const [selectedDataSource, setSelectedDataSource] = useState<string>("iFinD") const [selectedDataSource, setSelectedDataSource] = useState<string>("iFinD")
const [isSidebarOpen, setIsSidebarOpen] = useState(true)
const [companyId, setCompanyId] = useState<number | null>(null) const [companyId, setCompanyId] = useState<number | null>(null)
const [analysisId, setAnalysisId] = useState<number | null>(null) const [analysisId, setAnalysisId] = useState<number | null>(null)
const [oneTimeModel, setOneTimeModel] = useState<string | undefined>(undefined) const [oneTimeModel, setOneTimeModel] = useState<string | undefined>(undefined)
@ -194,17 +196,38 @@ export default function Home() {
return ( return (
<div className="flex h-screen w-full bg-background overflow-hidden"> <div className="flex h-screen w-full bg-background overflow-hidden">
{/* Sidebar */} {/* Sidebar */}
<AppSidebar <div
activeTab={currentView} className={cn(
onTabChange={handleTabChange} "transition-all duration-300 ease-in-out border-r bg-card flex-shrink-0 z-10 overflow-hidden",
hasSelectedCompany={!!selectedCompany} isSidebarOpen ? "w-64" : "w-0 border-r-0"
className="flex-shrink-0 z-10" )}
/> >
<AppSidebar
activeTab={currentView}
onTabChange={handleTabChange}
hasSelectedCompany={!!selectedCompany}
className="w-64 border-r-0"
/>
</div>
{/* Main Content Area */} {/* Main Content Area Wrapper */}
<main className="flex-1 overflow-auto bg-background/50 relative"> <div className="flex-1 relative flex flex-col min-w-0 overflow-hidden bg-background/50">
{renderContent()} {/* Sidebar Toggle Button */}
</main> <Button
variant="secondary"
size="icon"
className="absolute left-0 top-1/2 -translate-y-1/2 z-20 h-12 w-4 p-0 rounded-l-none rounded-r-lg border border-l-0 shadow-sm hover:w-8 transition-all opacity-50 hover:opacity-100"
onClick={() => setIsSidebarOpen(!isSidebarOpen)}
title={isSidebarOpen ? "收起导航" : "展开导航"}
>
{isSidebarOpen ? <ChevronLeft className="h-4 w-4" /> : <ChevronRight className="h-4 w-4" />}
</Button>
{/* Scrollable Content */}
<main className="flex-1 overflow-auto">
{renderContent()}
</main>
</div>
</div> </div>
) )
} }

View File

@ -328,6 +328,7 @@ function RawDataTable({ data, title, selectedCurrency = "Auto", userMarket }: {
calcAssetRatio('prepaid', 'prepaid_to_assets') calcAssetRatio('prepaid', 'prepaid_to_assets')
calcAssetRatio('property_plant&equipment', 'ppe_to_assets') calcAssetRatio('property_plant&equipment', 'ppe_to_assets')
calcAssetRatio('lt_investment', 'lt_investment_to_assets') calcAssetRatio('lt_investment', 'lt_investment_to_assets')
calcAssetRatio('goodwill', 'goodwill_to_assets')
calcAssetRatio('accounts_payable', 'payables_to_assets') calcAssetRatio('accounts_payable', 'payables_to_assets')
calcAssetRatio('st_defer_rev', 'deferred_revenue_to_assets') calcAssetRatio('st_defer_rev', 'deferred_revenue_to_assets')
calcAssetRatio('st_debt', 'st_debt_to_assets') calcAssetRatio('st_debt', 'st_debt_to_assets')
@ -339,7 +340,8 @@ function RawDataTable({ data, title, selectedCurrency = "Auto", userMarket }: {
const getR = (k: string) => (typeof row[k] === 'number' ? row[k] : 0) const getR = (k: string) => (typeof row[k] === 'number' ? row[k] : 0)
const sumKnown = getR('cash_to_assets') + getR('inventory_to_assets') + const sumKnown = getR('cash_to_assets') + getR('inventory_to_assets') +
getR('receivables_to_assets') + getR('prepaid_to_assets') + getR('receivables_to_assets') + getR('prepaid_to_assets') +
getR('ppe_to_assets') + getR('lt_investment_to_assets') getR('ppe_to_assets') + getR('lt_investment_to_assets') +
getR('goodwill_to_assets')
row['other_assets_ratio'] = 100 - sumKnown row['other_assets_ratio'] = 100 - sumKnown
} }
@ -417,7 +419,7 @@ function RawDataTable({ data, title, selectedCurrency = "Auto", userMarket }: {
'net_income', 'netincome_growth', 'net_income', 'netincome_growth',
'cash_from_operating', 'capital_expenditure', 'free_cash_flow', 'cash_from_operating', 'capital_expenditure', 'free_cash_flow',
'dividends_paid', 'dividend_payout_ratio', 'repurchase', 'dividends_paid', 'dividend_payout_ratio', 'repurchase',
'total_assets', 'equity', 'goodwill', 'total_assets', 'equity',
'__SECTION_EXPENSE__', '__SECTION_EXPENSE__',
'selling&marketing_to_revenue', 'selling&marketing', 'selling&marketing_to_revenue', 'selling&marketing',
'general&admin_to_revenue', 'general&admin', 'general&admin_to_revenue', 'general&admin',
@ -434,6 +436,7 @@ function RawDataTable({ data, title, selectedCurrency = "Auto", userMarket }: {
'prepaid_to_assets', 'prepaid', 'prepaid_to_assets', 'prepaid',
'ppe_to_assets', 'property_plant&equipment', 'ppe_to_assets', 'property_plant&equipment',
'lt_investment_to_assets', 'lt_investment', 'lt_investment_to_assets', 'lt_investment',
'goodwill_to_assets', 'goodwill',
'other_assets_ratio', 'other_assets_ratio',
'payables_to_assets', 'accounts_payable', 'payables_to_assets', 'accounts_payable',
'deferred_revenue_to_assets', 'st_defer_rev', 'deferred_revenue_to_assets', 'st_defer_rev',
@ -526,6 +529,7 @@ function RawDataTable({ data, title, selectedCurrency = "Auto", userMarket }: {
'prepaid_to_assets': 'prepaid', 'prepaid_to_assets': 'prepaid',
'ppe_to_assets': 'property_plant&equipment', 'ppe_to_assets': 'property_plant&equipment',
'lt_investment_to_assets': 'lt_investment', 'lt_investment_to_assets': 'lt_investment',
'goodwill_to_assets': 'goodwill',
'payables_to_assets': 'accounts_payable', 'payables_to_assets': 'accounts_payable',
'deferred_revenue_to_assets': 'st_defer_rev', 'deferred_revenue_to_assets': 'st_defer_rev',
'st_debt_to_assets': 'st_debt', 'st_debt_to_assets': 'st_debt',
@ -747,7 +751,8 @@ function RawDataTable({ data, title, selectedCurrency = "Auto", userMarket }: {
'cash_to_assets', 'inventory_to_assets', 'receivables_to_assets', 'cash_to_assets', 'inventory_to_assets', 'receivables_to_assets',
'prepaid_to_assets', 'ppe_to_assets', 'lt_investment_to_assets', 'prepaid_to_assets', 'ppe_to_assets', 'lt_investment_to_assets',
'payables_to_assets', 'deferred_revenue_to_assets', 'payables_to_assets', 'deferred_revenue_to_assets',
'st_debt_to_assets', 'lt_debt_to_assets', 'other_assets_ratio' 'st_debt_to_assets', 'lt_debt_to_assets', 'other_assets_ratio',
'goodwill_to_assets'
] ]
if (assetRatios.includes(indicator) && numVal > 30) { if (assetRatios.includes(indicator) && numVal > 30) {
@ -860,6 +865,7 @@ function formatColumnName(column: string): string {
'st_defer_rev': '短期递延收入', 'st_defer_rev': '短期递延收入',
'deferred_revenue_to_assets': '预收占比', 'deferred_revenue_to_assets': '预收占比',
'goodwill': '商誉', 'goodwill': '商誉',
'goodwill_to_assets': '商誉占比',
'total_debt_ratio': '总债务比率', 'total_debt_ratio': '总债务比率',
'cash_to_assets': '现金占比', 'cash_to_assets': '现金占比',
'inventory_to_assets': '存货占比', 'inventory_to_assets': '存货占比',
@ -940,7 +946,7 @@ function formatCellValue(column: string, value: any): string {
'other_breakdown_gross', 'other_breakdown_net', 'other_breakdown_sga', 'other_breakdown_rd', 'other_breakdown_gross', 'other_breakdown_net', 'other_breakdown_sga', 'other_breakdown_rd',
'cash_to_assets', 'inventory_to_assets', 'receivables_to_assets', 'prepaid_to_assets', 'ppe_to_assets', 'lt_investment_to_assets', 'cash_to_assets', 'inventory_to_assets', 'receivables_to_assets', 'prepaid_to_assets', 'ppe_to_assets', 'lt_investment_to_assets',
'payables_to_assets', 'deferred_revenue_to_assets', 'st_debt_to_assets', 'lt_debt_to_assets', 'payables_to_assets', 'deferred_revenue_to_assets', 'st_debt_to_assets', 'lt_debt_to_assets',
'other_assets_ratio' 'other_assets_ratio', 'goodwill_to_assets'
].includes(lowerCol) ].includes(lowerCol)
// Special handling for Per Employee (Just number formatting, 2 decimals) // Special handling for Per Employee (Just number formatting, 2 decimals)

View File

@ -34,7 +34,7 @@ export function HeaderSearch({ defaultDataSource }: { defaultDataSource?: string
setOpen(true) setOpen(true)
try { try {
// Using default model for light search // Using default model for light search
const data = await searchStock(query, "gemini-2.5-flash") const data = await searchStock(query, "gemini-3-flash-preview")
setResults(Array.isArray(data) ? data : []) setResults(Array.isArray(data) ? data : [])
} catch (err) { } catch (err) {
console.error("Search failed", err) console.error("Search failed", err)

View File

@ -82,7 +82,7 @@ export function NavHeader() {
} }
return ( return (
<header className="border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 sticky top-0 z-[60]"> <header className="border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 z-[60]">
<div className="flex h-14 items-center gap-4 px-6 lg:h-[60px] w-full px-8"> {/* Adjusted constraint */} <div className="flex h-14 items-center gap-4 px-6 lg:h-[60px] w-full px-8"> {/* Adjusted constraint */}
<Link className="flex items-center gap-2 font-semibold min-w-[140px]" href="/"> <Link className="flex items-center gap-2 font-semibold min-w-[140px]" href="/">
<MonitorPlay className="h-6 w-6" /> <MonitorPlay className="h-6 w-6" />