包含多个会话的累积代码变更: - backend: AI 聊天服务、触发器调度、认证增强、WebSocket、调度器最小间隔 - admin-web: ETL 状态页、任务管理、调度配置、登录优化 - miniprogram: 看板页面、聊天集成、UI 组件、导航更新 - etl: DWS 新任务(finance_area_daily/board_cache)、连接器增强 - tenant-admin: 项目初始化 - db: 19 个迁移脚本(etl_feiqiu 11 + zqyy_app 8) - packages/shared: 枚举和工具函数更新 - tools: 数据库工具、报表生成、健康检查 - docs: PRD/架构/部署/合约文档更新 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2.7 KiB
2.7 KiB
P9→NS1/RNS1 缺失项 #12:客户服务记录页的月度统计汇总展示
简要结论
- 状态:✅ 已解决
- 风险等级:🟡 低
- 月度统计汇总已完整实现:后端返回
month_count/month_hours,前端展示为三栏统计条(本月服务次数/服务时长/关系指数),含月份切换器和格式化展示。
详细审查
审查范围
apps/backend/app/schemas/xcx_customers.py—CustomerRecordsResponseschemaapps/backend/app/services/customer_service.py—get_customer_records()实现apps/miniprogram/miniprogram/pages/customer-service-records/customer-service-records.wxml— 月度统计区域apps/miniprogram/miniprogram/pages/customer-service-records/customer-service-records.ts— 数据处理
发现
-
后端:月度统计数据已实现
CustomerRecordsResponse含month_count: int和month_hours: floatget_customer_records()调用_get_month_aggregation()计算当月汇总(非分页子集)- 返回
total_service_count(跨月累计)
-
前端:月度统计展示已完整实现
- 月份切换器(上月/下月箭头 + 月份标签)
- 三栏统计条:
- 本月服务:
monthCount(如 "3次") - 服务时长:
monthHours(如 "12.5h"),蓝色高亮 - 关系指数:
monthRelation(如 "0.85"),橙色高亮
- 本月服务:
- 使用
formatCount()和formatHours()格式化函数 - 月份切换时重新请求 API(
loadMonthRecords())
-
月份切换交互已实现
onPrevMonth()/onNextMonth()切换月份- 边界控制:
canPrev/canNext禁用按钮 - 切换时显示 loading 状态
证据
前端月度统计展示:
<view class="month-summary">
<view class="summary-item">
<text class="summary-label">本月服务</text>
<text class="summary-value">{{fmt.safe(monthCount)}}</text>
</view>
<view class="summary-divider"></view>
<view class="summary-item">
<text class="summary-label">服务时长</text>
<text class="summary-value value-primary">{{fmt.safe(monthHours)}}</text>
</view>
<view class="summary-divider"></view>
<view class="summary-item">
<text class="summary-label">关系指数</text>
<text class="summary-value value-warning">{{fmt.safe(monthRelation)}}</text>
</view>
</view>
后端月度汇总查询:
month_count, month_hours = _get_month_aggregation(
conn, site_id, customer_id, year, month, table
)
建议(如未完全解决)
无重大缺失。可考虑的微调:
monthRelation(关系指数)当前前端硬编码为'0.85',后端CustomerRecordsResponse中无relation_index字段返回,需确认数据源