fix: 화면 복제 기능 개선 및 관련 버그 수정

- 화면 복제 기능을 개선하여 DB 구조 개편 후의 효율적인 화면 관리를 지원합니다.
- 그룹 복제 시 버튼의 `targetScreenId`가 새 화면으로 매핑되지 않는 버그를 수정하였습니다.
- 관련된 서비스 및 쿼리에서 `table_type_columns`를 사용하여 라벨 정보를 조회하도록 변경하였습니다.
- 여러 컨트롤러 및 서비스에서 `column_labels` 대신 `table_type_columns`를 참조하도록 업데이트하였습니다.
This commit is contained in:
DDD1542
2026-01-28 11:24:25 +09:00
parent 1753822211
commit 192b678bce
43 changed files with 7826 additions and 677 deletions

View File

@@ -3404,7 +3404,7 @@ export const resetUserPassword = async (
/**
* 테이블 스키마 조회 (엑셀 업로드 컬럼 매핑용)
* column_labels 테이블에서 라벨 정보도 함께 가져옴
* table_type_columns 테이블에서 라벨 정보도 함께 가져옴
*/
export async function getTableSchema(
req: AuthenticatedRequest,
@@ -3424,7 +3424,7 @@ export async function getTableSchema(
logger.info("테이블 스키마 조회", { tableName, companyCode });
// information_schema와 column_labels를 JOIN하여 컬럼 정보와 라벨 정보 함께 가져오기
// information_schema와 table_type_columns를 JOIN하여 컬럼 정보와 라벨 정보 함께 가져오기
const schemaQuery = `
SELECT
ic.column_name,
@@ -3434,15 +3434,16 @@ export async function getTableSchema(
ic.character_maximum_length,
ic.numeric_precision,
ic.numeric_scale,
cl.column_label,
cl.display_order
ttc.column_label,
ttc.display_order
FROM information_schema.columns ic
LEFT JOIN column_labels cl
ON cl.table_name = ic.table_name
AND cl.column_name = ic.column_name
LEFT JOIN table_type_columns ttc
ON ttc.table_name = ic.table_name
AND ttc.column_name = ic.column_name
AND ttc.company_code = '*'
WHERE ic.table_schema = 'public'
AND ic.table_name = $1
ORDER BY COALESCE(cl.display_order, ic.ordinal_position), ic.ordinal_position
ORDER BY COALESCE(ttc.display_order, ic.ordinal_position), ic.ordinal_position
`;
const columns = await query<any>(schemaQuery, [tableName]);