6.1 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, requirements, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | requirements | must_haves | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 01-p0 | 04 | execute | 1 |
|
true |
|
|
Purpose: sellerCostPrice 是佣金差额计算的基准。场景 5 中错误使用 buyerCostPrice(下级成本价)导致整个佣金链差额为 0,所有上级代理无法获得应有佣金。修复后代购场景佣金链正常工作。
Output:
- order/service.go: 场景 5 的 sellerCostPrice 改为 operatorCostPrice,其余 5 处经语义审查确认或按需修正
<execution_context> @$HOME/.config/opencode/get-shit-done/workflows/execute-plan.md @$HOME/.config/opencode/get-shit-done/templates/summary.md </execution_context>
@.planning/phases/01-p0/01-CONTEXT.md修复规格书(方案 A-5,第 579-618 行)
@.sisyphus/plans/修正业务-完整方案.md
Task 1: 逐一审查并修正 sellerCostPrice 6 处赋值(CRITICAL-06) internal/service/order/service.go **步骤 1:定位 6 处赋值**rg -n "sellerCostPrice" internal/service/order/service.go
确认规格书所述的 6 处(第 187, 262, 472, 548, 734, 809 行)是否与实际一致(行号可能有偏移)。
步骤 2:对照五种场景表逐一审查
对每一处 sellerCostPrice = buyerCostPrice,阅读其所在分支的上下文,确认:
- 这里的"操作方"是谁?(平台/代理)
- 资产归属是谁?(自己客户/下级代理客户)
- 对照上方场景表,sellerCostPrice 应该是哪个变量?
步骤 3:修正确认有问题的位置
规格书明确指出场景 5(代理代购下级代理客户)约在第 525-548 行:
// 当前错误(sellerCostPrice 用了下级成本价)
buyerCostPrice, _ := s.getCostPrice(ctx, *resourceShopID, firstPackageID) // 下级成本价
operatorCostPrice, _ := s.getCostPrice(ctx, operatorShopID, firstPackageID) // 自己成本价
totalAmount = buyerCostPrice // 下级成本价作为面值(正确)
actualPaidAmount = &operatorCostPrice // 实际扣自己钱包(正确)
sellerCostPrice = buyerCostPrice // ← 错误!应是 operatorCostPrice
// 修正后
sellerCostPrice = operatorCostPrice // ✅ 自己(代理)的成本价作为佣金差额基准
对其余 5 处,若语义审查确认正确(即该场景下 sellerCostPrice 本就应等于 buyerCostPrice),则不修改,并在 SUMMARY 中记录每处审查结论。
步骤 4:执行 go build ./...,确认编译通过,提交独立 commit(per D-05)。
注意:只改确认有问题的位置,禁止全量替换(per D-03)。 go build ./... && rg -n "sellerCostPrice" internal/service/order/service.go - 6 处 sellerCostPrice 赋值全部经过语义审查 - 场景 5 分支已将 sellerCostPrice = buyerCostPrice 改为 sellerCostPrice = operatorCostPrice - 其余各处审查结论已记录 - go build ./... 编译通过 - 独立 commit 已提交
整体验收:# 1. 编译验证
go build ./...
# 2. 查看所有 sellerCostPrice 赋值(人工确认场景 5 已修正)
rg -n "sellerCostPrice" internal/service/order/service.go
# 3. 搜索场景 5 分支(代购下级)是否仍然存在 sellerCostPrice = buyerCostPrice
# 需人工确认第 525-548 行附近已修改
人工验收(参见修正业务-完整方案.md A-5 验收清单):
- DBHub 抽查"代理代购下级代理客户"的订单和佣金记录
- 预期:tb_order.total_amount = 下级成本价,佣金链不再全部为 0
<success_criteria>
go build ./...编译通过- 场景 5(代理代购下级)sellerCostPrice = operatorCostPrice(不再是 buyerCostPrice)
- 其余 5 处经语义审查,结论记录在 SUMMARY 中
- 独立 commit 已提交 </success_criteria>