Commit Graph

55 Commits

Author SHA1 Message Date
kjs 3982aabc24 refactor: Enhance unique constraint validation across data operations
- Integrated `TableManagementService` to validate unique constraints before insert, update, and upsert actions in various controllers, including `dataflowExecutionController`, `dynamicFormController`, and `tableManagementController`.
- Improved error handling in `errorHandler` to provide detailed messages indicating which field has a unique constraint violation.
- Updated the `formatPgError` utility to extract and display specific column labels for unique constraint violations, enhancing user feedback.
- Adjusted the table schema retrieval to include company-specific nullable and unique constraints, ensuring accurate representation of database rules.

These changes improve data integrity by preventing duplicate entries and enhance user experience through clearer error messages related to unique constraints.
2026-03-10 16:15:20 +09:00
kjs c0eab878a1 refactor: Update table schema retrieval to prioritize company-specific labels
- Modified the `getTableSchema` function in `adminController.ts` to use company-specific column labels when available, falling back to common labels if not.
- Adjusted the SQL query to join `table_type_columns` for both company-specific and common labels, ensuring the correct display order is maintained.
- Removed unnecessary component count display in the `TabsDesignEditor` to streamline the UI.

These changes enhance the accuracy of the table schema representation based on company context and improve the overall user interface by simplifying tab displays.
2026-03-10 11:49:02 +09:00
DDD1542 772514c270 Merge branch 'jskim-node' of http://39.117.244.52:3000/kjs/ERP-node into gbpark-node 2026-03-05 09:59:23 +09:00
kjs 96637a9cb6 feat: Enhance audit logging with client IP tracking
- Integrated client IP address retrieval in the audit logging functionality across multiple controllers, including admin, common code, department, flow, screen, and table management.
- Updated the `auditLogService` to include a new method for obtaining the client's IP address, ensuring accurate logging of user actions.
- This enhancement improves traceability and accountability by capturing the source of requests, thereby strengthening the overall logging mechanism within the application.
2026-03-04 15:02:27 +09:00
kjs b4d5367e2b feat: Integrate audit logging for various operations
- Added audit logging functionality across multiple controllers, including menu, user, department, flow, screen, and table management.
- Implemented logging for create, update, and delete actions, capturing relevant details such as company code, user information, and changes made.
- Enhanced the category tree service with a new endpoint to check if category values are in use, improving data integrity checks.
- Updated routes to include new functionalities and ensure proper logging for batch operations and individual record changes.
- This integration improves traceability and accountability for data modifications within the application.
2026-03-04 13:49:08 +09:00
kjs ce8b4ed688 feat: Add menu icon support in menu management
- Enhanced the menu management functionality by adding a new `menu_icon` field in the database schema, allowing for the storage of menu icons.
- Updated the `saveMenu` and `updateMenu` functions in the admin controller to handle the new `menu_icon` field during menu creation and updates.
- Modified the `AdminService` to include `MENU_ICON` in various queries, ensuring that the icon data is retrieved and processed correctly.
- Integrated the `MenuIconPicker` component in the frontend to allow users to select and display menu icons in the `MenuFormModal`.
- Updated the sidebar and layout components to utilize the new icon data, enhancing the visual representation of menus across the application.
2026-03-03 15:42:30 +09:00
DDD1542 4294e6206b feat: Add express-async-errors for improved error handling
- Integrated express-async-errors to automatically handle errors in async route handlers, enhancing the overall error management in the application.
- Updated app.ts to include the express-async-errors import for global error handling.
- Removed redundant logging statements in admin and user menu retrieval functions to streamline the code and improve readability.
- Adjusted logging levels from info to debug for less critical logs, ensuring that important information is logged appropriately without cluttering the logs.
2026-02-12 11:42:52 +09:00
kjs f8c0fe9499 Merge branch 'feature/v2-renewal' of http://39.117.244.52:3000/kjs/ERP-node into jskim-node 2026-02-09 16:03:27 +09:00
DDD1542 257174d0c6 feat: 화면 그룹 삭제 시 메뉴 및 플로우 데이터 정리 로직 개선
- 화면 그룹 삭제 시 연결된 메뉴를 정리하는 로직을 추가하여, 삭제될 그룹에 연결된 메뉴를 자동으로 삭제하도록 하였습니다.
- 메뉴 삭제 시 관련된 화면 및 플로우 데이터도 함께 정리하여 데이터 일관성을 유지하였습니다.
- 복제 화면 모달에서 원본 회사와 동일한 회사 선택 시 자동으로 다른 회사로 변경하는 기능을 추가하였습니다.
- 삭제 확인 다이얼로그에 경고 메시지를 추가하여 사용자에게 삭제 작업의 영향을 명확히 안내하였습니다.
2026-02-02 20:18:47 +09:00
kjs 95bef976a5 docs: 다양한 문서 및 가이드 업데이트
- 여러 문서의 내용을 업데이트하여 최신 정보를 반영하였습니다.
- 컴포넌트 개발 가이드와 관련된 문서의 목차를 재구성하고, V2 및 Zod 레이아웃 시스템에 대한 내용을 추가하였습니다.
- 화면 컴포넌트 개발 가이드를 개선하여 핵심 원칙과 패턴을 명확히 설명하였습니다.
- 불필요한 문서 및 가이드를 삭제하고, 통합된 가이드를 통해 개발자들이 쉽게 참고할 수 있도록 하였습니다.
2026-01-28 17:36:19 +09:00
DDD1542 192b678bce fix: 화면 복제 기능 개선 및 관련 버그 수정
- 화면 복제 기능을 개선하여 DB 구조 개편 후의 효율적인 화면 관리를 지원합니다.
- 그룹 복제 시 버튼의 `targetScreenId`가 새 화면으로 매핑되지 않는 버그를 수정하였습니다.
- 관련된 서비스 및 쿼리에서 `table_type_columns`를 사용하여 라벨 정보를 조회하도록 변경하였습니다.
- 여러 컨트롤러 및 서비스에서 `column_labels` 대신 `table_type_columns`를 참조하도록 업데이트하였습니다.
2026-01-28 11:24:25 +09:00
DDD1542 df8065503d feat: 메뉴 삭제 및 동기화 기능 개선
- 메뉴 삭제 시 하위 메뉴를 재귀적으로 수집하여 관련 데이터 정리 기능 추가
- 메뉴 삭제 성공 시 삭제된 메뉴와 하위 메뉴 수를 포함한 응답 메시지 개선
- 메뉴 복제 시 항상 활성화 상태로 설정
- 화면-메뉴 동기화 진행 상태를 사용자에게 알리기 위한 프로그레스 메시지 추가
- 최상위 회사 폴더는 메뉴로 생성하지 않고 스킵하는 로직 추가
- 동기화 진행 중 오버레이 UI 개선
2026-01-16 17:41:19 +09:00
kjs b5c2e85496 화면 다국어 처리 2026-01-14 15:33:57 +09:00
kjs 61a7f585b4 다국어 자동생성 2026-01-14 10:20:27 +09:00
kjs 75e5326b3e 메뉴 복사로직 개선 2025-12-18 10:55:26 +09:00
kjs 1995c3dca4 엑셀 업로드 기능 개선 2025-12-17 12:01:16 +09:00
kjs 08575c296e 연쇄 통합관리 2025-12-10 15:59:04 +09:00
SeongHyun Kim 892278853c feat(UniversalFormModal): 전용 API 저장 기능 및 사원+부서 통합 저장 API 구현
- CustomApiSaveConfig 타입 정의 (apiType, mainDeptFields, subDeptFields)

