feat: 일일순회점검 시스템 구축 및 관리 기능 개선
- 일일순회점검 시스템 신규 구현 - DB 테이블: patrol_checklist_items, daily_patrol_sessions, patrol_check_records, workplace_items, item_types - API: /api/patrol/* 엔드포인트 - 프론트엔드: 지도 기반 작업장 점검 UI - 설비 관리 기능 개선 - 구매 관련 필드 추가 (구매일, 가격, 공급업체 등) - 설비 코드 자동 생성 (TKP-XXX 형식) - 작업장 관리 개선 - 레이아웃 이미지 업로드 기능 - 마커 위치 저장 기능 - 부서 관리 기능 추가 - 사이드바 네비게이션 카테고리 재구성 - 이미지 401 오류 수정 (정적 파일 경로 처리) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -266,6 +266,11 @@ const EquipmentController = {
|
||||
map_height_percent: req.body.map_height_percent
|
||||
};
|
||||
|
||||
// workplace_id가 있으면 포함 (설비를 다른 작업장으로 이동 가능)
|
||||
if (req.body.workplace_id !== undefined) {
|
||||
positionData.workplace_id = req.body.workplace_id;
|
||||
}
|
||||
|
||||
EquipmentModel.updateMapPosition(equipmentId, positionData, (error, result) => {
|
||||
if (error) {
|
||||
console.error('설비 위치 업데이트 오류:', error);
|
||||
@@ -343,6 +348,37 @@ const EquipmentController = {
|
||||
message: '서버 오류가 발생했습니다.'
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// GET NEXT EQUIPMENT CODE - 다음 관리번호 자동 생성
|
||||
getNextEquipmentCode: (req, res) => {
|
||||
try {
|
||||
const prefix = req.query.prefix || 'TKP';
|
||||
|
||||
EquipmentModel.getNextEquipmentCode(prefix, (error, nextCode) => {
|
||||
if (error) {
|
||||
console.error('다음 관리번호 조회 오류:', error);
|
||||
return res.status(500).json({
|
||||
success: false,
|
||||
message: '다음 관리번호 조회 중 오류가 발생했습니다.'
|
||||
});
|
||||
}
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
data: {
|
||||
next_code: nextCode,
|
||||
prefix: prefix
|
||||
}
|
||||
});
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('다음 관리번호 조회 오류:', error);
|
||||
res.status(500).json({
|
||||
success: false,
|
||||
message: '서버 오류가 발생했습니다.'
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user