API docsAPI docs
  • English
  • zh-CN
  • English
  • zh-CN
    • 概述
    • 请求 & 响应
    • 获取Auth Token
    • 使用 Auth Token
    • Api Example
    • 区域API
    • 部门API
    • 职位API
    • 人员API
    • 离职API
    • 设备API
    • 考勤记录API
    • 考勤报表API

人员API

列表

请求

  • Method: GET
  • Url: /personnel/api/employees/
  • Headers:
    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Query Parameters
参数描述
page显示第几页
page_size显示该页数据的条数
emp_code使用该字段进行查询
emp_code_icontains查询该字段包含所填内容的数据
first_name使用该字段进行查询
first_name_icontains查询该字段包含所填内容的数据
last_name使用该字段进行查询
last_name_icontains查询该字段包含所填内容的数据
department使用该字段进行查询,示例:department=1
areas使用该字段进行查询,示例:areas=1

响应

{
    "count": 6,
    "next": null,
    "previous": null,
    "msg": "",
    "code": 0,
    "data": [
        {
            "id": 1,
            "emp_code": "007",
            "first_name": "",
            "last_name": null,
            "nickname": null,
            "device_password": null,
            "card_no": null,
            "department": {
                "id": 3715,
                "dept_code": "4",
                "dept_name": "MARS Egypt"
            },
            "position": null,
            "hire_date": "2020-06-01",
            "gender": null,
            "birthday": null,
            "verify_mode": 0,
            "emp_type": null,
            "contact_tel": null,
            "office_tel": null,
            "mobile": null,
            "national": null,
            "city": null,
            "address": null,
            "postcode": null,
            "email": null,
            "enroll_sn": "CEUY201760002",
            "ssn": null,
            "religion": null,
            "enable_att": true,
            "enable_overtime": false,
            "enable_holiday": true,
            "dev_privilege": 0,
            "area": [
                {
                    "id": 136,
                    "area_code": "1111.111.11",
                    "area_name": "test1"
                }
            ],
            "app_status": 0,
            "app_role": 1,
            "update_time": "2020-06-01 19:37:35",
            "fingerprint": "Ver 10:1",
            "face": "-",
            "palm": "-",
            "vl_face": "-"
        },
        ......
    ]
}

读取

请求

  • Method: GET

  • Url: /personnel/api/employees/{id}/

  • Headers:

    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Path Parameters

参数描述
id必填

响应

  • Url: /personnel/api/employees/1/
{
    "id": 1,
    "emp_code": "007",
    "first_name": "",
    "last_name": null,
    "nickname": null,
    "device_password": null,
    "card_no": null,
    "department": {
        "id": 3715,
        "dept_code": "4",
        "dept_name": "MARS Egypt"
    },
    "position": null,
    "hire_date": "2020-06-01",
    "gender": null,
    "birthday": null,
    "verify_mode": 0,
    "emp_type": null,
    "contact_tel": null,
    "office_tel": null,
    "mobile": null,
    "national": null,
    "city": null,
    "address": null,
    "postcode": null,
    "email": null,
    "enroll_sn": "CEUY201760002",
    "ssn": null,
    "religion": null,
    "enable_att": true,
    "enable_overtime": false,
    "enable_holiday": true,
    "dev_privilege": 0,
    "area": [
        {
            "id": 136,
            "area_code": "1111.111.11",
            "area_name": "test1"
        }
    ],
    "app_status": 0,
    "app_role": 1,
    "update_time": "2020-06-01 19:37:35",
    "fingerprint": "Ver 10:1",
    "face": "-",
    "palm": "-",
    "vl_face": "-"
}

创建

  • Method: POST
  • Url: /personnel/api/employees/
  • Headers:
    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Request Body
{
    "emp_code": "111111111",
    "department": 1,
    "area": [1, 2]
}

|参数|必填|类型| 描述 | | ----- | ----- |------------------------------| |emp_code|Y|String| 人员编号 | |department|Y|Integer| 部门编号, 示例: [1, 2, 3, ...] | |area|Y|List| 区域编号 | |hire_date|N|String| 格式化: yyyy-mm-dd, 默认当天 | |first_name|N|String| 最大限制25个字符 | |last_name|N|String| 最大限制25个字符 | |gender|N|String| S, F, M | |mobile|N|String| 最大限制20个字符 | |national|N|String| 最大限制50个字符 | |address|N|String| 最大限制200个字符 | |email|N|String| 最大50个字符,且需输入邮箱格式 | |app_status|N|Integer| (1, 'Enable');(0, 'Disable') | |...|N|String| | |...|N|String| |

响应

{
    "id": 100,
    "emp_code": "111111111",
    "first_name": "",
    "last_name": null,
    "nickname": null,
    "device_password": null,
    "card_no": null,
    "department": {
        "id": 1,
        "dept_code": "default dept",
        "dept_name": "default dept"
    },
    "position": null,
    "hire_date": "2020-06-01",
    "gender": null,
    "birthday": null,
    "verify_mode": 0,
    "emp_type": null,
    "contact_tel": null,
    "office_tel": null,
    "mobile": null,
    "national": null,
    "city": null,
    "address": null,
    "postcode": null,
    "email": null,
    "enroll_sn": "",
    "ssn": null,
    "religion": null,
    "enable_att": true,
    "enable_overtime": false,
    "enable_holiday": true,
    "dev_privilege": 0,
    "area": [
        {
            "id": 1,
            "area_code": "default dept",
            "area_name": "default dept"
        },
        {
            "id": 2,
            "area_code": "default dept1",
            "area_name": "default dept1"
        }
    ],
    "app_status": 0,
    "app_role": 1,
    "update_time": "2020-06-01 19:37:35",
    "fingerprint": -,
    "face": "-",
    "palm": "-",
    "vl_face": "-"
}

