feat: 페이지 구조 재구성 및 사이드바 네비게이션 구현
- 페이지 폴더 재구성: 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>
This commit is contained in:
@@ -106,3 +106,70 @@ exports.getSummary = asyncHandler(async (req, res) => {
|
||||
message: '월간 요약 조회 성공'
|
||||
});
|
||||
});
|
||||
|
||||
// ========== 부적합 원인 관리 API ==========
|
||||
|
||||
/**
|
||||
* 작업 보고서의 부적합 원인 목록 조회
|
||||
*/
|
||||
exports.getReportDefects = asyncHandler(async (req, res) => {
|
||||
const { reportId } = req.params;
|
||||
const rows = await workReportService.getReportDefectsService(reportId);
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
data: rows,
|
||||
message: '부적합 원인 조회 성공'
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* 부적합 원인 저장 (전체 교체)
|
||||
* 기존 부적합 원인을 모두 삭제하고 새로 저장
|
||||
*/
|
||||
exports.saveReportDefects = asyncHandler(async (req, res) => {
|
||||
const { reportId } = req.params;
|
||||
const { defects } = req.body; // [{ error_type_id, defect_hours, note }]
|
||||
|
||||
const result = await workReportService.saveReportDefectsService(reportId, defects);
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
data: result,
|
||||
message: '부적합 원인이 저장되었습니다'
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* 부적합 원인 추가 (단일)
|
||||
*/
|
||||
exports.addReportDefect = asyncHandler(async (req, res) => {
|
||||
const { reportId } = req.params;
|
||||
const { error_type_id, defect_hours, note } = req.body;
|
||||
|
||||
const result = await workReportService.addReportDefectService(reportId, {
|
||||
error_type_id,
|
||||
defect_hours,
|
||||
note
|
||||
});
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
data: result,
|
||||
message: '부적합 원인이 추가되었습니다'
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* 부적합 원인 삭제
|
||||
*/
|
||||
exports.removeReportDefect = asyncHandler(async (req, res) => {
|
||||
const { defectId } = req.params;
|
||||
const result = await workReportService.removeReportDefectService(defectId);
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
data: result,
|
||||
message: '부적합 원인이 삭제되었습니다'
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user