按月滚动计算阿里巴巴账户余额 #160

Merged
chenxi merged 1 commits from feature/chenxi-alibaba-balance-rollforward into main 2026-09-11 13:50:13 +08:00
Collaborator

变更范围

  • modules/EcommerceFinance/Repositories/AlibabaAccountBalanceRepository.php
    • 2026-06-30 及以前继续读取历史快照,原值和空字段保持不变。
    • 2026-07 起从 ready 的 js_alibaba_bill 共享镜像按店铺/月聚合 tradeAMTIn、tradeAMTOut。
    • 以 2026-06-30 快照期末余额为种子,逐月计算期初、期末;无种子时标记缺少上月期末余额。
    • 系统期末余额固定 0,差异与核对状态按需求计算;当前及未来月份不展示。
    • 店铺选项合并历史快照和账单镜像,保持精确名称匹配。
  • tests/Unit/EcommerceFinance/AlibabaAccountBalanceRepositoryTest.php
    • 覆盖历史兼容、7/8 月滚动、跨空月份、缺少期初、零差异已核对、当前月排除。

仅复用

  • 现有余额页面 Controller、Blade、筛选、分页、导出接口。
  • MarketingAccountBillMirrorRepository::ready() 和 js_alibaba_bill 共享镜像,不修改同步契约。

验证

  • 容器内 PHP 语法检查通过。
  • 相关 Unit/Feature/Navigation 测试:28 passed, 235 assertions。
  • 共享镜像真实数据:2026-06 49 条、2026-07 21 条、2026-08 21 条、2026-09 0 条;响应约 50-600ms。
  • 浏览器页面会话因本地容器重启失效,无法重新登录完成本轮 UI 截图验收;页面路由、筛选与导出已由 Feature 测试覆盖。

风险

只读共享业务镜像;不写回上游、不覆盖历史快照、不新增迁移。

## 变更范围 - `modules/EcommerceFinance/Repositories/AlibabaAccountBalanceRepository.php` - 2026-06-30 及以前继续读取历史快照,原值和空字段保持不变。 - 2026-07 起从 ready 的 `js_alibaba_bill` 共享镜像按店铺/月聚合 `tradeAMTIn`、`tradeAMTOut`。 - 以 2026-06-30 快照期末余额为种子,逐月计算期初、期末;无种子时标记缺少上月期末余额。 - 系统期末余额固定 0,差异与核对状态按需求计算;当前及未来月份不展示。 - 店铺选项合并历史快照和账单镜像,保持精确名称匹配。 - `tests/Unit/EcommerceFinance/AlibabaAccountBalanceRepositoryTest.php` - 覆盖历史兼容、7/8 月滚动、跨空月份、缺少期初、零差异已核对、当前月排除。 ## 仅复用 - 现有余额页面 Controller、Blade、筛选、分页、导出接口。 - `MarketingAccountBillMirrorRepository::ready()` 和 `js_alibaba_bill` 共享镜像,不修改同步契约。 ## 验证 - 容器内 PHP 语法检查通过。 - 相关 Unit/Feature/Navigation 测试:28 passed, 235 assertions。 - 共享镜像真实数据:2026-06 49 条、2026-07 21 条、2026-08 21 条、2026-09 0 条;响应约 50-600ms。 - 浏览器页面会话因本地容器重启失效,无法重新登录完成本轮 UI 截图验收;页面路由、筛选与导出已由 Feature 测试覆盖。 ## 风险 只读共享业务镜像;不写回上游、不覆盖历史快照、不新增迁移。
chenxi added 1 commit 2026-09-11 13:44:25 +08:00
chenxi changed title from WIP: 阿里巴巴账户余额滚动计算 to 按月滚动计算阿里巴巴账户余额 2026-09-11 13:49:26 +08:00
chenxi merged commit a01f136ce1 into main 2026-09-11 13:50:13 +08:00
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#160
No description provided.