feat: 港股个股页接入现金流量表(东财域内源 RPT_HKSK_FN_CASHFLOW)#14
Open
dqjkpzw-njpp wants to merge 1 commit into
Open
Conversation
gstock 目前对港股只并入了行情 + 关键财务指标(GMAININDICATOR),
三表里的现金流量表尚未接。本 PR 补上港股现金流量表,仍走同一
东财 datacenter 域内源、复用现有 em_get 限流与 eastmoney_datacenter
封装,不引入任何新数据源/依赖,保持「域内合规子集」定位不变。
- backend/gstock.py:新增 hk_cashflow(query, periods=8)。按 STD_ITEM_CODE
稳定数字码提取经营/投资/筹资/净增加/期初期末 8 项汇总(不依赖东财中文
ITEM_NAME 措辞),按报告期分组、附同比;非港股(美/韩股)返回 {}。
- backend/app.py:新增 GET /api/global/hk/cashflow?symbol=00700。
- backend/chat.py:新增 query_hk_cashflow 工具(system AI + MCP 同步可用)。
- frontend:个股页港股视图下新增「现金流量表」卡(overflow-x 自适应,
最近 5 期,负数标绿);仅港股渲染,美股 404 静默留空。
- tests/test_live.py:新增 test_hk_cashflow_shape(形状 + 非港股返 {})。
实测 00700:8 期,经营 +1013.5亿/yoy+31.8%、投资 -105.6亿、筹资 -121.2亿、
期末现金 2177.7亿;AAPL/A股返回 {} / 404。仅客观数据、不含买卖建议。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
做了什么
gstock 目前对港股只并入了行情 + 关键财务指标(GMAININDICATOR),三表里的现金流量表尚未接。本 PR 补上港股现金流量表,仍走同一东财 datacenter 域内源(
RPT_HKSK_FN_CASHFLOW),复用现有em_get限流与eastmoney_datacenter封装,不引入任何新数据源 / 依赖,保持「域内合规子集」定位不变。改动
hk_cashflow(query, periods=8)。按STD_ITEM_CODE稳定数字码提取 经营 / 投资 / 筹资 / 净增加 / 期初期末 共 8 项汇总(不依赖东财中文ITEM_NAME措辞,避开编码/命名差异),按报告期分组、附同比;非港股(美 / 韩股)返回{}。GET /api/global/hk/cashflow?symbol=00700,错误处理与/api/global/stock一致。query_hk_cashflow工具(system AI 与 MCP server 同步可用,MCP 由chat.TOOLS派生,无需改 mcp_server.py)。api.ts+StockData.tsx):个股页港股视图下新增「现金流量表」卡片——overflow-x自适应、展示最近 5 期、负数(现金流出)标绿;仅港股渲染,美股返回 404 时静默留空。test_hk_cashflow_shape(形状 + 非港股返回{})。实测(00700 腾讯控股)
8 期数据,最新期:经营活动现金流净额 +1013.5 亿 / yoy +31.8%、投资 -105.6 亿、筹资 -121.2 亿、期末现金 2177.7 亿(币种 人民币,季度为 YTD 累计)。
AAPL/ A 股代码正确返回{}/ 404。合规
仅客观数据整理,不含买卖建议、不预测、不评分——与现有个股页一致;金额为原生币种。