fix(tksupport): 전사 차감 월별 반영 + 테이블 가독성 개선 + 캘린더 차감일 표시
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -51,11 +51,12 @@ const vacationDashboardController = {
|
||||
async getYearlyOverview(req, res) {
|
||||
try {
|
||||
const year = parseInt(req.query.year) || new Date().getFullYear();
|
||||
const [users, balances] = await Promise.all([
|
||||
const [users, balances, companyDeductions] = await Promise.all([
|
||||
vacationDashboardModel.getYearlyOverview(year),
|
||||
vacationDashboardModel.getBalances(year)
|
||||
vacationDashboardModel.getBalances(year),
|
||||
vacationDashboardModel.getCompanyDeductions(year)
|
||||
]);
|
||||
res.json({ success: true, data: { users, balances } });
|
||||
res.json({ success: true, data: { users, balances, companyDeductions } });
|
||||
} catch (error) {
|
||||
console.error('연간 총괄 조회 오류:', error);
|
||||
res.status(500).json({ success: false, error: '서버 오류가 발생했습니다' });
|
||||
|
||||
@@ -56,7 +56,7 @@ const vacationDashboardModel = {
|
||||
const db = getPool();
|
||||
const [rows] = await db.query(`
|
||||
SELECT
|
||||
su.user_id, su.name, su.username,
|
||||
su.user_id, su.name, su.username, su.hire_date,
|
||||
COALESCE(d.department_id, 0) as department_id,
|
||||
COALESCE(d.department_name, '미배정') as department_name,
|
||||
MONTH(vr.start_date) as month,
|
||||
@@ -104,11 +104,24 @@ const vacationDashboardModel = {
|
||||
return rows;
|
||||
},
|
||||
|
||||
// View 1: 전사 휴가 차감 내역
|
||||
async getCompanyDeductions(year) {
|
||||
const db = getPool();
|
||||
const [rows] = await db.query(`
|
||||
SELECT holiday_date, holiday_name, MONTH(holiday_date) as month
|
||||
FROM company_holidays
|
||||
WHERE YEAR(holiday_date) = ?
|
||||
AND holiday_type = 'ANNUAL_DEDUCT'
|
||||
AND deduction_applied_at IS NOT NULL
|
||||
`, [year]);
|
||||
return rows;
|
||||
},
|
||||
|
||||
// View 2: 공휴일 표시용
|
||||
async getHolidays(year, month) {
|
||||
const db = getPool();
|
||||
const [rows] = await db.query(`
|
||||
SELECT holiday_date, holiday_name
|
||||
SELECT holiday_date, holiday_name, holiday_type, deduction_applied_at
|
||||
FROM company_holidays
|
||||
WHERE YEAR(holiday_date) = ? AND MONTH(holiday_date) = ?
|
||||
`, [year, month]);
|
||||
|
||||
Reference in New Issue
Block a user