대시보드와 주간보고 기능 업데이트
This commit is contained in:
@@ -54,14 +54,15 @@ export default defineEventHandler(async (event) => {
|
||||
JOIN wr_weekly_report r ON t.report_id = r.report_id
|
||||
AND r.report_year = $1 AND r.report_week = $2
|
||||
JOIN wr_employee_info e ON r.author_id = e.employee_id
|
||||
WHERE p.project_status = 'IN_PROGRESS'
|
||||
GROUP BY p.project_id, p.project_code, p.project_name
|
||||
ORDER BY work_hours DESC
|
||||
`, [year, week])
|
||||
|
||||
// 3. 전체 요약
|
||||
const activeEmployees = employeeStats.length
|
||||
const submittedCount = employeeStats.filter((e: any) => e.report_id).length
|
||||
const submittedCount = employeeStats.filter((e: any) =>
|
||||
e.report_status === 'SUBMITTED' || e.report_status === 'AGGREGATED'
|
||||
).length
|
||||
const totalWorkHours = employeeStats.reduce((sum: number, e: any) => sum + parseFloat(e.work_hours || 0), 0)
|
||||
const totalPlanHours = employeeStats.reduce((sum: number, e: any) => sum + parseFloat(e.plan_hours || 0), 0)
|
||||
|
||||
@@ -86,7 +87,7 @@ export default defineEventHandler(async (event) => {
|
||||
planHours: parseFloat(e.plan_hours) || 0,
|
||||
workProjectCount: parseInt(e.work_project_count) || 0,
|
||||
planProjectCount: parseInt(e.plan_project_count) || 0,
|
||||
isSubmitted: !!e.report_id
|
||||
isSubmitted: e.report_status === 'SUBMITTED' || e.report_status === 'AGGREGATED'
|
||||
})),
|
||||
projects: projectStats.map((p: any) => ({
|
||||
projectId: p.project_id,
|
||||
|
||||
Reference in New Issue
Block a user