wecom-fullstack
0a6525edab
feat(strategy): P0 战略基座 — strategy_charter + GET/PUT /api/cma/charter + P组入口
...
ci/woodpecker/push/main Pipeline was successful
- 表 strategy_charter(一账套一行,entity_id 唯一):mission/vision/vision_year/vision_measurable/values_text/value_items(JSON) 全 NOT NULL
- 迁移脚本 backend/scripts/migrate_strategy_charter_20261021.py:--check/--apply/--down(回滚先 mysqldump,有数据需 --force),零 INSERT
- API:GET 无行 → filled=false 空态(禁示例数据);PUT 字段白名单 + 账套隔离三道 + vision_year 4位年份 + value_items [{name,meaning}] 结构校验
- 前端:P 组「战略章程」入口 + MyDialog 编辑(ceo/finance 可写,其余只读);战略地图页顶部只读章程条
- 用例 43 条 + auth-surface 58 条 = 101 passed;vite build rc=0
2026-10-21 18:54:09 +08:00
fullstack-bot and Hermes CI Fix
71867c4c7a
feat(ar): 应收账龄看板 + 逾期预警 overdue 接入(阶段A)
...
T1 逾期预警(§6 财务 2026-10-20 23:23 口径):
- alert_rules 支持 rule_type=ar_overdue;阈值/责任人/排除名单全量走 params(代码零业务常量)
- 90 天占比红线 key 保留但默认 null 停用(不回落 0.25);黄线 15%-25% 保留
- 新增逐户红线「>30 天且 >5 万」+ 聚合红线「150+ 占比环比上升 = 结构恶化」
- assignee 派生:manual → 近 3 个月主业务员(zxt_masterbill emp_id → employee_dict.u_Name,
缺表时降级同库摘要制单人姓名)→ 部门负责人(渠道 118 / 商务 114 / 直属酒窖 117);
两路皆失败 ⇒ 该户不生成、进 skipped[],禁落空 assignee
- POST /run-ar-overdue(dry_run 默认 true)+ check-all 分支;只 INSERT 同一 message 幂等
T2 账龄看板:
- GET /api/cma/ar-aging/{meta,trend,overview,customers,customers/export};每条查询带 entity_id
- 三口径分列、caliber=all → 400;缺期 has_data=false 且金额 null(不补 0)
- ArAging.vue:口径后缀/截止期徽标/趋势断点/六档堆叠/逐户可排序导出
单测 21 项全通过(SQLite 夹具,不连生产库);vite build 通过。
阶段A 零生产写:未 push、未部署、未 --apply、未 dry_run=false。
2026-10-21 08:42:24 +08:00
Hermes CI Fix
75a48f55d2
feat(strategy-map): live board reading map_objectives + kpi_targets (read-only)
...
Task: finance-20261011-strategy-map-frontend-fullstack (P2, read-only integration)
- backend/app/utils/strategy_board.py: single source of truth for the level
caliber (layer colors, inverse-kpi explicit whitelist, status class by
unit, zero guard, period ranking, latest-actual picking). Pure functions.
- backend/app/api/maps.py: GET /api/cma/maps/{map_id}/strategy-board
- nodes straight from map_objectives (sorted by sort_order, id)
- node<->kpi binding with 4-step fallback, binding_source echoed back
- targets from kpi_targets (target_type compatible: yearly + annual),
deduped per (kpi_id, period) with yearly preferred
- actuals from kpi_values actual-only scope, latest period
- causality edges from kpi_causality, out-of-map endpoints dropped+counted
- entity_id taken from the token only (no cross-tenant reads)
- zero writes; nothing is persisted by this endpoint
- frontend/src/views/StrategyMap.vue: /strategy-map live board (4 swim lanes
bottom-up, node cards, 20 causality arrows in SVG, period switch, A3 print).
No emoji, null guards everywhere (no toFixed on null).
- api/index.ts + router/index.ts + permission.ts: route + menu registration
(/strategy-map, zone A read-only, roles ceo/finance/business/it).
- backend/tests/test_strategy_board_20261011.py: 33 cases (spec section 4 /
4.1 / 4.2 / 4.3 + section 7 fixtures + threshold boundaries + period rank).
- backend/tests/test_map_objectives_kpis_form_20261011.py: 14 cases for the
four kpis column shapes (list, json string, object list, NULL/[]/weird).
Not included: push + backend restart (production write, separate gate).
(cherry picked from commit c675bde6b4beaf1d8a9d02a80f5434203a53f348)
2026-10-18 16:31:52 +08:00
Hermes CI Fix
e5eb092d20
feat(cma): treasury stage-1 MVP - migration, models, endpoints, rules, 2 pages
...
G1 review fixes P0-1/P0-2/P1-3/P1-4/P1-5/P2-6/P2-7/P2-8 applied:
- up() filters comment lines then asserts missing_tables == [] (CREATE hits 6/6)
- created counter = new-object diff via information_schema (idempotent second run = 0)
- down() drops columns per-column, dumps via write-path creds + fail-closed
- seeds expanded to 8 rules + 6 limits; data_status DEFAULT estimated
- no physical FK (app-layer checks), amount FLOAT wan-yuan, round(x,4)
Scope: 6 treasury_* tables + cash_plans 4 added columns; cash.py untouched.
Not pushed: deploy is approval-gated (de851257).
2026-09-15 20:02:56 +08:00
Hermes CI Fix
5e0b09e6b6
feat(cashflow): 按项目任务单复核修正——表名cashflow_statements+DoD兼容路径/菜单C组/角色收敛/术语0+验收脚本入库
...
- 表名: ORM+生产库 RENAME cash_flow_structure_values → cashflow_statements (DoD SHOW TABLES LIKE 字面验收)
- 兼容端点: /api/cma/cashflow/statements(GET/POST)+analysis 注册 main.py (DoD 验收路径)
- 菜单: 移入 🟡 C 监控与评价 组(与杜邦分析/管理报表平级), roles 收敛 ceo/finance (前端 ROLE_ROUTES/MENU_ITEMS/router meta + 后端 require_role 四处同步)
- 术语: docstring 改写, grep 现金流肖像=0
- 验收脚本: backend/scripts/verify_cashflow_structure.py (14项断言全PASS: type6→type1双向/瀑布5步/alias路径/权限/清理)
2026-09-03 01:34:13 +08:00
Hermes CI Fix
e5dd6e380b
feat(cashflow): 现金流量表结构分析——三大活动净额八类企业定性判定 (P1)
...
- 后端: cashflow_structure.py 模块 (GET rules/periods/values/analysis + POST values upsert)
- 判定: O/I/F 三净额符号 → 8类企业定性 (CMA P2 现金流量表分析, 无'现金流肖像'字样)
- 数据: cash_flow_structure_values 表 (entity_id+period 唯一), 官方现金流量表净额按期间注入
- 前端: CashFlowStructure.vue 判定横幅/瀑布图/规则表/入库记录 + MyDialog 录入弹窗
- 菜单: 财务报表分析 → 现金流量表分析 (路由 /cashflow-structure, 角色 ceo/finance/it)
- 测试: tests/test_cashflow_structure.py 7 条通过 (规则8类/判定/覆盖/博海边界6-7/非法期间)
2026-09-03 01:22:46 +08:00
Hermes CI Fix
ad68471b29
feat: 路线图R1决策建议一键落地+R2机会推送+R5预算闭环
...
R1(P0): AI建议一键应用到KPI/预算/行动方案
- 新表 ai_suggestions + AISuggestion 模型(init_db自动建)
- /api/cma/ai/suggestions CRUD + /{id}/apply(复用kpis/budget/action_plans) + dismiss
- 应用写 OperationLog(action=ai_suggestion_apply, detail含suggestion_id/before/after)
- 规则驱动建议生成 generate_rule_suggestions(低执行率/高执行率/预算超支/pending预警)
- 幂等: 同entity+type+target_id+title+unapplied不重复建; applied后拒绝重复应用
- 前端: Dashboard AI面板建议卡(应用到/忽略) + 建议中心页 /ai-suggestions
R2(P1): 数据找人扩大-机会类推送
- scripts/opportunity_detector.py: KPI向好(执行率>110%)/预算余量(<70%且actual>0)/预测上行
- scripts/daily_push.py: 异常+机会 每日9:15推企微(8800/send, --dry-run调试)
- crontab: 15 9 * * * (alert_generator 9:00之后)
R5(P0): 预算闭环加固
- auto-decompose批量幂等: 只取年度行(period=YYYY-00)+同KPI多版本取一行
- scripts/closed_loop_check.py: 预算执行率异常→检查现金流/行动同步→缺失提示+报告
- scripts/verify_decompose_idempotent.py: 幂等验证脚本
测试: test_ai_suggestions(10例)+test_roadmap_r2r5(14例); 修test_budget幂等契约适配年度行
全量: 673 passed
2026-08-30 12:05:36 +08:00
Hermes CI Fix
a64f184525
feat: 数据分类分级 — 重要数据标记+资产清单+CSV导出(8/20评估办法政策驱动)
...
- subjects/kpi_definitions 新增 important_flag/data_level/data_category 列
- 新增 /api/cma/data-classification/* API: inventory/stats/标记/批量/export/industry-reference
- 数据级别: core核心/important重要/general一般(GB/T 43697 简化)
- 前端 DataClassification.vue: 统计概览+清单+打标+导出+行业参考目录
- pytest 17例覆盖(含多租户隔离验证)
2026-08-26 07:51:39 +08:00
Hermes CI Fix
863514fec0
refactor: 实物期权计算器菜单从规划与目标移到复盘与改进 — 与预测模拟(NPV/IRR)同组
2026-08-25 17:36:37 +08:00
Hermes CI Fix
1e0439ff72
fix: 波士顿产品矩阵加入侧边栏菜单+角色权限 — 修复功能不可见
2026-08-25 16:59:00 +08:00
Hermes CI Fix
1c8b01d682
feat: 预测性成本智能模块上线(IMA 2026.7前沿) — 接线+重建页面
...
- CostIntelligence.vue 重建(被清理的未提交文件): 模型选择(线性/移动平均)+预测期数+统计卡+KPI表格+趋势图
- 路由: /cost-intelligence(挂财务维度D执行与控制), 修正 predict/cost-intelligence 路径不匹配
- 菜单: 预测性成本智能(ceo/finance/it)
- 后端API已存在: /predict/kpi-forecast/finance (kpi_forecast_engine)
- 验证: Chrome实测 5 KPI预测(厂补率/营收/净利/费用率/毛利), 趋势图渲染, pytest不影响
- 注: 置信度诚实标注(全部low=历史数据波动大, MVP原则)
2026-08-25 00:34:28 +08:00
Hermes CI Fix
266277d121
feat: 应收款催收闭环 — 催收视图+博海230万录入+回款登记联动
2026-08-14 22:07:02 +08:00
Hermes CI Fix
b1e8a55745
feat: 增长质量诊断模块 — 五维评分+雷达图+跨期对比+趋势
2026-08-11 00:21:10 +08:00
Hermes CI Fix
38b603f263
feat: 税务合规智能体—税负监控+发票校验+社保比对
2026-08-04 15:04:39 +08:00
Hermes CI Fix
8e277de3de
feat: 资金管理强化—缺口预测+收付款计划+预警
2026-08-04 14:53:14 +08:00
Hermes CI Fix
555d3b621a
feat: 费用审核智能体—规则+报销流程+看板
2026-08-04 14:40:03 +08:00
Hermes CI Fix
68e40ac9c5
fix: 自动创建KPI补全target_value/kpi_level+文件名中文日期解析
...
- 补NOT NULL字段: target_value=0, kpi_level='operational'
- 文件名支持中文日期: 2026年01月 / 2026年01月至2026年05月
- 科目余额表列名匹配增强: 余额/本年累计/本期发生额
- 期间列识别: 年/月开头列名
2026-07-29 18:12:11 +08:00
Hermes CI Fix
abedf8cb8d
feat: Bot KPI管理体系 — bot_source字段 + 11个财务Bot KPI + Bot KPI看板
...
- 新增 bot_source 字段到 kpi_definitions 表(DB迁移 + 模型字段)
- 创建 bot_kpis.py API(GET /api/cma/bot-kpis + POST .../value)
- 种子脚本 seed_finance_bot_kpis.py 插入11个财务Bot KPI
- BotKpiDashboard.vue 看板组件(三区:核心产出5/质量3/用户反馈3)
- 路由 /bot-kpis + 侧边栏菜单入口
- 复用五档评分引擎
2026-07-25 07:44:41 +08:00
Hermes CI Fix
2d0abe3411
feat: bot-bridge+verify合并 — API+数据库+验证引擎
2026-07-22 17:43:59 +08:00
Hermes CI Fix
e8ffa0d550
fix: 菜单顺序构建修复+types/menu接口定义
2026-07-22 17:12:44 +08:00
Hermes CI Fix
dc09a04c24
fix: 菜单按1-6顺序重排+规则4KPI分级
2026-07-22 16:56:19 +08:00
Hermes CI Fix
d88147ca36
fix: 菜单按1-6顺序重排(P→D→C→A→基础→系统)
2026-07-22 16:38:27 +08:00
Hermes CI Fix
5435361b79
fix: 菜单归属修正 — 改善行动→A/实物期权→P/OKR模板→基础
2026-07-22 15:44:03 +08:00
Hermes CI Fix
3f6e1fdba8
refactor: 菜单按CMA逻辑重组 — 改善行动D→A/实物期权P←A/二级分组
2026-07-22 15:40:56 +08:00
Hermes CI Fix
cbcc0d0a28
feat: 新30号准则P2 — MPM计算器+旧格式双列对比
2026-07-22 12:23:40 +08:00
Hermes CI Fix
270d7758f8
feat: PDCA双循环显式化 — 导航PDCA标识 + 双会议模板 + 战略回顾会数据联动
2026-07-21 18:10:48 +08:00
Hermes CI Fix
4bc4c32e4f
feat(okr): Phase2 - 行业扩展包12个+OKR模板库页面
...
- 插入12个行业包模板:贸易经销(7)+IT服务(5)
- 后端: name搜索+apply端点
- 前端: OKRTemplates.vue页面(搜索/筛选/三分区/应用弹窗)
- 路由+菜单+权限配置
2026-07-21 17:30:50 +08:00
Hermes CI Fix
56067261ad
feat: 驾驶舱改名经营看板+改善行动闭环按钮+统一菜单名
2026-07-19 15:54:20 +08:00
Hermes CI Fix
afa060bbfd
feat: 实物期权计算器 — 后端BSM+二叉树API+前端交互页面
2026-07-18 17:44:21 +08:00
Hermes CI Fix
4f0229fccc
fix: 补齐全部24项菜单的group字段
2026-07-17 09:31:50 +08:00
Hermes CI Fix
6799d546e8
fix: 删除重复的data-quality+补齐predict的group标签
2026-07-16 18:28:26 +08:00
Hermes CI Fix
ccbc21fb1c
fix: 删除重复的'数据管理'菜单项(同时出现在基础数据和监控组)
2026-07-16 18:24:15 +08:00
Hermes CI Fix
b8236c8307
refactor: KPI字典+数据管理移入基础数据组(独立于PDCA)
2026-07-16 18:01:50 +08:00
Hermes CI Fix
4569c24739
refactor: 菜单按PDCA五组重组 — 规划与目标/执行与控制/监控与评价/复盘与改进/系统与支持
2026-07-16 17:49:29 +08:00
Hermes CI Fix
72bc060afd
fix: 左侧菜单重复分组头——移除KPI字典和管报表的多余group
2026-07-13 14:49:14 +08:00
Hermes CI Fix
b26046349c
fix: 补注册缺失API模块+前端路由+ConnectionLines恢复
...
- 注册4个后端模块: customer_dashboard/deviation_push/budget_generate/knowledge_articles
- 修复改善行动路由指向ActionPlanLibrary.vue(原指向AlertList.vue)
- 新增3个路由: /reports(管理报表) /alignment(战略执行看板) /dupont-analysis
- 恢复ConnectionLines.vue完整版(288行, 原被截断为123行)
- 修复maps.py维度键 finance(原financial不匹配前端)
- 补回models/__init__.py knowledge模型导入
2026-07-13 09:49:55 +08:00
Hermes CI Fix
9987045781
fix: 补充缺失的路由和菜单 — 添加客户维度/学习成长看板路由和菜单入口
2026-07-12 18:23:20 +08:00
Hermes CI Fix
3dddd36866
init: 管理会计OS初始代码
...
包含前后端完整代码:
- 前端:Vue3+Vite+ElementPlus
- 后端:FastAPI+SQLAlchemy
- 模块:驾驶舱/KPI/战略地图/预警/预算/成本/预测/改善行动
- 当前版本:v1.0.0
2026-05-28 17:32:22 +08:00