GET 车间列表
参数位置:query:keyword、enabled。 GET 查询。query 参数:keyword(编码、名称、负责人模糊匹配,不分大小写)、enabled(1 启用 0 停用;不传为全部)。返回车间及工位数、启用工位数、设备数、可用设备数,按编码自然排序,不分页。
| 接口编码 | 所需范围 | 后端接口 |
|---|---|---|
production.workshop.list | production:read | GET /v1/production-workshop/list(comap-srm) |
员工权限:本接口按权限码 production:assembly:list,production:cost-config:list,production:equipment:list,production:inspections:list,production:onboarding:list,production:operations:list,production:routings:list,production:screens:list,production:tasks:list,production:terminals:list,production:time-clocks:list,production:wage-sheets:list,production:work-reports:list,production:workshops:list,production:workstations:list 对照绑定员工的主站功能权限。
请求参数(query)
本接口的 query 参数由后端查询对象整体展开,接口规格未保留各字段的原始 类型,故类型列统一显示为
string。实际取值语义见「说明」列,按自然类型 传即可(如"pageNum": 1),服务端会完成转换。
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
keyword | string | — | 编码、名称、负责人模糊匹配(不分大小写) |
enabled | string | — | 启用:1 启用 0 停用;不传为全部 |
「必填」仅反映接口规格声明的部分。服务内还有未体现在规格里的校验, 标「—」不等于可以不传;租户在主站配置的字段必填不约束本接口。 详见必填字段的判定与字段清单与自定义字段。
请求示例
curl -X POST https://open.risemap.cn/v1/api/invoke \
-H "Authorization: Bearer <访问令牌>" \
-H "Content-Type: application/json" \
-d '{
"apiCode": "production.workshop.list",
"query": {}
}'
响应 data 字段
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | integer(int64) | — | 车间 ID |
code | string | — | 车间编码 |
name | string | — | 车间名称 |
managerName | string | — | 负责人姓名(选了员工时是保存那会儿的姓名副本;managerId 为空时是没关联员工的旧文本) |
managerId | integer(int64) | — | 负责人(HR 员工 ID,F2-config-03) |
defaultStoreId | integer(int64) | — | 默认入库仓 |
defaultStoreName | string | — | 默认入库仓名称 |
defaultRequisitionStoreId | integer(int64) | — | 默认领料仓(C33) |
defaultRequisitionStoreName | string | — | 默认领料仓名称 |
enabled | integer(int32) | — | 启用:1 启用 0 停用 |
remark | string | — | 备注 |
createdAt | string(date-time) | — | 创建时间 |
updatedAt | string(date-time) | — | 更新时间 |
workstationCount | integer(int32) | — | 工位数(含停用,只在列表) |
enabledWorkstationCount | integer(int32) | — | 启用工位数(只在列表) |
equipmentCount | integer(int32) | — | 设备数,不含已报废(只在列表) |
availableEquipmentCount | integer(int32) | — | 其中可用的台数(只在列表) |
deptIds | integer(int64)[] | — | 关联部门(P02,只在车间建模) |
memberIds | integer(int64)[] | — | 其他人员(P02,只在车间建模) |
错误处理
响应统一信封 { code, message, data },code == 200 为成功。以下是本接口可能返回的开放平台层错误:
| 错误码 | 说明 | 可重试 |
|---|---|---|
| 92101 | 访问凭证无效 | 否 |
| 92201 | 接口未登记或已停用 | 否 |
| 92202 | 超出凭证授权范围——本接口需 production:read | 否 |
| 92204 | 绑定员工无此接口的功能权限 | 否 |
| 92203 | 上游服务调用失败 | 是 |
| 92301 | 请求过于频繁 | 是 |
除此之外,comap-srm 自身的业务校验失败会原样透传其业务码与提示
(如字段校验、状态不允许、数据不存在),这类码不在开放平台的号段内,
以响应里的 message 为准。完整的平台层错误码见错误码说明。
← 返回workshop