Neo a045625d48 fix(backend): 后端日志走查发现 2 个 schema 不一致 bug
- coach_service.py:594 _build_task_groups SQL 查 biz.notes.is_pinned
  但表无该字段 → UndefinedColumn 抛错 + 事务终止 + 级联 _build_notes
  / _build_history_months 全部失败(InFailedSqlTransaction)
  修复:删除 is_pinned 列,pinned 降级 False(置顶功能未落库,
  不影响核心备注展示)。

- customer_service.py:1088 _get_consumption_month_summary SQL 用错
  3 个字段(从 v_dwd_assistant_service_log 复制粘贴未适配
  v_dwd_settlement_head 字段名差异):
    sh.tenant_member_id → sh.member_id
    sh.is_delete = 0 → 删除(view 已过滤已撤销订单)
    sh.settle_time → sh.create_time
  → 高频 UndefinedColumn,小程序 customer-records 月度 rechargeTotal
  恒返回 0,consumption60D 恒返回 null。

走查覆盖(MCP):
- 小程序 customer-records 调 /api/xcx/customers/{id}/consumption-records
  修前: rechargeTotal=0, consumption60D=null
  修后: rechargeTotal=1009.08, consumption60D=7758.24, daysSinceVisit=31
       visitCount=1, consumeTotal=384.02 全部 PASS

发现来源:tmp/20260505_backed_LOG.txt 后端日志 grep
ERROR/Traceback 反复出现 UndefinedColumn。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 11:59:30 +08:00
2026-04-10 06:24:13 +08:00

NeoZQYY Monorepo

台球门店运营助手一体化平台,整合 ETL 数据 Connector、微信小程序后端、小程序前端与管理后台。

项目结构

目录 说明 文档
apps/etl/connectors/feiqiu/ 飞球 ConnectorAPI → ODS → DWD → DWS docs/
apps/backend/ FastAPI 后端13 个路由 · JWT 双认证 · WebSocket README · API 参考
apps/miniprogram/ 微信小程序Donut + TDesign + TypeScript README
apps/admin-web/ 管理后台React + Vite + Ant Design README
apps/mcp-server/ MCP ServerAI 工具集成PostgreSQL 只读查询) README
packages/shared/ 共享包(枚举、金额精度、时间工具) README
db/etl_feiqiu/ ETL 数据库6 层 Schemameta/ods/dwd/core/dws/app README
db/zqyy_app/ 业务数据库auth 认证 + 任务队列 + 调度) README
docs/ 项目文档中心(架构、数据库、部署、审计) README
scripts/ 运维/工具脚本
tests/ Monorepo 级属性测试

快速开始

# 安装全部依赖(需要 uv
uv sync

# 运行 ETL
cd apps/etl/connectors/feiqiu
python -m cli.main --pg-dsn "$PG_DSN" --store-id "$STORE_ID" --api-token "$API_TOKEN"

# 启动后端 API
cd apps/backend
uvicorn app.main:app --reload

# 运行 ETL 单元测试
cd apps/etl/connectors/feiqiu
pytest tests/unit

配置

配置采用分层叠加:根 .env -> 应用 .env.local -> 环境变量 -> CLI 参数。

参见 .env.template 了解可用配置项。

技术栈

  • Python 3.10+, uv workspace4 个成员etl、backend、mcp-server、shared
  • PostgreSQL 四库:etl_feiqiu / test_etl_feiqiuETLzqyy_app / test_zqyy_app(业务)
  • FastAPI + Uvicorn后端 API
  • React 19 + Vite 6 + Ant Design 5管理后台独立 pnpm
  • 微信小程序原生 + Donut + TDesign + TypeScriptC 端)
  • JWT 双认证(管理后台用户名密码 + 小程序微信登录)
  • 多门店隔离(site_id + RLS
Description
桌球运营小程序 Monorepo 统一仓库
Readme 64 MiB
Languages
Python 79.6%
TypeScript 17.4%
PLpgSQL 1.9%
HTML 0.7%
PowerShell 0.4%