R44 A2-A8 完成员工高级筛选批量操作与统计页
这个提交包含在:
@@ -62,7 +62,7 @@ describe("employee exports route", () => {
|
||||
|
||||
const response = await app.inject({
|
||||
method: "GET",
|
||||
url: `/api/exports/employees?format=csv&status=active&departmentId=${DEPARTMENT_ID}&q=alice`,
|
||||
url: `/api/exports/employees?format=csv&status=active&departmentId=${DEPARTMENT_ID}&q=alice&title=%E7%BB%8F%E7%90%86&managerId=bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb&hireDateFrom=2026-01-01&hireDateTo=2026-01-31&employmentStatus=active`,
|
||||
});
|
||||
|
||||
expect(response.statusCode).toBe(200);
|
||||
@@ -73,9 +73,22 @@ describe("employee exports route", () => {
|
||||
where: expect.objectContaining({
|
||||
status: "active",
|
||||
department_id: DEPARTMENT_ID,
|
||||
OR: expect.arrayContaining([
|
||||
expect.objectContaining({ name: expect.any(Object) }),
|
||||
expect.objectContaining({ employee_no: expect.any(Object) }),
|
||||
direct_manager_id: "bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb",
|
||||
employment_status: "active",
|
||||
hire_date: expect.objectContaining({
|
||||
gte: new Date("2026-01-01T00:00:00.000Z"),
|
||||
lte: new Date("2026-01-31T23:59:59.999Z"),
|
||||
}),
|
||||
AND: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
OR: expect.arrayContaining([
|
||||
expect.objectContaining({ name: expect.any(Object) }),
|
||||
expect.objectContaining({ employee_no: expect.any(Object) }),
|
||||
]),
|
||||
}),
|
||||
expect.objectContaining({
|
||||
title: expect.objectContaining({ contains: "经理" }),
|
||||
}),
|
||||
]),
|
||||
}),
|
||||
}),
|
||||
@@ -84,12 +97,20 @@ describe("employee exports route", () => {
|
||||
where: expect.objectContaining({
|
||||
status: "active",
|
||||
department_id: DEPARTMENT_ID,
|
||||
direct_manager_id: "bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb",
|
||||
}),
|
||||
});
|
||||
expect(auditCreate).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
data: expect.objectContaining({
|
||||
action: "EXPORT_EMPLOYEES",
|
||||
extra: expect.objectContaining({
|
||||
title: "经理",
|
||||
managerId: "bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb",
|
||||
hireDateFrom: "2026-01-01",
|
||||
hireDateTo: "2026-01-31",
|
||||
employmentStatus: "active",
|
||||
}),
|
||||
}),
|
||||
}),
|
||||
);
|
||||
|
||||
在新工单中引用
屏蔽一个用户