15 品质分类API
API列表
编号 | API名称 | |
---|---|---|
15.1 | 品质分类新增/更新 | /quality/categoryInfo/update |
15.2 | 根据平台标识返回品质分类树 | /quality/categoryInfo/trees |
15.3 | 删除品质分类 | /quality/categoryInfo/remove/{id} |
15.4 | 品质分类分页查询 | /quality/categoryInfo/page |
15.5 | 加载详情 | /quality/categoryInfo/get/{id} |
15.1 品质分类的新增和修改
描述
请求信息
HTTP协议:HTTP,HTTPS
uri: /quality/categoryInfo/update
方法:PUT
请求参数:
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
id | Long | 否 | 品质分类表的主键id, 些值为空代表新增,此值非空代表修改 |
name | String | 是 | 同一层级,名称不可重复,长度 1-64 |
orgId | Long | 否 | 睿住平台些值必填,代表全局切换业务组织id, 0 |
orgCode | String | 否 | 睿住平台些值必填,代表全局切换业务组织org_code |
tenantId | Long | 是 | 平台租户标识,默认为0, 云邻平台 睿住平台:1 |
parentId | Long | 否 | 父分类的主键id, 为空代表分类是一个顶级品质分类 |
请求Body描述(非Form表单数据)
{
"name":"BBBB",
"parentId": 123
}
返回信息
返回结果示例
{
"code": "200",
"data": {
"id": 58,
"orgId": null,
"orgCode": null,
"tenantId": "0",
"updateBy": null,
"updateTime": null,
"createBy": null,
"createTime": null,
"parentId": 52,
"parentCode": null,
"fullCategoryName": "ABC/ABC01/ABC0104",
"name": "ABC0104",
"code": "100000000100000000100000003",
"type": 3,
"isRefered": null,
"isDeleted": null,
"children": null
},
"message": "成功"
}
15.2 根据平台标识返回品质分类树
描述. 本接口返回多棵树。
请求信息
HTTP协议:HTTP,HTTPS
uri: /quality/categoryInfo/trees
eg: http://localhost:20070/quality/categoryInfo/trees
方法:POST
请求参数:
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
z | |||
orgCode | String | 否 | 睿住平台此值必填,代表全局切换业务组织org_code, 查询org_code的所有的分类树,需要调用统一的SDK |
tenantId | Long | 是 | 不需前端传入, 由云端调用平台全局统一SDK: com.smart.remac.quality.controller.BaseController.validate( T body, String sessionInfo) |
请求Body描述(非Form表单数据)
{"tenantId": 0}
返回信息
返回结果示例
{
"code": "200",
"data": {
"result": [
{
"tree": [
{
"id": 67,
"orgId": null,
"orgCode": null,
"tenantId": "0",
"updateBy": null,
"updateTime": "2021-11-02T08:58:41.000+00:00",
"createBy": null,
"createTime": null,
"parentId": null,
"parentCode": null,
"fullCategoryName": "OK1",
"name": "OK1",
"code": "100000000",
"type": 1,
"isRefered": false,
"isDeleted": 0,
"children": [
{
"id": 68,
"orgId": null,
"orgCode": null,
"tenantId": "0",
"updateBy": null,
"updateTime": "2021-11-02T08:58:53.000+00:00",
"createBy": null,
"createTime": null,
"parentId": 67,
"parentCode": "100000000",
"fullCategoryName": "OK1/OK1-1",
"name": "OK1-1",
"code": "100000000100000000",
"type": 2,
"isRefered": false,
"isDeleted": 0,
"children": null
},
{
"id": 69,
"orgId": null,
"orgCode": null,
"tenantId": "0",
"updateBy": null,
"updateTime": "2021-11-02T08:58:56.000+00:00",
"createBy": null,
"createTime": null,
"parentId": 67,
"parentCode": "100000000",
"fullCategoryName": "OK1/OK1-2",
"name": "OK1-2",
"code": "100000000100000001",
"type": 2,
"isRefered": false,
"isDeleted": 0,
"children": null
}
]
}
]
},
{
"tree": [
{
"id": 70,
"orgId": null,
"orgCode": null,
"tenantId": "0",
"updateBy": null,
"updateTime": "2021-11-02T08:59:33.000+00:00",
"createBy": null,
"createTime": null,
"parentId": null,
"parentCode": null,
"fullCategoryName": "OK2",
"name": "OK2",
"code": "100000001",
"type": 1,
"isRefered": false,
"isDeleted": 0,
"children": [
{
"id": 71,
"orgId": null,
"orgCode": null,
"tenantId": "0",
"updateBy": null,
"updateTime": "2021-11-02T08:59:53.000+00:00",
"createBy": null,
"createTime": null,
"parentId": 70,
"parentCode": "100000001",
"fullCategoryName": "OK2/OK2-1",
"name": "OK2-1",
"code": "100000001100000000",
"type": 2,
"isRefered": false,
"isDeleted": 0,
"children": null
},
{
"id": 72,
"orgId": null,
"orgCode": null,
"tenantId": "0",
"updateBy": null,
"updateTime": "2021-11-02T09:00:00.000+00:00",
"createBy": null,
"createTime": null,
"parentId": 70,
"parentCode": "100000001",
"fullCategoryName": "OK2/OK2-2",
"name": "OK2-2",
"code": "100000001100000001",
"type": 2,
"isRefered": false,
"isDeleted": 0,
"children": null
},
{
"id": 73,
"orgId": null,
"orgCode": null,
"tenantId": "0",
"updateBy": null,
"updateTime": "2021-11-02T09:00:04.000+00:00",
"createBy": null,
"createTime": null,
"parentId": 70,
"parentCode": "100000001",
"fullCategoryName": "OK2/OK2-3",
"name": "OK2-3",
"code": "100000001100000002",
"type": 2,
"isRefered": false,
"isDeleted": 0,
"children": [
{
"id": 74,
"orgId": null,
"orgCode": null,
"tenantId": "0",
"updateBy": null,
"updateTime": "2021-11-02T09:00:11.000+00:00",
"createBy": null,
"createTime": null,
"parentId": 73,
"parentCode": "100000001100000002",
"fullCategoryName": "OK2/OK2-3/OK2-3-1",
"name": "OK2-3-1",
"code": "100000001100000002100000000",
"type": 3,
"isRefered": false,
"isDeleted": 0,
"children": null
}
]
}
]
}
]
}
]
},
"message": "成功"
}
返回字段说明 :
tree: 代表一棵完整的品质分类树,可以包含多个子树节点children,支持无限级递归嵌套。由云平台采用统一的算法提供支持 ,生成的树型JSON与开源tree组件兼容。
15.3 品质分类删除
规则:1, 节点引用后作为未级; 2,检查指标引用品质分类节点,此分类节点没有下级节点;3,节点引用后,当前节点不可加下级,当前节点不可修改不可删除;
描述
请求信息
HTTP协议:HTTP,HTTPS
uri: /quality/categoryInfo/remove/{id}
方法:DELETE
路径参数:
id : 品质分类的主键id
15.4 品质分类分页查询
描述 前端不需要转入tenantId, 由平台统一处理
请求信息
HTTP协议:HTTP,HTTPS
uri: /quality/categoryInfo/page
方法:POST
路径参数:
id : 品质分类的主键id
请求参数:
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
z | |||
pageNo | Int | 否 | 默认为1 |
pageSize | Int | 否 | 分页查询,每页所加载的记录条数 |
orgId | String | 否 | orgId不为空,将查询orgId对应的业务组织下的集合 |
tenantId | String | 否 | 不需前端传入, 由云端调用平台全局统一SDK: com.smart.remac.quality.controller.BaseController.validate( T body, String sessionInfo) |
业务组织数据隔离 |
返回示例:
{
"code": 200,
"data": {
"total": 8,
"pages": 4,
"records": [
{
"code": "100000000",
"updateTime": "2021-11-02T08:58:41.000+00:00",
"isRefered": false,
"type": 1,
"orgId": null,
"parentId": null,
"createBy": null,
"isDeleted": 0,
"children": null,
"createTime": null,
"parentCode": null,
"updateBy": null,
"fullCategoryName": "OK1",
"orgCode": null,
"name": "OK1",
"tenantId": "0",
"id": 67
},
{
"code": "100000000100000000",
"updateTime": "2021-11-02T08:58:53.000+00:00",
"isRefered": false,
"type": 2,
"orgId": null,
"parentId": 67,
"createBy": null,
"isDeleted": 0,
"children": null,
"createTime": null,
"parentCode": "100000000",
"updateBy": null,
"fullCategoryName": "OK1/OK1-1",
"orgCode": null,
"name": "OK1-1",
"tenantId": "0",
"id": 68
}
],
"pageNo": 1,
"pageSize": 2
},
"message": "success"
}
返回字段:
total: 相关表总的记录条数
pages: 本次查询所返回的总页数
15.5 品质分类详情加载
描述
请求信息
HTTP协议:HTTP,HTTPS
uri: /quality/categoryInfo/get/{id}
方法:GET
路径参数:
id : 品质分类的主键id