- saveWithCustomApi() 함수 추가로 테이블 직접 저장 대신 전용 API 호출

- adminController에 saveUserWithDept(), getUserWithDept() API 추가

- user_info + user_dept 트랜잭션 저장, 메인 부서 변경 시 자동 겸직 전환

- ConfigPanel에 전용 API 저장 설정 UI 추가

- SplitPanelLayout2: getColumnValue()로 조인 테이블 컬럼 값 추출 개선

- 검색 컬럼 선택 시 표시 컬럼 기반으로 변경
2025-12-08 15:31:40 +09:00
kjs eb5ea411c9 화면 일괄삭제기능 2025-12-03 16:02:09 +09:00
kjs 00501f359c 탭기능 중간커밋 2025-11-24 17:24:47 +09:00
kjs 1d1597f8e7 메뉴 수정 안되는 현상 수정 2025-11-24 10:02:56 +09:00
kjs 8b3593c8fb feat: 메뉴 복사 시 화면명 일괄 변환 기능 추가
새로운 기능:
- 화면명에서 특정 텍스트 제거 (예: '탑씰' 제거)
- 화면명에 접두사 추가 (예: '한신' 추가)
- 변환 로직: 제거 → 접두사 추가 순서로 적용

백엔드:
- menuCopyService.copyMenu()에 screenNameConfig 파라미터 추가
- copyScreens()에서 화면명 변환 로직 적용
- 정규식으로 전역 치환 (new RegExp(text, 'g'))

