Commit 28b82740 by 刘铭阳

20260708 feat opportunity_list和`partner_opportunity_list` 需新增全部状态汇总计数

parent 54d36134
# partner-mp 第四点接口文档(介绍人视图 03 + 对接人视图 04) # partner-mp 第四点接口文档(介绍人视图 03 + 对接人视图 04)
...@@ -573,6 +573,59 @@ sdk.domainServicePost( ...@@ -573,6 +573,59 @@ sdk.domainServicePost(
# 六、20260708补充接口
> 需求来源:王雷 2026-07-08。商机列表 tab 需同时展示各状态数量(如 `全部12 进行中5 已成单4 已作废4`)。
> 涉及两个列表接口:`partner_opportunity_list`(合伙人视角,§五①)与 `opportunity_list`(对接人视角,§一②)。
## ① 修改接口:partner_opportunity_list — 响应新增 status_count
- **改动**:响应体(ApiResult.data)顶层**新增** `status_count` 对象,用于 tab 上展示各状态数量。原有 `total`/`page`/`data_list` 不变。
- **口径**`status_count` 与列表过滤条件保持一致(按当前登录合伙人 `partner_id` 过滤 + 保留 `search_key` 搜索),但**不受本次请求的 `status` 参数影响**——即无论传什么 `status`,返回的都是该合伙人名下(叠加搜索条件后)的全量状态分布。
- **字段**`status_count` 的 key 与 `status` 请求参数取值一一对应:
| key | 含义 | 统计口径 |
|-----|------|---------|
| all | 全部 | 全部状态 |
| in_progress | 进行中 | status ∈ (1待审核,2待分配,3跟进中,4暂时挂起) |
| "5" | 已成单 | status=5 |
| "6" | 已作废 | status=6 |
> 注意:`all` 是全部状态之和,`in_progress + "5" + "6"` 不一定等于 `all`(若存在其它状态值);按库中真实分布返回。
- **示例**
```jsonc
// 请求 data: { "status": "in_progress", "search_key": "科技", "page": 1 }
// 响应(status_count 不随 status 变化)
{ "code": 0, "msg": "成功", "data": {
"total": 5, "page": 1, "data_list": [ /* ...仅进行中的记录... */ ],
"status_count": { "all": 12, "in_progress": 5, "5": 4, "6": 4 }
}}
```
## ② 修改接口:opportunity_list — 响应新增 status_count
- **改动**:同 ①,响应体(ApiResult.data)顶层**新增** `status_count` 对象。原有 `total`/`page`/`data_list`/`following_untracked_count` 不变。
- **口径**`status_count` 与列表过滤条件保持一致(按 `contactor_uid` 过滤 + 保留 `source`/`product_ids`/`date_from`/`date_to`/`partner_key` 全部查询条件),但**不受本次请求的 `status` 参数影响**
- **字段**:与 ① 完全一致(`all` / `in_progress` / `"5"` / `"6"`)。
> 说明:本接口 `status` 入参为**数字**(0=全部,1~6 单状态),与 `partner_opportunity_list` 的字符串 tab(`in_progress`/`all`)不同;本次仅新增 `status_count`,未改动 `status` 入参过滤逻辑。前端「进行中」tab 数量取 `status_count.in_progress` 即可。
- **示例**
```jsonc
// 请求 data: { "status": 3, "product_ids": [101], "page": 1 }
// 响应
{ "code": 0, "msg": "成功", "data": {
"total": 8, "page": 1, "following_untracked_count": 2,
"data_list": [ /* ...仅跟进中的记录... */ ],
"status_count": { "all": 20, "in_progress": 12, "5": 5, "6": 3 }
}}
```
---
# 附:数据来源与依赖(供排查) # 附:数据来源与依赖(供排查)
- 商机:`partner_opportunity`(数据范围按 `contactor_uid`)。 - 商机:`partner_opportunity`(数据范围按 `contactor_uid`)。
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment