meta { name: 添加关联客户 type: http seq: 2 tags: [ generated ] } post { url: {{baseUrl}}/api/opportunity/customer/add body: formUrlEncoded auth: inherit } body:form-urlencoded { oppId: 748556126794022912 customerId: 920000000000000100 customerNameSnapshot: 园科集团(快照) customerRole: customer_role_01 isPrimaryIntended: 0 } docs { # 添加关联客户 `POST /api/opportunity/customer/add` 商机详情「客户」Tab「添加关联客户」弹窗「确认」触发。重复关联服务端拦截(66011);设为主要意向客户时原主要自动降为普通(原型业务规则 6),并回写主表快照列。customerId 从「候选客户搜索」或外部上下文带入,customerNameSnapshot 免 join 高频展示。 ## 请求参数 | 参数 | 类型 | 必填 | 默认 | 说明 | | --- | --- | --- | --- | --- | | oppId | string | 是 | - | 商机 ID | | customerId | string | 是 | - | 客户 ID(引用 A4 客户模块,未建;引用 id + 名快照并存) | | customerNameSnapshot | string | 否 | - | 客户名快照(免 join 展示) | | customerRole | string | 是 | - | 客户角色字典 code(原型弹窗关联信息设置区) | | isPrimaryIntended | number | 是 | - | 是否主要意向客户:1是 0否(设主要时原主要自动降为普通) | ## 请求示例 请求头:Authorization: Bearer {{token}} Content-Type: application/x-www-form-urlencoded POST /api/opportunity/customer/add oppId=748556126794022912&customerId=920000000000000100&customerNameSnapshot=园科集团(快照)&customerRole=customer_role_01&isPrimaryIntended=0 ## 响应 data 结构 新增关联行 ID(Long,序列化为 string) ## 响应示例 // 示例数据,字段结构以上表为准,非真实返回 ```json { "code": 0, "success": true, "message": "success", "data": "1" } ``` }