巡检接口文档

管理端接口(PC)

巡检项目

一、创建项目

create_pather_project

参数名称 描述 类型 是否必填
action create_pather_project string M
name 名称 string M
alias 别名,如果为空,则用uid替代 []string M
script 脚本,格式前端自己定义和解析 map M
strict 是否严格模式 1是0否,如果是严格模式,
项目的所有子项必须都完成才能提交
int M
dispatch_to 分配给谁,格式是用户id用逗号隔开
例如 “1,2,3,4” 表示分配给用户ID为 1,2,3,4 的四个用户
如果是空,则表示给所有用户
string M
description 描述 string M
user_id 当前用户,中台自动传入 int M
position_list 巡检点列表 数组,格式如下表 []map M

巡检点参数

参数名称 描述 类型 是否必填
name 巡检点名称 string M
alias 别名,如果为空,则用自动生成的uid替代 string O
description 描述 string M

请求示例:

{
    "action": "create_pather_project",
    "name": "name",
    "alias": "",
    "script": {
        "a": 1
    },
    "strict": 0,
    "dispatch_to": "1,2,3,4",
    "description": "description",
    "user_id": 1,
    "position_list": [
        {
            "name": "name",
            "alias": "alais",
            "description": "description"
        }
    ]
}

响应示例:

{
    "resp": "create_pather_project",
    "code": 200,
    "msg": "成功",
    "result": {
        "alias": "PPJ4505425200001",
        "created_at": "2024-05-30 16:23:54",
        "created_by": 1,
        "description": "description",
        "dispatch_to": "1,2,3,4",
        "id": 21,
        "is_active": 0,
        "name": "name",
        "script": {
            "a": 1
        },
        "strict": 0,
        "uid": "PPJ4505425200001",
        "updated_at": "2024-05-30 16:23:54",
        "updated_by": 1
    }
}

二、编辑项目

create_pather_project

参数名称 描述 类型 是否必填
action create_pather_project string M
uid 项目编号 string M
name 名称 string M
alias 别名,如果为空,则用uid替代 []string M
script 脚本,格式前端自己定义和解析 map M
strict 是否严格模式 1是0否,如果是严格模式,
项目的所有子项必须都完成才能提交
int M
dispatch_to 分配给谁,格式是用户id用逗号隔开
例如 “1,2,3,4” 表示分配给用户ID为 1,2,3,4 的四个用户
如果是空,则表示给所有用户
string M
description 描述 string M
user_id 当前用户,中台自动传入 int M
position_list 巡检点列表 数组 []map M

请求示例:

{
    "action": "update_pather_project",
    "uid": "PPJ4503807300001",
    "name": "name",
    "alias": "",
    "script": {
        "a": 1
    },
    "strict": 0,
    "dispatch_to": "1,2,3,4",
    "description": "description",
    "user_id": 1,
    "position_list": [
        {
            "name": "name",
            "alias": "alais",
            "description": "description"
        }
    ]
}

响应示例:

{
    "resp": "update_pather_project",
    "code": 200,
    "msg": "成功",
    "result": {
        "alias": "",
        "created_at": "2024-05-30 16:17:38",
        "created_by": 1,
        "description": "description",
        "dispatch_to": "1,2,3,4",
        "id": 16,
        "is_active": 0,
        "name": "name",
        "script": {
            "a": 1
        },
        "strict": 0,
        "uid": "PPJ4503807300001",
        "updated_at": "2024-05-30 16:33:33",
        "updated_by": 1
    }
}

三、删除项目

delete_pather_project

参数名称 描述 类型 是否必填
action delete_pather_project string M
uid 对象编号 string M

请求示例:

{
    "action": "delete_pather_project",
    "uid": "PPJ4503807300001"
}

响应示例:

{
    "resp": "delete_pather_project",
    "code": 200,
    "msg": "成功",
    "result": {
        "alias": "",
        "created_at": "2024-05-30 16:17:38",
        "created_by": 1,
        "description": "description",
        "dispatch_to": "1,2,3,4",
        "id": 16,
        "is_active": 0,
        "name": "name",
        "script": {
            "a": 1
        },
        "strict": 0,
        "uid": "PPJ4503807300001",
        "updated_at": "2024-05-30 16:33:33",
        "updated_by": 1
    }
}

