# 人员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 | |
areas |
# 响应
{
"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 | |
last_name | N | String | |
gender | N | String | S, F, M |
mobile | N | String | |
national | N | String | |
address | N | String | |
N | String | ||
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 | |
last_name | N | String | |
gender | N | String | S, F, M |
mobile | N | String | |
national | N | String | |
address | N | String | |
N | String | ||
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]
}
参数 | 必填 | 类型 | 描述 |
---|---|---|---|
employees | Y | List | 人员编号列表, 示例: [1, 2, 3, ...] |
areas | Y | List | 区域编号列表, 示例: [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
}
参数 | 必填 | 类型 | 描述 |
---|---|---|---|
employees | Y | List | 人员编号列表, 示例: [1, 2, 3, ...] |
department | Y | Integer | 部门编号 |
# 调整离职
# 请求
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 | |
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
}
参数 | 必填 | 类型 | 描述 |
---|---|---|---|
employees | Y | List | 人员编号列表, 示例: [1, 2, 3, ...] |
finger_print | N | Bool | true, false |
face | N | Bool | true, false |
finger_vein | N | Bool | true, false |
palm | N | Bool | true, false |
# 重新下发给设备
# 请求
Method: POST
Url: /personnel/api/employees/resync_to_device/
Headers:
- Content-Type: application/json
- Authorization: "JWT ey.........oQi98"
Request Body
{
"employees": [1, 2]
}
参数 | 必填 | 类型 | 描述 |
---|---|---|---|
employees | Y | List | 人员编号列表, 示例: [1, 2, 3, ...] |