admin/docs/定价工作台.md
zzh d1beefb2be
All checks were successful
Build and Deploy / deploy (push) Successful in 1m16s
feat: 定价工作台买价反推卖价预览与草稿回写
支持多渠道最低买价对齐合成、毛利率硬计算预览,以及回写销售产品草稿卖价(不自动发布)。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-12 11:19:36 +08:00

24 lines
1.1 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.

# 定价工作台(后端)
对应前端:`/channel/pricingWorkbench`,说明见前端仓库 `docs/定价工作台说明.md`。
## 服务
`PricingWorkbenchService`(`OMS-Channel`)
| 方法 | 路径 | 说明 |
|------|------|------|
| GetChannelSummariesAsync | GET `/channel/pricing-workbench/channel-summaries` | 买价摘要(发布快照优先) |
| PreviewAsync | POST `/channel/pricing-workbench/preview` | 对齐 + 最低买价 + 毛利硬计算 |
| ApplyAsync | POST `/channel/pricing-workbench/apply` | 回写销售产品草稿,调用 `SalesProductService.SavePriceAsync(Publish=false)` |
硬计算:`PricingWorkbenchCalculator`(可单测)。
## 审计
`apply` 写入 `ILogger` 结构化信息(用户、产品、价格项、渠道、毛利率、明细数、备注),响应含 `audit`。
## 权限码(RBAC 目录同步)
见 `PricingWorkbenchCodes`:`Channel.PricingWorkbench.Query|Preview|Apply|AiAssist`。渠道模块其它接口同样主要靠前端菜单权限;本服务未强制服务端拦截,避免未同步权限码时不可用。