四、获取项目列表

get_pather_project_list

支持传统where_and等参数

参数名称 描述 类型 是否必填
action get_pather_project_list string M

请求示例:

{
    "action": "get_pather_project_list"
}

响应示例:

{
    "resp": "get_pather_project_list",
    "code": 200,
    "msg": "成功",
    "result": {
        "data": [
            {
                "alias": "PPJ4504826100004",
                "created_at": "2024-05-30 16:28:48",
                "created_by": 1,
                "description": "description",
                "dispatch_to": "1,2,3,4",
                "id": 24,
                "is_active": 0,
                "name": "name",
                "script": {
                    "a": 1
                },
                "strict": 0,
                "uid": "PPJ4504826100004",
                "updated_at": "2024-05-30 16:28:48",
                "updated_by": 1
            },
            {
                "alias": "PPJ4505425200001",
                "created_at": "2024-05-30 16:23:54",
                "created_by": 1,
                "description": "description",
                "dispatch_to": "1,2,3,4",
                "id": 21,
                "is_active": 0,
                "name": "name",
                "script": {
                    "a": 1
                },
                "strict": 0,
                "uid": "PPJ4505425200001",
                "updated_at": "2024-05-30 16:23:54",
                "updated_by": 1
            }
        ],
        "page_index": 1,
        "page_size": 20,
        "total_pages": 1,
        "total_records": 2
    }
}

五、获取项目详情

get_pather_project_item

参数名称 描述 类型 是否必填
action get_pather_project_item string M
uid 项目编号 string M

请求示例:

{
    "action": "get_pather_project_item",
    "uid": "PPJ4580402600009"
}

响应示例:

{
    "resp": "get_pather_project_item",
    "code": 200,
    "msg": "成功",
    "result": {
        "alias": "PPJ4580402600009",
        "created_at": "2024-05-28 17:05:04",
        "created_by": 1,
        "description": "",
        "dispatch_to": "",
        "id": 10,
        "is_active": 1,
        "name": "projectname112321321321",
        "script": {
            "a": 1
        },
        "strict": 1,
        "uid": "PPJ4580402600009",
        "updated_at": "2024-05-29 10:50:15",
        "updated_by": 1
    }
}

六、获取项目具体详情

get_pather_project_detail 返回结果带巡检点和各巡检点下的巡检项

参数名称 描述 类型 是否必填
action get_pather_project_detail string M
uid 项目UID string M

返回结果说明:

result中的position_list 是巡检点列表

巡检点的字段说明如下:

参数名称 描述 类型
uid 巡检点编号 string
name 名称 string
project_uid 所属项目 string
script 脚本 map
sort 排序 1,2,3,4 前端在展示的时候,给前面加上P
例如P1、P2、P3
int
alias 别名 string
created_at 创建时间 string
created_by 创建人 int
updated_at 更新时间 string
updated_by 更新人 int
description 描述 string
item_list 巡检项列表 []map

巡检项的字段说明如下:

参数名称 描述 类型
uid 巡检点编号 string
name 名称 string
project_uid 所属项目 string
script 脚本 map
position_uid 所属巡检点 string
alias 别名 string
created_at 创建时间 string
created_by 创建人 int
updated_at 更新时间 string
updated_by 更新人 int
description 描述 string

请求示例:

{
    "action": "get_pather_project_detail",
    "uid": "PPJ4580402600009"
}

响应示例:

{
    "resp": "get_pather_project_detail",
    "code": 200,
    "msg": "成功",
    "result": {
        "alias": "PPJ4580402600009",
        "created_at": "2024-05-28 17:05:04",
        "created_by": 1,
        "description": "",
        "dispatch_to": "",
        "id": 10,
        "is_active": 1,
        "name": "projectname112321321321",
        "position_list": [
            {
                "alias": "PPS4591526500003",
                "created_at": "2024-05-29 10:50:15",
                "created_by": 1,
                "description": "descriptiondescriptiondescription",
                "id": 30,
                "item_list": [
                    {
                        "alias": "PIM4594490000002",
                        "created_at": "2024-05-29 10:59:45",
                        "created_by": 1,
                        "description": "",
                        "id": 3,
                        "name": "projectname112321321321",
                        "position_uid": "PPS4591526500003",
                        "project_uid": "PPJ4580402600009",
                        "script": {
                            "a": 1
                        },
                        "uid": "PIM4594490000002",
                        "updated_at": "2024-05-29 10:59:45",
                        "updated_by": 1
                    },
                    {
                        "alias": "PIM4590286300003",
                        "created_at": "2024-05-29 11:02:03",
                        "created_by": 1,
                        "description": "",
                        "id": 4,
                        "name": "projectname112321321321",
                        "position_uid": "PPS4591526500003",
                        "project_uid": "PPJ4580402600009",
                        "script": {
                            "a": 1
                        },
                        "uid": "PIM4590286300003",
                        "updated_at": "2024-05-29 11:02:03",
                        "updated_by": 1
                    }
                ],
                "name": "pst11",
                "project_uid": "PPJ4580402600009",
                "script": null,
                "sort": 1,
                "uid": "PPS4591526500003",
                "updated_at": "2024-05-29 10:50:15",
                "updated_by": 1
            },
            {
                "alias": "PPS4583739800003",
                "created_at": "2024-05-29 10:50:15",
                "created_by": 1,
                "description": "descriptiondescriptiondescription",
                "id": 31,
                "item_list": [],
                "name": "pst21",
                "project_uid": "PPJ4580402600009",
                "script": null,
                "sort": 2,
                "uid": "PPS4583739800003",
                "updated_at": "2024-05-29 10:50:15",
                "updated_by": 1
            },
            {
                "alias": "PPS4583739800004",
                "created_at": "2024-05-29 10:50:15",
                "created_by": 1,
                "description": "descriptiondescriptiondescription",
                "id": 32,
                "item_list": [],
                "name": "pst31",
                "project_uid": "PPJ4580402600009",
                "script": null,
                "sort": 3,
                "uid": "PPS4583739800004",
                "updated_at": "2024-05-29 10:50:15",
                "updated_by": 1
            }
        ],
        "script": {
            "a": 1
        },
        "strict": 1,
        "uid": "PPJ4580402600009",
        "updated_at": "2024-05-29 10:50:15",
        "updated_by": 1
    }
}

七、开启项目

open_pather_project

参数名称 描述 类型 是否必填
open_pather_project open_pather_project string M
uid uid string M

请求示例:

{
    "action": "open_pather_project",
    "uid": "PPJ4580402600009"
}

响应示例:

{
    "resp": "open_pather_project",
    "code": 200,
    "msg": "成功",
    "result": {
        "alias": "PPJ4580402600009",
        "created_at": "2024-05-28 17:05:04",
        "created_by": 1,
        "description": "",
        "dispatch_to": "",
        "id": 10,
        "is_active": 1,
        "name": "projectname112321321321",
        "script": {
            "a": 1
        },
        "strict": 1,
        "uid": "PPJ4580402600009",
        "updated_at": "2024-05-30 16:50:32",
        "updated_by": 1
    }
}

八、关闭项目

close_pather_project

参数名称 描述 类型 是否必填
action close_pather_project string M
uid uid string M

请求示例:

{
    "action": "close_pather_project",
    "uid": "PPJ4580402600009"
}

响应示例:

{
    "resp": "close_pather_project",
    "code": 200,
    "msg": "成功",
    "result": {
        "alias": "PPJ4580402600009",
        "created_at": "2024-05-28 17:05:04",
        "created_by": 1,
        "description": "",
        "dispatch_to": "",
        "id": 10,
        "is_active": 0,
        "name": "projectname112321321321",
        "script": {
            "a": 1
        },
        "strict": 1,
        "uid": "PPJ4580402600009",
        "updated_at": "2024-05-30 16:51:01",
        "updated_by": 1
    }
}

###

巡检点

一、巡检点列表

get_pather_position_list

支持传统where_and等

参数名称 描述 类型 是否必填
action get_pather_position_list string M

如果想要获取某一个项目下的所有巡检点,并且按照序号从小到大排列,可以这样请求:

请求示例:

{
    "action": "get_pather_position_list",
    "where_and":[["project_uid","=","PPJ4580402600009"]],
    "page_size":0,
    "page_index":0,
    "order_type":"asc",
    "order_by":"sort"
}

响应示例:

