- 페이지 폴더 재구성: safety/, attendance/ 폴더 신규 생성 - work/ → safety/: 이슈 신고, 출입 신청 관련 페이지 이동 - common/ → attendance/: 근태/휴가 관련 페이지 이동 - admin/ 정리: safety-* 파일들을 safety/로 이동 - 사이드바 네비게이션 메뉴 구현 - 카테고리별 메뉴: 작업관리, 안전관리, 근태관리, 시스템관리 - 접기/펼치기 기능 및 상태 저장 - 관리자 전용 메뉴 자동 표시/숨김 - 날씨 API 연동 (기상청 단기예보) - TBM 및 navbar에 현재 날씨 표시 - weatherService.js 추가 - 안전 체크리스트 확장 - 기본/날씨별/작업별 체크 유형 추가 - checklist-manage.html 페이지 추가 - 이슈 신고 시스템 구현 - workIssueController, workIssueModel, workIssueRoutes 추가 - DB 마이그레이션 파일 추가 (실행 대기) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
104 lines
4.1 KiB
JavaScript
104 lines
4.1 KiB
JavaScript
// routes/tbmRoutes.js - TBM 시스템 라우트
|
|
const express = require('express');
|
|
const router = express.Router();
|
|
const TbmController = require('../controllers/tbmController');
|
|
const { requireAuth } = require('../middlewares/auth');
|
|
|
|
// ==================== TBM 세션 관련 ====================
|
|
|
|
// TBM 세션 생성
|
|
router.post('/sessions', requireAuth, TbmController.createSession);
|
|
|
|
// 작업보고서가 작성되지 않은 TBM 팀 배정 조회 (구체적인 경로이므로 먼저 정의)
|
|
router.get('/sessions/incomplete-reports', requireAuth, TbmController.getIncompleteWorkReports);
|
|
|
|
// 특정 날짜의 TBM 세션 목록 조회
|
|
router.get('/sessions/date/:date', requireAuth, TbmController.getSessionsByDate);
|
|
|
|
// TBM 세션 상세 조회
|
|
router.get('/sessions/:sessionId', requireAuth, TbmController.getSessionById);
|
|
|
|
// TBM 세션 수정
|
|
router.put('/sessions/:sessionId', requireAuth, TbmController.updateSession);
|
|
|
|
// TBM 세션 완료 처리
|
|
router.post('/sessions/:sessionId/complete', requireAuth, TbmController.completeSession);
|
|
|
|
// ==================== 팀 구성 관련 ====================
|
|
|
|
// 팀원 추가 (단일)
|
|
router.post('/sessions/:sessionId/team', requireAuth, TbmController.addTeamMember);
|
|
|
|
// 팀 구성 일괄 추가
|
|
router.post('/sessions/:sessionId/team/batch', requireAuth, TbmController.addTeamMembers);
|
|
|
|
// TBM 세션의 팀 구성 조회
|
|
router.get('/sessions/:sessionId/team', requireAuth, TbmController.getTeamMembers);
|
|
|
|
// 팀원 전체 삭제 (수정 시 사용) - 더 구체적인 경로이므로 먼저 정의
|
|
router.delete('/sessions/:sessionId/team/clear', requireAuth, TbmController.clearAllTeamMembers);
|
|
|
|
// 팀원 제거
|
|
router.delete('/sessions/:sessionId/team/:workerId', requireAuth, TbmController.removeTeamMember);
|
|
|
|
// ==================== 안전 체크리스트 관련 ====================
|
|
|
|
// 모든 안전 체크 항목 조회
|
|
router.get('/safety-checks', requireAuth, TbmController.getAllSafetyChecks);
|
|
|
|
// 안전 체크 항목 생성 (관리자용)
|
|
router.post('/safety-checks', requireAuth, TbmController.createSafetyCheck);
|
|
|
|
// 안전 체크 항목 수정 (관리자용)
|
|
router.put('/safety-checks/:checkId', requireAuth, TbmController.updateSafetyCheck);
|
|
|
|
// 안전 체크 항목 삭제 (관리자용)
|
|
router.delete('/safety-checks/:checkId', requireAuth, TbmController.deleteSafetyCheck);
|
|
|
|
// TBM 세션의 안전 체크 기록 조회
|
|
router.get('/sessions/:sessionId/safety', requireAuth, TbmController.getSafetyRecords);
|
|
|
|
// 안전 체크 일괄 저장
|
|
router.post('/sessions/:sessionId/safety', requireAuth, TbmController.saveSafetyRecords);
|
|
|
|
// 필터링된 안전 체크리스트 조회 (기본 + 날씨 + 작업별)
|
|
router.get('/sessions/:sessionId/safety-checks/filtered', requireAuth, TbmController.getFilteredSafetyChecks);
|
|
|
|
// ==================== 날씨 관련 ====================
|
|
|
|
// 현재 날씨 조회
|
|
router.get('/weather/current', requireAuth, TbmController.getCurrentWeather);
|
|
|
|
// 날씨 조건 목록 조회
|
|
router.get('/weather/conditions', requireAuth, TbmController.getWeatherConditions);
|
|
|
|
// 세션 날씨 정보 조회
|
|
router.get('/sessions/:sessionId/weather', requireAuth, TbmController.getSessionWeather);
|
|
|
|
// 세션 날씨 정보 저장
|
|
router.post('/sessions/:sessionId/weather', requireAuth, TbmController.saveSessionWeather);
|
|
|
|
// ==================== 작업 인계 관련 ====================
|
|
|
|
// 작업 인계 생성
|
|
router.post('/handovers', requireAuth, TbmController.createHandover);
|
|
|
|
// 작업 인계 확인
|
|
router.post('/handovers/:handoverId/confirm', requireAuth, TbmController.confirmHandover);
|
|
|
|
// 특정 날짜의 작업 인계 목록 조회
|
|
router.get('/handovers/date/:date', requireAuth, TbmController.getHandoversByDate);
|
|
|
|
// 나에게 온 미확인 인계 건 조회
|
|
router.get('/handovers/pending', requireAuth, TbmController.getMyPendingHandovers);
|
|
|
|
// ==================== 통계 및 리포트 ====================
|
|
|
|
// TBM 통계 조회
|
|
router.get('/statistics/tbm', requireAuth, TbmController.getTbmStatistics);
|
|
|
|
// 리더별 TBM 진행 현황 조회
|
|
router.get('/statistics/leaders', requireAuth, TbmController.getLeaderStatistics);
|
|
|
|
module.exports = router;
|