프론트엔드:
- MenuCopyDialog에 화면명 일괄 변경 UI 추가
- Checkbox로 기능 활성화/비활성화
- 2개 Input: removeText, addPrefix
- API 호출 시 screenNameConfig 전달

사용 예시:
1. '탑씰 회사정보' → '회사정보' (제거만)
2. '회사정보' → '한신 회사정보' (접두사만)
3. '탑씰 회사정보' → '한신 회사정보' (제거 + 접두사)

관련 파일:
- backend-node/src/services/menuCopyService.ts
- backend-node/src/controllers/adminController.ts
- frontend/lib/api/menu.ts
- frontend/components/admin/MenuCopyDialog.tsx
2025-11-21 15:38:59 +09:00
kjs c70998fa4f feat: 메뉴 복사 기능 - 2단계 복사 방식으로 화면 참조 매핑 문제 해결
- 문제: 화면 복사 시 참조되는 화면이 아직 복사되지 않아 screenIdMap에 매핑 정보가 없었음
- 해결: 2단계 복사 방식 도입
  1단계: 모든 screen_definitions 먼저 복사하여 screenIdMap 완성
  2단계: screen_layouts 복사하면서 완성된 screenIdMap으로 참조 업데이트
- 결과: targetScreenId가 올바르게 새 회사의 화면 ID로 매핑됨 (예: 149 → 517)
- 추가: 화면 수집 시 문자열 타입 ID도 올바르게 파싱하도록 개선
- 추가: 참조 화면 발견 및 업데이트 로그 추가

관련 파일:
- backend-node/src/services/menuCopyService.ts
- db/migrations/1003_add_source_menu_objid_to_menu_info.sql
- db/scripts/cleanup_company_11_*.sql
2025-11-21 14:37:09 +09:00
kjs 9dc8a51f4c fix: 메뉴 URL 제거 시 화면 할당도 함께 해제
## 문제점
- menu_url을 빈 값으로 저장해도 screen_menu_assignments 테이블의
  화면 할당(is_active='Y')이 남아있어 메뉴 클릭 시 여전히 화면이 열림
- AppLayout의 handleMenuClick이 우선적으로 screen_menu_assignments를
  조회하므로 menu_url보다 화면 할당이 우선 적용됨

## 해결방법

### updateMenu (메뉴 수정)
- menu_url이 null/빈값일 때 screen_menu_assignments의 is_active를 'N'으로 업데이트
- 화면 할당과 menu_url을 동기화하여 완전한 할당 해제

### saveMenu (메뉴 생성)
- 기존과 동일하게 menu_url이 없으면 screen_code를 null로 설정
- INSERT 시 screen_code 컬럼을 명시적으로 포함

## 메뉴 클릭 동작 순서
1. screen_menu_assignments 조회 (우선순위)
2. is_active='N'이면 할당된 화면 없음으로 간주
3. menu_url이 있으면 해당 URL로 이동
4. 둘 다 없으면 "연결된 페이지가 없습니다" 경고

이제 메뉴에서 URL을 제거하면 화면 할당도 완전히 해제됩니다.
2025-11-13 12:27:36 +09:00
kjs 3ddca95af5 feat: 메뉴 관리에서 화면 할당 해제 기능 추가
## 문제점
- URL 직접 입력 모드에서 빈 값으로 저장 시 menu_url은 비워지지만
- screen_code는 기존 값이 남아있어 화면 할당이 해제되지 않음