{
    "resp": "get_pather_position_list",
    "code": 200,
    "msg": "成功",
    "result": {
        "data": [
            {
                "alias": "PPS4591526500003",
                "created_at": "2024-05-29 10:50:15",
                "created_by": 1,
                "description": "descriptiondescriptiondescription",
                "id": 30,
                "name": "pst11",
                "project_uid": "PPJ4580402600009",
                "script": null,
                "sort": 1,
                "uid": "PPS4591526500003",
                "updated_at": "2024-05-29 10:50:15",
                "updated_by": 1
            },
            {
                "alias": "PPS4583739800003",
                "created_at": "2024-05-29 10:50:15",
                "created_by": 1,
                "description": "descriptiondescriptiondescription",
                "id": 31,
                "name": "pst21",
                "project_uid": "PPJ4580402600009",
                "script": null,
                "sort": 2,
                "uid": "PPS4583739800003",
                "updated_at": "2024-05-29 10:50:15",
                "updated_by": 1
            },
            {
                "alias": "PPS4583739800004",
                "created_at": "2024-05-29 10:50:15",
                "created_by": 1,
                "description": "descriptiondescriptiondescription",
                "id": 32,
                "name": "pst31",
                "project_uid": "PPJ4580402600009",
                "script": null,
                "sort": 3,
                "uid": "PPS4583739800004",
                "updated_at": "2024-05-29 10:50:15",
                "updated_by": 1
            }
        ],
        "page_index": 1,
        "page_size": 0,
        "total_pages": 1,
        "total_records": 3
    }
}

###

巡检项

一、创建巡检项

create_pather_item

参数名称 描述 类型 是否必填
action create_pather_item string M
name 巡检项名称 string M
alias 别名 string M
project_uid 所属巡检项目 string M
position_uid 所属巡检点 string M
script 脚本 mao M
description 描述 string M
user_id 创建人 int M

请求示例:

{
    "action": "create_pather_item", 
    "name":"name",
    "alias":"alias",
    "project_uid":"PPJ4504826100004",
    "position_uid":"PPS4504826300005",
    "script":{"a":1},
    "description":"description",
    "user_id":1
}

响应示例:

{
    "resp": "create_pather_item",
    "code": 200,
    "msg": "成功",
    "result": {
        "alias": "alias",
        "created_at": "2024-05-30 17:00:03",
        "created_by": 1,
        "description": "description",
        "id": 6,
        "name": "name",
        "position_uid": "PPS4504826300005",
        "project_uid": "PPJ4504826100004",
        "script": {
            "a": 1
        },
        "uid": "PIM4500333200002",
        "updated_at": "2024-05-30 17:00:03",
        "updated_by": 1
    }
}

二、编辑巡检项

update_pather_item

参数名称 描述 类型 是否必填
action update_pather_item string M
uid 编号 string M
name 巡检项名称 string M
alias 别名 string M
project_uid 所属巡检项目 string M
position_uid 所属巡检点 string M
script 脚本 mao M
description 描述 string M
user_id 创建人 int M

请求示例:

{
    "action": "update_pather_item", 
    "uid":"PIM4500333200002",
    "name":"name",
    "alias":"alias",
    "project_uid":"PPJ4504826100004",
    "position_uid":"PPS4504826300005",
    "script":{"a":1},
    "description":"description",
    "user_id":1
}

响应示例:

{
    "resp": "update_pather_item",
    "code": 200,
    "msg": "成功",
    "result": {
        "alias": "alias",
        "created_at": "2024-05-30 17:00:03",
        "created_by": 1,
        "description": "description",
        "id": 6,
        "name": "name",
        "position_uid": "PPS4504826300005",
        "project_uid": "PPJ4504826100004",
        "script": {
            "a": 1
        },
        "uid": "PIM4500333200002",
        "updated_at": "2024-05-30 17:01:45",
        "updated_by": 1
    }
}

三、删除巡检项

delete_pather_item

参数名称 描述 类型 是否必填
action delete_pather_item string M
uid uid string M

请求示例:

{
    "action": "delete_pather_item", 
    "uid":"PIM4500333200002" 
}

响应示例:

{
    "resp": "delete_pather_item",
    "code": 200,
    "msg": "成功",
    "result": {
        "alias": "alias",
        "created_at": "2024-05-30 17:00:03",
        "created_by": 1,
        "description": "description",
        "id": 6,
        "name": "name",
        "position_uid": "PPS4504826300005",
        "project_uid": "PPJ4504826100004",
        "script": {
            "a": 1
        },
        "uid": "PIM4500333200002",
        "updated_at": "2024-05-30 17:01:45",
        "updated_by": 1
    }
}

四、获取巡检项列表

get_pather_item_list

用where_and可以获取指定项目和指定点的巡检项

参数名称 描述 类型 是否必填
action get_pather_item_list string M

请求示例:

{
    "action": "get_pather_item_list"
}

响应示例:

{
    "resp": "get_pather_item_list",
    "code": 200,
    "msg": "成功",
    "result": {
        "data": [
            {
                "alias": "PIM4590286300003",
                "created_at": "2024-05-29 11:02:03",
                "created_by": 1,
                "description": "",
                "id": 4,
                "name": "projectname112321321321",
                "position_uid": "PPS4591526500003",
                "project_uid": "PPJ4580402600009",
                "script": {
                    "a": 1
                },
                "uid": "PIM4590286300003",
                "updated_at": "2024-05-29 11:02:03",
                "updated_by": 1
            },
            {
                "alias": "PIM4594490000002",
                "created_at": "2024-05-29 10:59:45",
                "created_by": 1,
                "description": "",
                "id": 3,
                "name": "projectname112321321321",
                "position_uid": "PPS4591526500003",
                "project_uid": "PPJ4580402600009",
                "script": {
                    "a": 1
                },
                "uid": "PIM4594490000002",
                "updated_at": "2024-05-29 10:59:45",
                "updated_by": 1
            }
        ],
        "page_index": 1,
        "page_size": 20,
        "total_pages": 1,
        "total_records": 2
    }
}

五、获取巡检项详情

get_pather_item_item

参数名称 描述 类型 是否必填
action get_pather_item_item string M
uid uid string M

请求示例:

{
    "action": "get_pather_item_item", 
    "uid":"PIM4594490000002" 
}

响应示例:

{
    "resp": "get_pather_item_item",
    "code": 200,
    "msg": "成功",
    "result": {
        "alias": "PIM4594490000002",
        "created_at": "2024-05-29 10:59:45",
        "created_by": 1,
        "description": "",
        "id": 3,
        "name": "projectname112321321321",
        "position_uid": "PPS4591526500003",
        "project_uid": "PPJ4580402600009",
        "script": {
            "a": 1
        },
        "uid": "PIM4594490000002",
        "updated_at": "2024-05-29 10:59:45",
        "updated_by": 1
    }
}

###

巡检记录

一、巡检项目记录列表

get_pather_project_log_list

参数名称 描述 类型 是否必填
action get_pather_project_log_list string M

请求示例:

{
    "action": "get_pather_project_log_list"
}

响应示例:

{
    "resp": "get_pather_project_log_list",
    "code": 200,
    "msg": "成功",
    "result": {
        "data": [
            {
                "alias": "PPJ4580402600009",
                "created_at": "2024-05-29 18:08:24",
                "created_by": 2,
                "description": "",
                "finished_at": "2024-05-30 11:10:17",
                "id": 21,
                "is_finished": 1,
                "name": "projectname112321321321",
                "project_uid": "PPJ4580402600009",
                "script": {
                    "a": 1
                },
                "strict": 0,
                "uid": "PJL4592373500001",
                "updated_at": "2024-05-30 11:10:17",
                "updated_by": 2
            }
        ],
        "page_index": 1,
        "page_size": 20,
        "total_pages": 1,
        "total_records": 1
    }
}

二、获取巡检项记录列表

get_pather_item_log_list

带上where 条件可以获取某一个巡检项目记录 下的所有巡检项记录 project_log_uid

参数名称 描述 类型 是否必填
action get_pather_item_log_list string M

请求示例:

{
    "action": "get_pather_item_log_list"
}

响应示例:

{
    "resp": "get_pather_item_log_list",
    "code": 200,
    "msg": "成功",
    "result": {
        "data": [
            {
                "alias": "PIM4594490000002",
                "created_at": "2024-05-29 18:08:24",
                "created_by": 2,
                "description": "",
                "finished_at": null,
                "id": 14,
                "is_finished": 0,
                "item_uid": "PIM4594490000002",
                "name": "projectname112321321321",
                "position_log_uid": "PSL4592374200004",
                "position_uid": "PPS4591526500003",
                "project_log_uid": "PJL4592373500001",
                "project_uid": "PPJ4580402600009",
                "result": null,
                "script": {
                    "a": 1
                },
                "uid": "IML4592374400006",
                "updated_at": "2024-05-29 18:08:24",
                "updated_by": 2
            },
            {
                "alias": "PIM4590286300003",
                "created_at": "2024-05-29 18:08:24",
                "created_by": 2,
                "description": "",
                "finished_at": "2024-05-29 18:27:14",
                "id": 13,
                "is_finished": 1,
                "item_uid": "PIM4590286300003",
                "name": "projectname112321321321",
                "position_log_uid": "PSL4592374200004",
                "position_uid": "PPS4591526500003",
                "project_log_uid": "PJL4592373500001",
                "project_uid": "PPJ4580402600009",
                "result": {
                    "a": 1
                },
                "script": {
                    "a": 1
                },
                "uid": "IML4592374300005",
                "updated_at": "2024-05-29 18:27:14",
                "updated_by": 2
            }
        ],
        "page_index": 1,
        "page_size": 20,
        "total_pages": 1,
        "total_records": 2
    }
}

二、巡检记录详情

get_pather_project_log_item

参数名称 描述 类型 是否必填
action get_pather_project_log_item string M
uid uid string M

请求示例:

{
    "action": "get_pather_project_log_item",
    "uid": "PJL4592373500001"
}

响应示例:

{
    "resp": "get_pather_project_log_item",
    "code": 200,
    "msg": "成功",
    "result": {
        "alias": "PPJ4580402600009",
        "created_at": "2024-05-29 18:08:24",
        "created_by": 2,
        "description": "",
        "finished_at": "2024-05-30 11:10:17",
        "id": 21,
        "is_finished": 1,
        "name": "projectname112321321321",
        "project_uid": "PPJ4580402600009",
        "script": {
            "a": 1
        },
        "strict": 0,
        "uid": "PJL4592373500001",
        "updated_at": "2024-05-30 11:10:17",
        "updated_by": 2
    }
}

三、巡检记录详情(带点和项)

get_pather_project_log_detail

参数名称 描述 类型 是否必填
action get_pather_project_log_detail string M
uid uid string M

请求示例:

{
    "action": "get_pather_project_log_detail",
    "uid": "PJL4592373500001"
}

响应示例:

{
    "resp": "get_pather_project_log_detail",
    "code": 200,
    "msg": "成功",
    "result": {
        "alias": "PPJ4580402600009",
        "created_at": "2024-05-29 18:08:24",
        "created_by": 2,
        "description": "",
        "finished_at": "2024-05-30 11:10:17",
        "id": 21,
        "is_finished": 1,
        "name": "projectname112321321321",
        "position_list": [
            {
                "alias": "PPS4591526500003",
                "created_at": "2024-05-29 18:08:24",
                "created_by": 2,
                "description": "descriptiondescriptiondescription",
                "id": 50,
                "item_list": [
                    {
                        "alias": "PIM4590286300003",
                        "created_at": "2024-05-29 18:08:24",
                        "created_by": 2,
                        "description": "",
                        "finished_at": "2024-05-29 18:27:14",
                        "id": 13,
                        "is_finished": 1,
                        "item_uid": "PIM4590286300003",
                        "name": "projectname112321321321",
                        "position_log_uid": "PSL4592374200004",
                        "position_uid": "PPS4591526500003",
                        "project_log_uid": "PJL4592373500001",
                        "project_uid": "PPJ4580402600009",
                        "result": {
                            "a": 1
                        },
                        "script": {
                            "a": 1
                        },
                        "uid": "IML4592374300005",
                        "updated_at": "2024-05-29 18:27:14",
                        "updated_by": 2
                    },
                    {
                        "alias": "PIM4594490000002",
                        "created_at": "2024-05-29 18:08:24",
                        "created_by": 2,
                        "description": "",
                        "finished_at": null,
                        "id": 14,
                        "is_finished": 0,
                        "item_uid": "PIM4594490000002",
                        "name": "projectname112321321321",
                        "position_log_uid": "PSL4592374200004",
                        "position_uid": "PPS4591526500003",
                        "project_log_uid": "PJL4592373500001",
                        "project_uid": "PPJ4580402600009",
                        "result": null,
                        "script": {
                            "a": 1
                        },
                        "uid": "IML4592374400006",
                        "updated_at": "2024-05-29 18:08:24",
                        "updated_by": 2
                    }
                ],
                "name": "pst11",
                "position_uid": "PPS4591526500003",
                "project_log_uid": "PJL4592373500001",
                "project_uid": "PPJ4580402600009",
                "script": null,
                "sort": 1,
                "uid": "PSL4592374200004",
                "updated_at": "2024-05-29 18:08:24",
                "updated_by": 2
            },
            {
                "alias": "PPS4583739800003",
                "created_at": "2024-05-29 18:08:24",
                "created_by": 2,
                "description": "descriptiondescriptiondescription",
                "id": 48,
                "item_list": [],
                "name": "pst21",
                "position_uid": "PPS4583739800003",
                "project_log_uid": "PJL4592373500001",
                "project_uid": "PPJ4580402600009",
                "script": null,
                "sort": 2,
                "uid": "PSL4592373900002",
                "updated_at": "2024-05-29 18:08:24",
                "updated_by": 2
            },
            {
                "alias": "PPS4583739800004",
                "created_at": "2024-05-29 18:08:24",
                "created_by": 2,
                "description": "descriptiondescriptiondescription",
                "id": 49,
                "item_list": [],
                "name": "pst31",
                "position_uid": "PPS4583739800004",
                "project_log_uid": "PJL4592373500001",
                "project_uid": "PPJ4580402600009",
                "script": null,
                "sort": 3,
                "uid": "PSL4592374000003",
                "updated_at": "2024-05-29 18:08:24",
                "updated_by": 2
            }
        ],
        "project_uid": "PPJ4580402600009",
        "script": {
            "a": 1
        },
        "strict": 0,
        "uid": "PJL4592373500001",
        "updated_at": "2024-05-30 11:10:17",
        "updated_by": 2
    }
}

四、删除巡检记录

delete_pather_project_log

参数名称 描述 类型 是否必填
action delete_pather_project_log string M
uid uid string M

请求示例:

{
    "action": "delete_pather_project_log",
    "uid": "PJL4592373500001"
}

响应示例:

{
    "resp": "delete_pather_project_log",
    "code": 200,
    "msg": "成功",
    "result": {
        "alias": "PPJ4580402600009",
        "created_at": "2024-05-29 18:08:24",
        "created_by": 2,
        "description": "",
        "finished_at": "2024-05-30 11:10:17",
        "id": 21,
        "is_finished": 1,
        "name": "projectname112321321321",
        "project_uid": "PPJ4580402600009",
        "script": {
            "a": 1
        },
        "strict": 0,
        "uid": "PJL4592373500001",
        "updated_at": "2024-05-30 11:10:17",
        "updated_by": 2
    }
}

###

用户端接口(APP)

一、获取巡检列表(分配给我的全部)

包含指定给我的,和没有指定用户的

get_my_pather_project_list

参数名称 描述 类型 是否必填
action get_my_pather_project_list string M
user_id 当前用户ID int M

请求示例:

{
    "action": "get_my_pather_project_list",
    "user_id": 2
}

响应示例:

{
    "resp": "get_my_pather_project_list",
    "code": 200,
    "msg": "成功",
    "result": {
        "data": [
            {
                "alias": "PPJ4580402600009",
                "created_at": "2024-05-28 17:05:04",
                "created_by": 1,
                "description": "",
                "dispatch_to": "",
                "id": 10,
                "is_active": 1,
                "name": "projectname112321321321",
                "script": {
                    "a": 1
                },
                "strict": 1,
                "uid": "PPJ4580402600009",
                "updated_at": "2024-05-30 16:51:01",
                "updated_by": 1
            }
        ],
        "page_index": 1,
        "page_size": 20,
        "total_pages": 1,
        "total_records": 1
    }
}

二、获取巡检列表(巡检中)

