다국어 생성후 매핑 자동저장

This commit is contained in:
kjs
2026-01-14 13:26:41 +09:00
parent f9575d7b5f
commit 26bb93ab6e
6 changed files with 207 additions and 29 deletions

View File

@@ -1137,16 +1137,22 @@ export const generateScreenLabelKeys = async (
return;
}
// 사용자 회사 정보
const companyCode = req.user?.companyCode || "*";
// 화면의 회사 정보 조회 (사용자 회사가 아닌 화면 소속 회사 기준)
const { queryOne } = await import("../database/db");
const screenInfo = await queryOne<{ company_code: string }>(
`SELECT company_code FROM screen_definitions WHERE screen_id = $1`,
[screenId]
);
const companyCode = screenInfo?.company_code || req.user?.companyCode || "*";
// 회사명 조회
const { queryOne } = await import("../database/db");
const companyInfo = await queryOne<{ company_name: string }>(
`SELECT company_name FROM company_mng WHERE company_code = $1`,
[companyCode]
);
const companyName = companyCode === "*" ? "공통" : (companyInfo?.company_name || companyCode);
logger.info("화면 소속 회사 정보", { screenId, companyCode, companyName });
const multiLangService = new MultiLangService();
const results = await multiLangService.generateScreenLabelKeys({