## 해결방법

### 백엔드 (adminController.ts)
- updateMenu: menu_url이 비어있으면 screen_code도 null로 자동 설정
- 로직: menuUrl ? screenCode : null

### 프론트엔드 (MenuFormModal.tsx, menu.ts)
- 화면 선택 시 screenCode도 함께 formData에 저장
- URL 타입 변경 시 screenCode 초기화
- MenuFormData 인터페이스에 screenCode 필드 추가

## 동작 방식
1. 화면 할당: menuUrl + screenCode 함께 저장
2. URL 직접 입력: menuUrl만 저장, screenCode는 undefined
3. 빈 값 저장: menuUrl = null, screenCode = null (자동)

이제 메뉴에서 화면 할당을 완전히 해제할 수 있습니다.
2025-11-13 12:22:33 +09:00
kjs 658211b9d1 feat: 화면 복사 기능 개선 및 버튼 모달 설정 수정
## 주요 변경사항

### 1. 화면 복사 기능 강화
- 최고 관리자가 다른 회사로 화면 복사 가능하도록 개선
- 메인 화면과 연결된 모달 화면 자동 감지 및 일괄 복사
- 복사 시 버튼의 targetScreenId 자동 업데이트
- 일괄 이름 변경 기능 추가 (복사본 텍스트 제거)
- 중복 화면명 체크 기능 추가

#### 백엔드 (screenManagementService.ts)
- generateMultipleScreenCodes: 여러 화면 코드 일괄 생성 (Advisory Lock 사용)
- detectLinkedModalScreens: edit 액션도 모달로 감지하도록 개선
- checkDuplicateScreenName: 중복 화면명 체크 API 추가
- copyScreenWithModals: 메인+모달 일괄 복사 및 버튼 업데이트
- updateButtonTargetScreenIds: 복사된 모달로 버튼 targetScreenId 업데이트
- updated_date 컬럼 제거 (screen_layouts 테이블에 존재하지 않음)

#### 프론트엔드 (CopyScreenModal.tsx)
- 회사 선택 UI 추가 (최고 관리자 전용)
- 연결된 모달 화면 자동 감지 및 표시
- 일괄 이름 변경 기능 (텍스트 제거/추가)
- 실시간 미리보기
- 중복 화면명 체크

### 2. 버튼 설정 모달 화면 선택 개선
- 편집 중인 화면의 company_code 기준으로 화면 목록 조회
- 최고 관리자가 다른 회사 화면 편집 시 해당 회사의 모달 화면만 표시
- targetScreenId 문자열/숫자 타입 불일치 수정

#### 백엔드 (screenManagementController.ts)
- getScreens API에 companyCode 쿼리 파라미터 추가
- 최고 관리자는 다른 회사의 화면 목록 조회 가능

#### 프론트엔드
- ButtonConfigPanel: currentScreenCompanyCode props 추가
- DetailSettingsPanel: currentScreenCompanyCode 전달
- UnifiedPropertiesPanel: currentScreenCompanyCode 전달
- ScreenDesigner: selectedScreen.companyCode 전달
- targetScreenId 비교 시 parseInt 처리 (문자열→숫자)

### 3. 카테고리 메뉴별 컬럼 분리 기능
- 메뉴별로 카테고리 컬럼을 독립적으로 관리
- 카테고리 컬럼 추가/삭제 시 메뉴 스코프 적용