get_my_ongoing_project_list

参数名称 描述 类型 是否必填
action get_my_ongoing_project_list string M
user_id 用户ID int M

请求示例:

{
    "action": "get_my_ongoing_project_list",
    "user_id": 2
}

响应示例:

{
    "resp": "get_my_ongoing_project_list",
    "code": 200,
    "msg": "成功",
    "result": {
        "data": [],
        "page_index": 1,
        "page_size": 20,
        "total_pages": 0,
        "total_records": 0
    }
}

三、巡检我的记录列表

get_my_pather_project_log_list

参数名称 描述 类型 是否必填
action get_my_pather_project_log_list string M
user_id 用户ID int M

请求示例:

{
    "action": "get_my_pather_project_log_list",
    "user_id": 2
}

响应示例:

{
    "resp": "get_my_pather_project_log_list",
    "code": 200,
    "msg": "成功",
    "result": {
        "data": [],
        "page_index": 1,
        "page_size": 20,
        "total_pages": 0,
        "total_records": 0
    }
}

四、开始项目 开始按钮

start_pather_project

参数名称 描述 类型 是否必填
action start_pather_project string M
project_uid 要执行的项目UID string M
user_id 要执行的用户id int M

请求示例:

{
    "action": "start_pather_project",
    "project_uid": "PPJ4580402600009",
    "user_id": 2
}

响应示例:

{
    "resp": "start_pather_project",
    "code": 200,
    "msg": "成功",
    "result": {
        "alias": "PPJ4580402600009",
        "created_at": "2024-05-30 17:27:15",
        "created_by": 2,
        "description": "",
        "finished_at": null,
        "id": 24,
        "is_finished": 0,
        "name": "projectname112321321321",
        "project_uid": "PPJ4580402600009",
        "script": {
            "a": 1
        },
        "strict": 1,
        "uid": "PJL4501461600001",
        "updated_at": "2024-05-30 17:27:15",
        "updated_by": 2
    }
}

五、完成项目 结束按钮

finish_pather_project

参数名称 描述 类型 是否必填
action finish_pather_project string M
project_log_uid 项目UID string M
user_id 用户id []string M

请求示例:

{
    "action": "finish_pather_project",
    "project_log_uid": "PJL4501461600001",
    "user_id": 2
}

响应示例1:

{
    "resp": "finish_pather_project",
    "code": 10014,
    "msg": "请求-接口调用失败",
    "info": "严格模式下不能有未完成的巡检项",
    "result": {}
}

响应示例2:

{
    "resp": "finish_pather_project",
    "code": 200,
    "msg": "成功",
    "result": {
        "alias": "PPJ4580402600009",
        "created_at": "2024-05-30 17:27:15",
        "created_by": 2,
        "description": "",
        "finished_at": "2024-05-30 17:32:55",
        "id": 24,
        "is_finished": 1,
        "name": "projectname112321321321",
        "project_uid": "PPJ4580402600009",
        "script": {
            "a": 1
        },
        "strict": 0,
        "uid": "PJL4501461600001",
        "updated_at": "2024-05-30 17:32:55",
        "updated_by": 2
    }
}

六、提交巡检项

submit_pather_item

请求示例:

{
    "action": "submit_pather_item",
    "item_log_uid": "IML4501462200005",
    "result": {"a":1},
    "user_id": 2
}

响应示例:

{
    "resp": "submit_pather_item",
    "code": 200,
    "msg": "成功",
    "result": {
        "alias": "PIM4590286300003",
        "created_at": "2024-05-30 17:27:15",
        "created_by": 2,
        "description": "",
        "finished_at": "2024-05-30 17:35:30",
        "id": 15,
        "is_finished": 1,
        "item_uid": "PIM4590286300003",
        "name": "projectname112321321321",
        "position_log_uid": "PSL4501462100004",
        "position_uid": "PPS4591526500003",
        "project_log_uid": "PJL4501461600001",
        "project_uid": "PPJ4580402600009",
        "result": {
            "a": 1
        },
        "script": {
            "a": 1
        },
        "uid": "IML4501462200005",
        "updated_at": "2024-05-30 17:35:30",
        "updated_by": 2
    }
}

###

文档更新时间: 2024-08-30 20:57   作者:技术支持