feat: 대시보드 작업장 현황 지도 구현
- 실시간 작업장 현황을 지도로 시각화 - 작업장 관리 페이지에서 정의한 구역 정보 활용 - TBM 작업자 및 방문자 현황 표시 주요 변경사항: - dashboard.html: 작업장 현황 섹션 추가 (기존 작업 현황 테이블 제거) - workplace-status.js: 지도 렌더링 및 데이터 통합 로직 구현 - modern-dashboard.js: 삭제된 DOM 요소 조건부 체크 추가 시각화 방식: - 인원 없음: 회색 테두리 + 작업장 이름 - 내부 작업자: 파란색 영역 + 인원 수 - 외부 방문자: 보라색 영역 + 인원 수 - 둘 다: 초록색 영역 + 총 인원 수 기술 구현: - Canvas API 기반 사각형 영역 렌더링 - map-regions API를 통한 데이터 일관성 보장 - 클릭 이벤트로 상세 정보 모달 표시 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -248,6 +248,77 @@ const getMonthlyAttendanceStatsService = async (year, month, workerId = null) =>
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 출근 체크 목록 조회 (휴가 정보 포함)
|
||||
*/
|
||||
const getCheckinListService = async (date) => {
|
||||
if (!date) {
|
||||
throw new ValidationError('날짜가 필요합니다', {
|
||||
required: ['date'],
|
||||
received: { date }
|
||||
});
|
||||
}
|
||||
|
||||
logger.info('출근 체크 목록 조회 요청', { date });
|
||||
|
||||
try {
|
||||
const checkinList = await AttendanceModel.getCheckinList(date);
|
||||
logger.info('출근 체크 목록 조회 성공', { date, count: checkinList.length });
|
||||
return checkinList;
|
||||
} catch (error) {
|
||||
logger.error('출근 체크 목록 조회 실패', { date, error: error.message });
|
||||
throw new DatabaseError('출근 체크 목록 조회 중 데이터베이스 오류가 발생했습니다');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 출근 체크 일괄 저장
|
||||
*/
|
||||
const saveCheckinsService = async (date, checkins) => {
|
||||
if (!date || !checkins || !Array.isArray(checkins)) {
|
||||
throw new ValidationError('날짜와 출근 체크 목록이 필요합니다', {
|
||||
required: ['date', 'checkins'],
|
||||
received: { date, checkins: checkins ? `Array[${checkins.length}]` : null }
|
||||
});
|
||||
}
|
||||
|
||||
logger.info('출근 체크 일괄 저장 요청', { date, count: checkins.length });
|
||||
|
||||
try {
|
||||
const results = [];
|
||||
|
||||
for (const checkin of checkins) {
|
||||
const { worker_id, is_present } = checkin;
|
||||
|
||||
if (!worker_id || is_present === undefined) {
|
||||
logger.warn('출근 체크 데이터 누락', { checkin });
|
||||
continue;
|
||||
}
|
||||
|
||||
const result = await AttendanceModel.upsertCheckin({
|
||||
worker_id,
|
||||
record_date: date,
|
||||
is_present
|
||||
});
|
||||
|
||||
results.push({
|
||||
worker_id,
|
||||
record_id: result,
|
||||
is_present
|
||||
});
|
||||
}
|
||||
|
||||
logger.info('출근 체크 일괄 저장 성공', { date, saved: results.length });
|
||||
return {
|
||||
saved_count: results.length,
|
||||
results
|
||||
};
|
||||
} catch (error) {
|
||||
logger.error('출근 체크 일괄 저장 실패', { date, error: error.message });
|
||||
throw new DatabaseError('출근 체크 저장 중 데이터베이스 오류가 발생했습니다');
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
getDailyAttendanceStatusService,
|
||||
getDailyAttendanceRecordsService,
|
||||
@@ -257,5 +328,7 @@ module.exports = {
|
||||
getAttendanceTypesService,
|
||||
getVacationTypesService,
|
||||
getWorkerVacationBalanceService,
|
||||
getMonthlyAttendanceStatsService
|
||||
getMonthlyAttendanceStatsService,
|
||||
getCheckinListService,
|
||||
saveCheckinsService
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user