화면정보 수정 및 미리보기 기능

This commit is contained in:
kjs
2025-10-15 18:31:40 +09:00
parent c42853f261
commit 716cfcb2cf
10 changed files with 742 additions and 230 deletions

View File

@@ -300,6 +300,51 @@ export class ScreenManagementService {
return this.mapToScreenDefinition(screen);
}
/**
* 화면 정보 수정 (메타데이터만) - 편집 기능용
*/
async updateScreenInfo(
screenId: number,
updateData: { screenName: string; description?: string; isActive: string },
userCompanyCode: string
): Promise<void> {
// 권한 확인
const existingResult = await query<{ company_code: string | null }>(
`SELECT company_code FROM screen_definitions WHERE screen_id = $1 LIMIT 1`,
[screenId]
);
if (existingResult.length === 0) {
throw new Error("화면을 찾을 수 없습니다.");
}
const existingScreen = existingResult[0];
if (
userCompanyCode !== "*" &&
existingScreen.company_code !== userCompanyCode
) {
throw new Error("이 화면을 수정할 권한이 없습니다.");
}
// 화면 정보 업데이트
await query(
`UPDATE screen_definitions
SET screen_name = $1,
description = $2,
is_active = $3,
updated_date = $4
WHERE screen_id = $5`,
[
updateData.screenName,
updateData.description || null,
updateData.isActive,
new Date(),
screenId,
]
);
}
/**
* 화면 의존성 체크 - 다른 화면에서 이 화면을 참조하는지 확인
*/