Files
shanxia2.0/openspec/changes/pl-dibang-plan-quantity-accumulation/tasks.md
T
2026-07-12 12:04:43 +08:00

24 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Tasks: 地磅月计划量运输联动累加与回减
## 1. Schema 与迁移
- [x] 1.1 编写 `docs/sql/20260711_pl_transport_db_link_contributed_qty.sql`
- [x] 1.2 同步 `docs/sql/pl_tables.sql` 中 `pl_transport_db_link.contributed_qty`
- [x] 1.3 `backend/app/models/pl_models.py` 增加 `PlTransportDbLink.contributed_qty`
## 2. 桥接服务
- [x] 2.1 `pl_dibang_bridge_service.py` 新增 `_apply_plan_quantity_delta`、`_resolve_link_contributed_qty`
- [x] 2.2 `_sync_transport_inventory_links`:复用月计划时 `+= contributed_qty`;写入 link.contributed_qty
- [x] 2.3 `revoke_regeneratable_dibang_for_transport`:作废前 `-= contributed_qty`(下限 0)
## 3. 测试
- [x] 3.1 新建 `backend/tests/test_pl_dibang_plan_quantity.py`
- [x] 3.2 覆盖:累加、回减、阻断(本地 venv 损坏,已用 python3 手工验证核心路径)
## 4. 验收
- [ ] 4.1 本地 pytest 通过(需修复 venv 或 `pip install pytest`)
- [ ] 4.2 手工:A(30)+B(31)→61;取消 A→31;调整 A 30→25→净 25