## 수정된 파일
- backend-node/src/services/screenManagementService.ts
- backend-node/src/controllers/screenManagementController.ts
- backend-node/src/routes/screenManagementRoutes.ts
- frontend/components/screen/CopyScreenModal.tsx
- frontend/components/screen/config-panels/ButtonConfigPanel.tsx
- frontend/components/screen/panels/DetailSettingsPanel.tsx
- frontend/components/screen/panels/UnifiedPropertiesPanel.tsx
- frontend/components/screen/ScreenDesigner.tsx
- frontend/lib/api/screen.ts
2025-11-13 12:17:10 +09:00
leeheejin 82ff18e388 행 이동 화면 할당한 상황에서도 가능하게, 코드병합 버튼액션에 추가 2025-11-04 18:31:26 +09:00
dohyeons fd7fc754f4 회사 관리 - 등록 페이지 수정 2025-11-03 14:31:21 +09:00
kjs 148155e6fe feat: 관리자 테이블 스타일 개선 및 탭 컴포넌트 디자인 수정
- 외부 커넥션 관리 테이블 표준화 (DB 연결, REST API 연결)
- 모든 관리자 테이블의 그림자 제거 (테이블 타입 관리 왼쪽 카드 제외)
- 테이블 타입 관리 왼쪽 카드 호버 효과 강화 (shadow-lg, bg-muted/20)
- 탭 컴포넌트 배경색 밝게 조정 (bg-muted/30)
- 탭 트리거 테두리 제거
2025-10-30 17:55:55 +09:00
kjs 821336d40d 최고관리자가 부여한 권한에 따라 메뉴 보여주기 2025-10-27 18:27:32 +09:00
kjs 02df4355e2 회사별 메뉴 필터링 기능 2025-10-27 16:58:43 +09:00
kjs 29c49d7f07 각 회사별 데이터 분리 2025-10-27 16:40:59 +09:00
kjs dadd49b98f 화면관리 수정 2025-10-13 19:18:01 +09:00
kjs 9d5ac1716d 메뉴추가 기본값 제거 2025-10-13 15:06:48 +09:00
kjs 6e41fdf039 메뉴관리 추가 안되는 버그 수정 2025-10-13 15:01:37 +09:00
kjs 7919079362 docs: Phase 4 남은 Prisma 호출 전환 계획서 작성
현재 상황 분석 및 문서화:

컨트롤러 레이어:
-  adminController.ts (28개) 완료
-  screenFileController.ts (2개) 완료
- 🔄 남은 파일 (12개 호출):
  * webTypeStandardController.ts (11개)
  * fileController.ts (1개)

Routes & Services:
- ddlRoutes.ts (2개)
- companyManagementRoutes.ts (2개)
- multiConnectionQueryService.ts (4개)

Config:
- database.ts (4개 - 제거 예정)

새로운 계획서:
- PHASE4_REMAINING_PRISMA_CALLS.md (상세 전환 계획)
- 파일별 Prisma 호출 상세 분석
- 전환 패턴 및 우선순위 정리

전체 진행률: 445/444 (100.2%)
남은 작업: 12개 (추가 조사 필요한 파일 제외)
2025-10-01 14:33:08 +09:00
hjjeong cdd345a777 에러수정2 2025-09-26 18:51:27 +09:00
kjs 85a1e0c68a 메뉴 삭제 2025-09-09 16:14:21 +09:00
kjs 20cdcca171 이미지 미리보기 기능 2025-09-05 14:52:10 +09:00
hyeonsu b365969c72 Raw SQL을 Prisma ORM으로 마이그레이션 2025-09-01 14:52:00 +09:00
hyeonsu bde5f0884a 간단한 crud 부분 prisma orm으로 변경 2025-09-01 11:18:25 +09:00
hyeonsu cb88faa68e 주요기능 Prisma ORM으로 변경 2025-09-01 11:00:38 +09:00
hyeonsu 49f812f444 프로필 이미지 기능 수정 2025-08-28 10:05:06 +09:00
hyeonsu 00ce90a9f0 사용자 정보 수정 기능 구현 2025-08-27 17:32:41 +09:00
dohyeons 7267cc52eb 사용자 검색 기능 구현 2025-08-26 14:23:22 +09:00
dohyeons 6f68fa5639 비밀번호 변경 기능 구현 2025-08-26 14:18:14 +09:00
dohyeons 4f6be8f551 사용자 상태 변경 구현 2025-08-26 09:56:45 +09:00
dohyeons b43a88a045 사용자 변경 이력 조회 구현 2025-08-25 18:30:07 +09:00
kjs 96c601a0cf 다국어 관리 페이지 2025-08-25 15:12:31 +09:00
kjs 6cac3dfa3f 회사관리 등록기능 오류 수정 2025-08-25 14:24:00 +09:00