更新

请求

  • Method: PUT

  • Url: /personnel/api/employees/{id}/

  • Headers:

    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Path Parameters

参数描述
id必填
  • Request Body
{
    "emp_code": "111111111",
    "department": 1,
    "area": [1, 2]
}

|参数|必填|类型| 描述 | | ----- | ----- |------------------------------| |emp_code|Y|String| 人员编号 | |department|Y|Integer| 部门编号, 示例: [1, 2, 3, ...] | |area|Y|List| 区域编号 | |hire_date|N|String| 格式化: yyyy-mm-dd, 默认当天 | |first_name|N|String| 最大限制25个字符 | |last_name|N|String| 最大限制25个字符 | |gender|N|String| S, F, M | |mobile|N|String| 最大限制20个字符 | |national|N|String| 最大限制20个字符 | |address|N|String| 最大限制200个字符 | |email|N|String| 最大限制50个字符,需输入邮箱的正确格式 | |app_status|N|Integer| (1, 'Enable');(0, 'Disable') | |...|N|String| | |...|N|String| |

响应

{
    "id": 100,
    "emp_code": "111111111",
    "first_name": "",
    "last_name": null,
    "nickname": null,
    "device_password": null,
    "card_no": null,
    "department": {
        "id": 1,
        "dept_code": "default dept",
        "dept_name": "default dept"
    },
    "position": null,
    "hire_date": "2020-06-01",
    "gender": null,
    "birthday": null,
    "verify_mode": 0,
    "emp_type": null,
    "contact_tel": null,
    "office_tel": null,
    "mobile": null,
    "national": null,
    "city": null,
    "address": null,
    "postcode": null,
    "email": null,
    "enroll_sn": "",
    "ssn": null,
    "religion": null,
    "enable_att": true,
    "enable_overtime": false,
    "enable_holiday": true,
    "dev_privilege": 0,
    "area": [
        {
            "id": 1,
            "area_code": "default dept",
            "area_name": "default dept"
        },
        {
            "id": 2,
            "area_code": "default dept1",
            "area_name": "default dept1"
        }
    ],
    "app_status": 0,
    "app_role": 1,
    "update_time": "2020-06-01 19:37:35",
    "fingerprint": -,
    "face": "-",
    "palm": "-",
    "vl_face": "-"
}

删除

请求

  • Method: DELETE

  • Url: /personnel/api/employees/{id}/

  • Headers:

    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Path Parameters

参数描述
id必填

响应

None

调整区域

请求

  • Method: POST

  • Url: /personnel/api/employees/adjust_area/

  • Headers:

    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Request Body

{
    "employees": [1, 2],
    "areas": [3, 4]
}
参数必填类型描述
employeesYList人员编号列表, 示例: [1, 2, 3, ...]
areasYList区域编号列表, 示例: [1, 2, 3, ...]

调整部门

请求

  • Method: POST

  • Url: /personnel/api/employees/adjust_department/

  • Headers:

    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Request Body

{
    "employees": [1, 2],
    "department": 2
}
参数必填类型描述
employeesYList人员编号列表, 示例: [1, 2, 3, ...]
departmentYInteger部门编号

调整离职

请求

  • Method: POST

  • Url: /personnel/api/employees/adjust_regsin/

  • Headers:

    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Request Body

{
    "employees": [1, 2],
    "resign_date": 2,
    "resign_type": 1,
    "reason": "test reason",
    "disableatt": True
}

|参数|必填|类型| 描述 | | ----- | ----- |-------------------------------------------------------------------------------------| |employees|Y|List| 人员编号列表, 示例: [1, 2, 3, ...] | |resign_date|Y|String| 格式化: yyyy-mm-dd | |resign_type|Y|Integer| (1, quit), (2, dismissed), (3, resign), (4, transfer), (5, retainJobWithoutSalary), | |reason|N|String| 最大限制长度200个字符 | |disableatt|Y|Bool| true, false |

删除人员模板

请求

  • Method: POST

  • Url: /personnel/api/employees/del_bio_template/

  • Headers:

    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Request Body

{
    "employees": [1, 2],
    "finger_print": true,
    "face": false,
    "finger_vein": true,
    "palm": true
}
参数必填类型描述
employeesYList人员编号列表, 示例: [1, 2, 3, ...]
finger_printNBooltrue, false
faceNBooltrue, false
finger_veinNBooltrue, false
palmNBooltrue, false

重新下发给设备

请求

  • Method: POST

  • Url: /personnel/api/employees/resync_to_device/

  • Headers:

    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Request Body

{
    "employees": [1, 2]
}
参数必填类型描述
employeesYList人员编号列表, 示例: [1, 2, 3, ...]
Prev
职位API
Next
离职API