实际工作天数计算

parent 80bbcc19
...@@ -217,13 +217,6 @@ export const exportWorkhours = async (req: AuthRequest, res: Response): Promise< ...@@ -217,13 +217,6 @@ export const exportWorkhours = async (req: AuthRequest, res: Response): Promise<
p.id as project_id, p.project_name, p.project_no, p.id as project_id, p.project_name, p.project_no,
pm.name as manager_name, pm.name as manager_name,
o.id as overtime_id, o.hours as overtime_hours, o.description as overtime_description, o.id as overtime_id, o.hours as overtime_hours, o.description as overtime_description,
(SELECT COUNT(DISTINCT wh2.work_date)
FROM workhours wh2
WHERE wh2.employee_id = w.employee_id
AND wh2.project_id = w.project_id
${start_date ? ' AND wh2.work_date >= ?' : ''}
${end_date ? ' AND wh2.work_date <= ?' : ''}
) as work_day_count,
(SELECT ol.operator_name (SELECT ol.operator_name
FROM operation_logs ol FROM operation_logs ol
WHERE ol.module = '加班管理' WHERE ol.module = '加班管理'
...@@ -272,7 +265,8 @@ export const exportWorkhours = async (req: AuthRequest, res: Response): Promise< ...@@ -272,7 +265,8 @@ export const exportWorkhours = async (req: AuthRequest, res: Response): Promise<
'', // 审核人2(暂留空) '', // 审核人2(暂留空)
row.hours != null ? Number(row.hours) : '', // 实际工作量 row.hours != null ? Number(row.hours) : '', // 实际工作量
row.overtime_hours != null ? Number(row.overtime_hours) : '', // 实际加班 row.overtime_hours != null ? Number(row.overtime_hours) : '', // 实际加班
row.work_day_count || '', // 实际工作天数 // 实际工作天数 = 实际工作量/8 + 实际加班/8
((row.hours != null ? Number(row.hours) : 0) + (row.overtime_hours != null ? Number(row.overtime_hours) : 0)) / 8,
]); ]);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment