Files
junhong_cmp_fiber/.planning/phases/01-p0/01-04-PLAN.md

6.1 KiB
Raw Blame History

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
internal/service/order/service.go
true
CRITICAL-06
truths artifacts key_links
场景 5 分支(代理代购下级)的 sellerCostPrice 使用 operatorCostPrice不再是 buyerCostPrice
其他 5 处 sellerCostPrice 赋值经过语义审查,确认正确或按需修正
佣金差额计算基准正确,场景 5 的上级代理能获得应有佣金
path provides contains
internal/service/order/service.go 场景 5 sellerCostPrice 修正 operatorCostPrice
from to via pattern
internal/service/order/service.go 佣金计算链路 sellerCostPrice 作为佣金差额基准传递 sellerCostPrice
逐一审查并修正代购订单中 sellerCostPrice 的 6 处赋值CRITICAL-06确保场景 5代理代购下级使用正确的成本价基准。

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 ./...,确认编译通过,提交独立 commitper 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>

  1. go build ./... 编译通过
  2. 场景 5代理代购下级sellerCostPrice = operatorCostPrice不再是 buyerCostPrice
  3. 其余 5 处经语义审查,结论记录在 SUMMARY 中
  4. 独立 commit 已提交 </success_criteria>
完成后创建 `.planning/phases/01-p0/01-04-SUMMARY.md`,记录: - 6 处 sellerCostPrice 逐一审查结论(行号 + 场景判断 + 是否修改) - 场景 5 修改前后代码对比 - 编译验证结果 - CRITICAL-06 完成状态