feat: Implement smart factory schedule management functionality

- Added new API endpoints for managing smart factory schedules, including retrieval, creation, updating, and deletion of schedules.
- Integrated schedule management into the smart factory log controller, enhancing the overall functionality.
- Implemented a scheduler initialization process to automate daily plan generation and scheduled sends.
- Developed a frontend page for monitoring equipment, production, and quality, with real-time data fetching and auto-refresh capabilities.

These changes aim to provide comprehensive scheduling capabilities for smart factory operations, improving efficiency and operational visibility for users.
This commit is contained in:
kjs
2026-04-07 14:16:26 +09:00
parent 9aa8ca136b
commit c3e973bb1a
13 changed files with 3222 additions and 389 deletions

View File

@@ -173,6 +173,35 @@ export async function runMessengerMigration() {
/**
* 스마트공장 활용 로그 테이블 마이그레이션
*/
/**
* 스마트공장 스케줄 + 공휴일 테이블 마이그레이션
*/
export async function runSmartFactoryScheduleMigration() {
try {
console.log("🔄 스마트공장 스케줄 테이블 마이그레이션 시작...");
const sqlFilePath = path.join(
__dirname,
"../../db/migrations/201_create_smart_factory_schedule.sql"
);
if (!fs.existsSync(sqlFilePath)) {
console.log("⚠️ 마이그레이션 파일이 없습니다:", sqlFilePath);
return;
}
const sqlContent = fs.readFileSync(sqlFilePath, "utf8");
await PostgreSQLService.query(sqlContent);
console.log("✅ 스마트공장 스케줄 테이블 마이그레이션 완료!");
} catch (error) {
console.error("❌ 스마트공장 스케줄 테이블 마이그레이션 실패:", error);
if (error instanceof Error && error.message.includes("already exists")) {
console.log(" 테이블이 이미 존재합니다.");
}
}
}
export async function runSmartFactoryLogMigration() {
try {
console.log("🔄 스마트공장 로그 테이블 마이그레이션 시작...");