merge: 将线上性能明细物化版本 f8c594c3 合入 main #645

Open
qiuxiang wants to merge 11 commits from integration/performance-details-f8c-main-sync into main
Collaborator

目的

  • 将生产正在运行的 f8c594c3 完整合入最新 main。
  • 保留 f8c594c3 作为 main 的祖先,确保后续正式发布保护能够正确识别线上版本。

内容

  • 合入业绩明细差额物化、排序索引和同步命令。
  • 同步进程明细页面、目录表格和多选组件调整。

验证

  • 与最新 main 合并无冲突。
  • 9 个 PHP/Blade 变更文件 php -l 全部通过。
  • .\scripts\build-frontend.ps1 构建通过。
  • 合并策略必须使用 merge commit,不能 Squash,否则会丢失 f8c594c3 的祖先关系。
## 目的 - 将生产正在运行的 `f8c594c3` 完整合入最新 `main`。 - 保留 `f8c594c3` 作为 main 的祖先,确保后续正式发布保护能够正确识别线上版本。 ## 内容 - 合入业绩明细差额物化、排序索引和同步命令。 - 同步进程明细页面、目录表格和多选组件调整。 ## 验证 - 与最新 main 合并无冲突。 - 9 个 PHP/Blade 变更文件 `php -l` 全部通过。 - `.\scripts\build-frontend.ps1` 构建通过。 - 合并策略必须使用 merge commit,不能 Squash,否则会丢失 `f8c594c3` 的祖先关系。
qiuxiang added 10 commits 2026-10-26 20:10:30 +08:00
业绩明细页的「差额合计」「差额异常备注」「差额(有/无)」原先都在查询时
逐行现算同一套规则链(生成 SQL 24KB/50KB,含 36 处 ops_jst_orders 关联
子查询)。整月 32.4 万行实测:联动统计 14.5~41.6 秒,页面主体 2.7~4.6 秒。

- 新增物化列 difference_reason_index / base_difference / has_difference,
  以及 (report_month, difference_reason_index)、(report_month, has_difference)、
  (report_month, store_name, platform) 三个索引和物化状态表;
- 新增 store-receipt:materialize-differences 命令(分批写入、支持 --dry-run
  三项一致性校验,默认连带重算相邻月份以覆盖跨月备注);
- store-receipt:order-match:sync 成功后自动物化(--skip-materialize 可关闭);
- 页面聚合、联动统计、备注/差额筛选改读物化列,规则指纹不匹配或未物化时
  自动回退实时表达式,功能不受影响;
- 月份下拉缓存 6 小时、指标卡聚合 5 分钟、联动统计 1 小时,缓存键带规则
  指纹、物化状态与数据版本,物化后自动失效;
- 前端联动统计改为展开下拉时按需请求,页面加载不再同步统计整月。

规则表达式仍以 Pages 的静态方法为唯一口径,物化命令直接复用,不在 PHP 中
重写规则。本地用 7,907 行副本验证:三项一致性差异为 0,数字与实时口径完全
一致;联动统计 76ms→21ms、页面 56ms→41ms(同一数据)。详见
docs/业绩明细差额物化.md。
- 新增 (report_month, occurred_date, store_name, online_order_no) 索引,
  默认列表不再对整月 32 万行做 filesort;
- 文档补充共享库回填实测数据(91.7 万行回填 5.9 分钟,三项一致性差异 0;
  联动统计 84.9 秒 → 冷 1.7 秒 / 热 2 毫秒,页面 7.7 秒 → 冷 1.7 秒 / 热 24 毫秒)。
状态表标记已物化、但旧版本同步代码重刷账期时不写物化列,会留下 NULL
导致页面把未物化行当成 0 差额。现在读取状态时同时检查该账期是否还有
has_difference 为 NULL 的行,有则回退实时规则表达式(缓存 10 分钟)。
#602 把 .installation-filter-bar 的 display/grid-template-columns 移到了
安装明细页专用的 .installation-filter-primary / .installation-filter-time /
.installation-filter-actions 内部容器,但店铺维度报表、业绩明细、进销存报表、
入库明细四个页面仍直接以 .installation-filter-field 作为栅格项,失去网格后
每个筛选项各占一整行,查询/清除按钮被挤到最右下角。

新增 .installation-filter-bar--grid 修饰类,恢复四列栅格(1100px 两列、
650px 单列)与左对齐操作区,并只应用到上述四个直接使用字段栅格的表单;
安装明细页使用内部容器排版,不受影响。
qiuxiang added 1 commit 2026-10-26 20:13:00 +08:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
The changes on this branch are already on the target branch. This will be an empty commit.
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin integration/performance-details-f8c-main-sync:integration/performance-details-f8c-main-sync
git checkout integration/performance-details-f8c-main-sync
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: WuYongJie/CaiWuXiTong#645
No description provided.