Refactor code structure for improved readability and maintainability
This commit is contained in:
+37
-38
@@ -1,27 +1,28 @@
|
|||||||
# ==========================
|
# ==========================
|
||||||
# 멀티 스테이지 Dockerfile
|
# 멀티 스테이지 Dockerfile
|
||||||
# - 백엔드: Node.js + Express + TypeScript
|
# - 백엔드: Spring Boot (Java 21)
|
||||||
# - 프론트엔드: Next.js (프로덕션 빌드)
|
# - 프론트엔드: Next.js (프로덕션 빌드)
|
||||||
# ==========================
|
# ==========================
|
||||||
|
|
||||||
# ------------------------------
|
# ------------------------------
|
||||||
# Stage 1: 백엔드 빌드
|
# Stage 1: 백엔드 빌드 (Spring Boot)
|
||||||
# ------------------------------
|
# ------------------------------
|
||||||
FROM node:20.10-alpine AS backend-builder
|
FROM eclipse-temurin:21-jdk-alpine AS backend-builder
|
||||||
|
|
||||||
WORKDIR /app/backend
|
WORKDIR /app/backend
|
||||||
|
|
||||||
# 백엔드 의존성 설치
|
# Gradle Wrapper 복사
|
||||||
COPY backend-node/package*.json ./
|
COPY backend-spring/gradlew ./
|
||||||
RUN npm ci --only=production && \
|
COPY backend-spring/gradle ./gradle
|
||||||
npm cache clean --force
|
RUN chmod +x gradlew
|
||||||
|
|
||||||
# 백엔드 소스 복사 및 빌드
|
# 의존성 캐싱
|
||||||
COPY backend-node/tsconfig.json ./
|
COPY backend-spring/build.gradle backend-spring/settings.gradle ./
|
||||||
COPY backend-node/src ./src
|
RUN ./gradlew dependencies --no-daemon || true
|
||||||
RUN npm install -D typescript @types/node && \
|
|
||||||
npm run build && \
|
# 소스 복사 및 빌드
|
||||||
npm prune --production
|
COPY backend-spring/src ./src
|
||||||
|
RUN ./gradlew bootJar --no-daemon
|
||||||
|
|
||||||
# ------------------------------
|
# ------------------------------
|
||||||
# Stage 2: 프론트엔드 빌드
|
# Stage 2: 프론트엔드 빌드
|
||||||
@@ -46,38 +47,38 @@ RUN npm run build:no-lint
|
|||||||
# ------------------------------
|
# ------------------------------
|
||||||
# Stage 3: 최종 런타임 이미지
|
# Stage 3: 최종 런타임 이미지
|
||||||
# ------------------------------
|
# ------------------------------
|
||||||
FROM node:20.10-alpine AS runtime
|
FROM eclipse-temurin:21-jre-alpine AS runtime
|
||||||
|
|
||||||
# 보안 강화: 비특권 사용자 생성
|
RUN apk add --no-cache curl nodejs npm
|
||||||
RUN addgroup -g 1001 -S nodejs && \
|
|
||||||
adduser -S nodejs -u 1001
|
# 비특권 사용자 생성
|
||||||
|
RUN addgroup -g 1001 -S appgroup && \
|
||||||
|
adduser -S appuser -u 1001 -G appgroup
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# 백엔드 런타임 파일 복사
|
# 백엔드 JAR 복사
|
||||||
COPY --from=backend-builder --chown=nodejs:nodejs /app/backend/dist ./backend/dist
|
COPY --from=backend-builder --chown=appuser:appgroup /app/backend/build/libs/*.jar ./backend/app.jar
|
||||||
COPY --from=backend-builder --chown=nodejs:nodejs /app/backend/node_modules ./backend/node_modules
|
|
||||||
COPY --from=backend-builder --chown=nodejs:nodejs /app/backend/package.json ./backend/package.json
|
|
||||||
|
|
||||||
# 프론트엔드 런타임 파일 복사
|
# 프론트엔드 런타임 파일 복사
|
||||||
COPY --from=frontend-builder --chown=nodejs:nodejs /app/frontend/.next ./frontend/.next
|
COPY --from=frontend-builder --chown=appuser:appgroup /app/frontend/.next ./frontend/.next
|
||||||
COPY --from=frontend-builder --chown=nodejs:nodejs /app/frontend/node_modules ./frontend/node_modules
|
COPY --from=frontend-builder --chown=appuser:appgroup /app/frontend/node_modules ./frontend/node_modules
|
||||||
COPY --from=frontend-builder --chown=nodejs:nodejs /app/frontend/package.json ./frontend/package.json
|
COPY --from=frontend-builder --chown=appuser:appgroup /app/frontend/package.json ./frontend/package.json
|
||||||
COPY --from=frontend-builder --chown=nodejs:nodejs /app/frontend/public ./frontend/public
|
COPY --from=frontend-builder --chown=appuser:appgroup /app/frontend/public ./frontend/public
|
||||||
COPY --from=frontend-builder --chown=nodejs:nodejs /app/frontend/next.config.mjs ./frontend/next.config.mjs
|
COPY --from=frontend-builder --chown=appuser:appgroup /app/frontend/next.config.mjs ./frontend/next.config.mjs
|
||||||
|
|
||||||
# 업로드 디렉토리 생성 (백엔드용)
|
# 업로드 디렉토리 생성
|
||||||
RUN mkdir -p /app/backend/uploads && \
|
RUN mkdir -p /app/backend/uploads /app/backend/logs && \
|
||||||
chown -R nodejs:nodejs /app/backend/uploads
|
chown -R appuser:appgroup /app
|
||||||
|
|
||||||
# 시작 스크립트 생성
|
# 시작 스크립트 생성
|
||||||
RUN echo '#!/bin/sh' > /app/start.sh && \
|
RUN echo '#!/bin/sh' > /app/start.sh && \
|
||||||
echo 'set -e' >> /app/start.sh && \
|
echo 'set -e' >> /app/start.sh && \
|
||||||
echo '' >> /app/start.sh && \
|
echo '' >> /app/start.sh && \
|
||||||
echo '# 백엔드 시작 (백그라운드)' >> /app/start.sh && \
|
echo '# Spring Boot 백엔드 시작 (백그라운드)' >> /app/start.sh && \
|
||||||
echo 'cd /app/backend' >> /app/start.sh && \
|
echo 'cd /app/backend' >> /app/start.sh && \
|
||||||
echo 'echo "Starting backend on port 8080..."' >> /app/start.sh && \
|
echo 'echo "Starting Spring Boot backend on port 8081..."' >> /app/start.sh && \
|
||||||
echo 'node dist/app.js &' >> /app/start.sh && \
|
echo 'java -jar app.jar &' >> /app/start.sh && \
|
||||||
echo 'BACKEND_PID=$!' >> /app/start.sh && \
|
echo 'BACKEND_PID=$!' >> /app/start.sh && \
|
||||||
echo '' >> /app/start.sh && \
|
echo '' >> /app/start.sh && \
|
||||||
echo '# 프론트엔드 시작 (포그라운드)' >> /app/start.sh && \
|
echo '# 프론트엔드 시작 (포그라운드)' >> /app/start.sh && \
|
||||||
@@ -89,18 +90,16 @@ RUN echo '#!/bin/sh' > /app/start.sh && \
|
|||||||
echo '# 프로세스 모니터링' >> /app/start.sh && \
|
echo '# 프로세스 모니터링' >> /app/start.sh && \
|
||||||
echo 'wait $BACKEND_PID $FRONTEND_PID' >> /app/start.sh && \
|
echo 'wait $BACKEND_PID $FRONTEND_PID' >> /app/start.sh && \
|
||||||
chmod +x /app/start.sh && \
|
chmod +x /app/start.sh && \
|
||||||
chown nodejs:nodejs /app/start.sh
|
chown appuser:appgroup /app/start.sh
|
||||||
|
|
||||||
# 비특권 사용자로 전환
|
USER appuser
|
||||||
USER nodejs
|
|
||||||
|
|
||||||
# 포트 노출
|
# 포트 노출
|
||||||
EXPOSE 3000 8080
|
EXPOSE 3000 8081
|
||||||
|
|
||||||
# 헬스체크
|
# 헬스체크
|
||||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
||||||
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/api/health || exit 1
|
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/api/health || exit 1
|
||||||
|
|
||||||
# 컨테이너 시작
|
# 컨테이너 시작
|
||||||
CMD ["/app/start.sh"]
|
CMD ["/app/start.sh"]
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
# Windows 개발 환경 전용 Dockerfile (단순 개발 모드)
|
|
||||||
FROM node:20-bookworm-slim
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# 필요한 패키지 설치 (wget 포함)
|
|
||||||
RUN apt-get update \
|
|
||||||
&& apt-get install -y --no-install-recommends openssl ca-certificates wget \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# package.json 복사 및 의존성 설치
|
|
||||||
COPY package*.json ./
|
|
||||||
RUN npm ci
|
|
||||||
|
|
||||||
# 소스 코드 복사
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
# 개발 환경 설정
|
|
||||||
ENV NODE_ENV=development
|
|
||||||
|
|
||||||
# 포트 노출
|
|
||||||
EXPOSE 8080
|
|
||||||
|
|
||||||
# 개발 서버 시작 (nodemon 사용)
|
|
||||||
CMD ["npm", "run", "dev"]
|
|
||||||
@@ -249,6 +249,21 @@ public class AdminController {
|
|||||||
return ResponseEntity.ok(ApiResponse.success(adminService.saveUser(body), "사용자 수정 성공"));
|
return ResponseEntity.ok(ApiResponse.success(adminService.saveUser(body), "사용자 수정 성공"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DELETE /api/admin/users/{userId}
|
||||||
|
* 사용자 삭제 (비활성화)
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/users/{userId}")
|
||||||
|
public ResponseEntity<ApiResponse<Void>> deleteUser(
|
||||||
|
@PathVariable String userId) {
|
||||||
|
Map<String, Object> existing = adminService.getUserInfo(userId);
|
||||||
|
if (existing == null) {
|
||||||
|
return ResponseEntity.status(404).body(ApiResponse.error("사용자를 찾을 수 없습니다."));
|
||||||
|
}
|
||||||
|
adminService.changeUserStatus(userId, "inactive");
|
||||||
|
return ResponseEntity.ok(ApiResponse.success(null, "사용자 삭제 성공"));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PATCH /api/admin/users/{userId}/status
|
* PATCH /api/admin/users/{userId}/status
|
||||||
* 사용자 상태 변경
|
* 사용자 상태 변경
|
||||||
|
|||||||
@@ -84,6 +84,12 @@ public class BatchController {
|
|||||||
body.put("company_code", companyCode);
|
body.put("company_code", companyCode);
|
||||||
body.put("created_by", userId);
|
body.put("created_by", userId);
|
||||||
body.put("updated_by", userId);
|
body.put("updated_by", userId);
|
||||||
|
|
||||||
|
// API 필드명(cron_expression) → DB 필드명(cron_schedule) 매핑
|
||||||
|
if (body.containsKey("cron_expression") && !body.containsKey("cron_schedule")) {
|
||||||
|
body.put("cron_schedule", body.get("cron_expression"));
|
||||||
|
}
|
||||||
|
|
||||||
Map<String, Object> created = batchService.insertBatch(body);
|
Map<String, Object> created = batchService.insertBatch(body);
|
||||||
return ResponseEntity.status(201).body(ApiResponse.success(created, "배치 설정이 성공적으로 생성되었습니다."));
|
return ResponseEntity.status(201).body(ApiResponse.success(created, "배치 설정이 성공적으로 생성되었습니다."));
|
||||||
}
|
}
|
||||||
@@ -97,6 +103,12 @@ public class BatchController {
|
|||||||
body.put("company_code", companyCode);
|
body.put("company_code", companyCode);
|
||||||
body.put("updated_by", userId);
|
body.put("updated_by", userId);
|
||||||
body.put("id", id);
|
body.put("id", id);
|
||||||
|
|
||||||
|
// API 필드명(cron_expression) → DB 필드명(cron_schedule) 매핑
|
||||||
|
if (body.containsKey("cron_expression") && !body.containsKey("cron_schedule")) {
|
||||||
|
body.put("cron_schedule", body.get("cron_expression"));
|
||||||
|
}
|
||||||
|
|
||||||
Map<String, Object> updated = batchService.updateBatch(body);
|
Map<String, Object> updated = batchService.updateBatch(body);
|
||||||
return ResponseEntity.ok(ApiResponse.success(updated, "배치 설정이 성공적으로 수정되었습니다."));
|
return ResponseEntity.ok(ApiResponse.success(updated, "배치 설정이 성공적으로 수정되었습니다."));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class NumberingRuleController {
|
|||||||
@GetMapping("/available/{menuObjid}")
|
@GetMapping("/available/{menuObjid}")
|
||||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getAvailableRulesForMenuWithId(
|
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getAvailableRulesForMenuWithId(
|
||||||
@RequestAttribute("company_code") String companyCode,
|
@RequestAttribute("company_code") String companyCode,
|
||||||
@PathVariable Integer menuObjid) {
|
@PathVariable String menuObjid) {
|
||||||
List<Map<String, Object>> list = numberingRuleService.getAvailableRulesForMenu(companyCode, menuObjid);
|
List<Map<String, Object>> list = numberingRuleService.getAvailableRulesForMenu(companyCode, menuObjid);
|
||||||
return ResponseEntity.ok(ApiResponse.success(list, "사용 가능한 채번 규칙을 조회했습니다."));
|
return ResponseEntity.ok(ApiResponse.success(list, "사용 가능한 채번 규칙을 조회했습니다."));
|
||||||
}
|
}
|
||||||
@@ -86,7 +86,7 @@ public class NumberingRuleController {
|
|||||||
@GetMapping("/test/list/{menuObjid}")
|
@GetMapping("/test/list/{menuObjid}")
|
||||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getRulesFromTestWithMenu(
|
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getRulesFromTestWithMenu(
|
||||||
@RequestAttribute("company_code") String companyCode,
|
@RequestAttribute("company_code") String companyCode,
|
||||||
@PathVariable Integer menuObjid) {
|
@PathVariable String menuObjid) {
|
||||||
List<Map<String, Object>> list = numberingRuleService.getRulesFromTest(companyCode, menuObjid);
|
List<Map<String, Object>> list = numberingRuleService.getRulesFromTest(companyCode, menuObjid);
|
||||||
return ResponseEntity.ok(ApiResponse.success(list, "테스트 채번 규칙 목록을 조회했습니다."));
|
return ResponseEntity.ok(ApiResponse.success(list, "테스트 채번 규칙 목록을 조회했습니다."));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,6 +97,15 @@ public class RoleController {
|
|||||||
|
|
||||||
Map<String, Object> params = new HashMap<>(body);
|
Map<String, Object> params = new HashMap<>(body);
|
||||||
params.put("writer", userId);
|
params.put("writer", userId);
|
||||||
|
params.put("objid", (int)(System.currentTimeMillis() % Integer.MAX_VALUE));
|
||||||
|
|
||||||
|
// API 필드명(role_name/role_code) → DB 필드명(auth_name/auth_code) 매핑
|
||||||
|
if (params.containsKey("role_name") && !params.containsKey("auth_name")) {
|
||||||
|
params.put("auth_name", params.get("role_name"));
|
||||||
|
}
|
||||||
|
if (params.containsKey("role_code") && !params.containsKey("auth_code")) {
|
||||||
|
params.put("auth_code", params.get("role_code"));
|
||||||
|
}
|
||||||
|
|
||||||
Map<String, Object> created = roleService.createRoleGroup(params);
|
Map<String, Object> created = roleService.createRoleGroup(params);
|
||||||
return ResponseEntity.status(201).body(ApiResponse.success(created, "권한 그룹 생성 성공"));
|
return ResponseEntity.status(201).body(ApiResponse.success(created, "권한 그룹 생성 성공"));
|
||||||
@@ -130,6 +139,14 @@ public class RoleController {
|
|||||||
Map<String, Object> params = new HashMap<>(body);
|
Map<String, Object> params = new HashMap<>(body);
|
||||||
params.put("objid", parseLong(id));
|
params.put("objid", parseLong(id));
|
||||||
|
|
||||||
|
// API 필드명(role_name/role_code) → DB 필드명(auth_name/auth_code) 매핑
|
||||||
|
if (params.containsKey("role_name") && !params.containsKey("auth_name")) {
|
||||||
|
params.put("auth_name", params.get("role_name"));
|
||||||
|
}
|
||||||
|
if (params.containsKey("role_code") && !params.containsKey("auth_code")) {
|
||||||
|
params.put("auth_code", params.get("role_code"));
|
||||||
|
}
|
||||||
|
|
||||||
Map<String, Object> updated = roleService.updateRoleGroup(params);
|
Map<String, Object> updated = roleService.updateRoleGroup(params);
|
||||||
return ResponseEntity.ok(ApiResponse.success(updated, "권한 그룹 수정 성공"));
|
return ResponseEntity.ok(ApiResponse.success(updated, "권한 그룹 수정 성공"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class ScreenManagementController {
|
|||||||
if (screen == null) {
|
if (screen == null) {
|
||||||
return ResponseEntity.status(404).body(ApiResponse.error("화면을 찾을 수 없습니다."));
|
return ResponseEntity.status(404).body(ApiResponse.error("화면을 찾을 수 없습니다."));
|
||||||
}
|
}
|
||||||
return ResponseEntity.ok(ApiResponse.success(commonService.toCamelCaseKeys(screen)));
|
return ResponseEntity.ok(ApiResponse.success(screen));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/screens/{id}/menu")
|
@GetMapping("/screens/{id}/menu")
|
||||||
@@ -540,7 +540,7 @@ public class ScreenManagementController {
|
|||||||
@GetMapping("/menus/{menuObjid}/screens")
|
@GetMapping("/menus/{menuObjid}/screens")
|
||||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getScreensByMenu(
|
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getScreensByMenu(
|
||||||
@RequestAttribute("company_code") String companyCode,
|
@RequestAttribute("company_code") String companyCode,
|
||||||
@PathVariable Integer menuObjid) {
|
@PathVariable String menuObjid) {
|
||||||
return ResponseEntity.ok(ApiResponse.success(service.getScreensByMenu(menuObjid, companyCode)));
|
return ResponseEntity.ok(ApiResponse.success(service.getScreensByMenu(menuObjid, companyCode)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -548,7 +548,7 @@ public class ScreenManagementController {
|
|||||||
public ResponseEntity<ApiResponse<Void>> unassignScreenFromMenu(
|
public ResponseEntity<ApiResponse<Void>> unassignScreenFromMenu(
|
||||||
@RequestAttribute("company_code") String companyCode,
|
@RequestAttribute("company_code") String companyCode,
|
||||||
@PathVariable Integer screenId,
|
@PathVariable Integer screenId,
|
||||||
@PathVariable Integer menuObjid) {
|
@PathVariable String menuObjid) {
|
||||||
try {
|
try {
|
||||||
service.unassignScreenFromMenu(screenId, menuObjid, companyCode);
|
service.unassignScreenFromMenu(screenId, menuObjid, companyCode);
|
||||||
return ResponseEntity.ok(ApiResponse.success(null, "메뉴 할당이 해제되었습니다."));
|
return ResponseEntity.ok(ApiResponse.success(null, "메뉴 할당이 해제되었습니다."));
|
||||||
|
|||||||
@@ -76,6 +76,15 @@ public class AdminService extends BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> saveMenu(Map<String, Object> params) {
|
public Map<String, Object> saveMenu(Map<String, Object> params) {
|
||||||
|
// Generate timestamp-based objid
|
||||||
|
long objid = System.currentTimeMillis();
|
||||||
|
params.put("objid", objid);
|
||||||
|
|
||||||
|
// Map frontend field names to DB column names
|
||||||
|
if (params.get("menu_name_kor") == null && params.get("menu_name") != null) {
|
||||||
|
params.put("menu_name_kor", params.get("menu_name"));
|
||||||
|
}
|
||||||
|
|
||||||
sqlSession.insert("admin.insertMenu", params);
|
sqlSession.insert("admin.insertMenu", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
@@ -126,7 +135,7 @@ public class AdminService extends BaseService {
|
|||||||
pagination.put("total_pages", totalPages);
|
pagination.put("total_pages", totalPages);
|
||||||
|
|
||||||
Map<String, Object> result = new HashMap<>();
|
Map<String, Object> result = new HashMap<>();
|
||||||
result.put("data", commonService.toCamelCaseKeysList(users));
|
result.put("data", users);
|
||||||
result.put("total", total);
|
result.put("total", total);
|
||||||
result.put("search_type", rawSearch != null ? "v2" : "none");
|
result.put("search_type", rawSearch != null ? "v2" : "none");
|
||||||
result.put("pagination", pagination);
|
result.put("pagination", pagination);
|
||||||
@@ -342,17 +351,15 @@ public class AdminService extends BaseService {
|
|||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
List<Map<String, Object>> rawList = sqlSession.selectList("admin.selectDepartmentList", params);
|
List<Map<String, Object>> rawList = sqlSession.selectList("admin.selectDepartmentList", params);
|
||||||
|
|
||||||
// 평탄 목록 (camelCase 변환)
|
// 평탄 목록
|
||||||
List<Map<String, Object>> flatList = rawList.stream()
|
List<Map<String, Object>> flatList = new java.util.ArrayList<>(rawList);
|
||||||
.map(commonService::toCamelCaseKeys)
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
// 트리 구조 빌드 — 1차: camelCase 변환 + children 초기화
|
// 트리 구조 빌드
|
||||||
java.util.LinkedHashMap<String, Map<String, Object>> deptTreeMap = new java.util.LinkedHashMap<>();
|
java.util.LinkedHashMap<String, Map<String, Object>> deptTreeMap = new java.util.LinkedHashMap<>();
|
||||||
List<Map<String, Object>> rootDepts = new java.util.ArrayList<>();
|
List<Map<String, Object>> rootDepts = new java.util.ArrayList<>();
|
||||||
|
|
||||||
for (Map<String, Object> raw : rawList) {
|
for (Map<String, Object> raw : rawList) {
|
||||||
Map<String, Object> node = commonService.toCamelCaseKeys(raw);
|
Map<String, Object> node = new java.util.LinkedHashMap<>(raw);
|
||||||
node.put("children", new java.util.ArrayList<>());
|
node.put("children", new java.util.ArrayList<>());
|
||||||
deptTreeMap.put((String) raw.get("dept_code"), node);
|
deptTreeMap.put((String) raw.get("dept_code"), node);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ public class AnalyticsReportService extends BaseService {
|
|||||||
private static final String NS = "analyticsReport.";
|
private static final String NS = "analyticsReport.";
|
||||||
|
|
||||||
public Map<String, Object> getProductionReportData(Map<String, Object> params) {
|
public Map<String, Object> getProductionReportData(Map<String, Object> params) {
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "get_production_report_data", params);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "getProductionReportData", params);
|
||||||
Map<String, Object> filterOptions = new LinkedHashMap<>();
|
Map<String, Object> filterOptions = new LinkedHashMap<>();
|
||||||
filterOptions.put("processes", extractFilterSet(rows, "process"));
|
filterOptions.put("processes", extractFilterSet(rows, "process"));
|
||||||
filterOptions.put("equipment", extractFilterSet(rows, "equipment"));
|
filterOptions.put("equipment", extractFilterSet(rows, "equipment"));
|
||||||
@@ -30,7 +30,7 @@ public class AnalyticsReportService extends BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getInventoryReportData(Map<String, Object> params) {
|
public Map<String, Object> getInventoryReportData(Map<String, Object> params) {
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "get_inventory_report_data", params);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "getInventoryReportData", params);
|
||||||
Map<String, Object> filterOptions = new LinkedHashMap<>();
|
Map<String, Object> filterOptions = new LinkedHashMap<>();
|
||||||
filterOptions.put("items", extractFilterSet(rows, "item"));
|
filterOptions.put("items", extractFilterSet(rows, "item"));
|
||||||
filterOptions.put("warehouses", extractFilterSet(rows, "warehouse"));
|
filterOptions.put("warehouses", extractFilterSet(rows, "warehouse"));
|
||||||
@@ -49,7 +49,7 @@ public class AnalyticsReportService extends BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getPurchaseReportData(Map<String, Object> params) {
|
public Map<String, Object> getPurchaseReportData(Map<String, Object> params) {
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "get_purchase_report_data", params);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "getPurchaseReportData", params);
|
||||||
Map<String, Object> filterOptions = new LinkedHashMap<>();
|
Map<String, Object> filterOptions = new LinkedHashMap<>();
|
||||||
filterOptions.put("suppliers", extractFilterSet(rows, "supplier"));
|
filterOptions.put("suppliers", extractFilterSet(rows, "supplier"));
|
||||||
filterOptions.put("items", extractFilterSet(rows, "item"));
|
filterOptions.put("items", extractFilterSet(rows, "item"));
|
||||||
@@ -63,7 +63,7 @@ public class AnalyticsReportService extends BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getQualityReportData(Map<String, Object> params) {
|
public Map<String, Object> getQualityReportData(Map<String, Object> params) {
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "get_quality_report_data", params);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "getQualityReportData", params);
|
||||||
Map<String, Object> filterOptions = new LinkedHashMap<>();
|
Map<String, Object> filterOptions = new LinkedHashMap<>();
|
||||||
filterOptions.put("items", extractFilterSet(rows, "item"));
|
filterOptions.put("items", extractFilterSet(rows, "item"));
|
||||||
filterOptions.put("defect_types", List.of(
|
filterOptions.put("defect_types", List.of(
|
||||||
@@ -83,7 +83,7 @@ public class AnalyticsReportService extends BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getEquipmentReportData(Map<String, Object> params) {
|
public Map<String, Object> getEquipmentReportData(Map<String, Object> params) {
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "get_equipment_report_data", params);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "getEquipmentReportData", params);
|
||||||
Map<String, Object> filterOptions = new LinkedHashMap<>();
|
Map<String, Object> filterOptions = new LinkedHashMap<>();
|
||||||
filterOptions.put("equipment", extractFilterSet(rows, "equipment"));
|
filterOptions.put("equipment", extractFilterSet(rows, "equipment"));
|
||||||
filterOptions.put("equip_types", extractFilterSet(rows, "equip_type"));
|
filterOptions.put("equip_types", extractFilterSet(rows, "equip_type"));
|
||||||
@@ -97,7 +97,7 @@ public class AnalyticsReportService extends BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getMoldReportData(Map<String, Object> params) {
|
public Map<String, Object> getMoldReportData(Map<String, Object> params) {
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "get_mold_report_data", params);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "getMoldReportData", params);
|
||||||
Map<String, Object> filterOptions = new LinkedHashMap<>();
|
Map<String, Object> filterOptions = new LinkedHashMap<>();
|
||||||
filterOptions.put("molds", extractFilterSet(rows, "mold"));
|
filterOptions.put("molds", extractFilterSet(rows, "mold"));
|
||||||
filterOptions.put("mold_types", extractFilterSet(rows, "mold_type"));
|
filterOptions.put("mold_types", extractFilterSet(rows, "mold_type"));
|
||||||
|
|||||||
@@ -19,43 +19,43 @@ public class BatchExecutionLogService extends BaseService {
|
|||||||
public Map<String, Object> getBatchExecutionLogList(Map<String, Object> params) {
|
public Map<String, Object> getBatchExecutionLogList(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
commonService.applyPagination(params);
|
commonService.applyPagination(params);
|
||||||
Integer totalObj = sqlSession.selectOne(NS + "get_batch_execution_log_list_cnt", params);
|
Integer totalObj = sqlSession.selectOne(NS + "getBatchExecutionLogListCnt", params);
|
||||||
int totalCount = totalObj != null ? totalObj : 0;
|
int totalCount = totalObj != null ? totalObj : 0;
|
||||||
List<Map<String, Object>> list = sqlSession.selectList(NS + "get_batch_execution_log_list", params);
|
List<Map<String, Object>> list = sqlSession.selectList(NS + "getBatchExecutionLogList", params);
|
||||||
return commonService.buildListResponse(list, totalCount, params);
|
return commonService.buildListResponse(list, totalCount, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getBatchExecutionLogInfo(Map<String, Object> params) {
|
public Map<String, Object> getBatchExecutionLogInfo(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectOne(NS + "get_batch_execution_log_info", params);
|
return sqlSession.selectOne(NS + "getBatchExecutionLogInfo", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> insertBatchExecutionLog(Map<String, Object> params) {
|
public Map<String, Object> insertBatchExecutionLog(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.insert(NS + "insert_batch_execution_log", params);
|
sqlSession.insert(NS + "insertBatchExecutionLog", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> updateBatchExecutionLog(Map<String, Object> params) {
|
public Map<String, Object> updateBatchExecutionLog(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.update(NS + "update_batch_execution_log", params);
|
sqlSession.update(NS + "updateBatchExecutionLog", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> deleteBatchExecutionLog(Map<String, Object> params) {
|
public Map<String, Object> deleteBatchExecutionLog(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.delete(NS + "delete_batch_execution_log", params);
|
sqlSession.delete(NS + "deleteBatchExecutionLog", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getBatchExecutionLogLatest(Map<String, Object> params) {
|
public Map<String, Object> getBatchExecutionLogLatest(Map<String, Object> params) {
|
||||||
return sqlSession.selectOne(NS + "get_batch_execution_log_latest", params);
|
return sqlSession.selectOne(NS + "getBatchExecutionLogLatest", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getBatchExecutionLogStats(Map<String, Object> params) {
|
public Map<String, Object> getBatchExecutionLogStats(Map<String, Object> params) {
|
||||||
return sqlSession.selectOne(NS + "get_batch_execution_log_stats", params);
|
return sqlSession.selectOne(NS + "getBatchExecutionLogStats", params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class BatchManagementService extends BaseService {
|
|||||||
|
|
||||||
public Map<String, Object> getBatchStats(Map<String, Object> params) {
|
public Map<String, Object> getBatchStats(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
Map<String, Object> stats = sqlSession.selectOne(NS + "get_batch_management_stats", params);
|
Map<String, Object> stats = sqlSession.selectOne(NS + "getBatchManagementStats", params);
|
||||||
return stats != null ? stats : Collections.emptyMap();
|
return stats != null ? stats : Collections.emptyMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ public class BatchManagementService extends BaseService {
|
|||||||
|
|
||||||
public List<Map<String, Object>> getNodeFlows(Map<String, Object> params) {
|
public List<Map<String, Object>> getNodeFlows(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectList(NS + "get_batch_management_node_flow_list", params);
|
return sqlSession.selectList(NS + "getBatchManagementNodeFlowList", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Connections / Tables / Columns ────────────────────────────────────────
|
// ── Connections / Tables / Columns ────────────────────────────────────────
|
||||||
@@ -205,17 +205,17 @@ public class BatchManagementService extends BaseService {
|
|||||||
|
|
||||||
public List<String> getAuthServiceNames(Map<String, Object> params) {
|
public List<String> getAuthServiceNames(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectList(NS + "get_batch_management_auth_service_list", params);
|
return sqlSession.selectList(NS + "getBatchManagementAuthServiceList", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Sparkline / Recent Logs ───────────────────────────────────────────────
|
// ── Sparkline / Recent Logs ───────────────────────────────────────────────
|
||||||
|
|
||||||
public List<Map<String, Object>> getBatchSparkline(Map<String, Object> params) {
|
public List<Map<String, Object>> getBatchSparkline(Map<String, Object> params) {
|
||||||
return sqlSession.selectList(NS + "get_batch_management_sparkline_data", params);
|
return sqlSession.selectList(NS + "getBatchManagementSparklineData", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Map<String, Object>> getBatchRecentLogs(Map<String, Object> params) {
|
public List<Map<String, Object>> getBatchRecentLogs(Map<String, Object> params) {
|
||||||
return sqlSession.selectList(NS + "get_batch_management_recent_log_list", params);
|
return sqlSession.selectList(NS + "getBatchManagementRecentLogList", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Private Helpers ───────────────────────────────────────────────────────
|
// ── Private Helpers ───────────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -21,25 +21,25 @@ public class BatchService extends BaseService {
|
|||||||
public Map<String, Object> getBatchList(Map<String, Object> params) {
|
public Map<String, Object> getBatchList(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
commonService.applyPagination(params);
|
commonService.applyPagination(params);
|
||||||
Integer totalObj = sqlSession.selectOne(NS + "get_batch_list_cnt", params);
|
Integer totalObj = sqlSession.selectOne(NS + "getBatchListCnt", params);
|
||||||
int totalCount = totalObj != null ? totalObj : 0;
|
int totalCount = totalObj != null ? totalObj : 0;
|
||||||
List<Map<String, Object>> list = sqlSession.selectList(NS + "get_batch_list", params);
|
List<Map<String, Object>> list = sqlSession.selectList(NS + "getBatchList", params);
|
||||||
return commonService.buildListResponse(list, totalCount, params);
|
return commonService.buildListResponse(list, totalCount, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getBatchInfo(Map<String, Object> params) {
|
public Map<String, Object> getBatchInfo(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectOne(NS + "get_batch_info", params);
|
return sqlSession.selectOne(NS + "getBatchInfo", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> insertBatch(Map<String, Object> params) {
|
public Map<String, Object> insertBatch(Map<String, Object> params) {
|
||||||
sqlSession.insert(NS + "insert_batch", params);
|
sqlSession.insert(NS + "insertBatch", params);
|
||||||
Long id = params.get("id") != null ? Long.parseLong(params.get("id").toString()) : null;
|
Long id = params.get("id") != null ? Long.parseLong(params.get("id").toString()) : null;
|
||||||
if (id != null) {
|
if (id != null) {
|
||||||
Map<String, Object> infoParams = new HashMap<>();
|
Map<String, Object> infoParams = new HashMap<>();
|
||||||
infoParams.put("id", id);
|
infoParams.put("id", id);
|
||||||
return sqlSession.selectOne(NS + "get_batch_info", infoParams);
|
return sqlSession.selectOne(NS + "getBatchInfo", infoParams);
|
||||||
}
|
}
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
@@ -47,16 +47,16 @@ public class BatchService extends BaseService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> updateBatch(Map<String, Object> params) {
|
public Map<String, Object> updateBatch(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.update(NS + "update_batch", params);
|
sqlSession.update(NS + "updateBatch", params);
|
||||||
Map<String, Object> infoParams = new HashMap<>();
|
Map<String, Object> infoParams = new HashMap<>();
|
||||||
infoParams.put("id", params.get("id"));
|
infoParams.put("id", params.get("id"));
|
||||||
return sqlSession.selectOne(NS + "get_batch_info", infoParams);
|
return sqlSession.selectOne(NS + "getBatchInfo", infoParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public int deleteBatch(Map<String, Object> params) {
|
public int deleteBatch(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.delete(NS + "delete_batch", params);
|
return sqlSession.delete(NS + "deleteBatch", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Map<String, Object>> getConnections(String companyCode) {
|
public List<Map<String, Object>> getConnections(String companyCode) {
|
||||||
@@ -73,7 +73,7 @@ public class BatchService extends BaseService {
|
|||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
params.put("is_active", "Y");
|
params.put("is_active", "Y");
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
List<Map<String, Object>> externalConns = sqlSession.selectList(EXT_NS + "get_external_db_connection_list", params);
|
List<Map<String, Object>> externalConns = sqlSession.selectList(EXT_NS + "getExternalDbConnectionList", params);
|
||||||
for (Map<String, Object> conn : externalConns) {
|
for (Map<String, Object> conn : externalConns) {
|
||||||
Map<String, Object> item = new LinkedHashMap<>();
|
Map<String, Object> item = new LinkedHashMap<>();
|
||||||
item.put("id", conn.get("id"));
|
item.put("id", conn.get("id"));
|
||||||
@@ -91,7 +91,7 @@ public class BatchService extends BaseService {
|
|||||||
|
|
||||||
public List<Map<String, Object>> getTables(String type, Long connectionId) {
|
public List<Map<String, Object>> getTables(String type, Long connectionId) {
|
||||||
if ("internal".equals(type)) {
|
if ("internal".equals(type)) {
|
||||||
return sqlSession.selectList(NS + "get_internal_tables");
|
return sqlSession.selectList(NS + "getInternalTables");
|
||||||
}
|
}
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
@@ -100,7 +100,7 @@ public class BatchService extends BaseService {
|
|||||||
if ("internal".equals(type)) {
|
if ("internal".equals(type)) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
return sqlSession.selectList(NS + "get_internal_table_columns", params);
|
return sqlSession.selectList(NS + "getInternalTableColumns", params);
|
||||||
}
|
}
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,34 +25,34 @@ public class BomService extends BaseService {
|
|||||||
public Map<String, Object> getBomList(Map<String, Object> params) {
|
public Map<String, Object> getBomList(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
commonService.applyPagination(params);
|
commonService.applyPagination(params);
|
||||||
int totalCount = sqlSession.selectOne(NS + "get_bom_list_cnt", params);
|
int totalCount = sqlSession.selectOne(NS + "getBomListCnt", params);
|
||||||
List<Map<String, Object>> list = sqlSession.selectList(NS + "get_bom_list", params);
|
List<Map<String, Object>> list = sqlSession.selectList(NS + "getBomList", params);
|
||||||
return commonService.buildListResponse(list, totalCount, params);
|
return commonService.buildListResponse(list, totalCount, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getBomInfo(Map<String, Object> params) {
|
public Map<String, Object> getBomInfo(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectOne(NS + "get_bom_info", params);
|
return sqlSession.selectOne(NS + "getBomInfo", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> insertBom(Map<String, Object> params) {
|
public Map<String, Object> insertBom(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.insert(NS + "insert_bom", params);
|
sqlSession.insert(NS + "insertBom", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> updateBom(Map<String, Object> params) {
|
public Map<String, Object> updateBom(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.update(NS + "update_bom", params);
|
sqlSession.update(NS + "updateBom", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> deleteBom(Map<String, Object> params) {
|
public Map<String, Object> deleteBom(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.delete(NS + "delete_bom", params);
|
sqlSession.delete(NS + "deleteBom", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class ButtonActionStandardService extends BaseService {
|
|||||||
* 버튼 액션 목록 조회 (동적 필터)
|
* 버튼 액션 목록 조회 (동적 필터)
|
||||||
*/
|
*/
|
||||||
public List<Map<String, Object>> getButtonActions(Map<String, Object> params) {
|
public List<Map<String, Object>> getButtonActions(Map<String, Object> params) {
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "select_button_actions", params);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "selectButtonActions", params);
|
||||||
rows.forEach(this::parseJsonFields);
|
rows.forEach(this::parseJsonFields);
|
||||||
return rows;
|
return rows;
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,7 @@ public class ButtonActionStandardService extends BaseService {
|
|||||||
* 버튼 액션 단건 조회
|
* 버튼 액션 단건 조회
|
||||||
*/
|
*/
|
||||||
public Map<String, Object> getButtonAction(Map<String, Object> params) {
|
public Map<String, Object> getButtonAction(Map<String, Object> params) {
|
||||||
Map<String, Object> row = sqlSession.selectOne(NS + "select_button_action_by_type", params);
|
Map<String, Object> row = sqlSession.selectOne(NS + "selectButtonActionByType", params);
|
||||||
if (row != null) parseJsonFields(row);
|
if (row != null) parseJsonFields(row);
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
@@ -43,7 +43,7 @@ public class ButtonActionStandardService extends BaseService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> createButtonAction(Map<String, Object> params) {
|
public Map<String, Object> createButtonAction(Map<String, Object> params) {
|
||||||
// 중복 체크
|
// 중복 체크
|
||||||
Map<String, Object> existing = sqlSession.selectOne(NS + "select_button_action_by_type", params);
|
Map<String, Object> existing = sqlSession.selectOne(NS + "selectButtonActionByType", params);
|
||||||
if (existing != null) {
|
if (existing != null) {
|
||||||
throw new IllegalArgumentException("이미 존재하는 액션 타입입니다: " + params.get("action_type"));
|
throw new IllegalArgumentException("이미 존재하는 액션 타입입니다: " + params.get("action_type"));
|
||||||
}
|
}
|
||||||
@@ -59,11 +59,11 @@ public class ButtonActionStandardService extends BaseService {
|
|||||||
params.putIfAbsent("sort_order", 0);
|
params.putIfAbsent("sort_order", 0);
|
||||||
params.putIfAbsent("is_active", "Y");
|
params.putIfAbsent("is_active", "Y");
|
||||||
|
|
||||||
sqlSession.insert(NS + "insert_button_action", params);
|
sqlSession.insert(NS + "insertButtonAction", params);
|
||||||
|
|
||||||
// 삽입된 행 조회 후 반환 (actionType 키로 조회)
|
// 삽입된 행 조회 후 반환 (actionType 키로 조회)
|
||||||
params.put("action_type", params.get("action_type"));
|
params.put("action_type", params.get("action_type"));
|
||||||
Map<String, Object> created = sqlSession.selectOne(NS + "select_button_action_by_type", params);
|
Map<String, Object> created = sqlSession.selectOne(NS + "selectButtonActionByType", params);
|
||||||
if (created != null) parseJsonFields(created);
|
if (created != null) parseJsonFields(created);
|
||||||
return created;
|
return created;
|
||||||
}
|
}
|
||||||
@@ -74,7 +74,7 @@ public class ButtonActionStandardService extends BaseService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> updateButtonAction(Map<String, Object> params) {
|
public Map<String, Object> updateButtonAction(Map<String, Object> params) {
|
||||||
// 존재 여부 확인
|
// 존재 여부 확인
|
||||||
Map<String, Object> existing = sqlSession.selectOne(NS + "select_button_action_by_type", params);
|
Map<String, Object> existing = sqlSession.selectOne(NS + "selectButtonActionByType", params);
|
||||||
if (existing == null) {
|
if (existing == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -83,9 +83,9 @@ public class ButtonActionStandardService extends BaseService {
|
|||||||
serializeJsonField(params, "validation_rules");
|
serializeJsonField(params, "validation_rules");
|
||||||
serializeJsonField(params, "action_config");
|
serializeJsonField(params, "action_config");
|
||||||
|
|
||||||
sqlSession.update(NS + "update_button_action", params);
|
sqlSession.update(NS + "updateButtonAction", params);
|
||||||
|
|
||||||
Map<String, Object> updated = sqlSession.selectOne(NS + "select_button_action_by_type", params);
|
Map<String, Object> updated = sqlSession.selectOne(NS + "selectButtonActionByType", params);
|
||||||
if (updated != null) parseJsonFields(updated);
|
if (updated != null) parseJsonFields(updated);
|
||||||
return updated;
|
return updated;
|
||||||
}
|
}
|
||||||
@@ -95,11 +95,11 @@ public class ButtonActionStandardService extends BaseService {
|
|||||||
*/
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
public boolean deleteButtonAction(Map<String, Object> params) {
|
public boolean deleteButtonAction(Map<String, Object> params) {
|
||||||
Map<String, Object> existing = sqlSession.selectOne(NS + "select_button_action_by_type", params);
|
Map<String, Object> existing = sqlSession.selectOne(NS + "selectButtonActionByType", params);
|
||||||
if (existing == null) {
|
if (existing == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
sqlSession.delete(NS + "delete_button_action", params);
|
sqlSession.delete(NS + "deleteButtonAction", params);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ public class ButtonActionStandardService extends BaseService {
|
|||||||
public void updateSortOrder(List<Map<String, Object>> items, String userId) {
|
public void updateSortOrder(List<Map<String, Object>> items, String userId) {
|
||||||
for (Map<String, Object> item : items) {
|
for (Map<String, Object> item : items) {
|
||||||
item.put("updated_by", userId);
|
item.put("updated_by", userId);
|
||||||
sqlSession.update(NS + "update_sort_order_item", item);
|
sqlSession.update(NS + "updateSortOrderItem", item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ public class ButtonActionStandardService extends BaseService {
|
|||||||
* 카테고리 목록 조회 (카운트 포함)
|
* 카테고리 목록 조회 (카운트 포함)
|
||||||
*/
|
*/
|
||||||
public List<Map<String, Object>> getCategories(Map<String, Object> params) {
|
public List<Map<String, Object>> getCategories(Map<String, Object> params) {
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "select_categories", params);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "selectCategories", params);
|
||||||
// count 필드를 Integer로 변환
|
// count 필드를 Integer로 변환
|
||||||
rows.forEach(row -> {
|
rows.forEach(row -> {
|
||||||
Object cnt = row.get("count");
|
Object cnt = row.get("count");
|
||||||
|
|||||||
@@ -23,20 +23,20 @@ public class CascadingAutoFillService extends BaseService {
|
|||||||
public Map<String, Object> getCascadingAutoFillGroupList(Map<String, Object> params) {
|
public Map<String, Object> getCascadingAutoFillGroupList(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
commonService.applyPagination(params);
|
commonService.applyPagination(params);
|
||||||
int totalCount = sqlSession.selectOne(NS + "get_cascading_auto_fill_group_list_cnt", params);
|
int totalCount = sqlSession.selectOne(NS + "getCascadingAutoFillGroupListCnt", params);
|
||||||
List<Map<String, Object>> list = sqlSession.selectList(NS + "get_cascading_auto_fill_group_list", params);
|
List<Map<String, Object>> list = sqlSession.selectList(NS + "getCascadingAutoFillGroupList", params);
|
||||||
return commonService.buildListResponse(list, totalCount, params);
|
return commonService.buildListResponse(list, totalCount, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getCascadingAutoFillGroupDetail(Map<String, Object> params) {
|
public Map<String, Object> getCascadingAutoFillGroupDetail(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
Map<String, Object> group = sqlSession.selectOne(NS + "get_cascading_auto_fill_group_by_code", params);
|
Map<String, Object> group = sqlSession.selectOne(NS + "getCascadingAutoFillGroupByCode", params);
|
||||||
if (group == null) return null;
|
if (group == null) return null;
|
||||||
|
|
||||||
Map<String, Object> mappingParams = new HashMap<>();
|
Map<String, Object> mappingParams = new HashMap<>();
|
||||||
mappingParams.put("group_code", params.get("group_code"));
|
mappingParams.put("group_code", params.get("group_code"));
|
||||||
mappingParams.put("company_code", group.get("company_code"));
|
mappingParams.put("company_code", group.get("company_code"));
|
||||||
List<Map<String, Object>> mappings = sqlSession.selectList(NS + "get_cascading_auto_fill_mapping_list", mappingParams);
|
List<Map<String, Object>> mappings = sqlSession.selectList(NS + "getCascadingAutoFillMappingList", mappingParams);
|
||||||
|
|
||||||
Map<String, Object> result = new HashMap<>(group);
|
Map<String, Object> result = new HashMap<>(group);
|
||||||
result.put("mappings", mappings);
|
result.put("mappings", mappings);
|
||||||
@@ -51,7 +51,7 @@ public class CascadingAutoFillService extends BaseService {
|
|||||||
// Generate group code: AF_{timestamp_base36}_{count:03d}
|
// Generate group code: AF_{timestamp_base36}_{count:03d}
|
||||||
Map<String, Object> countParams = new HashMap<>();
|
Map<String, Object> countParams = new HashMap<>();
|
||||||
countParams.put("company_code", companyCode);
|
countParams.put("company_code", companyCode);
|
||||||
Number cntNum = sqlSession.selectOne(NS + "get_cascading_auto_fill_group_count", countParams);
|
Number cntNum = sqlSession.selectOne(NS + "getCascadingAutoFillGroupCount", countParams);
|
||||||
int count = (cntNum != null ? cntNum.intValue() : 0) + 1;
|
int count = (cntNum != null ? cntNum.intValue() : 0) + 1;
|
||||||
String timestamp = Long.toString(System.currentTimeMillis(), 36).toUpperCase();
|
String timestamp = Long.toString(System.currentTimeMillis(), 36).toUpperCase();
|
||||||
String suffix = timestamp.substring(Math.max(0, timestamp.length() - 4));
|
String suffix = timestamp.substring(Math.max(0, timestamp.length() - 4));
|
||||||
@@ -62,7 +62,7 @@ public class CascadingAutoFillService extends BaseService {
|
|||||||
params.put("is_active", "Y");
|
params.put("is_active", "Y");
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlSession.insert(NS + "insert_cascading_auto_fill_group", params);
|
sqlSession.insert(NS + "insertCascadingAutoFillGroup", params);
|
||||||
|
|
||||||
// Insert mappings
|
// Insert mappings
|
||||||
Object mappingsObj = params.get("mappings");
|
Object mappingsObj = params.get("mappings");
|
||||||
@@ -79,7 +79,7 @@ public class CascadingAutoFillService extends BaseService {
|
|||||||
if (mp.get("is_editable") == null) mp.put("is_editable", "Y");
|
if (mp.get("is_editable") == null) mp.put("is_editable", "Y");
|
||||||
if (mp.get("is_required") == null) mp.put("is_required", "N");
|
if (mp.get("is_required") == null) mp.put("is_required", "N");
|
||||||
if (mp.get("sort_order") == null) mp.put("sort_order", i + 1);
|
if (mp.get("sort_order") == null) mp.put("sort_order", i + 1);
|
||||||
sqlSession.insert(NS + "insert_cascading_auto_fill_mapping", mp);
|
sqlSession.insert(NS + "insertCascadingAutoFillMapping", mp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -91,20 +91,20 @@ public class CascadingAutoFillService extends BaseService {
|
|||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
String groupCode = (String) params.get("group_code");
|
String groupCode = (String) params.get("group_code");
|
||||||
|
|
||||||
Map<String, Object> existing = sqlSession.selectOne(NS + "get_cascading_auto_fill_group_by_code", params);
|
Map<String, Object> existing = sqlSession.selectOne(NS + "getCascadingAutoFillGroupByCode", params);
|
||||||
if (existing == null) return null;
|
if (existing == null) return null;
|
||||||
|
|
||||||
String actualCompanyCode = (String) existing.get("company_code");
|
String actualCompanyCode = (String) existing.get("company_code");
|
||||||
params.put("company_code", actualCompanyCode);
|
params.put("company_code", actualCompanyCode);
|
||||||
|
|
||||||
sqlSession.update(NS + "update_cascading_auto_fill_group", params);
|
sqlSession.update(NS + "updateCascadingAutoFillGroup", params);
|
||||||
|
|
||||||
// Replace mappings if provided
|
// Replace mappings if provided
|
||||||
if (params.containsKey("mappings")) {
|
if (params.containsKey("mappings")) {
|
||||||
Map<String, Object> delParams = new HashMap<>();
|
Map<String, Object> delParams = new HashMap<>();
|
||||||
delParams.put("group_code", groupCode);
|
delParams.put("group_code", groupCode);
|
||||||
delParams.put("company_code", actualCompanyCode);
|
delParams.put("company_code", actualCompanyCode);
|
||||||
sqlSession.delete(NS + "delete_cascading_auto_fill_mappings", delParams);
|
sqlSession.delete(NS + "deleteCascadingAutoFillMappings", delParams);
|
||||||
|
|
||||||
Object mappingsObj = params.get("mappings");
|
Object mappingsObj = params.get("mappings");
|
||||||
if (mappingsObj instanceof List) {
|
if (mappingsObj instanceof List) {
|
||||||
@@ -120,7 +120,7 @@ public class CascadingAutoFillService extends BaseService {
|
|||||||
if (mp.get("is_editable") == null) mp.put("is_editable", "Y");
|
if (mp.get("is_editable") == null) mp.put("is_editable", "Y");
|
||||||
if (mp.get("is_required") == null) mp.put("is_required", "N");
|
if (mp.get("is_required") == null) mp.put("is_required", "N");
|
||||||
if (mp.get("sort_order") == null) mp.put("sort_order", i + 1);
|
if (mp.get("sort_order") == null) mp.put("sort_order", i + 1);
|
||||||
sqlSession.insert(NS + "insert_cascading_auto_fill_mapping", mp);
|
sqlSession.insert(NS + "insertCascadingAutoFillMapping", mp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -131,7 +131,7 @@ public class CascadingAutoFillService extends BaseService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public boolean deleteCascadingAutoFillGroup(Map<String, Object> params) {
|
public boolean deleteCascadingAutoFillGroup(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
Map<String, Object> existing = sqlSession.selectOne(NS + "get_cascading_auto_fill_group_by_code", params);
|
Map<String, Object> existing = sqlSession.selectOne(NS + "getCascadingAutoFillGroupByCode", params);
|
||||||
if (existing == null) return false;
|
if (existing == null) return false;
|
||||||
|
|
||||||
String groupCode = (String) params.get("group_code");
|
String groupCode = (String) params.get("group_code");
|
||||||
@@ -140,8 +140,8 @@ public class CascadingAutoFillService extends BaseService {
|
|||||||
Map<String, Object> delParams = new HashMap<>();
|
Map<String, Object> delParams = new HashMap<>();
|
||||||
delParams.put("group_code", groupCode);
|
delParams.put("group_code", groupCode);
|
||||||
delParams.put("company_code", companyCode);
|
delParams.put("company_code", companyCode);
|
||||||
sqlSession.delete(NS + "delete_cascading_auto_fill_mappings", delParams);
|
sqlSession.delete(NS + "deleteCascadingAutoFillMappings", delParams);
|
||||||
sqlSession.delete(NS + "delete_cascading_auto_fill_group", delParams);
|
sqlSession.delete(NS + "deleteCascadingAutoFillGroup", delParams);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,7 +151,7 @@ public class CascadingAutoFillService extends BaseService {
|
|||||||
|
|
||||||
Map<String, Object> groupParams = new HashMap<>(params);
|
Map<String, Object> groupParams = new HashMap<>(params);
|
||||||
groupParams.put("is_active", "Y");
|
groupParams.put("is_active", "Y");
|
||||||
Map<String, Object> group = sqlSession.selectOne(NS + "get_cascading_auto_fill_group_by_code", groupParams);
|
Map<String, Object> group = sqlSession.selectOne(NS + "getCascadingAutoFillGroupByCode", groupParams);
|
||||||
if (group == null) return null;
|
if (group == null) return null;
|
||||||
|
|
||||||
String masterTable = sanitizeIdentifier((String) group.get("master_table"));
|
String masterTable = sanitizeIdentifier((String) group.get("master_table"));
|
||||||
@@ -185,14 +185,14 @@ public class CascadingAutoFillService extends BaseService {
|
|||||||
|
|
||||||
Map<String, Object> groupParams = new HashMap<>(params);
|
Map<String, Object> groupParams = new HashMap<>(params);
|
||||||
groupParams.put("is_active", "Y");
|
groupParams.put("is_active", "Y");
|
||||||
Map<String, Object> group = sqlSession.selectOne(NS + "get_cascading_auto_fill_group_by_code", groupParams);
|
Map<String, Object> group = sqlSession.selectOne(NS + "getCascadingAutoFillGroupByCode", groupParams);
|
||||||
if (group == null) return null;
|
if (group == null) return null;
|
||||||
|
|
||||||
String actualCompanyCode = (String) group.get("company_code");
|
String actualCompanyCode = (String) group.get("company_code");
|
||||||
Map<String, Object> mappingParams = new HashMap<>();
|
Map<String, Object> mappingParams = new HashMap<>();
|
||||||
mappingParams.put("group_code", groupCode);
|
mappingParams.put("group_code", groupCode);
|
||||||
mappingParams.put("company_code", actualCompanyCode);
|
mappingParams.put("company_code", actualCompanyCode);
|
||||||
List<Map<String, Object>> mappings = sqlSession.selectList(NS + "get_cascading_auto_fill_mapping_list", mappingParams);
|
List<Map<String, Object>> mappings = sqlSession.selectList(NS + "getCascadingAutoFillMappingList", mappingParams);
|
||||||
|
|
||||||
if (mappings.isEmpty()) {
|
if (mappings.isEmpty()) {
|
||||||
Map<String, Object> empty = new HashMap<>();
|
Map<String, Object> empty = new HashMap<>();
|
||||||
|
|||||||
@@ -24,34 +24,34 @@ public class CascadingConditionService extends BaseService {
|
|||||||
public Map<String, Object> getCascadingConditionList(Map<String, Object> params) {
|
public Map<String, Object> getCascadingConditionList(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
commonService.applyPagination(params);
|
commonService.applyPagination(params);
|
||||||
int totalCount = sqlSession.selectOne(NS + "get_cascading_condition_list_cnt", params);
|
int totalCount = sqlSession.selectOne(NS + "getCascadingConditionListCnt", params);
|
||||||
List<Map<String, Object>> list = sqlSession.selectList(NS + "get_cascading_condition_list", params);
|
List<Map<String, Object>> list = sqlSession.selectList(NS + "getCascadingConditionList", params);
|
||||||
return commonService.buildListResponse(list, totalCount, params);
|
return commonService.buildListResponse(list, totalCount, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getCascadingConditionInfo(Map<String, Object> params) {
|
public Map<String, Object> getCascadingConditionInfo(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectOne(NS + "get_cascading_condition_info", params);
|
return sqlSession.selectOne(NS + "getCascadingConditionInfo", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> insertCascadingCondition(Map<String, Object> params) {
|
public Map<String, Object> insertCascadingCondition(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.insert(NS + "insert_cascading_condition", params);
|
sqlSession.insert(NS + "insertCascadingCondition", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> updateCascadingCondition(Map<String, Object> params) {
|
public Map<String, Object> updateCascadingCondition(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.update(NS + "update_cascading_condition", params);
|
sqlSession.update(NS + "updateCascadingCondition", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> deleteCascadingCondition(Map<String, Object> params) {
|
public Map<String, Object> deleteCascadingCondition(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.delete(NS + "delete_cascading_condition", params);
|
sqlSession.delete(NS + "deleteCascadingCondition", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ public class CascadingConditionService extends BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 2. 조건 규칙 조회 (우선순위 내림차순)
|
// 2. 조건 규칙 조회 (우선순위 내림차순)
|
||||||
List<Map<String, Object>> conditions = sqlSession.selectList(NS + "get_cascading_conditions_by_relation_code", params);
|
List<Map<String, Object>> conditions = sqlSession.selectList(NS + "getCascadingConditionsByRelationCode", params);
|
||||||
|
|
||||||
// 3. 매칭 조건 탐색
|
// 3. 매칭 조건 탐색
|
||||||
Map<String, Object> matchedCondition = null;
|
Map<String, Object> matchedCondition = null;
|
||||||
|
|||||||
@@ -21,20 +21,20 @@ public class CascadingHierarchyService extends BaseService {
|
|||||||
public Map<String, Object> getCascadingHierarchyGroupList(Map<String, Object> params) {
|
public Map<String, Object> getCascadingHierarchyGroupList(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
commonService.applyPagination(params);
|
commonService.applyPagination(params);
|
||||||
int totalCount = sqlSession.selectOne(NS + "get_cascading_hierarchy_group_list_cnt", params);
|
int totalCount = sqlSession.selectOne(NS + "getCascadingHierarchyGroupListCnt", params);
|
||||||
List<Map<String, Object>> list = sqlSession.selectList(NS + "get_cascading_hierarchy_group_list", params);
|
List<Map<String, Object>> list = sqlSession.selectList(NS + "getCascadingHierarchyGroupList", params);
|
||||||
return commonService.buildListResponse(list, totalCount, params);
|
return commonService.buildListResponse(list, totalCount, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getCascadingHierarchyGroupDetail(Map<String, Object> params) {
|
public Map<String, Object> getCascadingHierarchyGroupDetail(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
Map<String, Object> group = sqlSession.selectOne(NS + "get_cascading_hierarchy_group_by_code", params);
|
Map<String, Object> group = sqlSession.selectOne(NS + "getCascadingHierarchyGroupByCode", params);
|
||||||
if (group == null) return null;
|
if (group == null) return null;
|
||||||
|
|
||||||
Map<String, Object> levelParams = new HashMap<>();
|
Map<String, Object> levelParams = new HashMap<>();
|
||||||
levelParams.put("group_code", params.get("group_code"));
|
levelParams.put("group_code", params.get("group_code"));
|
||||||
levelParams.put("company_code", group.get("company_code"));
|
levelParams.put("company_code", group.get("company_code"));
|
||||||
List<Map<String, Object>> levels = sqlSession.selectList(NS + "get_cascading_hierarchy_level_list", levelParams);
|
List<Map<String, Object>> levels = sqlSession.selectList(NS + "getCascadingHierarchyLevelList", levelParams);
|
||||||
|
|
||||||
Map<String, Object> result = new HashMap<>(group);
|
Map<String, Object> result = new HashMap<>(group);
|
||||||
result.put("levels", levels);
|
result.put("levels", levels);
|
||||||
@@ -50,7 +50,7 @@ public class CascadingHierarchyService extends BaseService {
|
|||||||
// Generate group code: HG_{timestamp_base36}_{count:03d}
|
// Generate group code: HG_{timestamp_base36}_{count:03d}
|
||||||
Map<String, Object> countParams = new HashMap<>();
|
Map<String, Object> countParams = new HashMap<>();
|
||||||
countParams.put("company_code", companyCode);
|
countParams.put("company_code", companyCode);
|
||||||
Number cntNum = sqlSession.selectOne(NS + "get_cascading_hierarchy_group_count", countParams);
|
Number cntNum = sqlSession.selectOne(NS + "getCascadingHierarchyGroupCount", countParams);
|
||||||
int count = (cntNum != null ? cntNum.intValue() : 0) + 1;
|
int count = (cntNum != null ? cntNum.intValue() : 0) + 1;
|
||||||
String timestamp = Long.toString(System.currentTimeMillis(), 36).toUpperCase();
|
String timestamp = Long.toString(System.currentTimeMillis(), 36).toUpperCase();
|
||||||
String suffix = timestamp.substring(Math.max(0, timestamp.length() - 4));
|
String suffix = timestamp.substring(Math.max(0, timestamp.length() - 4));
|
||||||
@@ -65,7 +65,7 @@ public class CascadingHierarchyService extends BaseService {
|
|||||||
if (params.get("no_options_message") == null) params.put("no_options_message", "옵션이 없습니다");
|
if (params.get("no_options_message") == null) params.put("no_options_message", "옵션이 없습니다");
|
||||||
if (params.get("loading_message") == null) params.put("loading_message", "로딩 중...");
|
if (params.get("loading_message") == null) params.put("loading_message", "로딩 중...");
|
||||||
|
|
||||||
sqlSession.insert(NS + "insert_cascading_hierarchy_group", params);
|
sqlSession.insert(NS + "insertCascadingHierarchyGroup", params);
|
||||||
|
|
||||||
// Insert levels for MULTI_TABLE type
|
// Insert levels for MULTI_TABLE type
|
||||||
Object levelsObj = params.get("levels");
|
Object levelsObj = params.get("levels");
|
||||||
@@ -84,7 +84,7 @@ public class CascadingHierarchyService extends BaseService {
|
|||||||
if (lp.get("placeholder") == null && lp.get("level_name") != null) {
|
if (lp.get("placeholder") == null && lp.get("level_name") != null) {
|
||||||
lp.put("placeholder", lp.get("level_name") + " 선택");
|
lp.put("placeholder", lp.get("level_name") + " 선택");
|
||||||
}
|
}
|
||||||
sqlSession.insert(NS + "insert_cascading_hierarchy_level", lp);
|
sqlSession.insert(NS + "insertCascadingHierarchyLevel", lp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -96,18 +96,18 @@ public class CascadingHierarchyService extends BaseService {
|
|||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
params.put("updated_by", params.getOrDefault("user_id", "system"));
|
params.put("updated_by", params.getOrDefault("user_id", "system"));
|
||||||
|
|
||||||
Map<String, Object> existing = sqlSession.selectOne(NS + "get_cascading_hierarchy_group_by_code", params);
|
Map<String, Object> existing = sqlSession.selectOne(NS + "getCascadingHierarchyGroupByCode", params);
|
||||||
if (existing == null) return null;
|
if (existing == null) return null;
|
||||||
|
|
||||||
params.put("company_code", existing.get("company_code"));
|
params.put("company_code", existing.get("company_code"));
|
||||||
sqlSession.update(NS + "update_cascading_hierarchy_group", params);
|
sqlSession.update(NS + "updateCascadingHierarchyGroup", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public boolean deleteCascadingHierarchyGroup(Map<String, Object> params) {
|
public boolean deleteCascadingHierarchyGroup(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
Map<String, Object> existing = sqlSession.selectOne(NS + "get_cascading_hierarchy_group_by_code", params);
|
Map<String, Object> existing = sqlSession.selectOne(NS + "getCascadingHierarchyGroupByCode", params);
|
||||||
if (existing == null) return false;
|
if (existing == null) return false;
|
||||||
|
|
||||||
String groupCode = (String) params.get("group_code");
|
String groupCode = (String) params.get("group_code");
|
||||||
@@ -116,8 +116,8 @@ public class CascadingHierarchyService extends BaseService {
|
|||||||
Map<String, Object> delParams = new HashMap<>();
|
Map<String, Object> delParams = new HashMap<>();
|
||||||
delParams.put("group_code", groupCode);
|
delParams.put("group_code", groupCode);
|
||||||
delParams.put("company_code", companyCode);
|
delParams.put("company_code", companyCode);
|
||||||
sqlSession.delete(NS + "delete_cascading_hierarchy_levels", delParams);
|
sqlSession.delete(NS + "deleteCascadingHierarchyLevels", delParams);
|
||||||
sqlSession.delete(NS + "delete_cascading_hierarchy_group", delParams);
|
sqlSession.delete(NS + "deleteCascadingHierarchyGroup", delParams);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,7 +129,7 @@ public class CascadingHierarchyService extends BaseService {
|
|||||||
Map<String, Object> groupParams = new HashMap<>();
|
Map<String, Object> groupParams = new HashMap<>();
|
||||||
groupParams.put("group_code", groupCode);
|
groupParams.put("group_code", groupCode);
|
||||||
groupParams.put("company_code", params.get("company_code"));
|
groupParams.put("company_code", params.get("company_code"));
|
||||||
Map<String, Object> group = sqlSession.selectOne(NS + "get_cascading_hierarchy_group_by_code", groupParams);
|
Map<String, Object> group = sqlSession.selectOne(NS + "getCascadingHierarchyGroupByCode", groupParams);
|
||||||
if (group == null) return null;
|
if (group == null) return null;
|
||||||
|
|
||||||
params.put("company_code", group.get("company_code"));
|
params.put("company_code", group.get("company_code"));
|
||||||
@@ -140,27 +140,27 @@ public class CascadingHierarchyService extends BaseService {
|
|||||||
params.put("placeholder", params.get("level_name") + " 선택");
|
params.put("placeholder", params.get("level_name") + " 선택");
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlSession.insert(NS + "insert_cascading_hierarchy_level", params);
|
sqlSession.insert(NS + "insertCascadingHierarchyLevel", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> updateCascadingHierarchyLevel(Map<String, Object> params) {
|
public Map<String, Object> updateCascadingHierarchyLevel(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
Map<String, Object> existing = sqlSession.selectOne(NS + "get_cascading_hierarchy_level_info", params);
|
Map<String, Object> existing = sqlSession.selectOne(NS + "getCascadingHierarchyLevelInfo", params);
|
||||||
if (existing == null) return null;
|
if (existing == null) return null;
|
||||||
|
|
||||||
sqlSession.update(NS + "update_cascading_hierarchy_level", params);
|
sqlSession.update(NS + "updateCascadingHierarchyLevel", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public boolean deleteCascadingHierarchyLevel(Map<String, Object> params) {
|
public boolean deleteCascadingHierarchyLevel(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
Map<String, Object> existing = sqlSession.selectOne(NS + "get_cascading_hierarchy_level_info", params);
|
Map<String, Object> existing = sqlSession.selectOne(NS + "getCascadingHierarchyLevelInfo", params);
|
||||||
if (existing == null) return false;
|
if (existing == null) return false;
|
||||||
|
|
||||||
sqlSession.delete(NS + "delete_cascading_hierarchy_level", params);
|
sqlSession.delete(NS + "deleteCascadingHierarchyLevel", params);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,7 +168,7 @@ public class CascadingHierarchyService extends BaseService {
|
|||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
String companyCode = (String) params.get("company_code");
|
String companyCode = (String) params.get("company_code");
|
||||||
|
|
||||||
Map<String, Object> level = sqlSession.selectOne(NS + "get_cascading_hierarchy_level_for_options", params);
|
Map<String, Object> level = sqlSession.selectOne(NS + "getCascadingHierarchyLevelForOptions", params);
|
||||||
if (level == null) return null;
|
if (level == null) return null;
|
||||||
|
|
||||||
String tableName = sanitizeIdentifier((String) level.get("table_name"));
|
String tableName = sanitizeIdentifier((String) level.get("table_name"));
|
||||||
|
|||||||
@@ -21,14 +21,14 @@ public class CascadingMutualExclusionService extends BaseService {
|
|||||||
public Map<String, Object> getCascadingMutualExclusionList(Map<String, Object> params) {
|
public Map<String, Object> getCascadingMutualExclusionList(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
commonService.applyPagination(params);
|
commonService.applyPagination(params);
|
||||||
int totalCount = sqlSession.selectOne(NS + "get_cascading_mutual_exclusion_list_cnt", params);
|
int totalCount = sqlSession.selectOne(NS + "getCascadingMutualExclusionListCnt", params);
|
||||||
List<Map<String, Object>> list = sqlSession.selectList(NS + "get_cascading_mutual_exclusion_list", params);
|
List<Map<String, Object>> list = sqlSession.selectList(NS + "getCascadingMutualExclusionList", params);
|
||||||
return commonService.buildListResponse(list, totalCount, params);
|
return commonService.buildListResponse(list, totalCount, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getCascadingMutualExclusionInfo(Map<String, Object> params) {
|
public Map<String, Object> getCascadingMutualExclusionInfo(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectOne(NS + "get_cascading_mutual_exclusion_info", params);
|
return sqlSession.selectOne(NS + "getCascadingMutualExclusionInfo", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -41,26 +41,26 @@ public class CascadingMutualExclusionService extends BaseService {
|
|||||||
String companyCode = (String) params.get("company_code");
|
String companyCode = (String) params.get("company_code");
|
||||||
Map<String, Object> countParams = new LinkedHashMap<>();
|
Map<String, Object> countParams = new LinkedHashMap<>();
|
||||||
countParams.put("company_code", companyCode);
|
countParams.put("company_code", companyCode);
|
||||||
int count = sqlSession.selectOne(NS + "get_cascading_mutual_exclusion_count", countParams);
|
int count = sqlSession.selectOne(NS + "getCascadingMutualExclusionCount", countParams);
|
||||||
String ts = Long.toString(System.currentTimeMillis(), 36).toUpperCase();
|
String ts = Long.toString(System.currentTimeMillis(), 36).toUpperCase();
|
||||||
ts = ts.substring(Math.max(0, ts.length() - 4));
|
ts = ts.substring(Math.max(0, ts.length() - 4));
|
||||||
params.put("exclusion_code", String.format("EX_%s_%03d", ts, count + 1));
|
params.put("exclusion_code", String.format("EX_%s_%03d", ts, count + 1));
|
||||||
|
|
||||||
sqlSession.insert(NS + "insert_cascading_mutual_exclusion", params);
|
sqlSession.insert(NS + "insertCascadingMutualExclusion", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> updateCascadingMutualExclusion(Map<String, Object> params) {
|
public Map<String, Object> updateCascadingMutualExclusion(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.update(NS + "update_cascading_mutual_exclusion", params);
|
sqlSession.update(NS + "updateCascadingMutualExclusion", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> deleteCascadingMutualExclusion(Map<String, Object> params) {
|
public Map<String, Object> deleteCascadingMutualExclusion(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.delete(NS + "delete_cascading_mutual_exclusion", params);
|
sqlSession.delete(NS + "deleteCascadingMutualExclusion", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ public class CascadingMutualExclusionService extends BaseService {
|
|||||||
*/
|
*/
|
||||||
public Map<String, Object> validateCascadingMutualExclusion(Map<String, Object> params) {
|
public Map<String, Object> validateCascadingMutualExclusion(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
Map<String, Object> exclusion = sqlSession.selectOne(NS + "get_cascading_mutual_exclusion_by_code", params);
|
Map<String, Object> exclusion = sqlSession.selectOne(NS + "getCascadingMutualExclusionByCode", params);
|
||||||
if (exclusion == null) throw new NoSuchElementException("상호 배제 규칙을 찾을 수 없습니다.");
|
if (exclusion == null) throw new NoSuchElementException("상호 배제 규칙을 찾을 수 없습니다.");
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -125,7 +125,7 @@ public class CascadingMutualExclusionService extends BaseService {
|
|||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
String companyCode = (String) params.get("company_code");
|
String companyCode = (String) params.get("company_code");
|
||||||
|
|
||||||
Map<String, Object> exclusion = sqlSession.selectOne(NS + "get_cascading_mutual_exclusion_by_code", params);
|
Map<String, Object> exclusion = sqlSession.selectOne(NS + "getCascadingMutualExclusionByCode", params);
|
||||||
if (exclusion == null) throw new NoSuchElementException("상호 배제 규칙을 찾을 수 없습니다.");
|
if (exclusion == null) throw new NoSuchElementException("상호 배제 규칙을 찾을 수 없습니다.");
|
||||||
|
|
||||||
String sourceTable = (String) exclusion.get("source_table");
|
String sourceTable = (String) exclusion.get("source_table");
|
||||||
|
|||||||
@@ -22,19 +22,19 @@ public class CascadingRelationService extends BaseService {
|
|||||||
public Map<String, Object> getCascadingRelationList(Map<String, Object> params) {
|
public Map<String, Object> getCascadingRelationList(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
commonService.applyPagination(params);
|
commonService.applyPagination(params);
|
||||||
int totalCount = sqlSession.selectOne(NS + "get_cascading_relation_list_cnt", params);
|
int totalCount = sqlSession.selectOne(NS + "getCascadingRelationListCnt", params);
|
||||||
List<Map<String, Object>> list = sqlSession.selectList(NS + "get_cascading_relation_list", params);
|
List<Map<String, Object>> list = sqlSession.selectList(NS + "getCascadingRelationList", params);
|
||||||
return commonService.buildListResponse(list, totalCount, params);
|
return commonService.buildListResponse(list, totalCount, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getCascadingRelationInfo(Map<String, Object> params) {
|
public Map<String, Object> getCascadingRelationInfo(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectOne(NS + "get_cascading_relation_info", params);
|
return sqlSession.selectOne(NS + "getCascadingRelationInfo", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getCascadingRelationByCode(Map<String, Object> params) {
|
public Map<String, Object> getCascadingRelationByCode(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectOne(NS + "get_cascading_relation_by_code", params);
|
return sqlSession.selectOne(NS + "getCascadingRelationByCode", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -55,7 +55,7 @@ public class CascadingRelationService extends BaseService {
|
|||||||
params.put("clear_on_parent_change", Boolean.TRUE.equals(clearOnParentChange) ? "Y" : "N");
|
params.put("clear_on_parent_change", Boolean.TRUE.equals(clearOnParentChange) ? "Y" : "N");
|
||||||
}
|
}
|
||||||
params.put("is_active", "Y");
|
params.put("is_active", "Y");
|
||||||
sqlSession.insert(NS + "insert_cascading_relation", params);
|
sqlSession.insert(NS + "insertCascadingRelation", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,14 +70,14 @@ public class CascadingRelationService extends BaseService {
|
|||||||
if (clearOnParentChange instanceof Boolean) {
|
if (clearOnParentChange instanceof Boolean) {
|
||||||
params.put("clear_on_parent_change", Boolean.TRUE.equals(clearOnParentChange) ? "Y" : "N");
|
params.put("clear_on_parent_change", Boolean.TRUE.equals(clearOnParentChange) ? "Y" : "N");
|
||||||
}
|
}
|
||||||
sqlSession.update(NS + "update_cascading_relation", params);
|
sqlSession.update(NS + "updateCascadingRelation", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> deleteCascadingRelation(Map<String, Object> params) {
|
public Map<String, Object> deleteCascadingRelation(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.update(NS + "delete_cascading_relation", params);
|
sqlSession.update(NS + "deleteCascadingRelation", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ public class CascadingRelationService extends BaseService {
|
|||||||
public List<Map<String, Object>> getParentOptions(Map<String, Object> params) {
|
public List<Map<String, Object>> getParentOptions(Map<String, Object> params) {
|
||||||
String companyCode = (String) params.get("company_code");
|
String companyCode = (String) params.get("company_code");
|
||||||
|
|
||||||
Map<String, Object> relation = sqlSession.selectOne(NS + "get_cascading_relation_by_code", params);
|
Map<String, Object> relation = sqlSession.selectOne(NS + "getCascadingRelationByCode", params);
|
||||||
if (relation == null) {
|
if (relation == null) {
|
||||||
throw new NoSuchElementException("연쇄 관계를 찾을 수 없습니다.");
|
throw new NoSuchElementException("연쇄 관계를 찾을 수 없습니다.");
|
||||||
}
|
}
|
||||||
@@ -145,7 +145,7 @@ public class CascadingRelationService extends BaseService {
|
|||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> relation = sqlSession.selectOne(NS + "get_cascading_relation_by_code", params);
|
Map<String, Object> relation = sqlSession.selectOne(NS + "getCascadingRelationByCode", params);
|
||||||
if (relation == null) {
|
if (relation == null) {
|
||||||
throw new NoSuchElementException("연쇄 관계를 찾을 수 없습니다.");
|
throw new NoSuchElementException("연쇄 관계를 찾을 수 없습니다.");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public class CategoryTreeService extends BaseService {
|
|||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
params.put("column_name", columnName);
|
params.put("column_name", columnName);
|
||||||
List<Map<String, Object>> flatList = sqlSession.selectList(NS + "get_category_tree_list", params);
|
List<Map<String, Object>> flatList = sqlSession.selectList(NS + "getCategoryTreeList", params);
|
||||||
return buildTree(flatList);
|
return buildTree(flatList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ public class CategoryTreeService extends BaseService {
|
|||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
params.put("column_name", columnName);
|
params.put("column_name", columnName);
|
||||||
return sqlSession.selectList(NS + "get_category_tree_list", params);
|
return sqlSession.selectList(NS + "getCategoryTreeList", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -49,7 +49,7 @@ public class CategoryTreeService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
params.put("value_id", valueId);
|
params.put("value_id", valueId);
|
||||||
return sqlSession.selectOne(NS + "get_category_tree_info", params);
|
return sqlSession.selectOne(NS + "getCategoryTreeInfo", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -75,7 +75,7 @@ public class CategoryTreeService extends BaseService {
|
|||||||
Map<String, Object> parentParams = new HashMap<>();
|
Map<String, Object> parentParams = new HashMap<>();
|
||||||
parentParams.put("company_code", companyCode);
|
parentParams.put("company_code", companyCode);
|
||||||
parentParams.put("value_id", ((Number) parentValueIdRaw).intValue());
|
parentParams.put("value_id", ((Number) parentValueIdRaw).intValue());
|
||||||
Map<String, Object> parent = sqlSession.selectOne(NS + "get_category_tree_info", parentParams);
|
Map<String, Object> parent = sqlSession.selectOne(NS + "getCategoryTreeInfo", parentParams);
|
||||||
if (parent != null) {
|
if (parent != null) {
|
||||||
depth = ((Number) parent.get("depth")).intValue() + 1;
|
depth = ((Number) parent.get("depth")).intValue() + 1;
|
||||||
if (depth > 3) {
|
if (depth > 3) {
|
||||||
@@ -107,13 +107,13 @@ public class CategoryTreeService extends BaseService {
|
|||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
params.put("created_by", createdBy);
|
params.put("created_by", createdBy);
|
||||||
|
|
||||||
sqlSession.insert(NS + "insert_category_tree", params);
|
sqlSession.insert(NS + "insertCategoryTree", params);
|
||||||
|
|
||||||
// useGeneratedKeys → params.get("value_id") 에 생성된 ID 저장
|
// useGeneratedKeys → params.get("value_id") 에 생성된 ID 저장
|
||||||
Map<String, Object> fetchParams = new HashMap<>();
|
Map<String, Object> fetchParams = new HashMap<>();
|
||||||
fetchParams.put("company_code", companyCode);
|
fetchParams.put("company_code", companyCode);
|
||||||
fetchParams.put("value_id", params.get("value_id"));
|
fetchParams.put("value_id", params.get("value_id"));
|
||||||
return sqlSession.selectOne(NS + "get_category_tree_info", fetchParams);
|
return sqlSession.selectOne(NS + "getCategoryTreeInfo", fetchParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -125,7 +125,7 @@ public class CategoryTreeService extends BaseService {
|
|||||||
Map<String, Object> currentParams = new HashMap<>();
|
Map<String, Object> currentParams = new HashMap<>();
|
||||||
currentParams.put("company_code", companyCode);
|
currentParams.put("company_code", companyCode);
|
||||||
currentParams.put("value_id", valueId);
|
currentParams.put("value_id", valueId);
|
||||||
Map<String, Object> current = sqlSession.selectOne(NS + "get_category_tree_info", currentParams);
|
Map<String, Object> current = sqlSession.selectOne(NS + "getCategoryTreeInfo", currentParams);
|
||||||
if (current == null) return null;
|
if (current == null) return null;
|
||||||
|
|
||||||
String currentLabel = (String) current.get("value_label");
|
String currentLabel = (String) current.get("value_label");
|
||||||
@@ -148,7 +148,7 @@ public class CategoryTreeService extends BaseService {
|
|||||||
Map<String, Object> newParentParams = new HashMap<>();
|
Map<String, Object> newParentParams = new HashMap<>();
|
||||||
newParentParams.put("company_code", companyCode);
|
newParentParams.put("company_code", companyCode);
|
||||||
newParentParams.put("value_id", ((Number) body.get("parent_value_id")).intValue());
|
newParentParams.put("value_id", ((Number) body.get("parent_value_id")).intValue());
|
||||||
Map<String, Object> newParent = sqlSession.selectOne(NS + "get_category_tree_info", newParentParams);
|
Map<String, Object> newParent = sqlSession.selectOne(NS + "getCategoryTreeInfo", newParentParams);
|
||||||
if (newParent != null) {
|
if (newParent != null) {
|
||||||
newDepth = ((Number) newParent.get("depth")).intValue() + 1;
|
newDepth = ((Number) newParent.get("depth")).intValue() + 1;
|
||||||
if (newDepth > 3) {
|
if (newDepth > 3) {
|
||||||
@@ -166,7 +166,7 @@ public class CategoryTreeService extends BaseService {
|
|||||||
Map<String, Object> parentParams = new HashMap<>();
|
Map<String, Object> parentParams = new HashMap<>();
|
||||||
parentParams.put("company_code", companyCode);
|
parentParams.put("company_code", companyCode);
|
||||||
parentParams.put("value_id", ((Number) currentParentId).intValue());
|
parentParams.put("value_id", ((Number) currentParentId).intValue());
|
||||||
Map<String, Object> parent = sqlSession.selectOne(NS + "get_category_tree_info", parentParams);
|
Map<String, Object> parent = sqlSession.selectOne(NS + "getCategoryTreeInfo", parentParams);
|
||||||
String parentPath = parent != null ? (String) parent.get("path") : null;
|
String parentPath = parent != null ? (String) parent.get("path") : null;
|
||||||
newPath = parentPath != null ? parentPath + "/" + newLabel : newLabel;
|
newPath = parentPath != null ? parentPath + "/" + newLabel : newLabel;
|
||||||
} else {
|
} else {
|
||||||
@@ -190,7 +190,7 @@ public class CategoryTreeService extends BaseService {
|
|||||||
updateParams.put("is_default", body.get("is_default"));
|
updateParams.put("is_default", body.get("is_default"));
|
||||||
updateParams.put("updated_by", updatedBy);
|
updateParams.put("updated_by", updatedBy);
|
||||||
|
|
||||||
int affected = sqlSession.update(NS + "update_category_tree", updateParams);
|
int affected = sqlSession.update(NS + "updateCategoryTree", updateParams);
|
||||||
if (affected == 0) return null;
|
if (affected == 0) return null;
|
||||||
|
|
||||||
if (labelChanged || parentChanged) {
|
if (labelChanged || parentChanged) {
|
||||||
@@ -200,7 +200,7 @@ public class CategoryTreeService extends BaseService {
|
|||||||
Map<String, Object> fetchParams = new HashMap<>();
|
Map<String, Object> fetchParams = new HashMap<>();
|
||||||
fetchParams.put("company_code", companyCode);
|
fetchParams.put("company_code", companyCode);
|
||||||
fetchParams.put("value_id", valueId);
|
fetchParams.put("value_id", valueId);
|
||||||
return sqlSession.selectOne(NS + "get_category_tree_info", fetchParams);
|
return sqlSession.selectOne(NS + "getCategoryTreeInfo", fetchParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -218,7 +218,7 @@ public class CategoryTreeService extends BaseService {
|
|||||||
Map<String, Object> childParams = new HashMap<>();
|
Map<String, Object> childParams = new HashMap<>();
|
||||||
childParams.put("value_id", valueId);
|
childParams.put("value_id", valueId);
|
||||||
childParams.put("company_code", companyCode);
|
childParams.put("company_code", companyCode);
|
||||||
Integer childCountObj = sqlSession.selectOne(NS + "get_category_tree_children_cnt", childParams);
|
Integer childCountObj = sqlSession.selectOne(NS + "getCategoryTreeChildrenCnt", childParams);
|
||||||
int childCount = childCountObj != null ? childCountObj : 0;
|
int childCount = childCountObj != null ? childCountObj : 0;
|
||||||
if (childCount > 0) {
|
if (childCount > 0) {
|
||||||
Map<String, Object> res = new LinkedHashMap<>();
|
Map<String, Object> res = new LinkedHashMap<>();
|
||||||
@@ -254,7 +254,7 @@ public class CategoryTreeService extends BaseService {
|
|||||||
Map<String, Object> childParams = new HashMap<>();
|
Map<String, Object> childParams = new HashMap<>();
|
||||||
childParams.put("value_id", valueId);
|
childParams.put("value_id", valueId);
|
||||||
childParams.put("company_code", companyCode);
|
childParams.put("company_code", companyCode);
|
||||||
Integer childCountObj = sqlSession.selectOne(NS + "get_category_tree_children_cnt", childParams);
|
Integer childCountObj = sqlSession.selectOne(NS + "getCategoryTreeChildrenCnt", childParams);
|
||||||
int childCount = childCountObj != null ? childCountObj : 0;
|
int childCount = childCountObj != null ? childCountObj : 0;
|
||||||
if (childCount > 0) {
|
if (childCount > 0) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
@@ -275,7 +275,7 @@ public class CategoryTreeService extends BaseService {
|
|||||||
Map<String, Object> deleteParams = new HashMap<>();
|
Map<String, Object> deleteParams = new HashMap<>();
|
||||||
deleteParams.put("company_code", companyCode);
|
deleteParams.put("company_code", companyCode);
|
||||||
deleteParams.put("value_id", valueId);
|
deleteParams.put("value_id", valueId);
|
||||||
return sqlSession.delete(NS + "delete_category_tree", deleteParams) > 0;
|
return sqlSession.delete(NS + "deleteCategoryTree", deleteParams) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -285,7 +285,7 @@ public class CategoryTreeService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
return sqlSession.selectList(NS + "get_category_tree_column_list", params);
|
return sqlSession.selectList(NS + "getCategoryTreeColumnList", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -294,7 +294,7 @@ public class CategoryTreeService extends BaseService {
|
|||||||
public List<Map<String, Object>> getCategoryTreeKeyList(String companyCode) {
|
public List<Map<String, Object>> getCategoryTreeKeyList(String companyCode) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
return sqlSession.selectList(NS + "get_category_tree_key_list", params);
|
return sqlSession.selectList(NS + "getCategoryTreeKeyList", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ─── private helpers ────────────────────────────────────────────────────────
|
// ─── private helpers ────────────────────────────────────────────────────────
|
||||||
@@ -336,7 +336,7 @@ public class CategoryTreeService extends BaseService {
|
|||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
params.put("parent_value_id", parentValueId);
|
params.put("parent_value_id", parentValueId);
|
||||||
|
|
||||||
List<Map<String, Object>> children = sqlSession.selectList(NS + "get_category_tree_children_list", params);
|
List<Map<String, Object>> children = sqlSession.selectList(NS + "getCategoryTreeChildrenList", params);
|
||||||
for (Map<String, Object> child : children) {
|
for (Map<String, Object> child : children) {
|
||||||
String valueLabel = (String) child.get("value_label");
|
String valueLabel = (String) child.get("value_label");
|
||||||
String newPath = parentPath + "/" + valueLabel;
|
String newPath = parentPath + "/" + valueLabel;
|
||||||
@@ -344,7 +344,7 @@ public class CategoryTreeService extends BaseService {
|
|||||||
Map<String, Object> updateParams = new HashMap<>();
|
Map<String, Object> updateParams = new HashMap<>();
|
||||||
updateParams.put("value_id", child.get("value_id"));
|
updateParams.put("value_id", child.get("value_id"));
|
||||||
updateParams.put("path", newPath);
|
updateParams.put("path", newPath);
|
||||||
sqlSession.update(NS + "update_category_tree_child_path", updateParams);
|
sqlSession.update(NS + "updateCategoryTreeChildPath", updateParams);
|
||||||
|
|
||||||
int childId = ((Number) child.get("value_id")).intValue();
|
int childId = ((Number) child.get("value_id")).intValue();
|
||||||
updateChildrenPaths(companyCode, childId, newPath);
|
updateChildrenPaths(companyCode, childId, newPath);
|
||||||
@@ -366,21 +366,21 @@ public class CategoryTreeService extends BaseService {
|
|||||||
// 1. 테이블 존재 확인
|
// 1. 테이블 존재 확인
|
||||||
Map<String, Object> tableParams = new HashMap<>();
|
Map<String, Object> tableParams = new HashMap<>();
|
||||||
tableParams.put("table_name", tableName);
|
tableParams.put("table_name", tableName);
|
||||||
Integer teObj = sqlSession.selectOne(NS + "check_table_exists", tableParams);
|
Integer teObj = sqlSession.selectOne(NS + "checkTableExists", tableParams);
|
||||||
if (teObj == null || teObj == 0) return notInUse;
|
if (teObj == null || teObj == 0) return notInUse;
|
||||||
|
|
||||||
// 2. 컬럼 존재 확인
|
// 2. 컬럼 존재 확인
|
||||||
Map<String, Object> colParams = new HashMap<>();
|
Map<String, Object> colParams = new HashMap<>();
|
||||||
colParams.put("table_name", tableName);
|
colParams.put("table_name", tableName);
|
||||||
colParams.put("column_name", columnName);
|
colParams.put("column_name", columnName);
|
||||||
Integer ceObj = sqlSession.selectOne(NS + "check_column_exists", colParams);
|
Integer ceObj = sqlSession.selectOne(NS + "checkColumnExists", colParams);
|
||||||
if (ceObj == null || ceObj == 0) return notInUse;
|
if (ceObj == null || ceObj == 0) return notInUse;
|
||||||
|
|
||||||
// 3. company_code 컬럼 존재 확인
|
// 3. company_code 컬럼 존재 확인
|
||||||
Map<String, Object> companyColParams = new HashMap<>();
|
Map<String, Object> companyColParams = new HashMap<>();
|
||||||
companyColParams.put("table_name", tableName);
|
companyColParams.put("table_name", tableName);
|
||||||
companyColParams.put("column_name", "company_code");
|
companyColParams.put("column_name", "company_code");
|
||||||
Integer ccObj = sqlSession.selectOne(NS + "check_column_exists", companyColParams);
|
Integer ccObj = sqlSession.selectOne(NS + "checkColumnExists", companyColParams);
|
||||||
boolean hasCompanyCode = ccObj != null && ccObj > 0;
|
boolean hasCompanyCode = ccObj != null && ccObj > 0;
|
||||||
|
|
||||||
// 4. 사용 건수 조회
|
// 4. 사용 건수 조회
|
||||||
@@ -391,14 +391,14 @@ public class CategoryTreeService extends BaseService {
|
|||||||
countParams.put("column_name", columnName);
|
countParams.put("column_name", columnName);
|
||||||
countParams.put("company_code", companyCode);
|
countParams.put("company_code", companyCode);
|
||||||
countParams.put("value_code", valueCode);
|
countParams.put("value_code", valueCode);
|
||||||
Integer cntObj = sqlSession.selectOne(NS + "count_category_usage_with_company", countParams);
|
Integer cntObj = sqlSession.selectOne(NS + "countCategoryUsageWithCompany", countParams);
|
||||||
count = cntObj != null ? cntObj : 0;
|
count = cntObj != null ? cntObj : 0;
|
||||||
} else {
|
} else {
|
||||||
Map<String, Object> countParams = new HashMap<>();
|
Map<String, Object> countParams = new HashMap<>();
|
||||||
countParams.put("table_name", tableName);
|
countParams.put("table_name", tableName);
|
||||||
countParams.put("column_name", columnName);
|
countParams.put("column_name", columnName);
|
||||||
countParams.put("value_code", valueCode);
|
countParams.put("value_code", valueCode);
|
||||||
Integer cntObj = sqlSession.selectOne(NS + "count_category_usage", countParams);
|
Integer cntObj = sqlSession.selectOne(NS + "countCategoryUsage", countParams);
|
||||||
count = cntObj != null ? cntObj : 0;
|
count = cntObj != null ? cntObj : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,17 +23,17 @@ public class CategoryValueCascadingService extends BaseService {
|
|||||||
public Map<String, Object> getCategoryValueCascadingGroupList(Map<String, Object> params) {
|
public Map<String, Object> getCategoryValueCascadingGroupList(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
commonService.applyPagination(params);
|
commonService.applyPagination(params);
|
||||||
int totalCount = sqlSession.selectOne(NS + "get_category_value_cascading_group_list_cnt", params);
|
int totalCount = sqlSession.selectOne(NS + "getCategoryValueCascadingGroupListCnt", params);
|
||||||
List<Map<String, Object>> list = sqlSession.selectList(NS + "get_category_value_cascading_group_list", params);
|
List<Map<String, Object>> list = sqlSession.selectList(NS + "getCategoryValueCascadingGroupList", params);
|
||||||
return commonService.buildListResponse(list, totalCount, params);
|
return commonService.buildListResponse(list, totalCount, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getCategoryValueCascadingGroupInfo(Map<String, Object> params) {
|
public Map<String, Object> getCategoryValueCascadingGroupInfo(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
Map<String, Object> group = sqlSession.selectOne(NS + "get_category_value_cascading_group_info", params);
|
Map<String, Object> group = sqlSession.selectOne(NS + "getCategoryValueCascadingGroupInfo", params);
|
||||||
if (group == null) return null;
|
if (group == null) return null;
|
||||||
|
|
||||||
List<Map<String, Object>> mappings = sqlSession.selectList(NS + "get_category_value_cascading_mappings_by_group_id", params);
|
List<Map<String, Object>> mappings = sqlSession.selectList(NS + "getCategoryValueCascadingMappingsByGroupId", params);
|
||||||
|
|
||||||
Map<String, List<Map<String, Object>>> mappingsByParent = new LinkedHashMap<>();
|
Map<String, List<Map<String, Object>>> mappingsByParent = new LinkedHashMap<>();
|
||||||
for (Map<String, Object> m : mappings) {
|
for (Map<String, Object> m : mappings) {
|
||||||
@@ -53,27 +53,27 @@ public class CategoryValueCascadingService extends BaseService {
|
|||||||
|
|
||||||
public Map<String, Object> getCategoryValueCascadingGroupByCode(Map<String, Object> params) {
|
public Map<String, Object> getCategoryValueCascadingGroupByCode(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectOne(NS + "get_category_value_cascading_group_by_code", params);
|
return sqlSession.selectOne(NS + "getCategoryValueCascadingGroupByCode", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> insertCategoryValueCascadingGroup(Map<String, Object> params) {
|
public Map<String, Object> insertCategoryValueCascadingGroup(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.insert(NS + "insert_category_value_cascading_group", params);
|
sqlSession.insert(NS + "insertCategoryValueCascadingGroup", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> updateCategoryValueCascadingGroup(Map<String, Object> params) {
|
public Map<String, Object> updateCategoryValueCascadingGroup(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.update(NS + "update_category_value_cascading_group", params);
|
sqlSession.update(NS + "updateCategoryValueCascadingGroup", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> deleteCategoryValueCascadingGroup(Map<String, Object> params) {
|
public Map<String, Object> deleteCategoryValueCascadingGroup(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.update(NS + "delete_category_value_cascading_group", params);
|
sqlSession.update(NS + "deleteCategoryValueCascadingGroup", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ public class CategoryValueCascadingService extends BaseService {
|
|||||||
String companyCode = (String) params.get("company_code");
|
String companyCode = (String) params.get("company_code");
|
||||||
Object groupId = params.get("group_id");
|
Object groupId = params.get("group_id");
|
||||||
|
|
||||||
sqlSession.delete(NS + "delete_category_value_cascading_mappings_by_group_id", params);
|
sqlSession.delete(NS + "deleteCategoryValueCascadingMappingsByGroupId", params);
|
||||||
|
|
||||||
int savedCount = 0;
|
int savedCount = 0;
|
||||||
Object mappingsObj = params.get("mappings");
|
Object mappingsObj = params.get("mappings");
|
||||||
@@ -94,7 +94,7 @@ public class CategoryValueCascadingService extends BaseService {
|
|||||||
Map<String, Object> mappingParams = new HashMap<>(mapping);
|
Map<String, Object> mappingParams = new HashMap<>(mapping);
|
||||||
mappingParams.put("group_id", groupId);
|
mappingParams.put("group_id", groupId);
|
||||||
mappingParams.put("company_code", companyCode);
|
mappingParams.put("company_code", companyCode);
|
||||||
sqlSession.insert(NS + "insert_category_value_cascading_mapping", mappingParams);
|
sqlSession.insert(NS + "insertCategoryValueCascadingMapping", mappingParams);
|
||||||
savedCount++;
|
savedCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -109,7 +109,7 @@ public class CategoryValueCascadingService extends BaseService {
|
|||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
String companyCode = (String) params.get("company_code");
|
String companyCode = (String) params.get("company_code");
|
||||||
|
|
||||||
Map<String, Object> group = sqlSession.selectOne(NS + "get_category_value_cascading_group_by_code", params);
|
Map<String, Object> group = sqlSession.selectOne(NS + "getCategoryValueCascadingGroupByCode", params);
|
||||||
if (group == null) {
|
if (group == null) {
|
||||||
Map<String, Object> result = new LinkedHashMap<>();
|
Map<String, Object> result = new LinkedHashMap<>();
|
||||||
result.put("data", Collections.emptyList());
|
result.put("data", Collections.emptyList());
|
||||||
@@ -145,7 +145,7 @@ public class CategoryValueCascadingService extends BaseService {
|
|||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
String companyCode = (String) params.get("company_code");
|
String companyCode = (String) params.get("company_code");
|
||||||
|
|
||||||
Map<String, Object> group = sqlSession.selectOne(NS + "get_category_value_cascading_group_by_code", params);
|
Map<String, Object> group = sqlSession.selectOne(NS + "getCategoryValueCascadingGroupByCode", params);
|
||||||
if (group == null) {
|
if (group == null) {
|
||||||
Map<String, Object> result = new LinkedHashMap<>();
|
Map<String, Object> result = new LinkedHashMap<>();
|
||||||
result.put("data", Collections.emptyList());
|
result.put("data", Collections.emptyList());
|
||||||
@@ -199,7 +199,7 @@ public class CategoryValueCascadingService extends BaseService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> group = sqlSession.selectOne(NS + "get_category_value_cascading_group_by_code", params);
|
Map<String, Object> group = sqlSession.selectOne(NS + "getCategoryValueCascadingGroupByCode", params);
|
||||||
if (group == null) {
|
if (group == null) {
|
||||||
Map<String, Object> result = new LinkedHashMap<>();
|
Map<String, Object> result = new LinkedHashMap<>();
|
||||||
result.put("data", Collections.emptyList());
|
result.put("data", Collections.emptyList());
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class CodeMergeService extends BaseService {
|
|||||||
public Map<String, Object> getTablesWithColumn(String columnName) {
|
public Map<String, Object> getTablesWithColumn(String columnName) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("column_name", columnName);
|
params.put("column_name", columnName);
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "get_tables_with_column", params);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "getTablesWithColumn", params);
|
||||||
|
|
||||||
List<String> tables = rows.stream()
|
List<String> tables = rows.stream()
|
||||||
.map(r -> {
|
.map(r -> {
|
||||||
@@ -64,7 +64,7 @@ public class CodeMergeService extends BaseService {
|
|||||||
|
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("column_name", columnName);
|
params.put("column_name", columnName);
|
||||||
List<Map<String, Object>> tableRows = sqlSession.selectList(NS + "get_tables_with_column", params);
|
List<Map<String, Object>> tableRows = sqlSession.selectList(NS + "getTablesWithColumn", params);
|
||||||
|
|
||||||
List<Map<String, Object>> preview = new ArrayList<>();
|
List<Map<String, Object>> preview = new ArrayList<>();
|
||||||
int totalRows = 0;
|
int totalRows = 0;
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ public class CommonCodeService extends BaseService {
|
|||||||
Object isActiveRaw = params.get("is_active");
|
Object isActiveRaw = params.get("is_active");
|
||||||
if (isActiveRaw != null) params.put("is_active", toActiveStr(isActiveRaw));
|
if (isActiveRaw != null) params.put("is_active", toActiveStr(isActiveRaw));
|
||||||
|
|
||||||
List<Map<String, Object>> categories = sqlSession.selectList(NS + "get_common_code_category_list", params);
|
List<Map<String, Object>> categories = sqlSession.selectList(NS + "getCommonCodeCategoryList", params);
|
||||||
Integer totalObj = sqlSession.selectOne(NS + "get_common_code_category_list_cnt", params);
|
Integer totalObj = sqlSession.selectOne(NS + "getCommonCodeCategoryListCnt", params);
|
||||||
int total = totalObj != null ? totalObj : 0;
|
int total = totalObj != null ? totalObj : 0;
|
||||||
|
|
||||||
Map<String, Object> result = new LinkedHashMap<>();
|
Map<String, Object> result = new LinkedHashMap<>();
|
||||||
@@ -62,7 +62,7 @@ public class CommonCodeService extends BaseService {
|
|||||||
params.put("value", value.trim());
|
params.put("value", value.trim());
|
||||||
params.put("exclude_code", excludeCode);
|
params.put("exclude_code", excludeCode);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
Integer countObj = sqlSession.selectOne(NS + "get_common_code_category_duplicate_by_field", params);
|
Integer countObj = sqlSession.selectOne(NS + "getCommonCodeCategoryDuplicateByField", params);
|
||||||
boolean isDuplicate = countObj != null && countObj > 0;
|
boolean isDuplicate = countObj != null && countObj > 0;
|
||||||
|
|
||||||
Map<String, Object> result = new LinkedHashMap<>();
|
Map<String, Object> result = new LinkedHashMap<>();
|
||||||
@@ -89,12 +89,12 @@ public class CommonCodeService extends BaseService {
|
|||||||
params.put("created_by", userId);
|
params.put("created_by", userId);
|
||||||
params.put("updated_by", userId);
|
params.put("updated_by", userId);
|
||||||
|
|
||||||
sqlSession.insert(NS + "insert_common_code_category", params);
|
sqlSession.insert(NS + "insertCommonCodeCategory", params);
|
||||||
|
|
||||||
Map<String, Object> q = new HashMap<>();
|
Map<String, Object> q = new HashMap<>();
|
||||||
q.put("category_code", params.get("category_code"));
|
q.put("category_code", params.get("category_code"));
|
||||||
q.put("company_code", companyCode);
|
q.put("company_code", companyCode);
|
||||||
return sqlSession.selectOne(NS + "get_common_code_category_info", q);
|
return sqlSession.selectOne(NS + "getCommonCodeCategoryInfo", q);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ══════════════════════════════════════════════════════════════
|
// ══════════════════════════════════════════════════════════════
|
||||||
@@ -115,13 +115,13 @@ public class CommonCodeService extends BaseService {
|
|||||||
if (body.containsKey("sort_order")) params.put("sort_order", body.get("sort_order"));
|
if (body.containsKey("sort_order")) params.put("sort_order", body.get("sort_order"));
|
||||||
if (body.containsKey("is_active")) params.put("is_active", toActiveStr(body.get("is_active")));
|
if (body.containsKey("is_active")) params.put("is_active", toActiveStr(body.get("is_active")));
|
||||||
|
|
||||||
int updated = sqlSession.update(NS + "update_common_code_category", params);
|
int updated = sqlSession.update(NS + "updateCommonCodeCategory", params);
|
||||||
if (updated == 0) return null;
|
if (updated == 0) return null;
|
||||||
|
|
||||||
Map<String, Object> q = new HashMap<>();
|
Map<String, Object> q = new HashMap<>();
|
||||||
q.put("category_code", categoryCode);
|
q.put("category_code", categoryCode);
|
||||||
q.put("company_code", companyCode);
|
q.put("company_code", companyCode);
|
||||||
return sqlSession.selectOne(NS + "get_common_code_category_info", q);
|
return sqlSession.selectOne(NS + "getCommonCodeCategoryInfo", q);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ══════════════════════════════════════════════════════════════
|
// ══════════════════════════════════════════════════════════════
|
||||||
@@ -133,7 +133,7 @@ public class CommonCodeService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("category_code", categoryCode);
|
params.put("category_code", categoryCode);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
int deleted = sqlSession.delete(NS + "delete_common_code_category", params);
|
int deleted = sqlSession.delete(NS + "deleteCommonCodeCategory", params);
|
||||||
if (deleted == 0) throw new IllegalArgumentException("카테고리를 찾을 수 없습니다.");
|
if (deleted == 0) throw new IllegalArgumentException("카테고리를 찾을 수 없습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,8 +151,8 @@ public class CommonCodeService extends BaseService {
|
|||||||
Object isActiveRaw = params.get("is_active");
|
Object isActiveRaw = params.get("is_active");
|
||||||
if (isActiveRaw != null) params.put("is_active", toActiveStr(isActiveRaw));
|
if (isActiveRaw != null) params.put("is_active", toActiveStr(isActiveRaw));
|
||||||
|
|
||||||
List<Map<String, Object>> rawList = sqlSession.selectList(NS + "get_common_code_list", params);
|
List<Map<String, Object>> rawList = sqlSession.selectList(NS + "getCommonCodeList", params);
|
||||||
Integer totalObj = sqlSession.selectOne(NS + "get_common_code_list_cnt", params);
|
Integer totalObj = sqlSession.selectOne(NS + "getCommonCodeListCnt", params);
|
||||||
int total = totalObj != null ? totalObj : 0;
|
int total = totalObj != null ? totalObj : 0;
|
||||||
|
|
||||||
List<Map<String, Object>> codes = new ArrayList<>();
|
List<Map<String, Object>> codes = new ArrayList<>();
|
||||||
@@ -185,7 +185,7 @@ public class CommonCodeService extends BaseService {
|
|||||||
params.put("value", value.trim());
|
params.put("value", value.trim());
|
||||||
params.put("exclude_code", excludeCode);
|
params.put("exclude_code", excludeCode);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
Integer countObj = sqlSession.selectOne(NS + "get_common_code_duplicate_by_field", params);
|
Integer countObj = sqlSession.selectOne(NS + "getCommonCodeDuplicateByField", params);
|
||||||
boolean isDuplicate = countObj != null && countObj > 0;
|
boolean isDuplicate = countObj != null && countObj > 0;
|
||||||
|
|
||||||
Map<String, Object> result = new LinkedHashMap<>();
|
Map<String, Object> result = new LinkedHashMap<>();
|
||||||
@@ -209,7 +209,7 @@ public class CommonCodeService extends BaseService {
|
|||||||
parentParams.put("category_code", categoryCode);
|
parentParams.put("category_code", categoryCode);
|
||||||
parentParams.put("code_value", parentCodeValueRaw.toString());
|
parentParams.put("code_value", parentCodeValueRaw.toString());
|
||||||
parentParams.put("company_code", companyCode);
|
parentParams.put("company_code", companyCode);
|
||||||
Integer parentDepth = sqlSession.selectOne(NS + "get_common_code_parent_depth", parentParams);
|
Integer parentDepth = sqlSession.selectOne(NS + "getCommonCodeParentDepth", parentParams);
|
||||||
depth = (parentDepth != null ? parentDepth : 0) + 1;
|
depth = (parentDepth != null ? parentDepth : 0) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,13 +228,13 @@ public class CommonCodeService extends BaseService {
|
|||||||
params.put("created_by", userId);
|
params.put("created_by", userId);
|
||||||
params.put("updated_by", userId);
|
params.put("updated_by", userId);
|
||||||
|
|
||||||
sqlSession.insert(NS + "insert_common_code", params);
|
sqlSession.insert(NS + "insertCommonCode", params);
|
||||||
|
|
||||||
Map<String, Object> q = new HashMap<>();
|
Map<String, Object> q = new HashMap<>();
|
||||||
q.put("category_code", categoryCode);
|
q.put("category_code", categoryCode);
|
||||||
q.put("code_value", params.get("code_value"));
|
q.put("code_value", params.get("code_value"));
|
||||||
q.put("company_code", companyCode);
|
q.put("company_code", companyCode);
|
||||||
Map<String, Object> raw = sqlSession.selectOne(NS + "get_common_code_info", q);
|
Map<String, Object> raw = sqlSession.selectOne(NS + "getCommonCodeInfo", q);
|
||||||
return raw != null ? transformCode(raw) : null;
|
return raw != null ? transformCode(raw) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -250,7 +250,7 @@ public class CommonCodeService extends BaseService {
|
|||||||
params.put("code_value", code.get("code_value"));
|
params.put("code_value", code.get("code_value"));
|
||||||
params.put("sort_order", code.get("sort_order"));
|
params.put("sort_order", code.get("sort_order"));
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
sqlSession.update(NS + "update_common_code_sort_order", params);
|
sqlSession.update(NS + "updateCommonCodeSortOrder", params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -267,7 +267,7 @@ public class CommonCodeService extends BaseService {
|
|||||||
|
|
||||||
// parentCodeValue, depth 필터는 params에 그대로 전달 (XML에서 처리)
|
// parentCodeValue, depth 필터는 params에 그대로 전달 (XML에서 처리)
|
||||||
|
|
||||||
List<Map<String, Object>> rawList = sqlSession.selectList(NS + "get_common_code_hierarchical_list", params);
|
List<Map<String, Object>> rawList = sqlSession.selectList(NS + "getCommonCodeHierarchicalList", params);
|
||||||
List<Map<String, Object>> result = new ArrayList<>();
|
List<Map<String, Object>> result = new ArrayList<>();
|
||||||
for (Map<String, Object> raw : rawList) {
|
for (Map<String, Object> raw : rawList) {
|
||||||
result.add(transformCode(raw));
|
result.add(transformCode(raw));
|
||||||
@@ -284,7 +284,7 @@ public class CommonCodeService extends BaseService {
|
|||||||
params.put("category_code", categoryCode);
|
params.put("category_code", categoryCode);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
|
|
||||||
List<Map<String, Object>> flatList = sqlSession.selectList(NS + "get_common_code_tree_list", params);
|
List<Map<String, Object>> flatList = sqlSession.selectList(NS + "getCommonCodeTreeList", params);
|
||||||
|
|
||||||
List<Map<String, Object>> flatTransformed = new ArrayList<>();
|
List<Map<String, Object>> flatTransformed = new ArrayList<>();
|
||||||
for (Map<String, Object> raw : flatList) {
|
for (Map<String, Object> raw : flatList) {
|
||||||
@@ -306,7 +306,7 @@ public class CommonCodeService extends BaseService {
|
|||||||
params.put("category_code", categoryCode);
|
params.put("category_code", categoryCode);
|
||||||
params.put("code_value", codeValue);
|
params.put("code_value", codeValue);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
Integer countObj = sqlSession.selectOne(NS + "get_common_code_children_cnt", params);
|
Integer countObj = sqlSession.selectOne(NS + "getCommonCodeChildrenCnt", params);
|
||||||
int count = countObj != null ? countObj : 0;
|
int count = countObj != null ? countObj : 0;
|
||||||
|
|
||||||
Map<String, Object> result = new LinkedHashMap<>();
|
Map<String, Object> result = new LinkedHashMap<>();
|
||||||
@@ -342,7 +342,7 @@ public class CommonCodeService extends BaseService {
|
|||||||
parentParams.put("category_code", categoryCode);
|
parentParams.put("category_code", categoryCode);
|
||||||
parentParams.put("code_value", newParent.toString());
|
parentParams.put("code_value", newParent.toString());
|
||||||
parentParams.put("company_code", companyCode);
|
parentParams.put("company_code", companyCode);
|
||||||
Integer parentDepth = sqlSession.selectOne(NS + "get_common_code_parent_depth", parentParams);
|
Integer parentDepth = sqlSession.selectOne(NS + "getCommonCodeParentDepth", parentParams);
|
||||||
params.put("depth", (parentDepth != null ? parentDepth : 0) + 1);
|
params.put("depth", (parentDepth != null ? parentDepth : 0) + 1);
|
||||||
} else {
|
} else {
|
||||||
params.put("depth", 1);
|
params.put("depth", 1);
|
||||||
@@ -351,14 +351,14 @@ public class CommonCodeService extends BaseService {
|
|||||||
params.put("depth", body.get("depth"));
|
params.put("depth", body.get("depth"));
|
||||||
}
|
}
|
||||||
|
|
||||||
int updated = sqlSession.update(NS + "update_common_code", params);
|
int updated = sqlSession.update(NS + "updateCommonCode", params);
|
||||||
if (updated == 0) return null;
|
if (updated == 0) return null;
|
||||||
|
|
||||||
Map<String, Object> q = new HashMap<>();
|
Map<String, Object> q = new HashMap<>();
|
||||||
q.put("category_code", categoryCode);
|
q.put("category_code", categoryCode);
|
||||||
q.put("code_value", codeValue);
|
q.put("code_value", codeValue);
|
||||||
q.put("company_code", companyCode);
|
q.put("company_code", companyCode);
|
||||||
Map<String, Object> raw = sqlSession.selectOne(NS + "get_common_code_info", q);
|
Map<String, Object> raw = sqlSession.selectOne(NS + "getCommonCodeInfo", q);
|
||||||
return raw != null ? transformCode(raw) : null;
|
return raw != null ? transformCode(raw) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -372,7 +372,7 @@ public class CommonCodeService extends BaseService {
|
|||||||
params.put("category_code", categoryCode);
|
params.put("category_code", categoryCode);
|
||||||
params.put("code_value", codeValue);
|
params.put("code_value", codeValue);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
int deleted = sqlSession.delete(NS + "delete_common_code", params);
|
int deleted = sqlSession.delete(NS + "deleteCommonCode", params);
|
||||||
if (deleted == 0) throw new IllegalArgumentException("코드를 찾을 수 없습니다.");
|
if (deleted == 0) throw new IllegalArgumentException("코드를 찾을 수 없습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -387,7 +387,7 @@ public class CommonCodeService extends BaseService {
|
|||||||
// 미지정 시 활성 코드만 반환 (드롭다운 기본 동작)
|
// 미지정 시 활성 코드만 반환 (드롭다운 기본 동작)
|
||||||
params.put("is_active", isActiveRaw != null ? toActiveStr(isActiveRaw) : "Y");
|
params.put("is_active", isActiveRaw != null ? toActiveStr(isActiveRaw) : "Y");
|
||||||
|
|
||||||
List<Map<String, Object>> rawList = sqlSession.selectList(NS + "get_common_code_option_list", params);
|
List<Map<String, Object>> rawList = sqlSession.selectList(NS + "getCommonCodeOptionList", params);
|
||||||
List<Map<String, Object>> options = new ArrayList<>();
|
List<Map<String, Object>> options = new ArrayList<>();
|
||||||
for (Map<String, Object> raw : rawList) {
|
for (Map<String, Object> raw : rawList) {
|
||||||
Map<String, Object> opt = new LinkedHashMap<>();
|
Map<String, Object> opt = new LinkedHashMap<>();
|
||||||
|
|||||||
@@ -95,6 +95,6 @@ public class CommonService extends BaseService {
|
|||||||
*/
|
*/
|
||||||
public List<Map<String, Object>> getCodeList(Map<String, Object> params) {
|
public List<Map<String, Object>> getCodeList(Map<String, Object> params) {
|
||||||
applyCompanyCodeFilter(params);
|
applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectList(NS + "select_code_list", params);
|
return sqlSession.selectList(NS + "selectCodeList", params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,8 +56,8 @@ public class ComponentStandardService extends BaseService {
|
|||||||
// 페이지네이션
|
// 페이지네이션
|
||||||
commonService.applyPagination(params);
|
commonService.applyPagination(params);
|
||||||
|
|
||||||
List<Map<String, Object>> components = sqlSession.selectList(NS + "select_component_list", params);
|
List<Map<String, Object>> components = sqlSession.selectList(NS + "selectComponentList", params);
|
||||||
Integer totalObj = sqlSession.selectOne(NS + "count_components", params);
|
Integer totalObj = sqlSession.selectOne(NS + "countComponents", params);
|
||||||
int total = totalObj != null ? totalObj : 0;
|
int total = totalObj != null ? totalObj : 0;
|
||||||
|
|
||||||
Map<String, Object> result = new LinkedHashMap<>();
|
Map<String, Object> result = new LinkedHashMap<>();
|
||||||
@@ -74,7 +74,7 @@ public class ComponentStandardService extends BaseService {
|
|||||||
|
|
||||||
public Map<String, Object> getComponent(String componentCode) {
|
public Map<String, Object> getComponent(String componentCode) {
|
||||||
Map<String, Object> params = Map.of("component_code", componentCode);
|
Map<String, Object> params = Map.of("component_code", componentCode);
|
||||||
Map<String, Object> component = sqlSession.selectOne(NS + "select_component", params);
|
Map<String, Object> component = sqlSession.selectOne(NS + "selectComponent", params);
|
||||||
if (component == null) {
|
if (component == null) {
|
||||||
throw new RuntimeException("컴포넌트를 찾을 수 없습니다: " + componentCode);
|
throw new RuntimeException("컴포넌트를 찾을 수 없습니다: " + componentCode);
|
||||||
}
|
}
|
||||||
@@ -88,7 +88,7 @@ public class ComponentStandardService extends BaseService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> createComponent(Map<String, Object> params) {
|
public Map<String, Object> createComponent(Map<String, Object> params) {
|
||||||
// 중복 코드 확인
|
// 중복 코드 확인
|
||||||
if (sqlSession.selectOne(NS + "check_duplicate", params) != null) {
|
if (sqlSession.selectOne(NS + "checkDuplicate", params) != null) {
|
||||||
throw new RuntimeException("이미 존재하는 컴포넌트 코드입니다: " + params.get("component_code"));
|
throw new RuntimeException("이미 존재하는 컴포넌트 코드입니다: " + params.get("component_code"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,8 +105,8 @@ public class ComponentStandardService extends BaseService {
|
|||||||
// JSONB 필드 직렬화
|
// JSONB 필드 직렬화
|
||||||
serializeJsonFields(params);
|
serializeJsonFields(params);
|
||||||
|
|
||||||
sqlSession.insert(NS + "insert_component", params);
|
sqlSession.insert(NS + "insertComponent", params);
|
||||||
return sqlSession.selectOne(NS + "select_component", Map.of("component_code", params.get("component_code")));
|
return sqlSession.selectOne(NS + "selectComponent", Map.of("component_code", params.get("component_code")));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ══════════════════════════════════════════════════════════
|
// ══════════════════════════════════════════════════════════
|
||||||
@@ -126,8 +126,8 @@ public class ComponentStandardService extends BaseService {
|
|||||||
data.put("component_code", componentCode);
|
data.put("component_code", componentCode);
|
||||||
serializeJsonFields(data);
|
serializeJsonFields(data);
|
||||||
|
|
||||||
sqlSession.update(NS + "update_component", data);
|
sqlSession.update(NS + "updateComponent", data);
|
||||||
return sqlSession.selectOne(NS + "select_component", Map.of("component_code", componentCode));
|
return sqlSession.selectOne(NS + "selectComponent", Map.of("component_code", componentCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ══════════════════════════════════════════════════════════
|
// ══════════════════════════════════════════════════════════
|
||||||
@@ -137,7 +137,7 @@ public class ComponentStandardService extends BaseService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> deleteComponent(String componentCode) {
|
public Map<String, Object> deleteComponent(String componentCode) {
|
||||||
getComponent(componentCode); // 존재 확인
|
getComponent(componentCode); // 존재 확인
|
||||||
sqlSession.delete(NS + "delete_component", Map.of("component_code", componentCode));
|
sqlSession.delete(NS + "deleteComponent", Map.of("component_code", componentCode));
|
||||||
return Map.of("message", "컴포넌트가 삭제되었습니다: " + componentCode);
|
return Map.of("message", "컴포넌트가 삭제되었습니다: " + componentCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ public class ComponentStandardService extends BaseService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> updateSortOrder(List<Map<String, Object>> updates) {
|
public Map<String, Object> updateSortOrder(List<Map<String, Object>> updates) {
|
||||||
for (Map<String, Object> item : updates) {
|
for (Map<String, Object> item : updates) {
|
||||||
sqlSession.update(NS + "update_sort_order", item);
|
sqlSession.update(NS + "updateSortOrder", item);
|
||||||
}
|
}
|
||||||
return Map.of("message", "정렬 순서가 업데이트되었습니다.");
|
return Map.of("message", "정렬 순서가 업데이트되었습니다.");
|
||||||
}
|
}
|
||||||
@@ -164,7 +164,7 @@ public class ComponentStandardService extends BaseService {
|
|||||||
// 새 코드 중복 확인
|
// 새 코드 중복 확인
|
||||||
Map<String, Object> dupCheck = new HashMap<>();
|
Map<String, Object> dupCheck = new HashMap<>();
|
||||||
dupCheck.put("component_code", newCode);
|
dupCheck.put("component_code", newCode);
|
||||||
if (sqlSession.selectOne(NS + "check_duplicate", dupCheck) != null) {
|
if (sqlSession.selectOne(NS + "checkDuplicate", dupCheck) != null) {
|
||||||
throw new RuntimeException("이미 존재하는 컴포넌트 코드입니다: " + newCode);
|
throw new RuntimeException("이미 존재하는 컴포넌트 코드입니다: " + newCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,8 +173,8 @@ public class ComponentStandardService extends BaseService {
|
|||||||
newComponent.put("component_name", newName);
|
newComponent.put("component_name", newName);
|
||||||
|
|
||||||
serializeJsonFields(newComponent);
|
serializeJsonFields(newComponent);
|
||||||
sqlSession.insert(NS + "insert_component", newComponent);
|
sqlSession.insert(NS + "insertComponent", newComponent);
|
||||||
return sqlSession.selectOne(NS + "select_component", Map.of("component_code", newCode));
|
return sqlSession.selectOne(NS + "selectComponent", Map.of("component_code", newCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ══════════════════════════════════════════════════════════
|
// ══════════════════════════════════════════════════════════
|
||||||
@@ -182,7 +182,7 @@ public class ComponentStandardService extends BaseService {
|
|||||||
// ══════════════════════════════════════════════════════════
|
// ══════════════════════════════════════════════════════════
|
||||||
|
|
||||||
public List<String> getCategories(Map<String, Object> params) {
|
public List<String> getCategories(Map<String, Object> params) {
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "select_categories", params);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "selectCategories", params);
|
||||||
List<String> categories = new ArrayList<>();
|
List<String> categories = new ArrayList<>();
|
||||||
for (Map<String, Object> row : rows) {
|
for (Map<String, Object> row : rows) {
|
||||||
Object cat = row.get("category");
|
Object cat = row.get("category");
|
||||||
@@ -196,10 +196,10 @@ public class ComponentStandardService extends BaseService {
|
|||||||
// ══════════════════════════════════════════════════════════
|
// ══════════════════════════════════════════════════════════
|
||||||
|
|
||||||
public Map<String, Object> getStatistics(Map<String, Object> params) {
|
public Map<String, Object> getStatistics(Map<String, Object> params) {
|
||||||
Integer totalObj = sqlSession.selectOne(NS + "count_statistics_total", params);
|
Integer totalObj = sqlSession.selectOne(NS + "countStatisticsTotal", params);
|
||||||
int total = totalObj != null ? totalObj : 0;
|
int total = totalObj != null ? totalObj : 0;
|
||||||
|
|
||||||
List<Map<String, Object>> byCategoryRaw = sqlSession.selectList(NS + "select_statistics_by_category", params);
|
List<Map<String, Object>> byCategoryRaw = sqlSession.selectList(NS + "selectStatisticsByCategory", params);
|
||||||
List<Map<String, Object>> byCategory = new ArrayList<>();
|
List<Map<String, Object>> byCategory = new ArrayList<>();
|
||||||
for (Map<String, Object> row : byCategoryRaw) {
|
for (Map<String, Object> row : byCategoryRaw) {
|
||||||
Map<String, Object> item = new LinkedHashMap<>();
|
Map<String, Object> item = new LinkedHashMap<>();
|
||||||
@@ -208,7 +208,7 @@ public class ComponentStandardService extends BaseService {
|
|||||||
byCategory.add(item);
|
byCategory.add(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Map<String, Object>> byStatusRaw = sqlSession.selectList(NS + "select_statistics_by_status");
|
List<Map<String, Object>> byStatusRaw = sqlSession.selectList(NS + "selectStatisticsByStatus");
|
||||||
List<Map<String, Object>> byStatus = new ArrayList<>();
|
List<Map<String, Object>> byStatus = new ArrayList<>();
|
||||||
for (Map<String, Object> row : byStatusRaw) {
|
for (Map<String, Object> row : byStatusRaw) {
|
||||||
Map<String, Object> item = new LinkedHashMap<>();
|
Map<String, Object> item = new LinkedHashMap<>();
|
||||||
@@ -229,7 +229,7 @@ public class ComponentStandardService extends BaseService {
|
|||||||
// ══════════════════════════════════════════════════════════
|
// ══════════════════════════════════════════════════════════
|
||||||
|
|
||||||
public boolean checkDuplicate(Map<String, Object> params) {
|
public boolean checkDuplicate(Map<String, Object> params) {
|
||||||
return sqlSession.selectOne(NS + "check_duplicate", params) != null;
|
return sqlSession.selectOne(NS + "checkDuplicate", params) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ══ private helpers ═══════════════════════════════════════
|
// ══ private helpers ═══════════════════════════════════════
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public class DashboardService extends BaseService {
|
|||||||
int offset = (page - 1) * limit;
|
int offset = (page - 1) * limit;
|
||||||
|
|
||||||
List<Object> args = new ArrayList<>();
|
List<Object> args = new ArrayList<>();
|
||||||
StringBuilder where = new StringBuilder("d.deleted_at IS NULL");
|
StringBuilder where = new StringBuilder("d.deleted_date IS NULL");
|
||||||
|
|
||||||
if (!"*".equals(companyCode)) {
|
if (!"*".equals(companyCode)) {
|
||||||
where.append(" AND d.company_code = ?");
|
where.append(" AND d.company_code = ?");
|
||||||
@@ -47,7 +47,7 @@ public class DashboardService extends BaseService {
|
|||||||
int total = jdbcTemplate.queryForObject(countSql, Integer.class, args.toArray());
|
int total = jdbcTemplate.queryForObject(countSql, Integer.class, args.toArray());
|
||||||
|
|
||||||
String listSql = "SELECT d.id, d.title, d.description, d.thumbnail_url, d.is_public," +
|
String listSql = "SELECT d.id, d.title, d.description, d.thumbnail_url, d.is_public," +
|
||||||
" d.created_by, d.created_at, d.updated_at, d.tags, d.category, d.view_count, d.company_code," +
|
" d.created_by, d.created_date, d.updated_date, d.tags, d.category, d.view_count, d.company_code," +
|
||||||
" u.user_name as created_by_name," +
|
" u.user_name as created_by_name," +
|
||||||
" COUNT(de.id) as elements_count" +
|
" COUNT(de.id) as elements_count" +
|
||||||
" FROM dashboards d" +
|
" FROM dashboards d" +
|
||||||
@@ -55,8 +55,8 @@ public class DashboardService extends BaseService {
|
|||||||
" LEFT JOIN user_info u ON d.created_by = u.user_id" +
|
" LEFT JOIN user_info u ON d.created_by = u.user_id" +
|
||||||
" WHERE " + where +
|
" WHERE " + where +
|
||||||
" GROUP BY d.id, d.title, d.description, d.thumbnail_url, d.is_public," +
|
" GROUP BY d.id, d.title, d.description, d.thumbnail_url, d.is_public," +
|
||||||
" d.created_by, d.created_at, d.updated_at, d.tags, d.category, d.view_count, d.company_code, u.user_name" +
|
" d.created_by, d.created_date, d.updated_date, d.tags, d.category, d.view_count, d.company_code, u.user_name" +
|
||||||
" ORDER BY d.updated_at DESC LIMIT ? OFFSET ?";
|
" ORDER BY d.updated_date DESC LIMIT ? OFFSET ?";
|
||||||
List<Object> listArgs = new ArrayList<>(args);
|
List<Object> listArgs = new ArrayList<>(args);
|
||||||
listArgs.add(limit);
|
listArgs.add(limit);
|
||||||
listArgs.add(offset);
|
listArgs.add(offset);
|
||||||
@@ -82,7 +82,7 @@ public class DashboardService extends BaseService {
|
|||||||
public Map<String, Object> getDashboardById(String dashboardId, String companyCode) {
|
public Map<String, Object> getDashboardById(String dashboardId, String companyCode) {
|
||||||
List<Object> args = new ArrayList<>();
|
List<Object> args = new ArrayList<>();
|
||||||
args.add(dashboardId);
|
args.add(dashboardId);
|
||||||
String where = "id = ? AND deleted_at IS NULL";
|
String where = "id = ? AND deleted_date IS NULL";
|
||||||
if (companyCode != null && !"*".equals(companyCode)) {
|
if (companyCode != null && !"*".equals(companyCode)) {
|
||||||
where += " AND company_code = ?";
|
where += " AND company_code = ?";
|
||||||
args.add(companyCode);
|
args.add(companyCode);
|
||||||
@@ -113,7 +113,7 @@ public class DashboardService extends BaseService {
|
|||||||
String settingsJson = toJson(params.getOrDefault("settings", new HashMap<>()));
|
String settingsJson = toJson(params.getOrDefault("settings", new HashMap<>()));
|
||||||
|
|
||||||
jdbcTemplate.update(
|
jdbcTemplate.update(
|
||||||
"INSERT INTO dashboards (id, title, description, is_public, created_by, created_at, updated_at, tags, category, view_count, settings, company_code)" +
|
"INSERT INTO dashboards (id, title, description, is_public, created_by, created_date, updated_date, tags, category, view_count, settings, company_code)" +
|
||||||
" VALUES (?, ?, ?, ?, ?, NOW(), NOW(), ?::jsonb, ?, 0, ?::jsonb, ?)",
|
" VALUES (?, ?, ?, ?, ?, NOW(), NOW(), ?::jsonb, ?, 0, ?::jsonb, ?)",
|
||||||
dashboardId, title, description, isPublic, userId, tagsJson, category, settingsJson, companyCode != null ? companyCode : "DEFAULT");
|
dashboardId, title, description, isPublic, userId, tagsJson, category, settingsJson, companyCode != null ? companyCode : "DEFAULT");
|
||||||
|
|
||||||
@@ -136,14 +136,14 @@ public class DashboardService extends BaseService {
|
|||||||
if (params.containsKey("tags")) { sets.add("tags = ?::jsonb"); args.add(toJson(params.get("tags"))); }
|
if (params.containsKey("tags")) { sets.add("tags = ?::jsonb"); args.add(toJson(params.get("tags"))); }
|
||||||
if (params.containsKey("category")) { sets.add("category = ?"); args.add(params.get("category")); }
|
if (params.containsKey("category")) { sets.add("category = ?"); args.add(params.get("category")); }
|
||||||
if (params.containsKey("settings")) { sets.add("settings = ?::jsonb"); args.add(toJson(params.get("settings"))); }
|
if (params.containsKey("settings")) { sets.add("settings = ?::jsonb"); args.add(toJson(params.get("settings"))); }
|
||||||
sets.add("updated_at = NOW()");
|
sets.add("updated_date = NOW()");
|
||||||
|
|
||||||
args.add(dashboardId);
|
args.add(dashboardId);
|
||||||
args.add(userId);
|
args.add(userId);
|
||||||
|
|
||||||
int updated = jdbcTemplate.update(
|
int updated = jdbcTemplate.update(
|
||||||
"UPDATE dashboards SET " + String.join(", ", sets) +
|
"UPDATE dashboards SET " + String.join(", ", sets) +
|
||||||
" WHERE id = ? AND created_by = ? AND deleted_at IS NULL",
|
" WHERE id = ? AND created_by = ? AND deleted_date IS NULL",
|
||||||
args.toArray());
|
args.toArray());
|
||||||
if (updated == 0) return null;
|
if (updated == 0) return null;
|
||||||
|
|
||||||
@@ -158,14 +158,14 @@ public class DashboardService extends BaseService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public boolean deleteDashboard(String dashboardId, String userId) {
|
public boolean deleteDashboard(String dashboardId, String userId) {
|
||||||
int deleted = jdbcTemplate.update(
|
int deleted = jdbcTemplate.update(
|
||||||
"UPDATE dashboards SET deleted_at = NOW(), updated_at = NOW() WHERE id = ? AND created_by = ? AND deleted_at IS NULL",
|
"UPDATE dashboards SET deleted_date = NOW(), updated_date = NOW() WHERE id = ? AND created_by = ? AND deleted_date IS NULL",
|
||||||
dashboardId, userId);
|
dashboardId, userId);
|
||||||
return deleted > 0;
|
return deleted > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── 조회수 증가 ───────────────────────────────────────────────────────────────
|
// ── 조회수 증가 ───────────────────────────────────────────────────────────────
|
||||||
public void incrementViewCount(String dashboardId) {
|
public void incrementViewCount(String dashboardId) {
|
||||||
jdbcTemplate.update("UPDATE dashboards SET view_count = view_count + 1 WHERE id = ? AND deleted_at IS NULL", dashboardId);
|
jdbcTemplate.update("UPDATE dashboards SET view_count = view_count + 1 WHERE id = ? AND deleted_date IS NULL", dashboardId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── execute-query (SELECT만) ──────────────────────────────────────────────────
|
// ── execute-query (SELECT만) ──────────────────────────────────────────────────
|
||||||
@@ -254,7 +254,7 @@ public class DashboardService extends BaseService {
|
|||||||
"INSERT INTO dashboard_elements (id, dashboard_id, element_type, element_subtype," +
|
"INSERT INTO dashboard_elements (id, dashboard_id, element_type, element_subtype," +
|
||||||
" position_x, position_y, width, height, title, custom_title, show_header, content," +
|
" position_x, position_y, width, height, title, custom_title, show_header, content," +
|
||||||
" data_source_config, chart_config, list_config, yard_config, custom_metric_config," +
|
" data_source_config, chart_config, list_config, yard_config, custom_metric_config," +
|
||||||
" display_order, created_at, updated_at)" +
|
" display_order, created_date, updated_date)" +
|
||||||
" VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?::jsonb,?::jsonb,?::jsonb,?::jsonb,?::jsonb,?,NOW(),NOW())",
|
" VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?::jsonb,?::jsonb,?::jsonb,?::jsonb,?::jsonb,?,NOW(),NOW())",
|
||||||
elementId, dashboardId,
|
elementId, dashboardId,
|
||||||
el.get("type"), el.get("subtype"),
|
el.get("type"), el.get("subtype"),
|
||||||
@@ -281,8 +281,8 @@ public class DashboardService extends BaseService {
|
|||||||
d.put("is_public", row.get("is_public"));
|
d.put("is_public", row.get("is_public"));
|
||||||
d.put("created_by", row.get("created_by"));
|
d.put("created_by", row.get("created_by"));
|
||||||
d.put("created_by_name", row.get("created_by_name") != null ? row.get("created_by_name") : row.get("created_by"));
|
d.put("created_by_name", row.get("created_by_name") != null ? row.get("created_by_name") : row.get("created_by"));
|
||||||
d.put("created_at", row.get("created_at"));
|
d.put("created_date", row.get("created_date"));
|
||||||
d.put("updated_at", row.get("updated_at"));
|
d.put("updated_date", row.get("updated_date"));
|
||||||
d.put("tags", parseJson(row.get("tags"), new ArrayList<>()));
|
d.put("tags", parseJson(row.get("tags"), new ArrayList<>()));
|
||||||
d.put("category", row.get("category"));
|
d.put("category", row.get("category"));
|
||||||
d.put("view_count", toInt(row.get("view_count"), 0));
|
d.put("view_count", toInt(row.get("view_count"), 0));
|
||||||
|
|||||||
@@ -16,13 +16,13 @@ public class DbTypeCategoryService extends BaseService {
|
|||||||
private static final String NS = "dbTypeCategory.";
|
private static final String NS = "dbTypeCategory.";
|
||||||
|
|
||||||
public List<Map<String, Object>> getAllCategories() {
|
public List<Map<String, Object>> getAllCategories() {
|
||||||
return sqlSession.selectList(NS + "select_all_categories");
|
return sqlSession.selectList(NS + "selectAllCategories");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getCategoryByTypeCode(String typeCode) {
|
public Map<String, Object> getCategoryByTypeCode(String typeCode) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("type_code", typeCode);
|
params.put("type_code", typeCode);
|
||||||
return sqlSession.selectOne(NS + "select_category_by_type_code", params);
|
return sqlSession.selectOne(NS + "selectCategoryByTypeCode", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -31,23 +31,23 @@ public class DbTypeCategoryService extends BaseService {
|
|||||||
|
|
||||||
Map<String, Object> checkParams = new HashMap<>();
|
Map<String, Object> checkParams = new HashMap<>();
|
||||||
checkParams.put("type_code", typeCode);
|
checkParams.put("type_code", typeCode);
|
||||||
Integer existing = sqlSession.selectOne(NS + "count_by_type_code", checkParams);
|
Integer existing = sqlSession.selectOne(NS + "countByTypeCode", checkParams);
|
||||||
if (existing != null && existing > 0) {
|
if (existing != null && existing > 0) {
|
||||||
throw new IllegalArgumentException("이미 존재하는 DB 타입 코드입니다.");
|
throw new IllegalArgumentException("이미 존재하는 DB 타입 코드입니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlSession.insert(NS + "insert_category", params);
|
sqlSession.insert(NS + "insertCategory", params);
|
||||||
return sqlSession.selectOne(NS + "select_category_by_type_code", checkParams);
|
return sqlSession.selectOne(NS + "selectCategoryByTypeCode", checkParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> updateCategory(String typeCode, Map<String, Object> params) {
|
public Map<String, Object> updateCategory(String typeCode, Map<String, Object> params) {
|
||||||
params.put("type_code", typeCode);
|
params.put("type_code", typeCode);
|
||||||
sqlSession.update(NS + "update_category", params);
|
sqlSession.update(NS + "updateCategory", params);
|
||||||
|
|
||||||
Map<String, Object> checkParams = new HashMap<>();
|
Map<String, Object> checkParams = new HashMap<>();
|
||||||
checkParams.put("type_code", typeCode);
|
checkParams.put("type_code", typeCode);
|
||||||
return sqlSession.selectOne(NS + "select_category_by_type_code", checkParams);
|
return sqlSession.selectOne(NS + "selectCategoryByTypeCode", checkParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -55,21 +55,21 @@ public class DbTypeCategoryService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("type_code", typeCode);
|
params.put("type_code", typeCode);
|
||||||
|
|
||||||
Integer connectionCount = sqlSession.selectOne(NS + "count_connections_by_type", params);
|
Integer connectionCount = sqlSession.selectOne(NS + "countConnectionsByType", params);
|
||||||
if (connectionCount != null && connectionCount > 0) {
|
if (connectionCount != null && connectionCount > 0) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
"해당 DB 타입을 사용하는 연결이 " + connectionCount + "개 있어 삭제할 수 없습니다.");
|
"해당 DB 타입을 사용하는 연결이 " + connectionCount + "개 있어 삭제할 수 없습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlSession.update(NS + "deactivate_category", params);
|
sqlSession.update(NS + "deactivateCategory", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Map<String, Object>> getConnectionStatsByType() {
|
public List<Map<String, Object>> getConnectionStatsByType() {
|
||||||
return sqlSession.selectList(NS + "select_connection_stats_by_type");
|
return sqlSession.selectList(NS + "selectConnectionStatsByType");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void initializeDefaultCategories() {
|
public void initializeDefaultCategories() {
|
||||||
sqlSession.insert(NS + "insert_default_categories", null);
|
sqlSession.insert(NS + "insertDefaultCategories", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ public class DdlService extends BaseService {
|
|||||||
params.put("limit", Math.min(limit, 200));
|
params.put("limit", Math.min(limit, 200));
|
||||||
params.put("user_id", userId);
|
params.put("user_id", userId);
|
||||||
params.put("ddl_type", ddlType);
|
params.put("ddl_type", ddlType);
|
||||||
return sqlSession.selectList(NS + "select_ddl_logs", params);
|
return sqlSession.selectList(NS + "selectDdlLogs", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getDdlStatistics(String fromDate, String toDate) {
|
public Map<String, Object> getDdlStatistics(String fromDate, String toDate) {
|
||||||
@@ -273,10 +273,10 @@ public class DdlService extends BaseService {
|
|||||||
params.put("from_date", fromDate);
|
params.put("from_date", fromDate);
|
||||||
params.put("to_date", toDate);
|
params.put("to_date", toDate);
|
||||||
|
|
||||||
Map<String, Object> totalStats = sqlSession.selectOne(NS + "select_ddl_total_stats", params);
|
Map<String, Object> totalStats = sqlSession.selectOne(NS + "selectDdlTotalStats", params);
|
||||||
List<Map<String, Object>> byType = sqlSession.selectList(NS + "select_ddl_stats_by_type", params);
|
List<Map<String, Object>> byType = sqlSession.selectList(NS + "selectDdlStatsByType", params);
|
||||||
List<Map<String, Object>> byUser = sqlSession.selectList(NS + "select_ddl_stats_by_user", params);
|
List<Map<String, Object>> byUser = sqlSession.selectList(NS + "selectDdlStatsByUser", params);
|
||||||
List<Map<String, Object>> recentFailures = sqlSession.selectList(NS + "select_recent_failures", params);
|
List<Map<String, Object>> recentFailures = sqlSession.selectList(NS + "selectRecentFailures", params);
|
||||||
|
|
||||||
Map<String, Long> byDdlType = new LinkedHashMap<>();
|
Map<String, Long> byDdlType = new LinkedHashMap<>();
|
||||||
for (Map<String, Object> row : byType) {
|
for (Map<String, Object> row : byType) {
|
||||||
@@ -300,15 +300,15 @@ public class DdlService extends BaseService {
|
|||||||
public List<Map<String, Object>> getTableDdlHistory(String tableName) {
|
public List<Map<String, Object>> getTableDdlHistory(String tableName) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
return sqlSession.selectList(NS + "select_table_ddl_history", params);
|
return sqlSession.selectList(NS + "selectTableDdlHistory", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getTableInfo(String tableName) {
|
public Map<String, Object> getTableInfo(String tableName) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
Map<String, Object> tableInfo = sqlSession.selectOne(NS + "select_table_info", params);
|
Map<String, Object> tableInfo = sqlSession.selectOne(NS + "selectTableInfo", params);
|
||||||
if (tableInfo == null) return null;
|
if (tableInfo == null) return null;
|
||||||
List<Map<String, Object>> columns = sqlSession.selectList(NS + "select_table_columns", params);
|
List<Map<String, Object>> columns = sqlSession.selectList(NS + "selectTableColumns", params);
|
||||||
return Map.of("table_info", tableInfo, "columns", columns);
|
return Map.of("table_info", tableInfo, "columns", columns);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -316,7 +316,7 @@ public class DdlService extends BaseService {
|
|||||||
LocalDateTime cutoff = LocalDateTime.now().minusDays(retentionDays);
|
LocalDateTime cutoff = LocalDateTime.now().minusDays(retentionDays);
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("cutoff_date", cutoff.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME));
|
params.put("cutoff_date", cutoff.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME));
|
||||||
int deleted = sqlSession.delete(NS + "delete_old_ddl_logs", params);
|
int deleted = sqlSession.delete(NS + "deleteOldDdlLogs", params);
|
||||||
log.info("DDL 로그 정리 완료: {}개 삭제, 보존 기간: {}일", deleted, retentionDays);
|
log.info("DDL 로그 정리 완료: {}개 삭제, 보존 기간: {}일", deleted, retentionDays);
|
||||||
return deleted;
|
return deleted;
|
||||||
}
|
}
|
||||||
@@ -528,7 +528,7 @@ public class DdlService extends BaseService {
|
|||||||
params.put("ddl_query", ddlQuery);
|
params.put("ddl_query", ddlQuery);
|
||||||
params.put("success", success);
|
params.put("success", success);
|
||||||
params.put("error_message", errorMessage);
|
params.put("error_message", errorMessage);
|
||||||
sqlSession.insert(NS + "insert_ddl_log", params);
|
sqlSession.insert(NS + "insertDdlLog", params);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("DDL 로그 기록 실패: userId={}, ddlType={}, tableName={}", userId, ddlType, tableName, e);
|
log.error("DDL 로그 기록 실패: userId={}, ddlType={}, tableName={}", userId, ddlType, tableName, e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ public class DeliveryService extends BaseService {
|
|||||||
|
|
||||||
public Map<String, Object> getDeliveryStatus(Map<String, Object> params) {
|
public Map<String, Object> getDeliveryStatus(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
List<Map<String, Object>> deliveries = sqlSession.selectList(NS + "get_delivery_list", params);
|
List<Map<String, Object>> deliveries = sqlSession.selectList(NS + "getDeliveryList", params);
|
||||||
List<Map<String, Object>> issues = sqlSession.selectList(NS + "get_customer_issue_list", params);
|
List<Map<String, Object>> issues = sqlSession.selectList(NS + "getCustomerIssueList", params);
|
||||||
Map<String, Object> todayStats = sqlSession.selectOne(NS + "get_delivery_today_stats", params);
|
Map<String, Object> todayStats = sqlSession.selectOne(NS + "getDeliveryTodayStats", params);
|
||||||
|
|
||||||
Map<String, Object> result = new HashMap<>();
|
Map<String, Object> result = new HashMap<>();
|
||||||
result.put("deliveries", deliveries);
|
result.put("deliveries", deliveries);
|
||||||
@@ -33,18 +33,18 @@ public class DeliveryService extends BaseService {
|
|||||||
|
|
||||||
public List<Map<String, Object>> getDelayedDeliveries(Map<String, Object> params) {
|
public List<Map<String, Object>> getDelayedDeliveries(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectList(NS + "get_delayed_delivery_list", params);
|
return sqlSession.selectList(NS + "getDelayedDeliveryList", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Map<String, Object>> getCustomerIssues(Map<String, Object> params) {
|
public List<Map<String, Object>> getCustomerIssues(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectList(NS + "get_customer_issue_list", params);
|
return sqlSession.selectList(NS + "getCustomerIssueList", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void updateDeliveryStatus(Map<String, Object> params) {
|
public void updateDeliveryStatus(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
int rows = sqlSession.update(NS + "update_delivery_status", params);
|
int rows = sqlSession.update(NS + "updateDeliveryStatus", params);
|
||||||
if (rows == 0) {
|
if (rows == 0) {
|
||||||
throw new IllegalArgumentException("Delivery not found: " + params.get("id"));
|
throw new IllegalArgumentException("Delivery not found: " + params.get("id"));
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@ public class DeliveryService extends BaseService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public void updateIssueStatus(Map<String, Object> params) {
|
public void updateIssueStatus(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
int rows = sqlSession.update(NS + "update_customer_issue_status", params);
|
int rows = sqlSession.update(NS + "updateCustomerIssueStatus", params);
|
||||||
if (rows == 0) {
|
if (rows == 0) {
|
||||||
throw new IllegalArgumentException("Customer issue not found: " + params.get("id"));
|
throw new IllegalArgumentException("Customer issue not found: " + params.get("id"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,13 +42,13 @@ public class DynamicFormService extends BaseService {
|
|||||||
public String resolveBaseTable(String tableName) {
|
public String resolveBaseTable(String tableName) {
|
||||||
try {
|
try {
|
||||||
Map<String, Object> params = Map.of("table_name", tableName);
|
Map<String, Object> params = Map.of("table_name", tableName);
|
||||||
Map<String, Object> tableInfo = sqlSession.selectOne(NS + "select_table_type", params);
|
Map<String, Object> tableInfo = sqlSession.selectOne(NS + "selectTableType", params);
|
||||||
|
|
||||||
if (tableInfo == null || !"VIEW".equals(tableInfo.get("table_type"))) {
|
if (tableInfo == null || !"VIEW".equals(tableInfo.get("table_type"))) {
|
||||||
return tableName;
|
return tableName;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> viewDef = sqlSession.selectOne(NS + "select_view_definition", params);
|
Map<String, Object> viewDef = sqlSession.selectOne(NS + "selectViewDefinition", params);
|
||||||
if (viewDef != null) {
|
if (viewDef != null) {
|
||||||
String definition = (String) viewDef.get("view_definition");
|
String definition = (String) viewDef.get("view_definition");
|
||||||
if (definition != null) {
|
if (definition != null) {
|
||||||
@@ -71,7 +71,7 @@ public class DynamicFormService extends BaseService {
|
|||||||
*/
|
*/
|
||||||
private List<String> getColumnNames(String tableName) {
|
private List<String> getColumnNames(String tableName) {
|
||||||
Map<String, Object> params = Map.of("table_name", tableName);
|
Map<String, Object> params = Map.of("table_name", tableName);
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "select_column_names", params);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "selectColumnNames", params);
|
||||||
return rows.stream()
|
return rows.stream()
|
||||||
.map(r -> (String) r.get("column_name"))
|
.map(r -> (String) r.get("column_name"))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
@@ -82,7 +82,7 @@ public class DynamicFormService extends BaseService {
|
|||||||
*/
|
*/
|
||||||
private Map<String, String> getColumnTypeMap(String tableName) {
|
private Map<String, String> getColumnTypeMap(String tableName) {
|
||||||
Map<String, Object> params = Map.of("table_name", tableName);
|
Map<String, Object> params = Map.of("table_name", tableName);
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "select_column_types", params);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "selectColumnTypes", params);
|
||||||
Map<String, String> result = new LinkedHashMap<>();
|
Map<String, String> result = new LinkedHashMap<>();
|
||||||
for (Map<String, Object> row : rows) {
|
for (Map<String, Object> row : rows) {
|
||||||
result.put((String) row.get("column_name"), (String) row.get("data_type"));
|
result.put((String) row.get("column_name"), (String) row.get("data_type"));
|
||||||
@@ -95,7 +95,7 @@ public class DynamicFormService extends BaseService {
|
|||||||
*/
|
*/
|
||||||
private List<String> getPrimaryKeyList(String tableName) {
|
private List<String> getPrimaryKeyList(String tableName) {
|
||||||
Map<String, Object> params = Map.of("table_name", tableName);
|
Map<String, Object> params = Map.of("table_name", tableName);
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "select_primary_keys", params);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "selectPrimaryKeys", params);
|
||||||
return rows.stream()
|
return rows.stream()
|
||||||
.map(r -> (String) r.get("column_name"))
|
.map(r -> (String) r.get("column_name"))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
@@ -533,7 +533,7 @@ public class DynamicFormService extends BaseService {
|
|||||||
String actualTable = resolveBaseTable(tableName);
|
String actualTable = resolveBaseTable(tableName);
|
||||||
validateName(actualTable);
|
validateName(actualTable);
|
||||||
|
|
||||||
Map<String, Object> pkInfo = sqlSession.selectOne(NS + "select_primary_key_with_type", Map.of("table_name", actualTable));
|
Map<String, Object> pkInfo = sqlSession.selectOne(NS + "selectPrimaryKeyWithType", Map.of("table_name", actualTable));
|
||||||
if (pkInfo == null) {
|
if (pkInfo == null) {
|
||||||
throw new IllegalStateException("테이블 " + actualTable + "의 기본키를 찾을 수 없습니다.");
|
throw new IllegalStateException("테이블 " + actualTable + "의 기본키를 찾을 수 없습니다.");
|
||||||
}
|
}
|
||||||
@@ -556,7 +556,7 @@ public class DynamicFormService extends BaseService {
|
|||||||
|
|
||||||
public Map<String, Object> getFormData(int id) {
|
public Map<String, Object> getFormData(int id) {
|
||||||
Map<String, Object> params = Map.of("id", id);
|
Map<String, Object> params = Map.of("id", id);
|
||||||
Map<String, Object> row = sqlSession.selectOne(NS + "select_form_data", params);
|
Map<String, Object> row = sqlSession.selectOne(NS + "selectFormData", params);
|
||||||
if (row == null) return null;
|
if (row == null) return null;
|
||||||
|
|
||||||
// form_data jsonb를 Map으로 파싱
|
// form_data jsonb를 Map으로 파싱
|
||||||
@@ -599,8 +599,8 @@ public class DynamicFormService extends BaseService {
|
|||||||
params.put("size", size);
|
params.put("size", size);
|
||||||
params.put("offset", offset);
|
params.put("offset", offset);
|
||||||
|
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "select_form_data_list", params);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "selectFormDataList", params);
|
||||||
Integer totalObj = sqlSession.selectOne(NS + "count_form_data_list", params);
|
Integer totalObj = sqlSession.selectOne(NS + "countFormDataList", params);
|
||||||
int total = totalObj != null ? totalObj : 0;
|
int total = totalObj != null ? totalObj : 0;
|
||||||
|
|
||||||
// form_data 파싱
|
// form_data 파싱
|
||||||
@@ -648,8 +648,8 @@ public class DynamicFormService extends BaseService {
|
|||||||
|
|
||||||
public List<Map<String, Object>> getTableColumns(String tableName) {
|
public List<Map<String, Object>> getTableColumns(String tableName) {
|
||||||
Map<String, Object> params = Map.of("table_name", tableName);
|
Map<String, Object> params = Map.of("table_name", tableName);
|
||||||
List<Map<String, Object>> columns = sqlSession.selectList(NS + "select_table_columns", params);
|
List<Map<String, Object>> columns = sqlSession.selectList(NS + "selectTableColumns", params);
|
||||||
List<Map<String, Object>> pks = sqlSession.selectList(NS + "select_primary_keys", params);
|
List<Map<String, Object>> pks = sqlSession.selectList(NS + "selectPrimaryKeys", params);
|
||||||
Set<String> pkSet = pks.stream().map(r -> (String) r.get("column_name")).collect(Collectors.toSet());
|
Set<String> pkSet = pks.stream().map(r -> (String) r.get("column_name")).collect(Collectors.toSet());
|
||||||
|
|
||||||
return columns.stream().map(col -> {
|
return columns.stream().map(col -> {
|
||||||
@@ -732,7 +732,7 @@ public class DynamicFormService extends BaseService {
|
|||||||
}
|
}
|
||||||
if (!params.containsKey("trip_status")) params.put("trip_status", "active");
|
if (!params.containsKey("trip_status")) params.put("trip_status", "active");
|
||||||
|
|
||||||
sqlSession.insert(NS + "insert_location_history", params);
|
sqlSession.insert(NS + "insertLocationHistory", params);
|
||||||
|
|
||||||
Map<String, Object> result = new LinkedHashMap<>();
|
Map<String, Object> result = new LinkedHashMap<>();
|
||||||
result.put("id", params.get("id"));
|
result.put("id", params.get("id"));
|
||||||
@@ -744,7 +744,7 @@ public class DynamicFormService extends BaseService {
|
|||||||
// startDate / endDate String → Date if present
|
// startDate / endDate String → Date if present
|
||||||
convertDateParam(params, "start_date");
|
convertDateParam(params, "start_date");
|
||||||
convertDateParam(params, "end_date");
|
convertDateParam(params, "end_date");
|
||||||
return sqlSession.selectList(NS + "select_location_history", params);
|
return sqlSession.selectList(NS + "selectLocationHistory", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void convertDateParam(Map<String, Object> params, String key) {
|
private void convertDateParam(Map<String, Object> params, String key) {
|
||||||
|
|||||||
@@ -107,13 +107,13 @@ public class EntityJoinService extends BaseService {
|
|||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
|
|
||||||
List<Map<String, Object>> entityColumns = sqlSession.selectList(NS + "select_entity_columns", params);
|
List<Map<String, Object>> entityColumns = sqlSession.selectList(NS + "selectEntityColumns", params);
|
||||||
List<Map<String, Object>> joinConfigs = new ArrayList<>();
|
List<Map<String, Object>> joinConfigs = new ArrayList<>();
|
||||||
|
|
||||||
Map<String, Object> writerCheck = new HashMap<>();
|
Map<String, Object> writerCheck = new HashMap<>();
|
||||||
writerCheck.put("table_name", tableName);
|
writerCheck.put("table_name", tableName);
|
||||||
writerCheck.put("column_name", "writer");
|
writerCheck.put("column_name", "writer");
|
||||||
if (sqlSession.selectOne(NS + "select_column_exists", writerCheck) != null) {
|
if (sqlSession.selectOne(NS + "selectColumnExists", writerCheck) != null) {
|
||||||
Map<String, Object> writerConfig = new LinkedHashMap<>();
|
Map<String, Object> writerConfig = new LinkedHashMap<>();
|
||||||
writerConfig.put("source_table", tableName);
|
writerConfig.put("source_table", tableName);
|
||||||
writerConfig.put("source_column", "writer");
|
writerConfig.put("source_column", "writer");
|
||||||
@@ -174,12 +174,12 @@ public class EntityJoinService extends BaseService {
|
|||||||
public List<Map<String, Object>> getReferenceTableColumns(String tableName, String companyCode) {
|
public List<Map<String, Object>> getReferenceTableColumns(String tableName, String companyCode) {
|
||||||
Map<String, Object> schemaParams = new HashMap<>();
|
Map<String, Object> schemaParams = new HashMap<>();
|
||||||
schemaParams.put("table_name", tableName);
|
schemaParams.put("table_name", tableName);
|
||||||
List<Map<String, Object>> schemaCols = sqlSession.selectList(NS + "select_table_schema_columns", schemaParams);
|
List<Map<String, Object>> schemaCols = sqlSession.selectList(NS + "selectTableSchemaColumns", schemaParams);
|
||||||
|
|
||||||
Map<String, Object> metaParams = new HashMap<>();
|
Map<String, Object> metaParams = new HashMap<>();
|
||||||
metaParams.put("table_name", tableName);
|
metaParams.put("table_name", tableName);
|
||||||
metaParams.put("company_code", companyCode);
|
metaParams.put("company_code", companyCode);
|
||||||
List<Map<String, Object>> metaCols = sqlSession.selectList(NS + "select_column_metadata", metaParams);
|
List<Map<String, Object>> metaCols = sqlSession.selectList(NS + "selectColumnMetadata", metaParams);
|
||||||
Map<String, Map<String, Object>> metaByCol = metaCols.stream()
|
Map<String, Map<String, Object>> metaByCol = metaCols.stream()
|
||||||
.collect(Collectors.toMap(
|
.collect(Collectors.toMap(
|
||||||
m -> (String) m.get("column_name"),
|
m -> (String) m.get("column_name"),
|
||||||
@@ -210,7 +210,7 @@ public class EntityJoinService extends BaseService {
|
|||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
params.put("column_name", columnName);
|
params.put("column_name", columnName);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
sqlSession.update(NS + "upsert_column_entity_settings", params);
|
sqlSession.update(NS + "upsertColumnEntitySettings", params);
|
||||||
log.info("Entity 설정 업데이트: {}.{}", tableName, columnName);
|
log.info("Entity 설정 업데이트: {}.{}", tableName, columnName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -376,7 +376,7 @@ public class EntityJoinService extends BaseService {
|
|||||||
|
|
||||||
Map<String, Object> p = new HashMap<>();
|
Map<String, Object> p = new HashMap<>();
|
||||||
p.put("table_name", refTable);
|
p.put("table_name", refTable);
|
||||||
if (sqlSession.selectOne(NS + "select_table_exists", p) == null) {
|
if (sqlSession.selectOne(NS + "selectTableExists", p) == null) {
|
||||||
log.warn("참조 테이블 없음: {}", refTable);
|
log.warn("참조 테이블 없음: {}", refTable);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -384,9 +384,9 @@ public class EntityJoinService extends BaseService {
|
|||||||
Map<String, Object> cp = new HashMap<>();
|
Map<String, Object> cp = new HashMap<>();
|
||||||
cp.put("table_name", refTable);
|
cp.put("table_name", refTable);
|
||||||
cp.put("column_name", refCol);
|
cp.put("column_name", refCol);
|
||||||
if (sqlSession.selectOne(NS + "select_column_exists", cp) == null) {
|
if (sqlSession.selectOne(NS + "selectColumnExists", cp) == null) {
|
||||||
cp.put("column_name", "id");
|
cp.put("column_name", "id");
|
||||||
if (sqlSession.selectOne(NS + "select_column_exists", cp) != null) {
|
if (sqlSession.selectOne(NS + "selectColumnExists", cp) != null) {
|
||||||
config.put("reference_column", "id");
|
config.put("reference_column", "id");
|
||||||
} else {
|
} else {
|
||||||
log.warn("참조 컬럼 없음: {}.{}", refTable, refCol);
|
log.warn("참조 컬럼 없음: {}.{}", refTable, refCol);
|
||||||
@@ -398,7 +398,7 @@ public class EntityJoinService extends BaseService {
|
|||||||
Map<String, Object> dp = new HashMap<>();
|
Map<String, Object> dp = new HashMap<>();
|
||||||
dp.put("table_name", refTable);
|
dp.put("table_name", refTable);
|
||||||
dp.put("column_name", displayCol);
|
dp.put("column_name", displayCol);
|
||||||
if (sqlSession.selectOne(NS + "select_column_exists", dp) == null) {
|
if (sqlSession.selectOne(NS + "selectColumnExists", dp) == null) {
|
||||||
log.warn("표시 컬럼 없음: {}.{}", refTable, displayCol);
|
log.warn("표시 컬럼 없음: {}.{}", refTable, displayCol);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -409,7 +409,7 @@ public class EntityJoinService extends BaseService {
|
|||||||
private String autoDetectDisplayColumn(String refTable, String refCol) {
|
private String autoDetectDisplayColumn(String refTable, String refCol) {
|
||||||
Map<String, Object> p = new HashMap<>();
|
Map<String, Object> p = new HashMap<>();
|
||||||
p.put("table_name", refTable);
|
p.put("table_name", refTable);
|
||||||
List<Map<String, Object>> cols = sqlSession.selectList(NS + "select_table_schema_columns", p);
|
List<Map<String, Object>> cols = sqlSession.selectList(NS + "selectTableSchemaColumns", p);
|
||||||
List<String> colNames = cols.stream()
|
List<String> colNames = cols.stream()
|
||||||
.map(c -> (String) c.get("column_name"))
|
.map(c -> (String) c.get("column_name"))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public class EntityReferenceService extends BaseService {
|
|||||||
int limit = toInt(params.getOrDefault("limit", 100));
|
int limit = toInt(params.getOrDefault("limit", 100));
|
||||||
Object search = params.get("search");
|
Object search = params.get("search");
|
||||||
|
|
||||||
Map<String, Object> columnInfo = sqlSession.selectOne(NS + "select_column_info",
|
Map<String, Object> columnInfo = sqlSession.selectOne(NS + "selectColumnInfo",
|
||||||
Map.of("table_name", tableName, "column_name", columnName));
|
Map.of("table_name", tableName, "column_name", columnName));
|
||||||
|
|
||||||
if (columnInfo == null) {
|
if (columnInfo == null) {
|
||||||
@@ -52,14 +52,14 @@ public class EntityReferenceService extends BaseService {
|
|||||||
throw new IllegalArgumentException("잘못된 참조 테이블/컬럼 이름입니다.");
|
throw new IllegalArgumentException("잘못된 참조 테이블/컬럼 이름입니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
Integer tableExistsObj = sqlSession.selectOne(NS + "check_table_exists_in_schema",
|
Integer tableExistsObj = sqlSession.selectOne(NS + "checkTableExistsInSchema",
|
||||||
Map.of("table_name", safeTable));
|
Map.of("table_name", safeTable));
|
||||||
int tableExists = tableExistsObj != null ? tableExistsObj : 0;
|
int tableExists = tableExistsObj != null ? tableExistsObj : 0;
|
||||||
if (tableExists == 0) {
|
if (tableExists == 0) {
|
||||||
throw new IllegalStateException("참조 테이블 '" + safeTable + "'이 존재하지 않습니다.");
|
throw new IllegalStateException("참조 테이블 '" + safeTable + "'이 존재하지 않습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
Integer hasCompanyCodeObj = sqlSession.selectOne(NS + "check_table_has_company_code",
|
Integer hasCompanyCodeObj = sqlSession.selectOne(NS + "checkTableHasCompanyCode",
|
||||||
Map.of("table_name", safeTable));
|
Map.of("table_name", safeTable));
|
||||||
int hasCompanyCode = hasCompanyCodeObj != null ? hasCompanyCodeObj : 0;
|
int hasCompanyCode = hasCompanyCodeObj != null ? hasCompanyCodeObj : 0;
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ public class EntityReferenceService extends BaseService {
|
|||||||
log.info("엔티티 참조 데이터 조회: {}.{} -> {}.{} (display: {}), company={}",
|
log.info("엔티티 참조 데이터 조회: {}.{} -> {}.{} (display: {}), company={}",
|
||||||
tableName, columnName, safeTable, safeRefCol, safeDispCol, companyCode);
|
tableName, columnName, safeTable, safeRefCol, safeDispCol, companyCode);
|
||||||
|
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "select_reference_data", queryParams);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "selectReferenceData", queryParams);
|
||||||
|
|
||||||
List<Map<String, Object>> options = new ArrayList<>();
|
List<Map<String, Object>> options = new ArrayList<>();
|
||||||
for (Map<String, Object> row : rows) {
|
for (Map<String, Object> row : rows) {
|
||||||
@@ -116,7 +116,7 @@ public class EntityReferenceService extends BaseService {
|
|||||||
|
|
||||||
log.info("공통 코드 데이터 조회: category={}, company={}", codeCategory, companyCode);
|
log.info("공통 코드 데이터 조회: category={}, company={}", codeCategory, companyCode);
|
||||||
|
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "select_code_data", queryParams);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "selectCodeData", queryParams);
|
||||||
|
|
||||||
List<Map<String, Object>> options = new ArrayList<>();
|
List<Map<String, Object>> options = new ArrayList<>();
|
||||||
for (Map<String, Object> row : rows) {
|
for (Map<String, Object> row : rows) {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class EntitySearchService extends BaseService {
|
|||||||
private Set<String> fetchColumns(String tableName) {
|
private Set<String> fetchColumns(String tableName) {
|
||||||
Map<String, Object> p = new HashMap<>();
|
Map<String, Object> p = new HashMap<>();
|
||||||
p.put("table_name", tableName);
|
p.put("table_name", tableName);
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "get_table_column_list", p);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "getTableColumnList", p);
|
||||||
return rows.stream()
|
return rows.stream()
|
||||||
.map(r -> (String) r.get("column_name"))
|
.map(r -> (String) r.get("column_name"))
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
@@ -238,7 +238,7 @@ public class EntitySearchService extends BaseService {
|
|||||||
try {
|
try {
|
||||||
Map<String, Object> pkp = new HashMap<>();
|
Map<String, Object> pkp = new HashMap<>();
|
||||||
pkp.put("table_name", tableName);
|
pkp.put("table_name", tableName);
|
||||||
Map<String, Object> pk = sqlSession.selectOne(NS + "get_primary_key_info", pkp);
|
Map<String, Object> pk = sqlSession.selectOne(NS + "getPrimaryKeyInfo", pkp);
|
||||||
if (pk != null && pk.get("column_name") != null) {
|
if (pk != null && pk.get("column_name") != null) {
|
||||||
orderByColumn = "\"" + sanitize((String) pk.get("column_name")) + "\"";
|
orderByColumn = "\"" + sanitize((String) pk.get("column_name")) + "\"";
|
||||||
}
|
}
|
||||||
@@ -257,8 +257,8 @@ public class EntitySearchService extends BaseService {
|
|||||||
qp.put("page_limit", limit);
|
qp.put("page_limit", limit);
|
||||||
qp.put("page_offset", offset);
|
qp.put("page_offset", offset);
|
||||||
|
|
||||||
List<Map<String, Object>> data = sqlSession.selectList(NS + "get_entity_search_list", qp);
|
List<Map<String, Object>> data = sqlSession.selectList(NS + "getEntitySearchList", qp);
|
||||||
Integer totalObj = sqlSession.selectOne(NS + "get_entity_search_list_cnt", qp);
|
Integer totalObj = sqlSession.selectOne(NS + "getEntitySearchListCnt", qp);
|
||||||
int total = totalObj != null ? totalObj : 0;
|
int total = totalObj != null ? totalObj : 0;
|
||||||
|
|
||||||
Map<String, Object> result = new LinkedHashMap<>();
|
Map<String, Object> result = new LinkedHashMap<>();
|
||||||
@@ -325,7 +325,7 @@ public class EntitySearchService extends BaseService {
|
|||||||
qp.put("where_clause", whereClause.toString());
|
qp.put("where_clause", whereClause.toString());
|
||||||
qp.put("label_column", "\"" + labelCol + "\"");
|
qp.put("label_column", "\"" + labelCol + "\"");
|
||||||
|
|
||||||
return sqlSession.selectList(NS + "get_entity_option_list", qp);
|
return sqlSession.selectList(NS + "getEntityOptionList", qp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Map<String, Object>> getDistinctColumnValues(Map<String, Object> params) {
|
public List<Map<String, Object>> getDistinctColumnValues(Map<String, Object> params) {
|
||||||
@@ -366,7 +366,7 @@ public class EntitySearchService extends BaseService {
|
|||||||
qp.put("label_column", "\"" + effectiveLabelCol + "\"");
|
qp.put("label_column", "\"" + effectiveLabelCol + "\"");
|
||||||
qp.put("where_clause", whereClause.toString());
|
qp.put("where_clause", whereClause.toString());
|
||||||
|
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "get_distinct_value_list", qp);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "getDistinctValueList", qp);
|
||||||
|
|
||||||
if (rows.isEmpty()) return rows;
|
if (rows.isEmpty()) return rows;
|
||||||
|
|
||||||
@@ -382,7 +382,7 @@ public class EntitySearchService extends BaseService {
|
|||||||
cvp.put("column_name", columnName);
|
cvp.put("column_name", columnName);
|
||||||
cvp.put("raw_values", rawValues);
|
cvp.put("raw_values", rawValues);
|
||||||
cvp.put("company_code", companyCode);
|
cvp.put("company_code", companyCode);
|
||||||
List<Map<String, Object>> cvRows = sqlSession.selectList(NS + "get_category_value_list", cvp);
|
List<Map<String, Object>> cvRows = sqlSession.selectList(NS + "getCategoryValueList", cvp);
|
||||||
for (Map<String, Object> r : cvRows) {
|
for (Map<String, Object> r : cvRows) {
|
||||||
labelMap.put((String) r.get("value_code"), (String) r.get("value_label"));
|
labelMap.put((String) r.get("value_code"), (String) r.get("value_label"));
|
||||||
}
|
}
|
||||||
@@ -394,7 +394,7 @@ public class EntitySearchService extends BaseService {
|
|||||||
Map<String, Object> ttcp = new HashMap<>();
|
Map<String, Object> ttcp = new HashMap<>();
|
||||||
ttcp.put("table_name", tableName);
|
ttcp.put("table_name", tableName);
|
||||||
ttcp.put("column_name", columnName);
|
ttcp.put("column_name", columnName);
|
||||||
Map<String, Object> ttcRow = sqlSession.selectOne(NS + "get_code_category_info", ttcp);
|
Map<String, Object> ttcRow = sqlSession.selectOne(NS + "getCodeCategoryInfo", ttcp);
|
||||||
String codeCategory = ttcRow != null ? (String) ttcRow.get("code_category") : null;
|
String codeCategory = ttcRow != null ? (String) ttcRow.get("code_category") : null;
|
||||||
|
|
||||||
if (codeCategory != null) {
|
if (codeCategory != null) {
|
||||||
@@ -402,7 +402,7 @@ public class EntitySearchService extends BaseService {
|
|||||||
cip.put("code_category", codeCategory);
|
cip.put("code_category", codeCategory);
|
||||||
cip.put("raw_values", rawValues);
|
cip.put("raw_values", rawValues);
|
||||||
cip.put("company_code", companyCode);
|
cip.put("company_code", companyCode);
|
||||||
List<Map<String, Object>> ciRows = sqlSession.selectList(NS + "get_code_info_list", cip);
|
List<Map<String, Object>> ciRows = sqlSession.selectList(NS + "getCodeInfoList", cip);
|
||||||
for (Map<String, Object> r : ciRows) {
|
for (Map<String, Object> r : ciRows) {
|
||||||
String codeValue = (String) r.get("code_value");
|
String codeValue = (String) r.get("code_value");
|
||||||
if (!labelMap.containsKey(codeValue)) {
|
if (!labelMap.containsKey(codeValue)) {
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ public class FileService extends BaseService {
|
|||||||
public Map<String, Object> getFileList(Map<String, Object> params) {
|
public Map<String, Object> getFileList(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
commonService.applyPagination(params);
|
commonService.applyPagination(params);
|
||||||
Integer totalObj = sqlSession.selectOne(NS + "get_file_list_cnt", params);
|
Integer totalObj = sqlSession.selectOne(NS + "getFileListCnt", params);
|
||||||
int totalCount = totalObj != null ? totalObj : 0;
|
int totalCount = totalObj != null ? totalObj : 0;
|
||||||
List<Map<String, Object>> list = sqlSession.selectList(NS + "get_file_list", params);
|
List<Map<String, Object>> list = sqlSession.selectList(NS + "getFileList", params);
|
||||||
return commonService.buildListResponse(list, totalCount, params);
|
return commonService.buildListResponse(list, totalCount, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,19 +45,19 @@ public class FileService extends BaseService {
|
|||||||
|
|
||||||
public Map<String, Object> getFileInfo(Map<String, Object> params) {
|
public Map<String, Object> getFileInfo(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectOne(NS + "get_file_info", params);
|
return sqlSession.selectOne(NS + "getFileInfo", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getFileInfoPublic(Map<String, Object> params) {
|
public Map<String, Object> getFileInfoPublic(Map<String, Object> params) {
|
||||||
// public 접근 — company_code 필터 없음
|
// public 접근 — company_code 필터 없음
|
||||||
return sqlSession.selectOne(NS + "get_file_info", params);
|
return sqlSession.selectOne(NS + "getFileInfo", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── 타겟별 파일 목록 ────────────────────────────────────────────────────
|
// ── 타겟별 파일 목록 ────────────────────────────────────────────────────
|
||||||
|
|
||||||
public List<Map<String, Object>> getFilesByTarget(Map<String, Object> params) {
|
public List<Map<String, Object>> getFilesByTarget(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectList(NS + "get_files_by_target", params);
|
return sqlSession.selectList(NS + "getFilesByTarget", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── 업로드 ────────────────────────────────────────────────────────────────
|
// ── 업로드 ────────────────────────────────────────────────────────────────
|
||||||
@@ -118,7 +118,7 @@ public class FileService extends BaseService {
|
|||||||
fileParams.put("status", "ACTIVE");
|
fileParams.put("status", "ACTIVE");
|
||||||
fileParams.put("is_representative", false);
|
fileParams.put("is_representative", false);
|
||||||
|
|
||||||
sqlSession.insert(NS + "insert_file", fileParams);
|
sqlSession.insert(NS + "insertFile", fileParams);
|
||||||
|
|
||||||
Map<String, Object> result = new HashMap<>();
|
Map<String, Object> result = new HashMap<>();
|
||||||
result.put("objid", objid);
|
result.put("objid", objid);
|
||||||
@@ -149,6 +149,6 @@ public class FileService extends BaseService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public void deleteFile(Map<String, Object> params) {
|
public void deleteFile(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.update(NS + "soft_delete_file", params);
|
sqlSession.update(NS + "softDeleteFile", params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,34 +19,34 @@ public class MailAccountFileService extends BaseService {
|
|||||||
public Map<String, Object> getMailAccountFileList(Map<String, Object> params) {
|
public Map<String, Object> getMailAccountFileList(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
commonService.applyPagination(params);
|
commonService.applyPagination(params);
|
||||||
int totalCount = sqlSession.selectOne(NS + "get_mail_account_file_list_cnt", params);
|
int totalCount = sqlSession.selectOne(NS + "getMailAccountFileListCnt", params);
|
||||||
List<Map<String, Object>> list = sqlSession.selectList(NS + "get_mail_account_file_list", params);
|
List<Map<String, Object>> list = sqlSession.selectList(NS + "getMailAccountFileList", params);
|
||||||
return commonService.buildListResponse(list, totalCount, params);
|
return commonService.buildListResponse(list, totalCount, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getMailAccountFileInfo(Map<String, Object> params) {
|
public Map<String, Object> getMailAccountFileInfo(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectOne(NS + "get_mail_account_file_info", params);
|
return sqlSession.selectOne(NS + "getMailAccountFileInfo", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> insertMailAccountFile(Map<String, Object> params) {
|
public Map<String, Object> insertMailAccountFile(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.insert(NS + "insert_mail_account_file", params);
|
sqlSession.insert(NS + "insertMailAccountFile", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> updateMailAccountFile(Map<String, Object> params) {
|
public Map<String, Object> updateMailAccountFile(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.update(NS + "update_mail_account_file", params);
|
sqlSession.update(NS + "updateMailAccountFile", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> deleteMailAccountFile(Map<String, Object> params) {
|
public Map<String, Object> deleteMailAccountFile(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.delete(NS + "delete_mail_account_file", params);
|
sqlSession.delete(NS + "deleteMailAccountFile", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,43 +22,43 @@ public class MailReceiveBasicService extends BaseService {
|
|||||||
public Map<String, Object> getMailReceiveBasicList(Map<String, Object> params) {
|
public Map<String, Object> getMailReceiveBasicList(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
commonService.applyPagination(params);
|
commonService.applyPagination(params);
|
||||||
int totalCount = sqlSession.selectOne(NS + "get_mail_receive_basic_list_cnt", params);
|
int totalCount = sqlSession.selectOne(NS + "getMailReceiveBasicListCnt", params);
|
||||||
List<Map<String, Object>> list = sqlSession.selectList(NS + "get_mail_receive_basic_list", params);
|
List<Map<String, Object>> list = sqlSession.selectList(NS + "getMailReceiveBasicList", params);
|
||||||
return commonService.buildListResponse(list, totalCount, params);
|
return commonService.buildListResponse(list, totalCount, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMailReceiveBasicTodayCount(Map<String, Object> params) {
|
public int getMailReceiveBasicTodayCount(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectOne(NS + "get_mail_receive_basic_today_count", params);
|
return sqlSession.selectOne(NS + "getMailReceiveBasicTodayCount", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getMailReceiveBasicInfo(Map<String, Object> params) {
|
public Map<String, Object> getMailReceiveBasicInfo(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectOne(NS + "get_mail_receive_basic_info", params);
|
return sqlSession.selectOne(NS + "getMailReceiveBasicInfo", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> markMailReceiveBasicAsRead(Map<String, Object> params) {
|
public Map<String, Object> markMailReceiveBasicAsRead(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.update(NS + "update_mail_receive_basic_as_read", params);
|
sqlSession.update(NS + "updateMailReceiveBasicAsRead", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> deleteMailReceiveBasic(Map<String, Object> params) {
|
public Map<String, Object> deleteMailReceiveBasic(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.update(NS + "delete_mail_receive_basic", params);
|
sqlSession.update(NS + "deleteMailReceiveBasic", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getMailReceiveBasicAttachment(Map<String, Object> params) {
|
public Map<String, Object> getMailReceiveBasicAttachment(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectOne(NS + "get_mail_receive_basic_attachment", params);
|
return sqlSession.selectOne(NS + "getMailReceiveBasicAttachment", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> testMailReceiveBasicImapConnection(Map<String, Object> params) {
|
public Map<String, Object> testMailReceiveBasicImapConnection(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
Map<String, Object> account = sqlSession.selectOne(NS + "get_mail_receive_basic_account_info", params);
|
Map<String, Object> account = sqlSession.selectOne(NS + "getMailReceiveBasicAccountInfo", params);
|
||||||
if (account == null) {
|
if (account == null) {
|
||||||
Map<String, Object> result = new HashMap<>();
|
Map<String, Object> result = new HashMap<>();
|
||||||
result.put("success", false);
|
result.put("success", false);
|
||||||
|
|||||||
@@ -37,14 +37,14 @@ public class MailSentHistoryService extends BaseService {
|
|||||||
|
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
commonService.applyPagination(params);
|
commonService.applyPagination(params);
|
||||||
int totalCount = sqlSession.selectOne(NS + "get_mail_sent_history_list_cnt", params);
|
int totalCount = sqlSession.selectOne(NS + "getMailSentHistoryListCnt", params);
|
||||||
List<Map<String, Object>> list = sqlSession.selectList(NS + "get_mail_sent_history_list", params);
|
List<Map<String, Object>> list = sqlSession.selectList(NS + "getMailSentHistoryList", params);
|
||||||
return commonService.buildListResponse(list, totalCount, params);
|
return commonService.buildListResponse(list, totalCount, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getMailSentHistoryInfo(Map<String, Object> params) {
|
public Map<String, Object> getMailSentHistoryInfo(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectOne(NS + "get_mail_sent_history_info", params);
|
return sqlSession.selectOne(NS + "getMailSentHistoryInfo", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -63,41 +63,41 @@ public class MailSentHistoryService extends BaseService {
|
|||||||
Map<String, Object> lookupParams = new HashMap<>();
|
Map<String, Object> lookupParams = new HashMap<>();
|
||||||
lookupParams.put("id", id);
|
lookupParams.put("id", id);
|
||||||
lookupParams.put("company_code", params.get("company_code"));
|
lookupParams.put("company_code", params.get("company_code"));
|
||||||
Map<String, Object> existing = sqlSession.selectOne(NS + "get_mail_sent_history_info", lookupParams);
|
Map<String, Object> existing = sqlSession.selectOne(NS + "getMailSentHistoryInfo", lookupParams);
|
||||||
|
|
||||||
if (existing != null) {
|
if (existing != null) {
|
||||||
sqlSession.update(NS + "update_mail_sent_history", params);
|
sqlSession.update(NS + "updateMailSentHistory", params);
|
||||||
} else {
|
} else {
|
||||||
sqlSession.insert(NS + "insert_mail_sent_history", params);
|
sqlSession.insert(NS + "insertMailSentHistory", params);
|
||||||
}
|
}
|
||||||
return sqlSession.selectOne(NS + "get_mail_sent_history_info", lookupParams);
|
return sqlSession.selectOne(NS + "getMailSentHistoryInfo", lookupParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> updateMailSentHistoryDraft(Map<String, Object> params) {
|
public Map<String, Object> updateMailSentHistoryDraft(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.update(NS + "update_mail_sent_history", params);
|
sqlSession.update(NS + "updateMailSentHistory", params);
|
||||||
return sqlSession.selectOne(NS + "get_mail_sent_history_info", params);
|
return sqlSession.selectOne(NS + "getMailSentHistoryInfo", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> deleteMailSentHistory(Map<String, Object> params) {
|
public Map<String, Object> deleteMailSentHistory(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.update(NS + "soft_delete_mail_sent_history", params);
|
sqlSession.update(NS + "softDeleteMailSentHistory", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> permanentlyDeleteMailSentHistory(Map<String, Object> params) {
|
public Map<String, Object> permanentlyDeleteMailSentHistory(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.delete(NS + "permanent_delete_mail_sent_history", params);
|
sqlSession.delete(NS + "permanentDeleteMailSentHistory", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> restoreMailSentHistory(Map<String, Object> params) {
|
public Map<String, Object> restoreMailSentHistory(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.update(NS + "restore_mail_sent_history", params);
|
sqlSession.update(NS + "restoreMailSentHistory", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ public class MailSentHistoryService extends BaseService {
|
|||||||
if (ids == null || ids.isEmpty()) {
|
if (ids == null || ids.isEmpty()) {
|
||||||
return Map.of("success_count", 0, "fail_count", 0);
|
return Map.of("success_count", 0, "fail_count", 0);
|
||||||
}
|
}
|
||||||
int successCount = sqlSession.update(NS + "bulk_soft_delete_mail_sent_history", params);
|
int successCount = sqlSession.update(NS + "bulkSoftDeleteMailSentHistory", params);
|
||||||
return Map.of("success_count", successCount, "fail_count", Math.max(0, ids.size() - successCount));
|
return Map.of("success_count", successCount, "fail_count", Math.max(0, ids.size() - successCount));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ public class MailSentHistoryService extends BaseService {
|
|||||||
if (ids == null || ids.isEmpty()) {
|
if (ids == null || ids.isEmpty()) {
|
||||||
return Map.of("success_count", 0, "fail_count", 0);
|
return Map.of("success_count", 0, "fail_count", 0);
|
||||||
}
|
}
|
||||||
int successCount = sqlSession.delete(NS + "bulk_permanent_delete_mail_sent_history", params);
|
int successCount = sqlSession.delete(NS + "bulkPermanentDeleteMailSentHistory", params);
|
||||||
return Map.of("success_count", successCount, "fail_count", Math.max(0, ids.size() - successCount));
|
return Map.of("success_count", successCount, "fail_count", Math.max(0, ids.size() - successCount));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,13 +130,13 @@ public class MailSentHistoryService extends BaseService {
|
|||||||
if (ids == null || ids.isEmpty()) {
|
if (ids == null || ids.isEmpty()) {
|
||||||
return Map.of("success_count", 0, "fail_count", 0);
|
return Map.of("success_count", 0, "fail_count", 0);
|
||||||
}
|
}
|
||||||
int successCount = sqlSession.update(NS + "bulk_restore_mail_sent_history", params);
|
int successCount = sqlSession.update(NS + "bulkRestoreMailSentHistory", params);
|
||||||
return Map.of("success_count", successCount, "fail_count", Math.max(0, ids.size() - successCount));
|
return Map.of("success_count", successCount, "fail_count", Math.max(0, ids.size() - successCount));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getMailSentHistoryStatistics(Map<String, Object> params) {
|
public Map<String, Object> getMailSentHistoryStatistics(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
Map<String, Object> stats = sqlSession.selectOne(NS + "get_mail_sent_history_statistics", params);
|
Map<String, Object> stats = sqlSession.selectOne(NS + "getMailSentHistoryStatistics", params);
|
||||||
if (stats == null) stats = new HashMap<>();
|
if (stats == null) stats = new HashMap<>();
|
||||||
|
|
||||||
long totalSent = toLong(stats.get("total_sent"));
|
long totalSent = toLong(stats.get("total_sent"));
|
||||||
@@ -155,7 +155,7 @@ public class MailSentHistoryService extends BaseService {
|
|||||||
if (params.get("sent_at") == null) {
|
if (params.get("sent_at") == null) {
|
||||||
params.put("sent_at", new Timestamp(System.currentTimeMillis()));
|
params.put("sent_at", new Timestamp(System.currentTimeMillis()));
|
||||||
}
|
}
|
||||||
sqlSession.insert(NS + "insert_mail_sent_history", params);
|
sqlSession.insert(NS + "insertMailSentHistory", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,21 +24,21 @@ public class MailTemplateFileService extends BaseService {
|
|||||||
public Map<String, Object> getMailTemplateFileList(Map<String, Object> params) {
|
public Map<String, Object> getMailTemplateFileList(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
commonService.applyPagination(params);
|
commonService.applyPagination(params);
|
||||||
int totalCount = sqlSession.selectOne(NS + "get_mail_template_file_list_cnt", params);
|
int totalCount = sqlSession.selectOne(NS + "getMailTemplateFileListCnt", params);
|
||||||
List<Map<String, Object>> list = sqlSession.selectList(NS + "get_mail_template_file_list", params);
|
List<Map<String, Object>> list = sqlSession.selectList(NS + "getMailTemplateFileList", params);
|
||||||
return commonService.buildListResponse(list, totalCount, params);
|
return commonService.buildListResponse(list, totalCount, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getMailTemplateFileInfo(Map<String, Object> params) {
|
public Map<String, Object> getMailTemplateFileInfo(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectOne(NS + "get_mail_template_file_info", params);
|
return sqlSession.selectOne(NS + "getMailTemplateFileInfo", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> insertMailTemplateFile(Map<String, Object> params) {
|
public Map<String, Object> insertMailTemplateFile(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
serializeJsonFields(params);
|
serializeJsonFields(params);
|
||||||
sqlSession.insert(NS + "insert_mail_template_file", params);
|
sqlSession.insert(NS + "insertMailTemplateFile", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,21 +46,21 @@ public class MailTemplateFileService extends BaseService {
|
|||||||
public Map<String, Object> updateMailTemplateFile(Map<String, Object> params) {
|
public Map<String, Object> updateMailTemplateFile(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
serializeJsonFields(params);
|
serializeJsonFields(params);
|
||||||
sqlSession.update(NS + "update_mail_template_file", params);
|
sqlSession.update(NS + "updateMailTemplateFile", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> deleteMailTemplateFile(Map<String, Object> params) {
|
public Map<String, Object> deleteMailTemplateFile(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.delete(NS + "delete_mail_template_file", params);
|
sqlSession.delete(NS + "deleteMailTemplateFile", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public Map<String, Object> previewMailTemplateFile(Map<String, Object> params) {
|
public Map<String, Object> previewMailTemplateFile(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
Map<String, Object> template = sqlSession.selectOne(NS + "get_mail_template_file_info", params);
|
Map<String, Object> template = sqlSession.selectOne(NS + "getMailTemplateFileInfo", params);
|
||||||
if (template == null) {
|
if (template == null) {
|
||||||
return Collections.emptyMap();
|
return Collections.emptyMap();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,34 +14,34 @@ public class MultilangService extends BaseService {
|
|||||||
private static final String NS = "multilang.";
|
private static final String NS = "multilang.";
|
||||||
|
|
||||||
public List<Map<String, Object>> getLanguages() {
|
public List<Map<String, Object>> getLanguages() {
|
||||||
return sqlSession.selectList(NS + "get_multilang_language_list", new HashMap<>());
|
return sqlSession.selectList(NS + "getMultilangLanguageList", new HashMap<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> createLanguage(Map<String, Object> params) {
|
public Map<String, Object> createLanguage(Map<String, Object> params) {
|
||||||
String langCode = str(params.get("lang_code"));
|
String langCode = str(params.get("lang_code"));
|
||||||
Map<String, Object> check = Map.of("lang_code", langCode);
|
Map<String, Object> check = Map.of("lang_code", langCode);
|
||||||
if (sqlSession.selectOne(NS + "get_multilang_language_info", check) != null) {
|
if (sqlSession.selectOne(NS + "getMultilangLanguageInfo", check) != null) {
|
||||||
throw new IllegalArgumentException("이미 존재하는 언어 코드입니다: " + langCode);
|
throw new IllegalArgumentException("이미 존재하는 언어 코드입니다: " + langCode);
|
||||||
}
|
}
|
||||||
if (params.get("is_active") == null) params.put("is_active", "Y");
|
if (params.get("is_active") == null) params.put("is_active", "Y");
|
||||||
if (params.get("sort_order") == null) params.put("sort_order", 0);
|
if (params.get("sort_order") == null) params.put("sort_order", 0);
|
||||||
sqlSession.insert(NS + "insert_multilang_language", params);
|
sqlSession.insert(NS + "insertMultilangLanguage", params);
|
||||||
return sqlSession.selectOne(NS + "get_multilang_language_info", check);
|
return sqlSession.selectOne(NS + "getMultilangLanguageInfo", check);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> updateLanguage(String langCode, Map<String, Object> params) {
|
public Map<String, Object> updateLanguage(String langCode, Map<String, Object> params) {
|
||||||
params.put("lang_code", langCode);
|
params.put("lang_code", langCode);
|
||||||
Map<String, Object> check = Map.of("lang_code", langCode);
|
Map<String, Object> check = Map.of("lang_code", langCode);
|
||||||
if (sqlSession.selectOne(NS + "get_multilang_language_info", check) == null) {
|
if (sqlSession.selectOne(NS + "getMultilangLanguageInfo", check) == null) {
|
||||||
throw new IllegalArgumentException("언어를 찾을 수 없습니다: " + langCode);
|
throw new IllegalArgumentException("언어를 찾을 수 없습니다: " + langCode);
|
||||||
}
|
}
|
||||||
sqlSession.update(NS + "update_multilang_language", params);
|
sqlSession.update(NS + "updateMultilangLanguage", params);
|
||||||
return sqlSession.selectOne(NS + "get_multilang_language_info", check);
|
return sqlSession.selectOne(NS + "getMultilangLanguageInfo", check);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toggleLanguage(String langCode) {
|
public String toggleLanguage(String langCode) {
|
||||||
Map<String, Object> check = Map.of("lang_code", langCode);
|
Map<String, Object> check = Map.of("lang_code", langCode);
|
||||||
Map<String, Object> current = sqlSession.selectOne(NS + "get_multilang_language_info", check);
|
Map<String, Object> current = sqlSession.selectOne(NS + "getMultilangLanguageInfo", check);
|
||||||
if (current == null) {
|
if (current == null) {
|
||||||
throw new IllegalArgumentException("언어를 찾을 수 없습니다: " + langCode);
|
throw new IllegalArgumentException("언어를 찾을 수 없습니다: " + langCode);
|
||||||
}
|
}
|
||||||
@@ -50,72 +50,72 @@ public class MultilangService extends BaseService {
|
|||||||
params.put("lang_code", langCode);
|
params.put("lang_code", langCode);
|
||||||
params.put("new_status", newStatus);
|
params.put("new_status", newStatus);
|
||||||
params.put("updated_by", "system");
|
params.put("updated_by", "system");
|
||||||
sqlSession.update(NS + "update_multilang_language_status", params);
|
sqlSession.update(NS + "updateMultilangLanguageStatus", params);
|
||||||
return "Y".equals(newStatus) ? "활성화" : "비활성화";
|
return "Y".equals(newStatus) ? "활성화" : "비활성화";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void deleteLanguage(String langCode) {
|
public void deleteLanguage(String langCode) {
|
||||||
Map<String, Object> check = Map.of("lang_code", langCode);
|
Map<String, Object> check = Map.of("lang_code", langCode);
|
||||||
if (sqlSession.selectOne(NS + "get_multilang_language_info", check) == null) {
|
if (sqlSession.selectOne(NS + "getMultilangLanguageInfo", check) == null) {
|
||||||
throw new IllegalArgumentException("언어를 찾을 수 없습니다: " + langCode);
|
throw new IllegalArgumentException("언어를 찾을 수 없습니다: " + langCode);
|
||||||
}
|
}
|
||||||
Map<String, Object> params = Map.of("lang_code", langCode);
|
Map<String, Object> params = Map.of("lang_code", langCode);
|
||||||
sqlSession.delete(NS + "delete_multilang_text_by_lang_code", params);
|
sqlSession.delete(NS + "deleteMultilangTextByLangCode", params);
|
||||||
sqlSession.delete(NS + "delete_multilang_language", params);
|
sqlSession.delete(NS + "deleteMultilangLanguage", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Map<String, Object>> getLangKeys(Map<String, Object> params) {
|
public List<Map<String, Object>> getLangKeys(Map<String, Object> params) {
|
||||||
if (params.containsKey("company_code")) {
|
if (params.containsKey("company_code")) {
|
||||||
params.put("filter_company_code", params.get("company_code"));
|
params.put("filter_company_code", params.get("company_code"));
|
||||||
}
|
}
|
||||||
return sqlSession.selectList(NS + "get_multilang_key_list", params);
|
return sqlSession.selectList(NS + "getMultilangKeyList", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Map<String, Object>> getLangTexts(int keyId) {
|
public List<Map<String, Object>> getLangTexts(int keyId) {
|
||||||
return sqlSession.selectList(NS + "get_multilang_text_list", Map.of("key_id", keyId));
|
return sqlSession.selectList(NS + "getMultilangTextList", Map.of("key_id", keyId));
|
||||||
}
|
}
|
||||||
|
|
||||||
public int createLangKey(Map<String, Object> params) {
|
public int createLangKey(Map<String, Object> params) {
|
||||||
String companyCode = str(params.get("company_code"));
|
String companyCode = str(params.get("company_code"));
|
||||||
String langKey = str(params.get("lang_key"));
|
String langKey = str(params.get("lang_key"));
|
||||||
Map<String, Object> dupCheck = Map.of("company_code", companyCode, "lang_key", langKey);
|
Map<String, Object> dupCheck = Map.of("company_code", companyCode, "lang_key", langKey);
|
||||||
if (sqlSession.selectOne(NS + "get_multilang_key_by_company_and_key", dupCheck) != null) {
|
if (sqlSession.selectOne(NS + "getMultilangKeyByCompanyAndKey", dupCheck) != null) {
|
||||||
throw new IllegalArgumentException("동일한 회사에 이미 존재하는 언어키입니다: " + langKey);
|
throw new IllegalArgumentException("동일한 회사에 이미 존재하는 언어키입니다: " + langKey);
|
||||||
}
|
}
|
||||||
if (params.get("is_active") == null) params.put("is_active", "Y");
|
if (params.get("is_active") == null) params.put("is_active", "Y");
|
||||||
sqlSession.insert(NS + "insert_multilang_key", params);
|
sqlSession.insert(NS + "insertMultilangKey", params);
|
||||||
return toInt(params.get("key_id"));
|
return toInt(params.get("key_id"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateLangKey(int keyId, Map<String, Object> params) {
|
public void updateLangKey(int keyId, Map<String, Object> params) {
|
||||||
params.put("key_id", keyId);
|
params.put("key_id", keyId);
|
||||||
if (sqlSession.selectOne(NS + "get_multilang_key_info", Map.of("key_id", keyId)) == null) {
|
if (sqlSession.selectOne(NS + "getMultilangKeyInfo", Map.of("key_id", keyId)) == null) {
|
||||||
throw new IllegalArgumentException("다국어 키를 찾을 수 없습니다: " + keyId);
|
throw new IllegalArgumentException("다국어 키를 찾을 수 없습니다: " + keyId);
|
||||||
}
|
}
|
||||||
String companyCode = str(params.get("company_code"));
|
String companyCode = str(params.get("company_code"));
|
||||||
String langKey = str(params.get("lang_key"));
|
String langKey = str(params.get("lang_key"));
|
||||||
if (!companyCode.isEmpty() && !langKey.isEmpty()) {
|
if (!companyCode.isEmpty() && !langKey.isEmpty()) {
|
||||||
Map<String, Object> dupCheck = Map.of("company_code", companyCode, "lang_key", langKey, "key_id", keyId);
|
Map<String, Object> dupCheck = Map.of("company_code", companyCode, "lang_key", langKey, "key_id", keyId);
|
||||||
if (sqlSession.selectOne(NS + "get_multilang_key_by_company_and_key_exclude", dupCheck) != null) {
|
if (sqlSession.selectOne(NS + "getMultilangKeyByCompanyAndKeyExclude", dupCheck) != null) {
|
||||||
throw new IllegalArgumentException("동일한 회사에 이미 존재하는 언어키입니다: " + langKey);
|
throw new IllegalArgumentException("동일한 회사에 이미 존재하는 언어키입니다: " + langKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sqlSession.update(NS + "update_multilang_key", params);
|
sqlSession.update(NS + "updateMultilangKey", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void deleteLangKey(int keyId) {
|
public void deleteLangKey(int keyId) {
|
||||||
if (sqlSession.selectOne(NS + "get_multilang_key_info", Map.of("key_id", keyId)) == null) {
|
if (sqlSession.selectOne(NS + "getMultilangKeyInfo", Map.of("key_id", keyId)) == null) {
|
||||||
throw new IllegalArgumentException("다국어 키를 찾을 수 없습니다: " + keyId);
|
throw new IllegalArgumentException("다국어 키를 찾을 수 없습니다: " + keyId);
|
||||||
}
|
}
|
||||||
Map<String, Object> params = Map.of("key_id", keyId);
|
Map<String, Object> params = Map.of("key_id", keyId);
|
||||||
sqlSession.delete(NS + "delete_multilang_text_by_key_id", params);
|
sqlSession.delete(NS + "deleteMultilangTextByKeyId", params);
|
||||||
sqlSession.delete(NS + "delete_multilang_key", params);
|
sqlSession.delete(NS + "deleteMultilangKey", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toggleLangKey(int keyId) {
|
public String toggleLangKey(int keyId) {
|
||||||
Map<String, Object> current = sqlSession.selectOne(NS + "get_multilang_key_info", Map.of("key_id", keyId));
|
Map<String, Object> current = sqlSession.selectOne(NS + "getMultilangKeyInfo", Map.of("key_id", keyId));
|
||||||
if (current == null) {
|
if (current == null) {
|
||||||
throw new IllegalArgumentException("다국어 키를 찾을 수 없습니다: " + keyId);
|
throw new IllegalArgumentException("다국어 키를 찾을 수 없습니다: " + keyId);
|
||||||
}
|
}
|
||||||
@@ -124,21 +124,21 @@ public class MultilangService extends BaseService {
|
|||||||
params.put("key_id", keyId);
|
params.put("key_id", keyId);
|
||||||
params.put("new_status", newStatus);
|
params.put("new_status", newStatus);
|
||||||
params.put("updated_by", "system");
|
params.put("updated_by", "system");
|
||||||
sqlSession.update(NS + "update_multilang_key_status", params);
|
sqlSession.update(NS + "updateMultilangKeyStatus", params);
|
||||||
return "Y".equals(newStatus) ? "활성화" : "비활성화";
|
return "Y".equals(newStatus) ? "활성화" : "비활성화";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void saveLangTexts(int keyId, List<Map<String, Object>> texts) {
|
public void saveLangTexts(int keyId, List<Map<String, Object>> texts) {
|
||||||
if (sqlSession.selectOne(NS + "get_multilang_key_info", Map.of("key_id", keyId)) == null) {
|
if (sqlSession.selectOne(NS + "getMultilangKeyInfo", Map.of("key_id", keyId)) == null) {
|
||||||
throw new IllegalArgumentException("다국어 키를 찾을 수 없습니다: " + keyId);
|
throw new IllegalArgumentException("다국어 키를 찾을 수 없습니다: " + keyId);
|
||||||
}
|
}
|
||||||
sqlSession.delete(NS + "delete_multilang_text_by_key_id", Map.of("key_id", keyId));
|
sqlSession.delete(NS + "deleteMultilangTextByKeyId", Map.of("key_id", keyId));
|
||||||
for (Map<String, Object> text : texts) {
|
for (Map<String, Object> text : texts) {
|
||||||
Map<String, Object> params = new HashMap<>(text);
|
Map<String, Object> params = new HashMap<>(text);
|
||||||
params.put("key_id", keyId);
|
params.put("key_id", keyId);
|
||||||
if (params.get("is_active") == null) params.put("is_active", "Y");
|
if (params.get("is_active") == null) params.put("is_active", "Y");
|
||||||
sqlSession.insert(NS + "insert_multilang_text", params);
|
sqlSession.insert(NS + "insertMultilangText", params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,14 +146,14 @@ public class MultilangService extends BaseService {
|
|||||||
Map<String, Object> params = Map.of(
|
Map<String, Object> params = Map.of(
|
||||||
"company_code", companyCode, "menu_code", menuCode,
|
"company_code", companyCode, "menu_code", menuCode,
|
||||||
"lang_key", langKey, "user_lang", userLang);
|
"lang_key", langKey, "user_lang", userLang);
|
||||||
Map<String, Object> result = sqlSession.selectOne(NS + "get_multilang_user_text", params);
|
Map<String, Object> result = sqlSession.selectOne(NS + "getMultilangUserText", params);
|
||||||
return result != null ? str(result.get("lang_text")) : langKey;
|
return result != null ? str(result.get("lang_text")) : langKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLangText(String companyCode, String langKey, String langCode) {
|
public String getLangText(String companyCode, String langKey, String langCode) {
|
||||||
Map<String, Object> params = Map.of(
|
Map<String, Object> params = Map.of(
|
||||||
"company_code", companyCode, "lang_key", langKey, "lang_code", langCode);
|
"company_code", companyCode, "lang_key", langKey, "lang_code", langCode);
|
||||||
Map<String, Object> result = sqlSession.selectOne(NS + "get_multilang_single_text", params);
|
Map<String, Object> result = sqlSession.selectOne(NS + "getMultilangSingleText", params);
|
||||||
return result != null ? str(result.get("lang_text")) : langKey;
|
return result != null ? str(result.get("lang_text")) : langKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,7 +165,7 @@ public class MultilangService extends BaseService {
|
|||||||
params.put("menu_code", menuCode);
|
params.put("menu_code", menuCode);
|
||||||
params.put("user_lang", userLang);
|
params.put("user_lang", userLang);
|
||||||
params.put("lang_keys", langKeys);
|
params.put("lang_keys", langKeys);
|
||||||
List<Map<String, Object>> translations = sqlSession.selectList(NS + "get_multilang_batch_translation_list", params);
|
List<Map<String, Object>> translations = sqlSession.selectList(NS + "getMultilangBatchTranslationList", params);
|
||||||
Map<String, String> result = new LinkedHashMap<>();
|
Map<String, String> result = new LinkedHashMap<>();
|
||||||
Set<String> processed = new HashSet<>();
|
Set<String> processed = new HashSet<>();
|
||||||
for (Map<String, Object> t : translations) {
|
for (Map<String, Object> t : translations) {
|
||||||
@@ -180,7 +180,7 @@ public class MultilangService extends BaseService {
|
|||||||
Map<String, Object> fallbackParams = new HashMap<>();
|
Map<String, Object> fallbackParams = new HashMap<>();
|
||||||
fallbackParams.put("company_code", companyCode);
|
fallbackParams.put("company_code", companyCode);
|
||||||
fallbackParams.put("missing_keys", missingKeys);
|
fallbackParams.put("missing_keys", missingKeys);
|
||||||
List<Map<String, Object>> fallback = sqlSession.selectList(NS + "get_multilang_fallback_translation_list", fallbackParams);
|
List<Map<String, Object>> fallback = sqlSession.selectList(NS + "getMultilangFallbackTranslationList", fallbackParams);
|
||||||
Set<String> fbProcessed = new HashSet<>();
|
Set<String> fbProcessed = new HashSet<>();
|
||||||
for (Map<String, Object> t : fallback) {
|
for (Map<String, Object> t : fallback) {
|
||||||
String key = str(t.get("lang_key"));
|
String key = str(t.get("lang_key"));
|
||||||
@@ -195,16 +195,16 @@ public class MultilangService extends BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<Map<String, Object>> getCategories() {
|
public List<Map<String, Object>> getCategories() {
|
||||||
List<Map<String, Object>> flat = sqlSession.selectList(NS + "get_multilang_category_list", new HashMap<>());
|
List<Map<String, Object>> flat = sqlSession.selectList(NS + "getMultilangCategoryList", new HashMap<>());
|
||||||
return buildCategoryTree(flat);
|
return buildCategoryTree(flat);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getCategoryById(int categoryId) {
|
public Map<String, Object> getCategoryById(int categoryId) {
|
||||||
return sqlSession.selectOne(NS + "get_multilang_category_info", Map.of("category_id", categoryId));
|
return sqlSession.selectOne(NS + "getMultilangCategoryInfo", Map.of("category_id", categoryId));
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Map<String, Object>> getCategoryPath(int categoryId) {
|
public List<Map<String, Object>> getCategoryPath(int categoryId) {
|
||||||
return sqlSession.selectList(NS + "get_multilang_category_path", Map.of("category_id", categoryId));
|
return sqlSession.selectList(NS + "getMultilangCategoryPath", Map.of("category_id", categoryId));
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Map<String, Object>> buildCategoryTree(List<Map<String, Object>> flat) {
|
private List<Map<String, Object>> buildCategoryTree(List<Map<String, Object>> flat) {
|
||||||
@@ -242,7 +242,7 @@ public class MultilangService extends BaseService {
|
|||||||
List<Map<String, Object>> categoryPath = getCategoryPath(categoryId);
|
List<Map<String, Object>> categoryPath = getCategoryPath(categoryId);
|
||||||
if (categoryPath.isEmpty()) throw new IllegalArgumentException("존재하지 않는 카테고리입니다");
|
if (categoryPath.isEmpty()) throw new IllegalArgumentException("존재하지 않는 카테고리입니다");
|
||||||
String langKey = buildLangKey(categoryPath, keyMeaning);
|
String langKey = buildLangKey(categoryPath, keyMeaning);
|
||||||
if (sqlSession.selectOne(NS + "get_multilang_key_by_company_and_key", Map.of("company_code", companyCode, "lang_key", langKey)) != null) {
|
if (sqlSession.selectOne(NS + "getMultilangKeyByCompanyAndKey", Map.of("company_code", companyCode, "lang_key", langKey)) != null) {
|
||||||
throw new IllegalArgumentException("이미 존재하는 키입니다: " + langKey);
|
throw new IllegalArgumentException("이미 존재하는 키입니다: " + langKey);
|
||||||
}
|
}
|
||||||
Map<String, Object> insertParams = new HashMap<>();
|
Map<String, Object> insertParams = new HashMap<>();
|
||||||
@@ -253,7 +253,7 @@ public class MultilangService extends BaseService {
|
|||||||
insertParams.put("usage_note", params.get("usage_note"));
|
insertParams.put("usage_note", params.get("usage_note"));
|
||||||
insertParams.put("description", params.get("usage_note"));
|
insertParams.put("description", params.get("usage_note"));
|
||||||
insertParams.put("created_by", params.getOrDefault("created_by", "system"));
|
insertParams.put("created_by", params.getOrDefault("created_by", "system"));
|
||||||
sqlSession.insert(NS + "insert_multilang_key_with_category", insertParams);
|
sqlSession.insert(NS + "insertMultilangKeyWithCategory", insertParams);
|
||||||
int keyId = toInt(insertParams.get("key_id"));
|
int keyId = toInt(insertParams.get("key_id"));
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
List<Map<String, Object>> texts = (List<Map<String, Object>>) params.get("texts");
|
List<Map<String, Object>> texts = (List<Map<String, Object>>) params.get("texts");
|
||||||
@@ -264,7 +264,7 @@ public class MultilangService extends BaseService {
|
|||||||
if (tp.get("is_active") == null) tp.put("is_active", "Y");
|
if (tp.get("is_active") == null) tp.put("is_active", "Y");
|
||||||
if (tp.get("created_by") == null) tp.put("created_by", params.getOrDefault("created_by", "system"));
|
if (tp.get("created_by") == null) tp.put("created_by", params.getOrDefault("created_by", "system"));
|
||||||
if (tp.get("updated_by") == null) tp.put("updated_by", params.getOrDefault("created_by", "system"));
|
if (tp.get("updated_by") == null) tp.put("updated_by", params.getOrDefault("created_by", "system"));
|
||||||
sqlSession.insert(NS + "insert_multilang_text", tp);
|
sqlSession.insert(NS + "insertMultilangText", tp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return keyId;
|
return keyId;
|
||||||
@@ -274,8 +274,8 @@ public class MultilangService extends BaseService {
|
|||||||
List<Map<String, Object>> categoryPath = getCategoryPath(categoryId);
|
List<Map<String, Object>> categoryPath = getCategoryPath(categoryId);
|
||||||
if (categoryPath.isEmpty()) throw new IllegalArgumentException("존재하지 않는 카테고리입니다");
|
if (categoryPath.isEmpty()) throw new IllegalArgumentException("존재하지 않는 카테고리입니다");
|
||||||
String langKey = buildLangKey(categoryPath, keyMeaning);
|
String langKey = buildLangKey(categoryPath, keyMeaning);
|
||||||
Map<String, Object> commonKey = sqlSession.selectOne(NS + "get_multilang_key_by_company_and_key", Map.of("company_code", "*", "lang_key", langKey));
|
Map<String, Object> commonKey = sqlSession.selectOne(NS + "getMultilangKeyByCompanyAndKey", Map.of("company_code", "*", "lang_key", langKey));
|
||||||
Map<String, Object> companyKey = sqlSession.selectOne(NS + "get_multilang_key_by_company_and_key", Map.of("company_code", companyCode, "lang_key", langKey));
|
Map<String, Object> companyKey = sqlSession.selectOne(NS + "getMultilangKeyByCompanyAndKey", Map.of("company_code", companyCode, "lang_key", langKey));
|
||||||
Map<String, Object> result = new LinkedHashMap<>();
|
Map<String, Object> result = new LinkedHashMap<>();
|
||||||
result.put("lang_key", langKey);
|
result.put("lang_key", langKey);
|
||||||
result.put("exists", companyKey != null);
|
result.put("exists", companyKey != null);
|
||||||
@@ -288,11 +288,11 @@ public class MultilangService extends BaseService {
|
|||||||
public int createOverrideKey(Map<String, Object> params) {
|
public int createOverrideKey(Map<String, Object> params) {
|
||||||
int baseKeyId = toInt(params.get("base_key_id"));
|
int baseKeyId = toInt(params.get("base_key_id"));
|
||||||
String companyCode = str(params.get("company_code"));
|
String companyCode = str(params.get("company_code"));
|
||||||
Map<String, Object> baseKey = sqlSession.selectOne(NS + "get_multilang_base_key_info", Map.of("key_id", baseKeyId));
|
Map<String, Object> baseKey = sqlSession.selectOne(NS + "getMultilangBaseKeyInfo", Map.of("key_id", baseKeyId));
|
||||||
if (baseKey == null) throw new IllegalArgumentException("원본 키를 찾을 수 없습니다");
|
if (baseKey == null) throw new IllegalArgumentException("원본 키를 찾을 수 없습니다");
|
||||||
if (!"*".equals(str(baseKey.get("company_code")))) throw new IllegalArgumentException("공통 키(*)만 오버라이드 할 수 있습니다");
|
if (!"*".equals(str(baseKey.get("company_code")))) throw new IllegalArgumentException("공통 키(*)만 오버라이드 할 수 있습니다");
|
||||||
String langKey = str(baseKey.get("lang_key"));
|
String langKey = str(baseKey.get("lang_key"));
|
||||||
if (sqlSession.selectOne(NS + "get_multilang_key_by_company_and_key", Map.of("company_code", companyCode, "lang_key", langKey)) != null) {
|
if (sqlSession.selectOne(NS + "getMultilangKeyByCompanyAndKey", Map.of("company_code", companyCode, "lang_key", langKey)) != null) {
|
||||||
throw new IllegalArgumentException("이미 해당 회사의 오버라이드 키가 존재합니다");
|
throw new IllegalArgumentException("이미 해당 회사의 오버라이드 키가 존재합니다");
|
||||||
}
|
}
|
||||||
Map<String, Object> insertParams = new HashMap<>();
|
Map<String, Object> insertParams = new HashMap<>();
|
||||||
@@ -302,7 +302,7 @@ public class MultilangService extends BaseService {
|
|||||||
insertParams.put("key_meaning", baseKey.get("key_meaning"));
|
insertParams.put("key_meaning", baseKey.get("key_meaning"));
|
||||||
insertParams.put("base_key_id", baseKeyId);
|
insertParams.put("base_key_id", baseKeyId);
|
||||||
insertParams.put("created_by", params.getOrDefault("created_by", "system"));
|
insertParams.put("created_by", params.getOrDefault("created_by", "system"));
|
||||||
sqlSession.insert(NS + "insert_multilang_override_key", insertParams);
|
sqlSession.insert(NS + "insertMultilangOverrideKey", insertParams);
|
||||||
int keyId = toInt(insertParams.get("key_id"));
|
int keyId = toInt(insertParams.get("key_id"));
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
List<Map<String, Object>> texts = (List<Map<String, Object>>) params.get("texts");
|
List<Map<String, Object>> texts = (List<Map<String, Object>>) params.get("texts");
|
||||||
@@ -313,27 +313,27 @@ public class MultilangService extends BaseService {
|
|||||||
if (tp.get("is_active") == null) tp.put("is_active", "Y");
|
if (tp.get("is_active") == null) tp.put("is_active", "Y");
|
||||||
if (tp.get("created_by") == null) tp.put("created_by", params.getOrDefault("created_by", "system"));
|
if (tp.get("created_by") == null) tp.put("created_by", params.getOrDefault("created_by", "system"));
|
||||||
if (tp.get("updated_by") == null) tp.put("updated_by", params.getOrDefault("created_by", "system"));
|
if (tp.get("updated_by") == null) tp.put("updated_by", params.getOrDefault("created_by", "system"));
|
||||||
sqlSession.insert(NS + "insert_multilang_text", tp);
|
sqlSession.insert(NS + "insertMultilangText", tp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return keyId;
|
return keyId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Map<String, Object>> getOverrideKeys(String companyCode) {
|
public List<Map<String, Object>> getOverrideKeys(String companyCode) {
|
||||||
return sqlSession.selectList(NS + "get_multilang_override_key_list", Map.of("company_code", companyCode));
|
return sqlSession.selectList(NS + "getMultilangOverrideKeyList", Map.of("company_code", companyCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public List<Map<String, Object>> generateScreenLabelKeys(Map<String, Object> params) {
|
public List<Map<String, Object>> generateScreenLabelKeys(Map<String, Object> params) {
|
||||||
int screenId = toInt(params.get("screen_id"));
|
int screenId = toInt(params.get("screen_id"));
|
||||||
Map<String, Object> screenInfo = sqlSession.selectOne(NS + "get_multilang_screen_company_code", Map.of("screen_id", screenId));
|
Map<String, Object> screenInfo = sqlSession.selectOne(NS + "getMultilangScreenCompanyCode", Map.of("screen_id", screenId));
|
||||||
String companyCode = (screenInfo != null && !str(screenInfo.get("company_code")).isEmpty())
|
String companyCode = (screenInfo != null && !str(screenInfo.get("company_code")).isEmpty())
|
||||||
? str(screenInfo.get("company_code")) : str(params.getOrDefault("company_code", "*"));
|
? str(screenInfo.get("company_code")) : str(params.getOrDefault("company_code", "*"));
|
||||||
String companyName;
|
String companyName;
|
||||||
if ("*".equals(companyCode)) {
|
if ("*".equals(companyCode)) {
|
||||||
companyName = "공통";
|
companyName = "공통";
|
||||||
} else {
|
} else {
|
||||||
Map<String, Object> companyInfo = sqlSession.selectOne(NS + "get_multilang_company_name", Map.of("company_code", companyCode));
|
Map<String, Object> companyInfo = sqlSession.selectOne(NS + "getMultilangCompanyName", Map.of("company_code", companyCode));
|
||||||
companyName = (companyInfo != null) ? str(companyInfo.get("company_name")) : companyCode;
|
companyName = (companyInfo != null) ? str(companyInfo.get("company_name")) : companyCode;
|
||||||
}
|
}
|
||||||
List<String> groupPath = getScreenGroupPath(screenId);
|
List<String> groupPath = getScreenGroupPath(screenId);
|
||||||
@@ -351,7 +351,7 @@ public class MultilangService extends BaseService {
|
|||||||
List<String> parts = new ArrayList<>(keyPrefixParts);
|
List<String> parts = new ArrayList<>(keyPrefixParts);
|
||||||
parts.add(keyMeaning);
|
parts.add(keyMeaning);
|
||||||
String langKey = String.join(".", parts);
|
String langKey = String.join(".", parts);
|
||||||
Map<String, Object> existing = sqlSession.selectOne(NS + "get_multilang_key_by_company_and_key", Map.of("company_code", companyCode, "lang_key", langKey));
|
Map<String, Object> existing = sqlSession.selectOne(NS + "getMultilangKeyByCompanyAndKey", Map.of("company_code", companyCode, "lang_key", langKey));
|
||||||
int keyId;
|
int keyId;
|
||||||
if (existing != null) {
|
if (existing != null) {
|
||||||
keyId = toInt(existing.get("key_id"));
|
keyId = toInt(existing.get("key_id"));
|
||||||
@@ -363,9 +363,9 @@ public class MultilangService extends BaseService {
|
|||||||
insertParams.put("is_active", "Y");
|
insertParams.put("is_active", "Y");
|
||||||
insertParams.put("category_id", categoryId);
|
insertParams.put("category_id", categoryId);
|
||||||
insertParams.put("key_meaning", keyMeaning);
|
insertParams.put("key_meaning", keyMeaning);
|
||||||
sqlSession.insert(NS + "insert_multilang_key_with_category", insertParams);
|
sqlSession.insert(NS + "insertMultilangKeyWithCategory", insertParams);
|
||||||
keyId = toInt(insertParams.get("key_id"));
|
keyId = toInt(insertParams.get("key_id"));
|
||||||
sqlSession.update(NS + "upsert_multilang_text", Map.of("key_id", keyId, "lang_code", "KR", "lang_text", label));
|
sqlSession.update(NS + "upsertMultilangText", Map.of("key_id", keyId, "lang_code", "KR", "lang_text", label));
|
||||||
}
|
}
|
||||||
Map<String, Object> entry = new LinkedHashMap<>();
|
Map<String, Object> entry = new LinkedHashMap<>();
|
||||||
entry.put("component_id", componentId);
|
entry.put("component_id", componentId);
|
||||||
@@ -377,10 +377,10 @@ public class MultilangService extends BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private List<String> getScreenGroupPath(int screenId) {
|
private List<String> getScreenGroupPath(int screenId) {
|
||||||
Map<String, Object> groupRow = sqlSession.selectOne(NS + "get_multilang_screen_group_id", Map.of("screen_id", screenId));
|
Map<String, Object> groupRow = sqlSession.selectOne(NS + "getMultilangScreenGroupId", Map.of("screen_id", screenId));
|
||||||
if (groupRow == null) return Collections.emptyList();
|
if (groupRow == null) return Collections.emptyList();
|
||||||
int groupId = toInt(groupRow.get("group_id"));
|
int groupId = toInt(groupRow.get("group_id"));
|
||||||
List<Map<String, Object>> groups = sqlSession.selectList(NS + "get_multilang_screen_group_path", Map.of("group_id", groupId));
|
List<Map<String, Object>> groups = sqlSession.selectList(NS + "getMultilangScreenGroupPath", Map.of("group_id", groupId));
|
||||||
List<String> path = new ArrayList<>();
|
List<String> path = new ArrayList<>();
|
||||||
for (Map<String, Object> g : groups) path.add(str(g.get("group_name")));
|
for (Map<String, Object> g : groups) path.add(str(g.get("group_name")));
|
||||||
return path;
|
return path;
|
||||||
@@ -391,7 +391,7 @@ public class MultilangService extends BaseService {
|
|||||||
int parentId = ensureCompanyCategory(companyCode, companyName);
|
int parentId = ensureCompanyCategory(companyCode, companyName);
|
||||||
int currentLevel = 3;
|
int currentLevel = 3;
|
||||||
for (String groupName : groupPath) {
|
for (String groupName : groupPath) {
|
||||||
Map<String, Object> existing = sqlSession.selectOne(NS + "get_multilang_category_by_name_and_parent", Map.of("category_name", groupName, "parent_id", parentId));
|
Map<String, Object> existing = sqlSession.selectOne(NS + "getMultilangCategoryByNameAndParent", Map.of("category_name", groupName, "parent_id", parentId));
|
||||||
if (existing != null) {
|
if (existing != null) {
|
||||||
parentId = toInt(existing.get("category_id"));
|
parentId = toInt(existing.get("category_id"));
|
||||||
} else {
|
} else {
|
||||||
@@ -403,7 +403,7 @@ public class MultilangService extends BaseService {
|
|||||||
insertParams.put("key_prefix", groupName.toLowerCase().replace("\\s+", "_"));
|
insertParams.put("key_prefix", groupName.toLowerCase().replace("\\s+", "_"));
|
||||||
insertParams.put("description", groupName + " 화면 그룹의 다국어");
|
insertParams.put("description", groupName + " 화면 그룹의 다국어");
|
||||||
insertParams.put("sort_order", 0);
|
insertParams.put("sort_order", 0);
|
||||||
sqlSession.insert(NS + "insert_multilang_category", insertParams);
|
sqlSession.insert(NS + "insertMultilangCategory", insertParams);
|
||||||
parentId = toInt(insertParams.get("category_id"));
|
parentId = toInt(insertParams.get("category_id"));
|
||||||
}
|
}
|
||||||
currentLevel++;
|
currentLevel++;
|
||||||
@@ -413,7 +413,7 @@ public class MultilangService extends BaseService {
|
|||||||
|
|
||||||
private int ensureCompanyCategory(String companyCode, String companyName) {
|
private int ensureCompanyCategory(String companyCode, String companyName) {
|
||||||
int screenRootId = ensureScreenRootCategory();
|
int screenRootId = ensureScreenRootCategory();
|
||||||
Map<String, Object> existing = sqlSession.selectOne(NS + "get_multilang_category_by_code_and_parent", Map.of("category_code", companyCode, "parent_id", screenRootId));
|
Map<String, Object> existing = sqlSession.selectOne(NS + "getMultilangCategoryByCodeAndParent", Map.of("category_code", companyCode, "parent_id", screenRootId));
|
||||||
if (existing != null) return toInt(existing.get("category_id"));
|
if (existing != null) return toInt(existing.get("category_id"));
|
||||||
String displayName = "*".equals(companyCode) ? "공통" : companyName;
|
String displayName = "*".equals(companyCode) ? "공통" : companyName;
|
||||||
String keyPrefix = "*".equals(companyCode) ? "common" : companyCode.toLowerCase();
|
String keyPrefix = "*".equals(companyCode) ? "common" : companyCode.toLowerCase();
|
||||||
@@ -425,12 +425,12 @@ public class MultilangService extends BaseService {
|
|||||||
insertParams.put("key_prefix", keyPrefix);
|
insertParams.put("key_prefix", keyPrefix);
|
||||||
insertParams.put("description", displayName + " 회사의 화면 다국어");
|
insertParams.put("description", displayName + " 회사의 화면 다국어");
|
||||||
insertParams.put("sort_order", "*".equals(companyCode) ? 0 : 10);
|
insertParams.put("sort_order", "*".equals(companyCode) ? 0 : 10);
|
||||||
sqlSession.insert(NS + "insert_multilang_category", insertParams);
|
sqlSession.insert(NS + "insertMultilangCategory", insertParams);
|
||||||
return toInt(insertParams.get("category_id"));
|
return toInt(insertParams.get("category_id"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private int ensureScreenRootCategory() {
|
private int ensureScreenRootCategory() {
|
||||||
Map<String, Object> existing = sqlSession.selectOne(NS + "get_multilang_root_category_by_code", Map.of("category_code", "screen"));
|
Map<String, Object> existing = sqlSession.selectOne(NS + "getMultilangRootCategoryByCode", Map.of("category_code", "screen"));
|
||||||
if (existing != null) return toInt(existing.get("category_id"));
|
if (existing != null) return toInt(existing.get("category_id"));
|
||||||
Map<String, Object> insertParams = new HashMap<>();
|
Map<String, Object> insertParams = new HashMap<>();
|
||||||
insertParams.put("category_code", "screen");
|
insertParams.put("category_code", "screen");
|
||||||
@@ -440,7 +440,7 @@ public class MultilangService extends BaseService {
|
|||||||
insertParams.put("key_prefix", "screen");
|
insertParams.put("key_prefix", "screen");
|
||||||
insertParams.put("description", "화면 디자이너에서 자동 생성된 다국어 키");
|
insertParams.put("description", "화면 디자이너에서 자동 생성된 다국어 키");
|
||||||
insertParams.put("sort_order", 100);
|
insertParams.put("sort_order", 100);
|
||||||
sqlSession.insert(NS + "insert_multilang_category", insertParams);
|
sqlSession.insert(NS + "insertMultilangCategory", insertParams);
|
||||||
return toInt(insertParams.get("category_id"));
|
return toInt(insertParams.get("category_id"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class NumberingRuleService extends BaseService {
|
|||||||
public List<Map<String, Object>> getRuleList(String companyCode) {
|
public List<Map<String, Object>> getRuleList(String companyCode) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
List<Map<String, Object>> rules = sqlSession.selectList(NS + "get_rule_list", params);
|
List<Map<String, Object>> rules = sqlSession.selectList(NS + "getRuleList", params);
|
||||||
loadPartsForRules(rules, companyCode);
|
loadPartsForRules(rules, companyCode);
|
||||||
return rules;
|
return rules;
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ public class NumberingRuleService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("rule_id", ruleId);
|
params.put("rule_id", ruleId);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
Map<String, Object> rule = sqlSession.selectOne(NS + "get_rule_by_id", params);
|
Map<String, Object> rule = sqlSession.selectOne(NS + "getRuleById", params);
|
||||||
if (rule == null) return null;
|
if (rule == null) return null;
|
||||||
loadPartsForRule(rule, companyCode);
|
loadPartsForRule(rule, companyCode);
|
||||||
return rule;
|
return rule;
|
||||||
@@ -63,7 +63,7 @@ public class NumberingRuleService extends BaseService {
|
|||||||
params.put("category_value_id", body.get("category_value_id"));
|
params.put("category_value_id", body.get("category_value_id"));
|
||||||
params.put("created_by", body.get("user_id"));
|
params.put("created_by", body.get("user_id"));
|
||||||
|
|
||||||
sqlSession.insert(NS + "insert_rule", params);
|
sqlSession.insert(NS + "insertRule", params);
|
||||||
|
|
||||||
// parts 삽입
|
// parts 삽입
|
||||||
Object partsObj = body.get("parts");
|
Object partsObj = body.get("parts");
|
||||||
@@ -82,7 +82,7 @@ public class NumberingRuleService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>(body);
|
Map<String, Object> params = new HashMap<>(body);
|
||||||
params.put("rule_id", ruleId);
|
params.put("rule_id", ruleId);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
int updated = sqlSession.update(NS + "update_rule", params);
|
int updated = sqlSession.update(NS + "updateRule", params);
|
||||||
if (updated == 0) throw new RuntimeException("규칙을 찾을 수 없거나 권한이 없습니다");
|
if (updated == 0) throw new RuntimeException("규칙을 찾을 수 없거나 권한이 없습니다");
|
||||||
|
|
||||||
// parts 교체 (있는 경우)
|
// parts 교체 (있는 경우)
|
||||||
@@ -91,7 +91,7 @@ public class NumberingRuleService extends BaseService {
|
|||||||
Map<String, Object> delParams = new HashMap<>();
|
Map<String, Object> delParams = new HashMap<>();
|
||||||
delParams.put("rule_id", ruleId);
|
delParams.put("rule_id", ruleId);
|
||||||
delParams.put("company_code", companyCode);
|
delParams.put("company_code", companyCode);
|
||||||
sqlSession.delete(NS + "delete_rule_parts_by_rule_id", delParams);
|
sqlSession.delete(NS + "deleteRulePartsByRuleId", delParams);
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
List<Map<String, Object>> parts = (List<Map<String, Object>>) partsObj;
|
List<Map<String, Object>> parts = (List<Map<String, Object>>) partsObj;
|
||||||
@@ -108,9 +108,9 @@ public class NumberingRuleService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("rule_id", ruleId);
|
params.put("rule_id", ruleId);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
sqlSession.delete(NS + "delete_rule_parts_by_rule_id", params);
|
sqlSession.delete(NS + "deleteRulePartsByRuleId", params);
|
||||||
sqlSession.delete(NS + "delete_sequences_by_rule_id", params);
|
sqlSession.delete(NS + "deleteSequencesByRuleId", params);
|
||||||
int deleted = sqlSession.delete(NS + "delete_rule", params);
|
int deleted = sqlSession.delete(NS + "deleteRule", params);
|
||||||
if (deleted == 0) throw new RuntimeException("규칙을 찾을 수 없거나 권한이 없습니다");
|
if (deleted == 0) throw new RuntimeException("규칙을 찾을 수 없거나 권한이 없습니다");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,7 +172,7 @@ public class NumberingRuleService extends BaseService {
|
|||||||
seqParams.put("rule_id", ruleId);
|
seqParams.put("rule_id", ruleId);
|
||||||
seqParams.put("company_code", companyCode);
|
seqParams.put("company_code", companyCode);
|
||||||
seqParams.put("current_sequence", allocatedSequence);
|
seqParams.put("current_sequence", allocatedSequence);
|
||||||
sqlSession.update(NS + "update_current_sequence_in_rule", seqParams);
|
sqlSession.update(NS + "updateCurrentSequenceInRule", seqParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 수동 파트 값 적용
|
// 수동 파트 값 적용
|
||||||
@@ -196,8 +196,8 @@ public class NumberingRuleService extends BaseService {
|
|||||||
params.put("rule_id", ruleId);
|
params.put("rule_id", ruleId);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
params.put("current_sequence", 0);
|
params.put("current_sequence", 0);
|
||||||
sqlSession.delete(NS + "delete_sequences_by_rule_id", params);
|
sqlSession.delete(NS + "deleteSequencesByRuleId", params);
|
||||||
sqlSession.update(NS + "update_current_sequence_in_rule", params);
|
sqlSession.update(NS + "updateCurrentSequenceInRule", params);
|
||||||
log.info("시퀀스 초기화 완료: ruleId={}, companyCode={}", ruleId, companyCode);
|
log.info("시퀀스 초기화 완료: ruleId={}, companyCode={}", ruleId, companyCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,11 +206,11 @@ public class NumberingRuleService extends BaseService {
|
|||||||
// ================================================================
|
// ================================================================
|
||||||
|
|
||||||
/** GET /available/:menuObjid? → 메뉴별 사용 가능한 규칙 목록 */
|
/** GET /available/:menuObjid? → 메뉴별 사용 가능한 규칙 목록 */
|
||||||
public List<Map<String, Object>> getAvailableRulesForMenu(String companyCode, Integer menuObjid) {
|
public List<Map<String, Object>> getAvailableRulesForMenu(String companyCode, String menuObjid) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
if (menuObjid != null) params.put("menu_objid", menuObjid);
|
if (menuObjid != null) params.put("menu_objid", menuObjid);
|
||||||
List<Map<String, Object>> rules = sqlSession.selectList(NS + "get_available_rules_for_menu", params);
|
List<Map<String, Object>> rules = sqlSession.selectList(NS + "getAvailableRulesForMenu", params);
|
||||||
loadPartsForRules(rules, companyCode);
|
loadPartsForRules(rules, companyCode);
|
||||||
return rules;
|
return rules;
|
||||||
}
|
}
|
||||||
@@ -220,7 +220,7 @@ public class NumberingRuleService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
List<Map<String, Object>> rules = sqlSession.selectList(NS + "get_available_rules_for_screen", params);
|
List<Map<String, Object>> rules = sqlSession.selectList(NS + "getAvailableRulesForScreen", params);
|
||||||
loadPartsForRules(rules, companyCode);
|
loadPartsForRules(rules, companyCode);
|
||||||
return rules;
|
return rules;
|
||||||
}
|
}
|
||||||
@@ -238,18 +238,18 @@ public class NumberingRuleService extends BaseService {
|
|||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
params.put("column_name", columnName);
|
params.put("column_name", columnName);
|
||||||
|
|
||||||
Map<String, Object> rule = sqlSession.selectOne(NS + "get_rule_by_column", params);
|
Map<String, Object> rule = sqlSession.selectOne(NS + "getRuleByColumn", params);
|
||||||
|
|
||||||
// fallback: column_name이 비어있는 레거시 규칙
|
// fallback: column_name이 비어있는 레거시 규칙
|
||||||
if (rule == null) {
|
if (rule == null) {
|
||||||
rule = sqlSession.selectOne(NS + "get_rule_by_column_fallback", params);
|
rule = sqlSession.selectOne(NS + "getRuleByColumnFallback", params);
|
||||||
if (rule != null) {
|
if (rule != null) {
|
||||||
// column_name 자동 업데이트 (레거시 마이그레이션)
|
// column_name 자동 업데이트 (레거시 마이그레이션)
|
||||||
Map<String, Object> upParams = new HashMap<>();
|
Map<String, Object> upParams = new HashMap<>();
|
||||||
upParams.put("rule_id", rule.get("rule_id"));
|
upParams.put("rule_id", rule.get("rule_id"));
|
||||||
upParams.put("company_code", companyCode);
|
upParams.put("company_code", companyCode);
|
||||||
upParams.put("column_name", columnName);
|
upParams.put("column_name", columnName);
|
||||||
sqlSession.update(NS + "update_rule_column_name", upParams);
|
sqlSession.update(NS + "updateRuleColumnName", upParams);
|
||||||
rule.put("column_name", columnName);
|
rule.put("column_name", columnName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -265,7 +265,7 @@ public class NumberingRuleService extends BaseService {
|
|||||||
// ================================================================
|
// ================================================================
|
||||||
|
|
||||||
/** GET /test/list/:menuObjid? → 테스트용 규칙 목록 */
|
/** GET /test/list/:menuObjid? → 테스트용 규칙 목록 */
|
||||||
public List<Map<String, Object>> getRulesFromTest(String companyCode, Integer menuObjid) {
|
public List<Map<String, Object>> getRulesFromTest(String companyCode, String menuObjid) {
|
||||||
return getAvailableRulesForMenu(companyCode, menuObjid);
|
return getAvailableRulesForMenu(companyCode, menuObjid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -277,17 +277,17 @@ public class NumberingRuleService extends BaseService {
|
|||||||
Map<String, Object> lookupParams = new HashMap<>();
|
Map<String, Object> lookupParams = new HashMap<>();
|
||||||
lookupParams.put("rule_id", ruleId);
|
lookupParams.put("rule_id", ruleId);
|
||||||
lookupParams.put("company_code", companyCode);
|
lookupParams.put("company_code", companyCode);
|
||||||
Map<String, Object> existing = sqlSession.selectOne(NS + "get_rule_by_id", lookupParams);
|
Map<String, Object> existing = sqlSession.selectOne(NS + "getRuleById", lookupParams);
|
||||||
|
|
||||||
if (existing != null) {
|
if (existing != null) {
|
||||||
// 업데이트
|
// 업데이트
|
||||||
Map<String, Object> upParams = new HashMap<>(body);
|
Map<String, Object> upParams = new HashMap<>(body);
|
||||||
upParams.put("rule_id", ruleId);
|
upParams.put("rule_id", ruleId);
|
||||||
upParams.put("company_code", companyCode);
|
upParams.put("company_code", companyCode);
|
||||||
sqlSession.update(NS + "update_rule", upParams);
|
sqlSession.update(NS + "updateRule", upParams);
|
||||||
|
|
||||||
// parts 교체
|
// parts 교체
|
||||||
sqlSession.delete(NS + "delete_rule_parts_by_rule_id", lookupParams);
|
sqlSession.delete(NS + "deleteRulePartsByRuleId", lookupParams);
|
||||||
} else {
|
} else {
|
||||||
// 신규 등록
|
// 신규 등록
|
||||||
createRule(body, companyCode);
|
createRule(body, companyCode);
|
||||||
@@ -320,7 +320,7 @@ public class NumberingRuleService extends BaseService {
|
|||||||
String targetCompanyCode) {
|
String targetCompanyCode) {
|
||||||
Map<String, Object> srcParams = new HashMap<>();
|
Map<String, Object> srcParams = new HashMap<>();
|
||||||
srcParams.put("company_code", sourceCompanyCode);
|
srcParams.put("company_code", sourceCompanyCode);
|
||||||
List<Map<String, Object>> sourceRules = sqlSession.selectList(NS + "get_rules_for_copy", srcParams);
|
List<Map<String, Object>> sourceRules = sqlSession.selectList(NS + "getRulesForCopy", srcParams);
|
||||||
|
|
||||||
int copied = 0;
|
int copied = 0;
|
||||||
int skipped = 0;
|
int skipped = 0;
|
||||||
@@ -332,7 +332,7 @@ public class NumberingRuleService extends BaseService {
|
|||||||
Map<String, Object> checkParams = new HashMap<>();
|
Map<String, Object> checkParams = new HashMap<>();
|
||||||
checkParams.put("rule_id", ruleId);
|
checkParams.put("rule_id", ruleId);
|
||||||
checkParams.put("company_code", targetCompanyCode);
|
checkParams.put("company_code", targetCompanyCode);
|
||||||
Map<String, Object> existing = sqlSession.selectOne(NS + "get_rule_by_id", checkParams);
|
Map<String, Object> existing = sqlSession.selectOne(NS + "getRuleById", checkParams);
|
||||||
|
|
||||||
if (existing != null) {
|
if (existing != null) {
|
||||||
skipped++;
|
skipped++;
|
||||||
@@ -344,13 +344,13 @@ public class NumberingRuleService extends BaseService {
|
|||||||
insertParams.put("company_code", targetCompanyCode);
|
insertParams.put("company_code", targetCompanyCode);
|
||||||
insertParams.put("current_sequence", 0);
|
insertParams.put("current_sequence", 0);
|
||||||
insertParams.put("created_by", "system");
|
insertParams.put("created_by", "system");
|
||||||
sqlSession.insert(NS + "insert_rule", insertParams);
|
sqlSession.insert(NS + "insertRule", insertParams);
|
||||||
|
|
||||||
// parts 복사
|
// parts 복사
|
||||||
Map<String, Object> partsParams = new HashMap<>();
|
Map<String, Object> partsParams = new HashMap<>();
|
||||||
partsParams.put("rule_id", ruleId);
|
partsParams.put("rule_id", ruleId);
|
||||||
partsParams.put("company_code", sourceCompanyCode);
|
partsParams.put("company_code", sourceCompanyCode);
|
||||||
List<Map<String, Object>> parts = sqlSession.selectList(NS + "get_rule_parts_for_copy", partsParams);
|
List<Map<String, Object>> parts = sqlSession.selectList(NS + "getRulePartsForCopy", partsParams);
|
||||||
insertParts(parts, ruleId, targetCompanyCode);
|
insertParts(parts, ruleId, targetCompanyCode);
|
||||||
|
|
||||||
copied++;
|
copied++;
|
||||||
@@ -382,7 +382,7 @@ public class NumberingRuleService extends BaseService {
|
|||||||
Map<String, Object> manualConfig = parseAutoConfig(part.get("manual_config"));
|
Map<String, Object> manualConfig = parseAutoConfig(part.get("manual_config"));
|
||||||
partParams.put("manual_config", toJsonString(manualConfig));
|
partParams.put("manual_config", toJsonString(manualConfig));
|
||||||
|
|
||||||
sqlSession.insert(NS + "insert_rule_part", partParams);
|
sqlSession.insert(NS + "insertRulePart", partParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -397,7 +397,7 @@ public class NumberingRuleService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("rule_id", ruleId);
|
params.put("rule_id", ruleId);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
List<Map<String, Object>> parts = sqlSession.selectList(NS + "get_rule_parts_by_rule_id", params);
|
List<Map<String, Object>> parts = sqlSession.selectList(NS + "getRulePartsByRuleId", params);
|
||||||
// autoConfig에서 separatorAfter 추출
|
// autoConfig에서 separatorAfter 추출
|
||||||
for (Map<String, Object> part : parts) {
|
for (Map<String, Object> part : parts) {
|
||||||
Map<String, Object> ac = parseAutoConfig(part.get("auto_config"));
|
Map<String, Object> ac = parseAutoConfig(part.get("auto_config"));
|
||||||
@@ -420,7 +420,7 @@ public class NumberingRuleService extends BaseService {
|
|||||||
params.put("rule_id", ruleId);
|
params.put("rule_id", ruleId);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
params.put("prefix_key", prefixKey);
|
params.put("prefix_key", prefixKey);
|
||||||
Map<String, Object> row = sqlSession.selectOne(NS + "get_sequence_for_prefix", params);
|
Map<String, Object> row = sqlSession.selectOne(NS + "getSequenceForPrefix", params);
|
||||||
if (row == null) return 0L;
|
if (row == null) return 0L;
|
||||||
Object seq = row.get("current_sequence");
|
Object seq = row.get("current_sequence");
|
||||||
return seq == null ? 0L : ((Number) seq).longValue();
|
return seq == null ? 0L : ((Number) seq).longValue();
|
||||||
|
|||||||
@@ -22,28 +22,28 @@ public class PackagingService extends BaseService {
|
|||||||
|
|
||||||
public List<Map<String, Object>> getPkgUnits(Map<String, Object> params) {
|
public List<Map<String, Object>> getPkgUnits(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectList(NS + "get_pkg_units", params);
|
return sqlSession.selectList(NS + "getPkgUnits", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> createPkgUnit(Map<String, Object> params) {
|
public Map<String, Object> createPkgUnit(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.insert(NS + "insert_pkg_unit", params);
|
sqlSession.insert(NS + "insertPkgUnit", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> updatePkgUnit(Map<String, Object> params) {
|
public Map<String, Object> updatePkgUnit(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.update(NS + "update_pkg_unit", params);
|
sqlSession.update(NS + "updatePkgUnit", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> deletePkgUnit(Map<String, Object> params) {
|
public Map<String, Object> deletePkgUnit(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.delete(NS + "delete_pkg_unit_items_by_unit_id", params);
|
sqlSession.delete(NS + "deletePkgUnitItemsByUnitId", params);
|
||||||
sqlSession.delete(NS + "delete_pkg_unit", params);
|
sqlSession.delete(NS + "deletePkgUnit", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,20 +51,20 @@ public class PackagingService extends BaseService {
|
|||||||
|
|
||||||
public List<Map<String, Object>> getPkgUnitItems(Map<String, Object> params) {
|
public List<Map<String, Object>> getPkgUnitItems(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectList(NS + "get_pkg_unit_items", params);
|
return sqlSession.selectList(NS + "getPkgUnitItems", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> createPkgUnitItem(Map<String, Object> params) {
|
public Map<String, Object> createPkgUnitItem(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.insert(NS + "insert_pkg_unit_item", params);
|
sqlSession.insert(NS + "insertPkgUnitItem", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> deletePkgUnitItem(Map<String, Object> params) {
|
public Map<String, Object> deletePkgUnitItem(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.delete(NS + "delete_pkg_unit_item", params);
|
sqlSession.delete(NS + "deletePkgUnitItem", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,28 +72,28 @@ public class PackagingService extends BaseService {
|
|||||||
|
|
||||||
public List<Map<String, Object>> getLoadingUnits(Map<String, Object> params) {
|
public List<Map<String, Object>> getLoadingUnits(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectList(NS + "get_loading_units", params);
|
return sqlSession.selectList(NS + "getLoadingUnits", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> createLoadingUnit(Map<String, Object> params) {
|
public Map<String, Object> createLoadingUnit(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.insert(NS + "insert_loading_unit", params);
|
sqlSession.insert(NS + "insertLoadingUnit", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> updateLoadingUnit(Map<String, Object> params) {
|
public Map<String, Object> updateLoadingUnit(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.update(NS + "update_loading_unit", params);
|
sqlSession.update(NS + "updateLoadingUnit", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> deleteLoadingUnit(Map<String, Object> params) {
|
public Map<String, Object> deleteLoadingUnit(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.delete(NS + "delete_loading_unit_pkgs_by_unit_id", params);
|
sqlSession.delete(NS + "deleteLoadingUnitPkgsByUnitId", params);
|
||||||
sqlSession.delete(NS + "delete_loading_unit", params);
|
sqlSession.delete(NS + "deleteLoadingUnit", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,20 +101,20 @@ public class PackagingService extends BaseService {
|
|||||||
|
|
||||||
public List<Map<String, Object>> getLoadingUnitPkgs(Map<String, Object> params) {
|
public List<Map<String, Object>> getLoadingUnitPkgs(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectList(NS + "get_loading_unit_pkgs", params);
|
return sqlSession.selectList(NS + "getLoadingUnitPkgs", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> createLoadingUnitPkg(Map<String, Object> params) {
|
public Map<String, Object> createLoadingUnitPkg(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.insert(NS + "insert_loading_unit_pkg", params);
|
sqlSession.insert(NS + "insertLoadingUnitPkg", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> deleteLoadingUnitPkg(Map<String, Object> params) {
|
public Map<String, Object> deleteLoadingUnitPkg(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.delete(NS + "delete_loading_unit_pkg", params);
|
sqlSession.delete(NS + "deleteLoadingUnitPkg", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,80 +19,80 @@ public class ProcessWorkStandardService extends BaseService {
|
|||||||
public Map<String, Object> getProcessWorkStandardItemList(Map<String, Object> params) {
|
public Map<String, Object> getProcessWorkStandardItemList(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
commonService.applyPagination(params);
|
commonService.applyPagination(params);
|
||||||
Integer totalObj = sqlSession.selectOne(NS + "get_process_work_standard_item_list_cnt", params);
|
Integer totalObj = sqlSession.selectOne(NS + "getProcessWorkStandardItemListCnt", params);
|
||||||
int totalCount = totalObj != null ? totalObj : 0;
|
int totalCount = totalObj != null ? totalObj : 0;
|
||||||
List<Map<String, Object>> list = sqlSession.selectList(NS + "get_process_work_standard_item_list", params);
|
List<Map<String, Object>> list = sqlSession.selectList(NS + "getProcessWorkStandardItemList", params);
|
||||||
return commonService.buildListResponse(list, totalCount, params);
|
return commonService.buildListResponse(list, totalCount, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Map<String, Object>> getProcessWorkStandardRoutingList(Map<String, Object> params) {
|
public List<Map<String, Object>> getProcessWorkStandardRoutingList(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectList(NS + "get_process_work_standard_routing_list", params);
|
return sqlSession.selectList(NS + "getProcessWorkStandardRoutingList", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> setProcessWorkStandardDefaultVersion(Map<String, Object> params) {
|
public Map<String, Object> setProcessWorkStandardDefaultVersion(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.update(NS + "set_process_work_standard_default_version", params);
|
sqlSession.update(NS + "setProcessWorkStandardDefaultVersion", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> unsetProcessWorkStandardDefaultVersion(Map<String, Object> params) {
|
public Map<String, Object> unsetProcessWorkStandardDefaultVersion(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.update(NS + "unset_process_work_standard_default_version", params);
|
sqlSession.update(NS + "unsetProcessWorkStandardDefaultVersion", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Map<String, Object>> getProcessWorkStandardWorkItemList(Map<String, Object> params) {
|
public List<Map<String, Object>> getProcessWorkStandardWorkItemList(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectList(NS + "get_process_work_standard_work_item_list", params);
|
return sqlSession.selectList(NS + "getProcessWorkStandardWorkItemList", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> insertProcessWorkStandardWorkItem(Map<String, Object> params) {
|
public Map<String, Object> insertProcessWorkStandardWorkItem(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.insert(NS + "insert_process_work_standard_work_item", params);
|
sqlSession.insert(NS + "insertProcessWorkStandardWorkItem", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> updateProcessWorkStandardWorkItem(Map<String, Object> params) {
|
public Map<String, Object> updateProcessWorkStandardWorkItem(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.update(NS + "update_process_work_standard_work_item", params);
|
sqlSession.update(NS + "updateProcessWorkStandardWorkItem", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> deleteProcessWorkStandardWorkItem(Map<String, Object> params) {
|
public Map<String, Object> deleteProcessWorkStandardWorkItem(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.delete(NS + "delete_process_work_standard_work_item", params);
|
sqlSession.delete(NS + "deleteProcessWorkStandardWorkItem", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Map<String, Object>> getProcessWorkStandardWorkItemDetailList(Map<String, Object> params) {
|
public List<Map<String, Object>> getProcessWorkStandardWorkItemDetailList(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectList(NS + "get_process_work_standard_work_item_detail_list", params);
|
return sqlSession.selectList(NS + "getProcessWorkStandardWorkItemDetailList", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> insertProcessWorkStandardWorkItemDetail(Map<String, Object> params) {
|
public Map<String, Object> insertProcessWorkStandardWorkItemDetail(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.insert(NS + "insert_process_work_standard_work_item_detail", params);
|
sqlSession.insert(NS + "insertProcessWorkStandardWorkItemDetail", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> updateProcessWorkStandardWorkItemDetail(Map<String, Object> params) {
|
public Map<String, Object> updateProcessWorkStandardWorkItemDetail(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.update(NS + "update_process_work_standard_work_item_detail", params);
|
sqlSession.update(NS + "updateProcessWorkStandardWorkItemDetail", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> deleteProcessWorkStandardWorkItemDetail(Map<String, Object> params) {
|
public Map<String, Object> deleteProcessWorkStandardWorkItemDetail(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.delete(NS + "delete_process_work_standard_work_item_detail", params);
|
sqlSession.delete(NS + "deleteProcessWorkStandardWorkItemDetail", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,9 +105,9 @@ public class ProcessWorkStandardService extends BaseService {
|
|||||||
for (Map<String, Object> workItem : workItems) {
|
for (Map<String, Object> workItem : workItems) {
|
||||||
workItem.put("company_code", params.get("company_code"));
|
workItem.put("company_code", params.get("company_code"));
|
||||||
if (workItem.get("id") != null) {
|
if (workItem.get("id") != null) {
|
||||||
sqlSession.update(NS + "update_process_work_standard_work_item", workItem);
|
sqlSession.update(NS + "updateProcessWorkStandardWorkItem", workItem);
|
||||||
} else {
|
} else {
|
||||||
sqlSession.insert(NS + "insert_process_work_standard_work_item", workItem);
|
sqlSession.insert(NS + "insertProcessWorkStandardWorkItem", workItem);
|
||||||
}
|
}
|
||||||
List<Map<String, Object>> details = (List<Map<String, Object>>) workItem.get("details");
|
List<Map<String, Object>> details = (List<Map<String, Object>>) workItem.get("details");
|
||||||
if (details != null) {
|
if (details != null) {
|
||||||
@@ -115,9 +115,9 @@ public class ProcessWorkStandardService extends BaseService {
|
|||||||
detail.put("company_code", params.get("company_code"));
|
detail.put("company_code", params.get("company_code"));
|
||||||
detail.put("work_item_id", workItem.get("id"));
|
detail.put("work_item_id", workItem.get("id"));
|
||||||
if (detail.get("id") != null) {
|
if (detail.get("id") != null) {
|
||||||
sqlSession.update(NS + "update_process_work_standard_work_item_detail", detail);
|
sqlSession.update(NS + "updateProcessWorkStandardWorkItemDetail", detail);
|
||||||
} else {
|
} else {
|
||||||
sqlSession.insert(NS + "insert_process_work_standard_work_item_detail", detail);
|
sqlSession.insert(NS + "insertProcessWorkStandardWorkItemDetail", detail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -128,13 +128,13 @@ public class ProcessWorkStandardService extends BaseService {
|
|||||||
|
|
||||||
public List<Map<String, Object>> getProcessWorkStandardRegisteredItemList(Map<String, Object> params) {
|
public List<Map<String, Object>> getProcessWorkStandardRegisteredItemList(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectList(NS + "get_process_work_standard_registered_item_list", params);
|
return sqlSession.selectList(NS + "getProcessWorkStandardRegisteredItemList", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> insertProcessWorkStandardRegisteredItem(Map<String, Object> params) {
|
public Map<String, Object> insertProcessWorkStandardRegisteredItem(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.insert(NS + "insert_process_work_standard_registered_item", params);
|
sqlSession.insert(NS + "insertProcessWorkStandardRegisteredItem", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,14 +148,14 @@ public class ProcessWorkStandardService extends BaseService {
|
|||||||
item.put("company_code", params.get("company_code"));
|
item.put("company_code", params.get("company_code"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sqlSession.insert(NS + "insert_process_work_standard_registered_item_batch", params);
|
sqlSession.insert(NS + "insertProcessWorkStandardRegisteredItemBatch", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> deleteProcessWorkStandardRegisteredItem(Map<String, Object> params) {
|
public Map<String, Object> deleteProcessWorkStandardRegisteredItem(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
sqlSession.delete(NS + "delete_process_work_standard_registered_item", params);
|
sqlSession.delete(NS + "deleteProcessWorkStandardRegisteredItem", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,10 +50,6 @@ public class RoleService extends BaseService {
|
|||||||
memberParams.put("master_objid", objid);
|
memberParams.put("master_objid", objid);
|
||||||
sqlSession.delete("role.deleteAllRoleMembers", memberParams);
|
sqlSession.delete("role.deleteAllRoleMembers", memberParams);
|
||||||
|
|
||||||
Map<String, Object> menuParams = new HashMap<>();
|
|
||||||
menuParams.put("auth_objid", objid);
|
|
||||||
sqlSession.delete("role.deleteMenuPermissions", menuParams);
|
|
||||||
|
|
||||||
sqlSession.delete("role.deleteRoleGroup", params);
|
sqlSession.delete("role.deleteRoleGroup", params);
|
||||||
log.info("권한 그룹 삭제 완료: objid={}", objid);
|
log.info("권한 그룹 삭제 완료: objid={}", objid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ public class SalesReportService extends BaseService {
|
|||||||
public Map<String, Object> getSalesReportList(Map<String, Object> params) {
|
public Map<String, Object> getSalesReportList(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
commonService.applyPagination(params);
|
commonService.applyPagination(params);
|
||||||
int totalCount = sqlSession.selectOne(NS + "get_sales_report_list_cnt", params);
|
int totalCount = sqlSession.selectOne(NS + "getSalesReportListCnt", params);
|
||||||
List<Map<String, Object>> list = sqlSession.selectList(NS + "get_sales_report_list", params);
|
List<Map<String, Object>> list = sqlSession.selectList(NS + "getSalesReportList", params);
|
||||||
for (Map<String, Object> row : list) {
|
for (Map<String, Object> row : list) {
|
||||||
row.put("unit_price", DecimalUtils.toBigDecimal(row.get("unit_price")));
|
row.put("unit_price", DecimalUtils.toBigDecimal(row.get("unit_price")));
|
||||||
row.put("order_amt", DecimalUtils.toBigDecimal(row.get("order_amt")));
|
row.put("order_amt", DecimalUtils.toBigDecimal(row.get("order_amt")));
|
||||||
@@ -36,7 +36,7 @@ public class SalesReportService extends BaseService {
|
|||||||
|
|
||||||
public Map<String, Object> getSalesReportSummary(Map<String, Object> params) {
|
public Map<String, Object> getSalesReportSummary(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
Map<String, Object> summary = sqlSession.selectOne(NS + "get_sales_report_summary", params);
|
Map<String, Object> summary = sqlSession.selectOne(NS + "getSalesReportSummary", params);
|
||||||
if (summary != null) {
|
if (summary != null) {
|
||||||
summary.put("total_amount", DecimalUtils.toBigDecimal(summary.get("total_amount")));
|
summary.put("total_amount", DecimalUtils.toBigDecimal(summary.get("total_amount")));
|
||||||
summary.put("avg_unit_price", DecimalUtils.toBigDecimal(summary.get("avg_unit_price")));
|
summary.put("avg_unit_price", DecimalUtils.toBigDecimal(summary.get("avg_unit_price")));
|
||||||
@@ -48,15 +48,15 @@ public class SalesReportService extends BaseService {
|
|||||||
|
|
||||||
public Map<String, Object> getSalesReportData(Map<String, Object> params) {
|
public Map<String, Object> getSalesReportData(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "get_sales_report_data_rows", params);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "getSalesReportDataRows", params);
|
||||||
for (Map<String, Object> row : rows) {
|
for (Map<String, Object> row : rows) {
|
||||||
row.put("unit_price", DecimalUtils.toBigDecimal(row.get("unit_price")));
|
row.put("unit_price", DecimalUtils.toBigDecimal(row.get("unit_price")));
|
||||||
row.put("order_amt", DecimalUtils.toBigDecimal(row.get("order_amt")));
|
row.put("order_amt", DecimalUtils.toBigDecimal(row.get("order_amt")));
|
||||||
row.put("order_qty", DecimalUtils.toBigDecimal(row.get("order_qty")));
|
row.put("order_qty", DecimalUtils.toBigDecimal(row.get("order_qty")));
|
||||||
row.put("ship_qty", DecimalUtils.toBigDecimal(row.get("ship_qty")));
|
row.put("ship_qty", DecimalUtils.toBigDecimal(row.get("ship_qty")));
|
||||||
}
|
}
|
||||||
List<Map<String, Object>> customers = sqlSession.selectList(NS + "get_sales_report_customers", params);
|
List<Map<String, Object>> customers = sqlSession.selectList(NS + "getSalesReportCustomers", params);
|
||||||
List<Map<String, Object>> statuses = sqlSession.selectList(NS + "get_sales_report_statuses", params);
|
List<Map<String, Object>> statuses = sqlSession.selectList(NS + "getSalesReportStatuses", params);
|
||||||
|
|
||||||
// 데이터에서 품목 목록 추출 (중복 제거)
|
// 데이터에서 품목 목록 추출 (중복 제거)
|
||||||
Map<String, String> itemSet = new LinkedHashMap<>();
|
Map<String, String> itemSet = new LinkedHashMap<>();
|
||||||
|
|||||||
@@ -21,12 +21,12 @@ public class ScheduleService extends BaseService {
|
|||||||
|
|
||||||
public List<Map<String, Object>> getScheduleList(Map<String, Object> params) {
|
public List<Map<String, Object>> getScheduleList(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectList(NS + "get_schedule_list", params);
|
return sqlSession.selectList(NS + "getScheduleList", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getScheduleInfo(Map<String, Object> params) {
|
public Map<String, Object> getScheduleInfo(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.selectOne(NS + "get_schedule_info", params);
|
return sqlSession.selectOne(NS + "getScheduleInfo", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -150,7 +150,7 @@ public class ScheduleService extends BaseService {
|
|||||||
existParams.put("period_start", period.get("start"));
|
existParams.put("period_start", period.get("start"));
|
||||||
existParams.put("period_end", period.get("end"));
|
existParams.put("period_end", period.get("end"));
|
||||||
try {
|
try {
|
||||||
toDelete = sqlSession.selectList(NS + "get_existing_schedule_list", existParams);
|
toDelete = sqlSession.selectList(NS + "getExistingScheduleList", existParams);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.warn("기존 스케줄 조회 실패: {}", e.getMessage());
|
log.warn("기존 스케줄 조회 실패: {}", e.getMessage());
|
||||||
}
|
}
|
||||||
@@ -201,7 +201,7 @@ public class ScheduleService extends BaseService {
|
|||||||
Map<String, Object> deleteParams = new HashMap<>();
|
Map<String, Object> deleteParams = new HashMap<>();
|
||||||
deleteParams.put("company_code", companyCode);
|
deleteParams.put("company_code", companyCode);
|
||||||
deleteParams.put("id_list", deleteIds);
|
deleteParams.put("id_list", deleteIds);
|
||||||
sqlSession.delete(NS + "delete_schedules_by_id_list", deleteParams);
|
sqlSession.delete(NS + "deleteSchedulesByIdList", deleteParams);
|
||||||
deleted = deleteIds.size();
|
deleted = deleteIds.size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -213,7 +213,7 @@ public class ScheduleService extends BaseService {
|
|||||||
insertParams.put("generated_by", userId);
|
insertParams.put("generated_by", userId);
|
||||||
insertParams.put("created_by", userId);
|
insertParams.put("created_by", userId);
|
||||||
insertParams.put("updated_by", userId);
|
insertParams.put("updated_by", userId);
|
||||||
sqlSession.insert(NS + "insert_schedule", insertParams);
|
sqlSession.insert(NS + "insertSchedule", insertParams);
|
||||||
created++;
|
created++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -226,19 +226,19 @@ public class ScheduleService extends BaseService {
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public int insertSchedule(Map<String, Object> params) {
|
public int insertSchedule(Map<String, Object> params) {
|
||||||
return sqlSession.insert(NS + "insert_schedule", params);
|
return sqlSession.insert(NS + "insertSchedule", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public int updateSchedule(Map<String, Object> params) {
|
public int updateSchedule(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
return sqlSession.update(NS + "update_schedule", params);
|
return sqlSession.update(NS + "updateSchedule", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> deleteSchedule(Map<String, Object> params) {
|
public Map<String, Object> deleteSchedule(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
int affected = sqlSession.delete(NS + "delete_schedule", params);
|
int affected = sqlSession.delete(NS + "deleteSchedule", params);
|
||||||
if (affected == 0) {
|
if (affected == 0) {
|
||||||
Map<String, Object> result = new HashMap<>();
|
Map<String, Object> result = new HashMap<>();
|
||||||
result.put("success", false);
|
result.put("success", false);
|
||||||
@@ -251,7 +251,7 @@ public class ScheduleService extends BaseService {
|
|||||||
historyParams.put("schedule_id", params.get("schedule_id"));
|
historyParams.put("schedule_id", params.get("schedule_id"));
|
||||||
historyParams.put("action", "DELETE");
|
historyParams.put("action", "DELETE");
|
||||||
historyParams.put("changed_by", params.getOrDefault("user_id", "system"));
|
historyParams.put("changed_by", params.getOrDefault("user_id", "system"));
|
||||||
sqlSession.insert(NS + "insert_schedule_history", historyParams);
|
sqlSession.insert(NS + "insertScheduleHistory", historyParams);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.warn("스케줄 이력 저장 실패 (무시): {}", e.getMessage());
|
log.warn("스케줄 이력 저장 실패 (무시): {}", e.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ public class ScreenGroupService extends BaseService {
|
|||||||
params.put("limit", size);
|
params.put("limit", size);
|
||||||
params.put("offset", (page - 1) * size);
|
params.put("offset", (page - 1) * size);
|
||||||
|
|
||||||
int total = sqlSession.selectOne(NS + "count_screen_groups", params);
|
int total = sqlSession.selectOne(NS + "countScreenGroups", params);
|
||||||
List<Map<String, Object>> groups = sqlSession.selectList(NS + "select_screen_groups", params);
|
List<Map<String, Object>> groups = sqlSession.selectList(NS + "selectScreenGroups", params);
|
||||||
|
|
||||||
// screens 조립 (별도 쿼리)
|
// screens 조립 (별도 쿼리)
|
||||||
if (!groups.isEmpty()) {
|
if (!groups.isEmpty()) {
|
||||||
@@ -36,7 +36,7 @@ public class ScreenGroupService extends BaseService {
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
Map<String, Object> screenParams = new HashMap<>();
|
Map<String, Object> screenParams = new HashMap<>();
|
||||||
screenParams.put("group_ids", groupIds);
|
screenParams.put("group_ids", groupIds);
|
||||||
List<Map<String, Object>> allScreens = sqlSession.selectList(NS + "select_group_screens_by_group_ids", screenParams);
|
List<Map<String, Object>> allScreens = sqlSession.selectList(NS + "selectGroupScreensByGroupIds", screenParams);
|
||||||
Map<Object, List<Map<String, Object>>> byGroup = allScreens.stream()
|
Map<Object, List<Map<String, Object>>> byGroup = allScreens.stream()
|
||||||
.collect(Collectors.groupingBy(s -> s.get("group_id")));
|
.collect(Collectors.groupingBy(s -> s.get("group_id")));
|
||||||
for (Map<String, Object> g : groups) {
|
for (Map<String, Object> g : groups) {
|
||||||
@@ -55,13 +55,13 @@ public class ScreenGroupService extends BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getScreenGroup(Map<String, Object> params) {
|
public Map<String, Object> getScreenGroup(Map<String, Object> params) {
|
||||||
Map<String, Object> group = sqlSession.selectOne(NS + "select_screen_group_by_id", params);
|
Map<String, Object> group = sqlSession.selectOne(NS + "selectScreenGroupById", params);
|
||||||
if (group == null) return null;
|
if (group == null) return null;
|
||||||
|
|
||||||
List<Object> groupIds = Collections.singletonList(group.get("id"));
|
List<Object> groupIds = Collections.singletonList(group.get("id"));
|
||||||
Map<String, Object> sp = new HashMap<>();
|
Map<String, Object> sp = new HashMap<>();
|
||||||
sp.put("group_ids", groupIds);
|
sp.put("group_ids", groupIds);
|
||||||
List<Map<String, Object>> screens = sqlSession.selectList(NS + "select_group_screens_by_group_ids", sp);
|
List<Map<String, Object>> screens = sqlSession.selectList(NS + "selectGroupScreensByGroupIds", sp);
|
||||||
group.put("screens", screens);
|
group.put("screens", screens);
|
||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@ public class ScreenGroupService extends BaseService {
|
|||||||
if (parentGroupId != null) {
|
if (parentGroupId != null) {
|
||||||
Map<String, Object> pp = new HashMap<>();
|
Map<String, Object> pp = new HashMap<>();
|
||||||
pp.put("parent_group_id", parentGroupId);
|
pp.put("parent_group_id", parentGroupId);
|
||||||
Map<String, Object> parent = sqlSession.selectOne(NS + "select_parent_group_by_id", pp);
|
Map<String, Object> parent = sqlSession.selectOne(NS + "selectParentGroupById", pp);
|
||||||
if (parent != null) {
|
if (parent != null) {
|
||||||
groupLevel = toInt(parent.getOrDefault("group_level", 0)) + 1;
|
groupLevel = toInt(parent.getOrDefault("group_level", 0)) + 1;
|
||||||
parentHierarchyPath = (String) parent.getOrDefault("hierarchy_path",
|
parentHierarchyPath = (String) parent.getOrDefault("hierarchy_path",
|
||||||
@@ -84,7 +84,7 @@ public class ScreenGroupService extends BaseService {
|
|||||||
}
|
}
|
||||||
params.put("group_level", groupLevel);
|
params.put("group_level", groupLevel);
|
||||||
|
|
||||||
sqlSession.insert(NS + "insert_screen_group", params);
|
sqlSession.insert(NS + "insertScreenGroup", params);
|
||||||
Object newId = params.get("id");
|
Object newId = params.get("id");
|
||||||
|
|
||||||
// hierarchy_path 업데이트
|
// hierarchy_path 업데이트
|
||||||
@@ -97,11 +97,11 @@ public class ScreenGroupService extends BaseService {
|
|||||||
Map<String, Object> hp = new HashMap<>();
|
Map<String, Object> hp = new HashMap<>();
|
||||||
hp.put("id", newId);
|
hp.put("id", newId);
|
||||||
hp.put("hierarchy_path", hierarchyPath);
|
hp.put("hierarchy_path", hierarchyPath);
|
||||||
sqlSession.update(NS + "update_screen_group_hierarchy_path", hp);
|
sqlSession.update(NS + "updateScreenGroupHierarchyPath", hp);
|
||||||
|
|
||||||
Map<String, Object> sp = new HashMap<>();
|
Map<String, Object> sp = new HashMap<>();
|
||||||
sp.put("id", newId);
|
sp.put("id", newId);
|
||||||
return sqlSession.selectOne(NS + "select_screen_group_by_id", sp);
|
return sqlSession.selectOne(NS + "selectScreenGroupById", sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -121,7 +121,7 @@ public class ScreenGroupService extends BaseService {
|
|||||||
if (parentGroupId != null) {
|
if (parentGroupId != null) {
|
||||||
Map<String, Object> pp = new HashMap<>();
|
Map<String, Object> pp = new HashMap<>();
|
||||||
pp.put("parent_group_id", parentGroupId);
|
pp.put("parent_group_id", parentGroupId);
|
||||||
Map<String, Object> parent = sqlSession.selectOne(NS + "select_parent_group_by_id", pp);
|
Map<String, Object> parent = sqlSession.selectOne(NS + "selectParentGroupById", pp);
|
||||||
if (parent != null) {
|
if (parent != null) {
|
||||||
String parentPath = (String) parent.getOrDefault("hierarchy_path",
|
String parentPath = (String) parent.getOrDefault("hierarchy_path",
|
||||||
"/" + parentGroupId + "/");
|
"/" + parentGroupId + "/");
|
||||||
@@ -140,16 +140,16 @@ public class ScreenGroupService extends BaseService {
|
|||||||
Object targetCompanyCode = params.get("target_company_code");
|
Object targetCompanyCode = params.get("target_company_code");
|
||||||
int rows;
|
int rows;
|
||||||
if ("*".equals(userCompanyCode) && targetCompanyCode != null) {
|
if ("*".equals(userCompanyCode) && targetCompanyCode != null) {
|
||||||
rows = sqlSession.update(NS + "update_screen_group_with_company", params);
|
rows = sqlSession.update(NS + "updateScreenGroupWithCompany", params);
|
||||||
} else {
|
} else {
|
||||||
rows = sqlSession.update(NS + "update_screen_group", params);
|
rows = sqlSession.update(NS + "updateScreenGroup", params);
|
||||||
}
|
}
|
||||||
if (rows == 0) {
|
if (rows == 0) {
|
||||||
throw new NoSuchElementException("화면 그룹을 찾을 수 없거나 권한이 없습니다.");
|
throw new NoSuchElementException("화면 그룹을 찾을 수 없거나 권한이 없습니다.");
|
||||||
}
|
}
|
||||||
Map<String, Object> sp = new HashMap<>();
|
Map<String, Object> sp = new HashMap<>();
|
||||||
sp.put("id", id);
|
sp.put("id", id);
|
||||||
return sqlSession.selectOne(NS + "select_screen_group_by_id", sp);
|
return sqlSession.selectOne(NS + "selectScreenGroupById", sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -159,7 +159,7 @@ public class ScreenGroupService extends BaseService {
|
|||||||
boolean deleteNumberingRules = Boolean.TRUE.equals(params.get("delete_numbering_rules"));
|
boolean deleteNumberingRules = Boolean.TRUE.equals(params.get("delete_numbering_rules"));
|
||||||
|
|
||||||
// 대상 그룹의 company_code 확인
|
// 대상 그룹의 company_code 확인
|
||||||
Map<String, Object> target = sqlSession.selectOne(NS + "select_screen_group_for_delete", params);
|
Map<String, Object> target = sqlSession.selectOne(NS + "selectScreenGroupForDelete", params);
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
throw new NoSuchElementException("화면 그룹을 찾을 수 없습니다.");
|
throw new NoSuchElementException("화면 그룹을 찾을 수 없습니다.");
|
||||||
}
|
}
|
||||||
@@ -174,7 +174,7 @@ public class ScreenGroupService extends BaseService {
|
|||||||
Map<String, Object> cp = new HashMap<>();
|
Map<String, Object> cp = new HashMap<>();
|
||||||
cp.put("id", id);
|
cp.put("id", id);
|
||||||
cp.put("target_company_code", targetCompanyCode);
|
cp.put("target_company_code", targetCompanyCode);
|
||||||
List<Map<String, Object>> children = sqlSession.selectList(NS + "select_all_child_group_ids", cp);
|
List<Map<String, Object>> children = sqlSession.selectList(NS + "selectAllChildGroupIds", cp);
|
||||||
List<Object> groupIds = children.stream().map(c -> c.get("id")).collect(Collectors.toList());
|
List<Object> groupIds = children.stream().map(c -> c.get("id")).collect(Collectors.toList());
|
||||||
|
|
||||||
if (!groupIds.isEmpty()) {
|
if (!groupIds.isEmpty()) {
|
||||||
@@ -182,33 +182,33 @@ public class ScreenGroupService extends BaseService {
|
|||||||
Map<String, Object> mp = new HashMap<>();
|
Map<String, Object> mp = new HashMap<>();
|
||||||
mp.put("group_ids", groupIds);
|
mp.put("group_ids", groupIds);
|
||||||
mp.put("target_company_code", targetCompanyCode);
|
mp.put("target_company_code", targetCompanyCode);
|
||||||
List<Map<String, Object>> menus = sqlSession.selectList(NS + "select_menus_by_group_ids", mp);
|
List<Map<String, Object>> menus = sqlSession.selectList(NS + "selectMenusByGroupIds", mp);
|
||||||
List<Object> menuObjids = menus.stream().map(m -> m.get("objid")).collect(Collectors.toList());
|
List<Object> menuObjids = menus.stream().map(m -> m.get("objid")).collect(Collectors.toList());
|
||||||
|
|
||||||
if (!menuObjids.isEmpty()) {
|
if (!menuObjids.isEmpty()) {
|
||||||
Map<String, Object> delp = new HashMap<>();
|
Map<String, Object> delp = new HashMap<>();
|
||||||
delp.put("menu_objids", menuObjids);
|
delp.put("menu_objids", menuObjids);
|
||||||
delp.put("target_company_code", targetCompanyCode);
|
delp.put("target_company_code", targetCompanyCode);
|
||||||
sqlSession.delete(NS + "delete_screen_menu_assignments_by_menu_objids", delp);
|
sqlSession.delete(NS + "deleteScreenMenuAssignmentsByMenuObjids", delp);
|
||||||
sqlSession.delete(NS + "delete_menus_by_group_ids", mp);
|
sqlSession.delete(NS + "deleteMenusByGroupIds", mp);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 채번 규칙 삭제 (최상위 그룹 + 명시 요청)
|
// 채번 규칙 삭제 (최상위 그룹 + 명시 요청)
|
||||||
if (deleteNumberingRules) {
|
if (deleteNumberingRules) {
|
||||||
Map<String, Object> rp = new HashMap<>();
|
Map<String, Object> rp = new HashMap<>();
|
||||||
rp.put("id", id);
|
rp.put("id", id);
|
||||||
int isRoot = sqlSession.selectOne(NS + "is_root_group_by_id", rp);
|
int isRoot = sqlSession.selectOne(NS + "isRootGroupById", rp);
|
||||||
if (isRoot > 0) {
|
if (isRoot > 0) {
|
||||||
Map<String, Object> nrp = new HashMap<>();
|
Map<String, Object> nrp = new HashMap<>();
|
||||||
nrp.put("target_company_code", targetCompanyCode);
|
nrp.put("target_company_code", targetCompanyCode);
|
||||||
sqlSession.delete(NS + "delete_numbering_rule_parts", nrp);
|
sqlSession.delete(NS + "deleteNumberingRuleParts", nrp);
|
||||||
sqlSession.delete(NS + "delete_numbering_rules", nrp);
|
sqlSession.delete(NS + "deleteNumberingRules", nrp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 그룹 삭제
|
// 그룹 삭제
|
||||||
int deleted = sqlSession.delete(NS + "delete_screen_group_by_id", cp);
|
int deleted = sqlSession.delete(NS + "deleteScreenGroupById", cp);
|
||||||
if (deleted == 0) {
|
if (deleted == 0) {
|
||||||
throw new NoSuchElementException("화면 그룹을 찾을 수 없거나 권한이 없습니다.");
|
throw new NoSuchElementException("화면 그룹을 찾을 수 없거나 권한이 없습니다.");
|
||||||
}
|
}
|
||||||
@@ -220,12 +220,12 @@ public class ScreenGroupService extends BaseService {
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> addScreenToGroup(Map<String, Object> params) {
|
public Map<String, Object> addScreenToGroup(Map<String, Object> params) {
|
||||||
sqlSession.insert(NS + "insert_group_screen", params);
|
sqlSession.insert(NS + "insertGroupScreen", params);
|
||||||
// 삽입 후 조회
|
// 삽입 후 조회
|
||||||
List<Object> ids = Collections.singletonList(params.get("group_id"));
|
List<Object> ids = Collections.singletonList(params.get("group_id"));
|
||||||
Map<String, Object> sp = new HashMap<>();
|
Map<String, Object> sp = new HashMap<>();
|
||||||
sp.put("group_ids", ids);
|
sp.put("group_ids", ids);
|
||||||
List<Map<String, Object>> screens = sqlSession.selectList(NS + "select_group_screens_by_group_ids", sp);
|
List<Map<String, Object>> screens = sqlSession.selectList(NS + "selectGroupScreensByGroupIds", sp);
|
||||||
return screens.stream()
|
return screens.stream()
|
||||||
.filter(s -> Objects.equals(s.get("screen_id"), params.get("screen_id")))
|
.filter(s -> Objects.equals(s.get("screen_id"), params.get("screen_id")))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
@@ -234,14 +234,14 @@ public class ScreenGroupService extends BaseService {
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> updateScreenInGroup(Map<String, Object> params) {
|
public Map<String, Object> updateScreenInGroup(Map<String, Object> params) {
|
||||||
int rows = sqlSession.update(NS + "update_group_screen", params);
|
int rows = sqlSession.update(NS + "updateGroupScreen", params);
|
||||||
if (rows == 0) throw new NoSuchElementException("연결을 찾을 수 없거나 권한이 없습니다.");
|
if (rows == 0) throw new NoSuchElementException("연결을 찾을 수 없거나 권한이 없습니다.");
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void removeScreenFromGroup(Map<String, Object> params) {
|
public void removeScreenFromGroup(Map<String, Object> params) {
|
||||||
int rows = sqlSession.delete(NS + "delete_group_screen", params);
|
int rows = sqlSession.delete(NS + "deleteGroupScreen", params);
|
||||||
if (rows == 0) throw new NoSuchElementException("연결을 찾을 수 없거나 권한이 없습니다.");
|
if (rows == 0) throw new NoSuchElementException("연결을 찾을 수 없거나 권한이 없습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -250,25 +250,25 @@ public class ScreenGroupService extends BaseService {
|
|||||||
// ══════════════════════════════════════════════════════════════
|
// ══════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
public List<Map<String, Object>> getFieldJoins(Map<String, Object> params) {
|
public List<Map<String, Object>> getFieldJoins(Map<String, Object> params) {
|
||||||
return sqlSession.selectList(NS + "select_field_joins", params);
|
return sqlSession.selectList(NS + "selectFieldJoins", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> createFieldJoin(Map<String, Object> params) {
|
public Map<String, Object> createFieldJoin(Map<String, Object> params) {
|
||||||
sqlSession.insert(NS + "insert_field_join", params);
|
sqlSession.insert(NS + "insertFieldJoin", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> updateFieldJoin(Map<String, Object> params) {
|
public Map<String, Object> updateFieldJoin(Map<String, Object> params) {
|
||||||
int rows = sqlSession.update(NS + "update_field_join", params);
|
int rows = sqlSession.update(NS + "updateFieldJoin", params);
|
||||||
if (rows == 0) throw new NoSuchElementException("필드 조인을 찾을 수 없거나 권한이 없습니다.");
|
if (rows == 0) throw new NoSuchElementException("필드 조인을 찾을 수 없거나 권한이 없습니다.");
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void deleteFieldJoin(Map<String, Object> params) {
|
public void deleteFieldJoin(Map<String, Object> params) {
|
||||||
int rows = sqlSession.delete(NS + "delete_field_join", params);
|
int rows = sqlSession.delete(NS + "deleteFieldJoin", params);
|
||||||
if (rows == 0) throw new NoSuchElementException("필드 조인을 찾을 수 없거나 권한이 없습니다.");
|
if (rows == 0) throw new NoSuchElementException("필드 조인을 찾을 수 없거나 권한이 없습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -277,28 +277,28 @@ public class ScreenGroupService extends BaseService {
|
|||||||
// ══════════════════════════════════════════════════════════════
|
// ══════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
public List<Map<String, Object>> getDataFlows(Map<String, Object> params) {
|
public List<Map<String, Object>> getDataFlows(Map<String, Object> params) {
|
||||||
return sqlSession.selectList(NS + "select_data_flows", params);
|
return sqlSession.selectList(NS + "selectDataFlows", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> createDataFlow(Map<String, Object> params) {
|
public Map<String, Object> createDataFlow(Map<String, Object> params) {
|
||||||
// data_mapping을 JSON 문자열로 변환
|
// data_mapping을 JSON 문자열로 변환
|
||||||
convertToJsonString(params, "data_mapping");
|
convertToJsonString(params, "data_mapping");
|
||||||
sqlSession.insert(NS + "insert_data_flow", params);
|
sqlSession.insert(NS + "insertDataFlow", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> updateDataFlow(Map<String, Object> params) {
|
public Map<String, Object> updateDataFlow(Map<String, Object> params) {
|
||||||
convertToJsonString(params, "data_mapping");
|
convertToJsonString(params, "data_mapping");
|
||||||
int rows = sqlSession.update(NS + "update_data_flow", params);
|
int rows = sqlSession.update(NS + "updateDataFlow", params);
|
||||||
if (rows == 0) throw new NoSuchElementException("데이터 흐름을 찾을 수 없거나 권한이 없습니다.");
|
if (rows == 0) throw new NoSuchElementException("데이터 흐름을 찾을 수 없거나 권한이 없습니다.");
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void deleteDataFlow(Map<String, Object> params) {
|
public void deleteDataFlow(Map<String, Object> params) {
|
||||||
int rows = sqlSession.delete(NS + "delete_data_flow", params);
|
int rows = sqlSession.delete(NS + "deleteDataFlow", params);
|
||||||
if (rows == 0) throw new NoSuchElementException("데이터 흐름을 찾을 수 없거나 권한이 없습니다.");
|
if (rows == 0) throw new NoSuchElementException("데이터 흐름을 찾을 수 없거나 권한이 없습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,25 +307,25 @@ public class ScreenGroupService extends BaseService {
|
|||||||
// ══════════════════════════════════════════════════════════════
|
// ══════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
public List<Map<String, Object>> getTableRelations(Map<String, Object> params) {
|
public List<Map<String, Object>> getTableRelations(Map<String, Object> params) {
|
||||||
return sqlSession.selectList(NS + "select_table_relations", params);
|
return sqlSession.selectList(NS + "selectTableRelations", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> createTableRelation(Map<String, Object> params) {
|
public Map<String, Object> createTableRelation(Map<String, Object> params) {
|
||||||
sqlSession.insert(NS + "insert_table_relation", params);
|
sqlSession.insert(NS + "insertTableRelation", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> updateTableRelation(Map<String, Object> params) {
|
public Map<String, Object> updateTableRelation(Map<String, Object> params) {
|
||||||
int rows = sqlSession.update(NS + "update_table_relation", params);
|
int rows = sqlSession.update(NS + "updateTableRelation", params);
|
||||||
if (rows == 0) throw new NoSuchElementException("화면-테이블 관계를 찾을 수 없거나 권한이 없습니다.");
|
if (rows == 0) throw new NoSuchElementException("화면-테이블 관계를 찾을 수 없거나 권한이 없습니다.");
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void deleteTableRelation(Map<String, Object> params) {
|
public void deleteTableRelation(Map<String, Object> params) {
|
||||||
int rows = sqlSession.delete(NS + "delete_table_relation", params);
|
int rows = sqlSession.delete(NS + "deleteTableRelation", params);
|
||||||
if (rows == 0) throw new NoSuchElementException("화면-테이블 관계를 찾을 수 없거나 권한이 없습니다.");
|
if (rows == 0) throw new NoSuchElementException("화면-테이블 관계를 찾을 수 없거나 권한이 없습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -334,7 +334,7 @@ public class ScreenGroupService extends BaseService {
|
|||||||
// ══════════════════════════════════════════════════════════════
|
// ══════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
public Map<String, Object> getScreenLayoutSummary(Map<String, Object> params) {
|
public Map<String, Object> getScreenLayoutSummary(Map<String, Object> params) {
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "select_layout_components", params);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "selectLayoutComponents", params);
|
||||||
|
|
||||||
Map<String, Integer> widgetCounts = new LinkedHashMap<>();
|
Map<String, Integer> widgetCounts = new LinkedHashMap<>();
|
||||||
List<String> labels = new ArrayList<>();
|
List<String> labels = new ArrayList<>();
|
||||||
@@ -380,7 +380,7 @@ public class ScreenGroupService extends BaseService {
|
|||||||
|
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("screen_ids", screenIds);
|
params.put("screen_ids", screenIds);
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "select_multiple_layout_components", params);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "selectMultipleLayoutComponents", params);
|
||||||
|
|
||||||
// 화면별 summary 초기화
|
// 화면별 summary 초기화
|
||||||
Map<Integer, Map<String, Object>> summaryMap = new LinkedHashMap<>();
|
Map<Integer, Map<String, Object>> summaryMap = new LinkedHashMap<>();
|
||||||
@@ -462,7 +462,7 @@ public class ScreenGroupService extends BaseService {
|
|||||||
p.put("screen_ids", screenIds);
|
p.put("screen_ids", screenIds);
|
||||||
|
|
||||||
// ── 1. 컴포넌트 config 기반 서브 테이블 수집 ─────────────────
|
// ── 1. 컴포넌트 config 기반 서브 테이블 수집 ─────────────────
|
||||||
List<Map<String, Object>> compRows = sqlSession.selectList(NS + "select_sub_table_component_configs", p);
|
List<Map<String, Object>> compRows = sqlSession.selectList(NS + "selectSubTableComponentConfigs", p);
|
||||||
|
|
||||||
// column label lookup 수집
|
// column label lookup 수집
|
||||||
List<Map<String, Object>> columnPairs = new ArrayList<>();
|
List<Map<String, Object>> columnPairs = new ArrayList<>();
|
||||||
@@ -489,7 +489,7 @@ public class ScreenGroupService extends BaseService {
|
|||||||
if (!columnPairs.isEmpty()) {
|
if (!columnPairs.isEmpty()) {
|
||||||
Map<String, Object> lp = new HashMap<>();
|
Map<String, Object> lp = new HashMap<>();
|
||||||
lp.put("pairs", columnPairs);
|
lp.put("pairs", columnPairs);
|
||||||
sqlSession.<Map<String, Object>>selectList(NS + "select_column_labels_by_pairs", lp)
|
sqlSession.<Map<String, Object>>selectList(NS + "selectColumnLabelsByPairs", lp)
|
||||||
.forEach(r -> colLabelMap.put(r.get("table_name") + "." + r.get("column_name"),
|
.forEach(r -> colLabelMap.put(r.get("table_name") + "." + r.get("column_name"),
|
||||||
(String) r.get("column_label")));
|
(String) r.get("column_label")));
|
||||||
}
|
}
|
||||||
@@ -523,7 +523,7 @@ public class ScreenGroupService extends BaseService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// ── 2. reference_table 기반 참조 서브 테이블 ──────────────────
|
// ── 2. reference_table 기반 참조 서브 테이블 ──────────────────
|
||||||
sqlSession.<Map<String, Object>>selectList(NS + "select_reference_columns", p).forEach(row -> {
|
sqlSession.<Map<String, Object>>selectList(NS + "selectReferenceColumns", p).forEach(row -> {
|
||||||
int sid = toInt(row.get("screen_id"));
|
int sid = toInt(row.get("screen_id"));
|
||||||
String mainTable = (String) row.get("main_table");
|
String mainTable = (String) row.get("main_table");
|
||||||
String refTable = (String) row.get("reference_table");
|
String refTable = (String) row.get("reference_table");
|
||||||
@@ -562,7 +562,7 @@ public class ScreenGroupService extends BaseService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// ── 3. parentDataMapping ───────────────────────────────────
|
// ── 3. parentDataMapping ───────────────────────────────────
|
||||||
sqlSession.<Map<String, Object>>selectList(NS + "select_parent_data_mapping_configs", p).forEach(row -> {
|
sqlSession.<Map<String, Object>>selectList(NS + "selectParentDataMappingConfigs", p).forEach(row -> {
|
||||||
int sid = toInt(row.get("screen_id"));
|
int sid = toInt(row.get("screen_id"));
|
||||||
String mainTable = (String) row.get("main_table");
|
String mainTable = (String) row.get("main_table");
|
||||||
String compType = (String) row.get("component_type");
|
String compType = (String) row.get("component_type");
|
||||||
@@ -611,7 +611,7 @@ public class ScreenGroupService extends BaseService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// ── 4. rightPanel.relation ─────────────────────────────────
|
// ── 4. rightPanel.relation ─────────────────────────────────
|
||||||
List<Map<String, Object>> rpRows = sqlSession.selectList(NS + "select_right_panel_relations", p);
|
List<Map<String, Object>> rpRows = sqlSession.selectList(NS + "selectRightPanelRelations", p);
|
||||||
// rightPanel columns에서 dot-notation 참조 테이블 수집
|
// rightPanel columns에서 dot-notation 참조 테이블 수집
|
||||||
Map<String, Set<String>> rpJoinedTables = new HashMap<>();
|
Map<String, Set<String>> rpJoinedTables = new HashMap<>();
|
||||||
rpRows.forEach(row -> {
|
rpRows.forEach(row -> {
|
||||||
@@ -734,7 +734,7 @@ public class ScreenGroupService extends BaseService {
|
|||||||
fkp.put("sub_table_names", new ArrayList<>(subTableNamesSet));
|
fkp.put("sub_table_names", new ArrayList<>(subTableNamesSet));
|
||||||
fkp.put("ref_table_names", new ArrayList<>(refTableNamesSet));
|
fkp.put("ref_table_names", new ArrayList<>(refTableNamesSet));
|
||||||
Map<String, List<Map<String, Object>>> joinColRefs = new HashMap<>();
|
Map<String, List<Map<String, Object>>> joinColRefs = new HashMap<>();
|
||||||
sqlSession.<Map<String, Object>>selectList(NS + "select_fk_columns_for_joined_tables", fkp).forEach(row -> {
|
sqlSession.<Map<String, Object>>selectList(NS + "selectFkColumnsForJoinedTables", fkp).forEach(row -> {
|
||||||
String tbl = (String) row.get("table_name");
|
String tbl = (String) row.get("table_name");
|
||||||
joinColRefs.computeIfAbsent(tbl, k -> new ArrayList<>());
|
joinColRefs.computeIfAbsent(tbl, k -> new ArrayList<>());
|
||||||
String col = (String) row.get("column_name");
|
String col = (String) row.get("column_name");
|
||||||
@@ -823,7 +823,7 @@ public class ScreenGroupService extends BaseService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// ── 8. Save Tables ────────────────────────────────────────
|
// ── 8. Save Tables ────────────────────────────────────────
|
||||||
sqlSession.<Map<String, Object>>selectList(NS + "select_save_table_actions", p).forEach(row -> {
|
sqlSession.<Map<String, Object>>selectList(NS + "selectSaveTableActions", p).forEach(row -> {
|
||||||
int sid = toInt(row.get("screen_id"));
|
int sid = toInt(row.get("screen_id"));
|
||||||
String mainTable = (String) row.get("main_table");
|
String mainTable = (String) row.get("main_table");
|
||||||
String actionType = (String) row.get("action_type");
|
String actionType = (String) row.get("action_type");
|
||||||
@@ -853,7 +853,7 @@ public class ScreenGroupService extends BaseService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// ── 9. 전역 메인 테이블 목록 ──────────────────────────────
|
// ── 9. 전역 메인 테이블 목록 ──────────────────────────────
|
||||||
List<String> globalMainTables = sqlSession.<Map<String, Object>>selectList(NS + "select_global_main_tables", p).stream()
|
List<String> globalMainTables = sqlSession.<Map<String, Object>>selectList(NS + "selectGlobalMainTables", p).stream()
|
||||||
.map(r -> (String) r.get("main_table"))
|
.map(r -> (String) r.get("main_table"))
|
||||||
.filter(t -> t != null && !t.isEmpty())
|
.filter(t -> t != null && !t.isEmpty())
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
@@ -869,12 +869,12 @@ public class ScreenGroupService extends BaseService {
|
|||||||
// ══════════════════════════════════════════════════════════════
|
// ══════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
public List<Map<String, Object>> getPopScreenGroups(Map<String, Object> params) {
|
public List<Map<String, Object>> getPopScreenGroups(Map<String, Object> params) {
|
||||||
List<Map<String, Object>> groups = sqlSession.selectList(NS + "select_pop_screen_groups", params);
|
List<Map<String, Object>> groups = sqlSession.selectList(NS + "selectPopScreenGroups", params);
|
||||||
if (!groups.isEmpty()) {
|
if (!groups.isEmpty()) {
|
||||||
List<Object> groupIds = groups.stream().map(g -> g.get("id")).collect(Collectors.toList());
|
List<Object> groupIds = groups.stream().map(g -> g.get("id")).collect(Collectors.toList());
|
||||||
Map<String, Object> sp = new HashMap<>();
|
Map<String, Object> sp = new HashMap<>();
|
||||||
sp.put("group_ids", groupIds);
|
sp.put("group_ids", groupIds);
|
||||||
List<Map<String, Object>> allScreens = sqlSession.selectList(NS + "select_pop_group_screens", sp);
|
List<Map<String, Object>> allScreens = sqlSession.selectList(NS + "selectPopGroupScreens", sp);
|
||||||
Map<Object, List<Map<String, Object>>> byGroup = allScreens.stream()
|
Map<Object, List<Map<String, Object>>> byGroup = allScreens.stream()
|
||||||
.collect(Collectors.groupingBy(s -> s.get("group_id")));
|
.collect(Collectors.groupingBy(s -> s.get("group_id")));
|
||||||
groups.forEach(g -> g.put("screens", byGroup.getOrDefault(g.get("id"), Collections.emptyList())));
|
groups.forEach(g -> g.put("screens", byGroup.getOrDefault(g.get("id"), Collections.emptyList())));
|
||||||
@@ -897,7 +897,7 @@ public class ScreenGroupService extends BaseService {
|
|||||||
if (parentGroupId != null) {
|
if (parentGroupId != null) {
|
||||||
Map<String, Object> pp = new HashMap<>();
|
Map<String, Object> pp = new HashMap<>();
|
||||||
pp.put("parent_group_id", parentGroupId);
|
pp.put("parent_group_id", parentGroupId);
|
||||||
Map<String, Object> parent = sqlSession.selectOne(NS + "select_parent_group_by_id", pp);
|
Map<String, Object> parent = sqlSession.selectOne(NS + "selectParentGroupById", pp);
|
||||||
if (parent != null) {
|
if (parent != null) {
|
||||||
hierarchyPath = parent.get("hierarchy_path") + "/" + params.get("group_code");
|
hierarchyPath = parent.get("hierarchy_path") + "/" + params.get("group_code");
|
||||||
} else {
|
} else {
|
||||||
@@ -909,37 +909,37 @@ public class ScreenGroupService extends BaseService {
|
|||||||
params.put("hierarchy_path", hierarchyPath);
|
params.put("hierarchy_path", hierarchyPath);
|
||||||
|
|
||||||
// 중복 체크
|
// 중복 체크
|
||||||
int dupCount = sqlSession.selectOne(NS + "count_group_by_code", params);
|
int dupCount = sqlSession.selectOne(NS + "countGroupByCode", params);
|
||||||
if (dupCount > 0) {
|
if (dupCount > 0) {
|
||||||
throw new IllegalArgumentException("동일한 그룹코드가 이미 존재합니다.");
|
throw new IllegalArgumentException("동일한 그룹코드가 이미 존재합니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlSession.insert(NS + "insert_pop_screen_group", params);
|
sqlSession.insert(NS + "insertPopScreenGroup", params);
|
||||||
Map<String, Object> sp = new HashMap<>();
|
Map<String, Object> sp = new HashMap<>();
|
||||||
sp.put("id", params.get("id"));
|
sp.put("id", params.get("id"));
|
||||||
return sqlSession.selectOne(NS + "select_screen_group_by_id", sp);
|
return sqlSession.selectOne(NS + "selectScreenGroupById", sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> updatePopScreenGroup(Map<String, Object> params) {
|
public Map<String, Object> updatePopScreenGroup(Map<String, Object> params) {
|
||||||
Map<String, Object> existing = sqlSession.selectOne(NS + "select_screen_group_for_update", params);
|
Map<String, Object> existing = sqlSession.selectOne(NS + "selectScreenGroupForUpdate", params);
|
||||||
if (existing == null) throw new NoSuchElementException("그룹을 찾을 수 없습니다.");
|
if (existing == null) throw new NoSuchElementException("그룹을 찾을 수 없습니다.");
|
||||||
|
|
||||||
String hierarchyPath = (String) existing.get("hierarchy_path");
|
String hierarchyPath = (String) existing.get("hierarchy_path");
|
||||||
if (hierarchyPath == null || !hierarchyPath.startsWith("POP")) {
|
if (hierarchyPath == null || !hierarchyPath.startsWith("POP")) {
|
||||||
throw new IllegalArgumentException("POP 그룹만 수정할 수 있습니다.");
|
throw new IllegalArgumentException("POP 그룹만 수정할 수 있습니다.");
|
||||||
}
|
}
|
||||||
sqlSession.update(NS + "update_pop_screen_group", params);
|
sqlSession.update(NS + "updatePopScreenGroup", params);
|
||||||
Map<String, Object> sp = new HashMap<>();
|
Map<String, Object> sp = new HashMap<>();
|
||||||
sp.put("id", params.get("id"));
|
sp.put("id", params.get("id"));
|
||||||
return sqlSession.selectOne(NS + "select_screen_group_by_id", sp);
|
return sqlSession.selectOne(NS + "selectScreenGroupById", sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void deletePopScreenGroup(Map<String, Object> params) {
|
public void deletePopScreenGroup(Map<String, Object> params) {
|
||||||
Map<String, Object> existing = sqlSession.selectOne(NS + "select_screen_group_for_update", params);
|
Map<String, Object> existing = sqlSession.selectOne(NS + "selectScreenGroupForUpdate", params);
|
||||||
if (existing == null) {
|
if (existing == null) {
|
||||||
Map<String, Object> any = sqlSession.selectOne(NS + "select_any_screen_group_by_id", params);
|
Map<String, Object> any = sqlSession.selectOne(NS + "selectAnyScreenGroupById", params);
|
||||||
if (any != null) {
|
if (any != null) {
|
||||||
String ownerCode = (String) any.get("company_code");
|
String ownerCode = (String) any.get("company_code");
|
||||||
throw new SecurityException("이 그룹은 " + ("*".equals(ownerCode) ? "최고관리자" : ownerCode)
|
throw new SecurityException("이 그룹은 " + ("*".equals(ownerCode) ? "최고관리자" : ownerCode)
|
||||||
@@ -951,26 +951,26 @@ public class ScreenGroupService extends BaseService {
|
|||||||
if (hierarchyPath == null || !hierarchyPath.startsWith("POP")) {
|
if (hierarchyPath == null || !hierarchyPath.startsWith("POP")) {
|
||||||
throw new IllegalArgumentException("POP 그룹만 삭제할 수 있습니다.");
|
throw new IllegalArgumentException("POP 그룹만 삭제할 수 있습니다.");
|
||||||
}
|
}
|
||||||
int childCount = sqlSession.selectOne(NS + "count_child_groups_by_parent_id", params);
|
int childCount = sqlSession.selectOne(NS + "countChildGroupsByParentId", params);
|
||||||
if (childCount > 0) throw new IllegalArgumentException("하위 그룹이 " + childCount + "개 있어 삭제할 수 없습니다. 하위 그룹을 먼저 삭제해주세요.");
|
if (childCount > 0) throw new IllegalArgumentException("하위 그룹이 " + childCount + "개 있어 삭제할 수 없습니다. 하위 그룹을 먼저 삭제해주세요.");
|
||||||
int screenCount = sqlSession.selectOne(NS + "count_group_screens_by_group_id", params);
|
int screenCount = sqlSession.selectOne(NS + "countGroupScreensByGroupId", params);
|
||||||
if (screenCount > 0) throw new IllegalArgumentException("그룹에 연결된 화면이 " + screenCount + "개 있어 삭제할 수 없습니다. 화면을 먼저 제거해주세요.");
|
if (screenCount > 0) throw new IllegalArgumentException("그룹에 연결된 화면이 " + screenCount + "개 있어 삭제할 수 없습니다. 화면을 먼저 제거해주세요.");
|
||||||
|
|
||||||
Map<String, Object> dp = new HashMap<>();
|
Map<String, Object> dp = new HashMap<>();
|
||||||
dp.put("id", params.get("id"));
|
dp.put("id", params.get("id"));
|
||||||
dp.put("target_company_code", existing.get("company_code"));
|
dp.put("target_company_code", existing.get("company_code"));
|
||||||
sqlSession.delete(NS + "delete_screen_group_by_id", dp);
|
sqlSession.delete(NS + "deleteScreenGroupById", dp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> ensurePopRootGroup(Map<String, Object> params) {
|
public Map<String, Object> ensurePopRootGroup(Map<String, Object> params) {
|
||||||
String companyCode = (String) params.get("company_code");
|
String companyCode = (String) params.get("company_code");
|
||||||
Map<String, Object> existing = sqlSession.selectOne(NS + "select_pop_root_group", params);
|
Map<String, Object> existing = sqlSession.selectOne(NS + "selectPopRootGroup", params);
|
||||||
if (existing != null) return existing;
|
if (existing != null) return existing;
|
||||||
|
|
||||||
if (!"*".equals(companyCode)) return null;
|
if (!"*".equals(companyCode)) return null;
|
||||||
|
|
||||||
sqlSession.insert(NS + "insert_pop_root_group", params);
|
sqlSession.insert(NS + "insertPopRootGroup", params);
|
||||||
return sqlSession.selectOne(NS + "select_pop_root_group", params);
|
return sqlSession.selectOne(NS + "selectPopRootGroup", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ══════════════════════════════════════════════════════════════
|
// ══════════════════════════════════════════════════════════════
|
||||||
@@ -986,8 +986,8 @@ public class ScreenGroupService extends BaseService {
|
|||||||
try {
|
try {
|
||||||
Map<String, Object> p = new HashMap<>();
|
Map<String, Object> p = new HashMap<>();
|
||||||
p.put("company_code", companyCode);
|
p.put("company_code", companyCode);
|
||||||
List<Map<String, Object>> groups = sqlSession.selectList(NS + "select_screen_groups_for_sync", p);
|
List<Map<String, Object>> groups = sqlSession.selectList(NS + "selectScreenGroupsForSync", p);
|
||||||
List<Map<String, Object>> existingMenus = sqlSession.selectList(NS + "select_existing_menus_for_sync", p);
|
List<Map<String, Object>> existingMenus = sqlSession.selectList(NS + "selectExistingMenusForSync", p);
|
||||||
|
|
||||||
// path/name → menu 매핑 (screen_group_id 없는 것만)
|
// path/name → menu 매핑 (screen_group_id 없는 것만)
|
||||||
Map<String, Map<String, Object>> menuByPath = new LinkedHashMap<>();
|
Map<String, Map<String, Object>> menuByPath = new LinkedHashMap<>();
|
||||||
@@ -1005,7 +1005,7 @@ public class ScreenGroupService extends BaseService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 사용자 메뉴 루트 확보
|
// 사용자 메뉴 루트 확보
|
||||||
Map<String, Object> rootMenu = sqlSession.selectOne(NS + "select_user_menu_root", p);
|
Map<String, Object> rootMenu = sqlSession.selectOne(NS + "selectUserMenuRoot", p);
|
||||||
long userMenuRootObjid;
|
long userMenuRootObjid;
|
||||||
if (rootMenu != null) {
|
if (rootMenu != null) {
|
||||||
userMenuRootObjid = toLong(rootMenu.get("objid"));
|
userMenuRootObjid = toLong(rootMenu.get("objid"));
|
||||||
@@ -1015,7 +1015,7 @@ public class ScreenGroupService extends BaseService {
|
|||||||
rp.put("objid", rootObjid);
|
rp.put("objid", rootObjid);
|
||||||
rp.put("company_code", companyCode);
|
rp.put("company_code", companyCode);
|
||||||
rp.put("user_id", userId);
|
rp.put("user_id", userId);
|
||||||
sqlSession.insert(NS + "insert_user_menu_root", rp);
|
sqlSession.insert(NS + "insertUserMenuRoot", rp);
|
||||||
userMenuRootObjid = rootObjid;
|
userMenuRootObjid = rootObjid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1053,7 +1053,7 @@ public class ScreenGroupService extends BaseService {
|
|||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
Map<String, Object> cp = new HashMap<>(); cp.put("id", gid);
|
Map<String, Object> cp = new HashMap<>(); cp.put("id", gid);
|
||||||
sqlSession.update(NS + "clear_screen_group_menu_objid", cp);
|
sqlSession.update(NS + "clearScreenGroupMenuObjid", cp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1068,18 +1068,18 @@ public class ScreenGroupService extends BaseService {
|
|||||||
if (matchedMenu != null) {
|
if (matchedMenu != null) {
|
||||||
long mObjid = toLong(matchedMenu.get("objid"));
|
long mObjid = toLong(matchedMenu.get("objid"));
|
||||||
Map<String, Object> up = new HashMap<>(); up.put("menu_objid", mObjid); up.put("id", gid);
|
Map<String, Object> up = new HashMap<>(); up.put("menu_objid", mObjid); up.put("id", gid);
|
||||||
sqlSession.update(NS + "update_screen_group_menu_objid", up);
|
sqlSession.update(NS + "updateScreenGroupMenuObjid", up);
|
||||||
Map<String, Object> up2 = new HashMap<>(); up2.put("group_id", gid); up2.put("objid", mObjid);
|
Map<String, Object> up2 = new HashMap<>(); up2.put("group_id", gid); up2.put("objid", mObjid);
|
||||||
sqlSession.update(NS + "update_menu_screen_group_id", up2);
|
sqlSession.update(NS + "updateMenuScreenGroupId", up2);
|
||||||
// URL 업데이트
|
// URL 업데이트
|
||||||
Map<String, Object> dp = new HashMap<>(); dp.put("group_id", gid); dp.put("company_code", companyCode);
|
Map<String, Object> dp = new HashMap<>(); dp.put("group_id", gid); dp.put("company_code", companyCode);
|
||||||
Map<String, Object> defaultScreen = sqlSession.selectOne(NS + "select_default_screen_for_group", dp);
|
Map<String, Object> defaultScreen = sqlSession.selectOne(NS + "selectDefaultScreenForGroup", dp);
|
||||||
if (defaultScreen != null) {
|
if (defaultScreen != null) {
|
||||||
Map<String, Object> urlp = new HashMap<>();
|
Map<String, Object> urlp = new HashMap<>();
|
||||||
urlp.put("menu_url", "/screens/" + defaultScreen.get("screen_id"));
|
urlp.put("menu_url", "/screens/" + defaultScreen.get("screen_id"));
|
||||||
urlp.put("screen_code", defaultScreen.get("screen_code"));
|
urlp.put("screen_code", defaultScreen.get("screen_code"));
|
||||||
urlp.put("objid", mObjid);
|
urlp.put("objid", mObjid);
|
||||||
sqlSession.update(NS + "update_menu_url_and_screen_code", urlp);
|
sqlSession.update(NS + "updateMenuUrlAndScreenCode", urlp);
|
||||||
}
|
}
|
||||||
groupToMenuMap.put(gid, mObjid);
|
groupToMenuMap.put(gid, mObjid);
|
||||||
linked++;
|
linked++;
|
||||||
@@ -1101,10 +1101,10 @@ public class ScreenGroupService extends BaseService {
|
|||||||
Map<String, Object> seqp = new HashMap<>();
|
Map<String, Object> seqp = new HashMap<>();
|
||||||
seqp.put("parent_objid", parentMenuObjid);
|
seqp.put("parent_objid", parentMenuObjid);
|
||||||
seqp.put("company_code", companyCode);
|
seqp.put("company_code", companyCode);
|
||||||
int seq = sqlSession.selectOne(NS + "get_next_menu_seq_under_parent", seqp);
|
int seq = sqlSession.selectOne(NS + "getNextMenuSeqUnderParent", seqp);
|
||||||
|
|
||||||
Map<String, Object> dp = new HashMap<>(); dp.put("group_id", gid); dp.put("company_code", companyCode);
|
Map<String, Object> dp = new HashMap<>(); dp.put("group_id", gid); dp.put("company_code", companyCode);
|
||||||
Map<String, Object> defScreen = sqlSession.selectOne(NS + "select_default_screen_for_group", dp);
|
Map<String, Object> defScreen = sqlSession.selectOne(NS + "selectDefaultScreenForGroup", dp);
|
||||||
String menuUrl = defScreen != null ? "/screens/" + defScreen.get("screen_id") : null;
|
String menuUrl = defScreen != null ? "/screens/" + defScreen.get("screen_id") : null;
|
||||||
String screenCode = defScreen != null ? (String) defScreen.get("screen_code") : null;
|
String screenCode = defScreen != null ? (String) defScreen.get("screen_code") : null;
|
||||||
|
|
||||||
@@ -1114,10 +1114,10 @@ public class ScreenGroupService extends BaseService {
|
|||||||
ins.put("seq", seq); ins.put("company_code", companyCode); ins.put("user_id", userId);
|
ins.put("seq", seq); ins.put("company_code", companyCode); ins.put("user_id", userId);
|
||||||
ins.put("group_id", gid); ins.put("description", group.get("description"));
|
ins.put("group_id", gid); ins.put("description", group.get("description"));
|
||||||
ins.put("menu_url", menuUrl); ins.put("screen_code", screenCode); ins.put("icon", group.get("icon"));
|
ins.put("menu_url", menuUrl); ins.put("screen_code", screenCode); ins.put("icon", group.get("icon"));
|
||||||
sqlSession.insert(NS + "insert_menu_for_group", ins);
|
sqlSession.insert(NS + "insertMenuForGroup", ins);
|
||||||
|
|
||||||
Map<String, Object> up = new HashMap<>(); up.put("menu_objid", newObjid); up.put("id", gid);
|
Map<String, Object> up = new HashMap<>(); up.put("menu_objid", newObjid); up.put("id", gid);
|
||||||
sqlSession.update(NS + "update_screen_group_menu_objid", up);
|
sqlSession.update(NS + "updateScreenGroupMenuObjid", up);
|
||||||
|
|
||||||
groupToMenuMap.put(gid, newObjid);
|
groupToMenuMap.put(gid, newObjid);
|
||||||
created++;
|
created++;
|
||||||
@@ -1154,11 +1154,11 @@ public class ScreenGroupService extends BaseService {
|
|||||||
p.put("company_code", companyCode);
|
p.put("company_code", companyCode);
|
||||||
|
|
||||||
// 회사명 조회
|
// 회사명 조회
|
||||||
Map<String, Object> companyRow = sqlSession.selectOne(NS + "select_company_name", p);
|
Map<String, Object> companyRow = sqlSession.selectOne(NS + "selectCompanyName", p);
|
||||||
String companyName = companyRow != null ? toStr(companyRow.get("company_name")) : companyCode;
|
String companyName = companyRow != null ? toStr(companyRow.get("company_name")) : companyCode;
|
||||||
|
|
||||||
List<Map<String, Object>> menus = sqlSession.selectList(NS + "select_menus_for_sync", p);
|
List<Map<String, Object>> menus = sqlSession.selectList(NS + "selectMenusForSync", p);
|
||||||
List<Map<String, Object>> groups = sqlSession.selectList(NS + "select_groups_for_sync", p);
|
List<Map<String, Object>> groups = sqlSession.selectList(NS + "selectGroupsForSync", p);
|
||||||
|
|
||||||
// path/name → group 매핑 (menu_objid 없는 것만)
|
// path/name → group 매핑 (menu_objid 없는 것만)
|
||||||
Map<String, Map<String, Object>> groupByPath = new LinkedHashMap<>();
|
Map<String, Map<String, Object>> groupByPath = new LinkedHashMap<>();
|
||||||
@@ -1176,24 +1176,24 @@ public class ScreenGroupService extends BaseService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 회사 폴더 확보
|
// 회사 폴더 확보
|
||||||
Map<String, Object> folderRow = sqlSession.selectOne(NS + "select_root_company_folder", p);
|
Map<String, Object> folderRow = sqlSession.selectOne(NS + "selectRootCompanyFolder", p);
|
||||||
int companyFolderId;
|
int companyFolderId;
|
||||||
if (folderRow != null) {
|
if (folderRow != null) {
|
||||||
companyFolderId = toInt(folderRow.get("id"));
|
companyFolderId = toInt(folderRow.get("id"));
|
||||||
} else {
|
} else {
|
||||||
int maxOrder = sqlSession.selectOne(NS + "get_max_root_display_order", null);
|
int maxOrder = sqlSession.selectOne(NS + "getMaxRootDisplayOrder", null);
|
||||||
Map<String, Object> fp = new HashMap<>();
|
Map<String, Object> fp = new HashMap<>();
|
||||||
fp.put("company_name", companyName);
|
fp.put("company_name", companyName);
|
||||||
fp.put("group_code", companyCode.toLowerCase());
|
fp.put("group_code", companyCode.toLowerCase());
|
||||||
fp.put("display_order", maxOrder);
|
fp.put("display_order", maxOrder);
|
||||||
fp.put("company_code", companyCode);
|
fp.put("company_code", companyCode);
|
||||||
fp.put("user_id", userId);
|
fp.put("user_id", userId);
|
||||||
sqlSession.insert(NS + "insert_company_folder", fp);
|
sqlSession.insert(NS + "insertCompanyFolder", fp);
|
||||||
companyFolderId = toInt(fp.get("id"));
|
companyFolderId = toInt(fp.get("id"));
|
||||||
Map<String, Object> hp = new HashMap<>();
|
Map<String, Object> hp = new HashMap<>();
|
||||||
hp.put("id", companyFolderId);
|
hp.put("id", companyFolderId);
|
||||||
hp.put("hierarchy_path", "/" + companyFolderId + "/");
|
hp.put("hierarchy_path", "/" + companyFolderId + "/");
|
||||||
sqlSession.update(NS + "update_group_hierarchy_path_by_id", hp);
|
sqlSession.update(NS + "updateGroupHierarchyPathById", hp);
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<Long, Integer> menuToGroupMap = new LinkedHashMap<>();
|
Map<Long, Integer> menuToGroupMap = new LinkedHashMap<>();
|
||||||
@@ -1221,9 +1221,9 @@ public class ScreenGroupService extends BaseService {
|
|||||||
if (matchedGroup != null) {
|
if (matchedGroup != null) {
|
||||||
int gid = toInt(matchedGroup.get("id"));
|
int gid = toInt(matchedGroup.get("id"));
|
||||||
Map<String, Object> up = new HashMap<>(); up.put("menu_objid", mObjid); up.put("id", gid);
|
Map<String, Object> up = new HashMap<>(); up.put("menu_objid", mObjid); up.put("id", gid);
|
||||||
sqlSession.update(NS + "update_screen_group_for_menu_sync", up);
|
sqlSession.update(NS + "updateScreenGroupForMenuSync", up);
|
||||||
Map<String, Object> up2 = new HashMap<>(); up2.put("group_id", gid); up2.put("objid", mObjid);
|
Map<String, Object> up2 = new HashMap<>(); up2.put("group_id", gid); up2.put("objid", mObjid);
|
||||||
sqlSession.update(NS + "update_menu_screen_group_id", up2);
|
sqlSession.update(NS + "updateMenuScreenGroupId", up2);
|
||||||
menuToGroupMap.put(mObjid, gid);
|
menuToGroupMap.put(mObjid, gid);
|
||||||
linked++;
|
linked++;
|
||||||
details.add(detail("linked", mName, mObjid, gid, null));
|
details.add(detail("linked", mName, mObjid, gid, null));
|
||||||
@@ -1236,7 +1236,7 @@ public class ScreenGroupService extends BaseService {
|
|||||||
// 부모 그룹 level + hierarchy_path 조회
|
// 부모 그룹 level + hierarchy_path 조회
|
||||||
Map<String, Object> pp = new HashMap<>();
|
Map<String, Object> pp = new HashMap<>();
|
||||||
pp.put("parent_group_id", parentGid);
|
pp.put("parent_group_id", parentGid);
|
||||||
Map<String, Object> parentGroup = sqlSession.selectOne(NS + "select_parent_group_by_id", pp);
|
Map<String, Object> parentGroup = sqlSession.selectOne(NS + "selectParentGroupById", pp);
|
||||||
int parentLevel = parentGroup != null ? toInt(parentGroup.getOrDefault("group_level", 0)) : 0;
|
int parentLevel = parentGroup != null ? toInt(parentGroup.getOrDefault("group_level", 0)) : 0;
|
||||||
String parentPath = parentGroup != null ? toStr(parentGroup.get("hierarchy_path")) : "/" + parentGid + "/";
|
String parentPath = parentGroup != null ? toStr(parentGroup.get("hierarchy_path")) : "/" + parentGid + "/";
|
||||||
|
|
||||||
@@ -1251,17 +1251,17 @@ public class ScreenGroupService extends BaseService {
|
|||||||
ins.put("hierarchy_path", parentPath + "0/");
|
ins.put("hierarchy_path", parentPath + "0/");
|
||||||
ins.put("menu_objid", mObjid);
|
ins.put("menu_objid", mObjid);
|
||||||
ins.put("description", menu.get("menu_desc"));
|
ins.put("description", menu.get("menu_desc"));
|
||||||
sqlSession.insert(NS + "insert_screen_group_for_sync", ins);
|
sqlSession.insert(NS + "insertScreenGroupForSync", ins);
|
||||||
|
|
||||||
int newGid = toInt(ins.get("id"));
|
int newGid = toInt(ins.get("id"));
|
||||||
String hp = (parentPath + newGid + "/").replace("//", "/");
|
String hp = (parentPath + newGid + "/").replace("//", "/");
|
||||||
Map<String, Object> hpu = new HashMap<>();
|
Map<String, Object> hpu = new HashMap<>();
|
||||||
hpu.put("id", newGid);
|
hpu.put("id", newGid);
|
||||||
hpu.put("hierarchy_path", hp);
|
hpu.put("hierarchy_path", hp);
|
||||||
sqlSession.update(NS + "update_group_hierarchy_path_by_id", hpu);
|
sqlSession.update(NS + "updateGroupHierarchyPathById", hpu);
|
||||||
|
|
||||||
Map<String, Object> up2 = new HashMap<>(); up2.put("group_id", newGid); up2.put("objid", mObjid);
|
Map<String, Object> up2 = new HashMap<>(); up2.put("group_id", newGid); up2.put("objid", mObjid);
|
||||||
sqlSession.update(NS + "update_menu_screen_group_id", up2);
|
sqlSession.update(NS + "updateMenuScreenGroupId", up2);
|
||||||
|
|
||||||
menuToGroupMap.put(mObjid, newGid);
|
menuToGroupMap.put(mObjid, newGid);
|
||||||
existingGroupIds.add(newGid);
|
existingGroupIds.add(newGid);
|
||||||
@@ -1291,8 +1291,8 @@ public class ScreenGroupService extends BaseService {
|
|||||||
public Map<String, Object> getSyncStatus(String companyCode) {
|
public Map<String, Object> getSyncStatus(String companyCode) {
|
||||||
Map<String, Object> p = new HashMap<>();
|
Map<String, Object> p = new HashMap<>();
|
||||||
p.put("company_code", companyCode);
|
p.put("company_code", companyCode);
|
||||||
List<Map<String, Object>> groupStats = sqlSession.selectList(NS + "select_sync_status_groups", p);
|
List<Map<String, Object>> groupStats = sqlSession.selectList(NS + "selectSyncStatusGroups", p);
|
||||||
List<Map<String, Object>> menuStats = sqlSession.selectList(NS + "select_sync_status_menus", p);
|
List<Map<String, Object>> menuStats = sqlSession.selectList(NS + "selectSyncStatusMenus", p);
|
||||||
Map<String, Object> status = new LinkedHashMap<>();
|
Map<String, Object> status = new LinkedHashMap<>();
|
||||||
status.put("company_code", companyCode);
|
status.put("company_code", companyCode);
|
||||||
status.put("groups", groupStats);
|
status.put("groups", groupStats);
|
||||||
@@ -1305,7 +1305,7 @@ public class ScreenGroupService extends BaseService {
|
|||||||
// ══════════════════════════════════════════════════════════════
|
// ══════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
public Map<String, Object> syncAllCompanies(String userId) {
|
public Map<String, Object> syncAllCompanies(String userId) {
|
||||||
List<Map<String, Object>> companies = sqlSession.selectList(NS + "select_all_company_codes", null);
|
List<Map<String, Object>> companies = sqlSession.selectList(NS + "selectAllCompanyCodes", null);
|
||||||
List<Map<String, Object>> results = new ArrayList<>();
|
List<Map<String, Object>> results = new ArrayList<>();
|
||||||
int successCount = 0, failedCount = 0;
|
int successCount = 0, failedCount = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ public class ScreenManagementService extends BaseService {
|
|||||||
params.put("exclude_pop", "true".equalsIgnoreCase(epRaw.toString()));
|
params.put("exclude_pop", "true".equalsIgnoreCase(epRaw.toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Map<String, Object>> data = sqlSession.selectList(NS + "select_screen_list", params);
|
List<Map<String, Object>> data = sqlSession.selectList(NS + "selectScreenList", params);
|
||||||
int total = sqlSession.selectOne(NS + "count_screen_list", params);
|
int total = sqlSession.selectOne(NS + "countScreenList", params);
|
||||||
|
|
||||||
// 테이블 레이블 병합
|
// 테이블 레이블 병합
|
||||||
enrichWithTableLabels(data);
|
enrichWithTableLabels(data);
|
||||||
@@ -68,7 +68,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
public Map<String, Object> getScreenById(Integer screenId) {
|
public Map<String, Object> getScreenById(Integer screenId) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("screen_id", screenId);
|
params.put("screen_id", screenId);
|
||||||
return sqlSession.selectOne(NS + "select_screen_by_id", params);
|
return sqlSession.selectOne(NS + "selectScreenById", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 화면에 할당된 메뉴 조회 */
|
/** 화면에 할당된 메뉴 조회 */
|
||||||
@@ -76,38 +76,38 @@ public class ScreenManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("screen_id", screenId);
|
params.put("screen_id", screenId);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
return sqlSession.selectOne(NS + "select_menu_by_screen", params);
|
return sqlSession.selectOne(NS + "selectMenuByScreen", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 화면 생성 */
|
/** 화면 생성 */
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> createScreen(Map<String, Object> body, String companyCode, String userId) {
|
public Map<String, Object> createScreen(Map<String, Object> body, String companyCode, String userId) {
|
||||||
// 화면 코드 중복 체크
|
// 화면 코드 중복 체크
|
||||||
String screenCode = (String) body.get("screen_code");
|
String screenCode = (String) bp(body, "screen_code", "screenCode");
|
||||||
if (screenCode != null) {
|
if (screenCode != null) {
|
||||||
Map<String, Object> ckParams = new HashMap<>();
|
Map<String, Object> ckParams = new HashMap<>();
|
||||||
ckParams.put("screen_code", screenCode);
|
ckParams.put("screen_code", screenCode);
|
||||||
int cnt = sqlSession.selectOne(NS + "check_screen_code_exists", ckParams);
|
int cnt = sqlSession.selectOne(NS + "checkScreenCodeExists", ckParams);
|
||||||
if (cnt > 0) {
|
if (cnt > 0) {
|
||||||
throw new IllegalStateException("DUPLICATE_SCREEN_CODE");
|
throw new IllegalStateException("DUPLICATE_SCREEN_CODE");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("screen_name", body.get("screen_name"));
|
params.put("screen_name", bp(body, "screen_name", "screenName"));
|
||||||
params.put("screen_code", screenCode);
|
params.put("screen_code", screenCode);
|
||||||
params.put("table_name", body.get("table_name"));
|
params.put("table_name", bp(body, "table_name", "tableName"));
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
params.put("description", body.get("description"));
|
params.put("description", body.get("description"));
|
||||||
params.put("created_by", userId);
|
params.put("created_by", userId);
|
||||||
params.put("db_source_type", body.get("db_source_type"));
|
params.put("db_source_type", bp(body, "db_source_type", "dbSourceType"));
|
||||||
params.put("db_connection_id", body.get("db_connection_id"));
|
params.put("db_connection_id", bp(body, "db_connection_id", "dbConnectionId"));
|
||||||
params.put("data_source_type", body.get("data_source_type"));
|
params.put("data_source_type", bp(body, "data_source_type", "dataSourceType"));
|
||||||
params.put("rest_api_connection_id", body.get("rest_api_connection_id"));
|
params.put("rest_api_connection_id", bp(body, "rest_api_connection_id", "restApiConnectionId"));
|
||||||
params.put("rest_api_endpoint", body.get("rest_api_endpoint"));
|
params.put("rest_api_endpoint", bp(body, "rest_api_endpoint", "restApiEndpoint"));
|
||||||
params.put("rest_api_json_path", body.get("rest_api_json_path"));
|
params.put("rest_api_json_path", bp(body, "rest_api_json_path", "restApiJsonPath"));
|
||||||
|
|
||||||
return sqlSession.selectOne(NS + "insert_screen", params);
|
return sqlSession.selectOne(NS + "insertScreen", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 화면 수정 */
|
/** 화면 수정 */
|
||||||
@@ -121,7 +121,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
params.put("is_active", body.getOrDefault("is_active", "Y"));
|
params.put("is_active", body.getOrDefault("is_active", "Y"));
|
||||||
params.put("updated_by", userId);
|
params.put("updated_by", userId);
|
||||||
|
|
||||||
int updated = sqlSession.update(NS + "update_screen", params);
|
int updated = sqlSession.update(NS + "updateScreen", params);
|
||||||
if (updated == 0) return null;
|
if (updated == 0) return null;
|
||||||
return getScreenById(screenId);
|
return getScreenById(screenId);
|
||||||
}
|
}
|
||||||
@@ -143,7 +143,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
params.put("rest_api_endpoint", body.get("rest_api_endpoint"));
|
params.put("rest_api_endpoint", body.get("rest_api_endpoint"));
|
||||||
params.put("rest_api_json_path", body.get("rest_api_json_path"));
|
params.put("rest_api_json_path", body.get("rest_api_json_path"));
|
||||||
|
|
||||||
int updated = sqlSession.update(NS + "update_screen_info", params);
|
int updated = sqlSession.update(NS + "updateScreenInfo", params);
|
||||||
if (updated == 0) return null;
|
if (updated == 0) return null;
|
||||||
return getScreenById(screenId);
|
return getScreenById(screenId);
|
||||||
}
|
}
|
||||||
@@ -154,7 +154,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("screen_id", screenId);
|
params.put("screen_id", screenId);
|
||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
int updated = sqlSession.update(NS + "update_screen_table_name", params);
|
int updated = sqlSession.update(NS + "updateScreenTableName", params);
|
||||||
if (updated == 0) return null;
|
if (updated == 0) return null;
|
||||||
return getScreenById(screenId);
|
return getScreenById(screenId);
|
||||||
}
|
}
|
||||||
@@ -165,8 +165,8 @@ public class ScreenManagementService extends BaseService {
|
|||||||
params.put("screen_id", screenId);
|
params.put("screen_id", screenId);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
|
|
||||||
List<Map<String, Object>> menuDeps = sqlSession.selectList(NS + "select_menu_assignment_deps", params);
|
List<Map<String, Object>> menuDeps = sqlSession.selectList(NS + "selectMenuAssignmentDeps", params);
|
||||||
List<Map<String, Object>> layoutDeps = sqlSession.selectList(NS + "select_screens_with_layouts", params);
|
List<Map<String, Object>> layoutDeps = sqlSession.selectList(NS + "selectScreensWithLayouts", params);
|
||||||
|
|
||||||
// 이 화면을 모달로 사용하는 레이아웃 탐색
|
// 이 화면을 모달로 사용하는 레이아웃 탐색
|
||||||
List<Map<String, Object>> linkedScreens = detectLinkedScreensInternal(screenId, companyCode);
|
List<Map<String, Object>> linkedScreens = detectLinkedScreensInternal(screenId, companyCode);
|
||||||
@@ -205,15 +205,15 @@ public class ScreenManagementService extends BaseService {
|
|||||||
usageParams.put("screen_id", screenId);
|
usageParams.put("screen_id", screenId);
|
||||||
usageParams.put("company_code", companyCode);
|
usageParams.put("company_code", companyCode);
|
||||||
usageParams.put("flow_id", flowId);
|
usageParams.put("flow_id", flowId);
|
||||||
int usageCount = sqlSession.selectOne(NS + "count_flow_usage_in_other_screens", usageParams);
|
int usageCount = sqlSession.selectOne(NS + "countFlowUsageInOtherScreens", usageParams);
|
||||||
if (usageCount == 0) {
|
if (usageCount == 0) {
|
||||||
Map<String, Object> fp = new HashMap<>();
|
Map<String, Object> fp = new HashMap<>();
|
||||||
fp.put("flow_id", flowId);
|
fp.put("flow_id", flowId);
|
||||||
fp.put("company_code", companyCode);
|
fp.put("company_code", companyCode);
|
||||||
sqlSession.delete(NS + "delete_flow_step_connections", fp);
|
sqlSession.delete(NS + "deleteFlowStepConnections", fp);
|
||||||
sqlSession.delete(NS + "delete_flow_steps", fp);
|
sqlSession.delete(NS + "deleteFlowSteps", fp);
|
||||||
sqlSession.delete(NS + "delete_flow_definition", fp);
|
sqlSession.delete(NS + "deleteFlowDefinition", fp);
|
||||||
sqlSession.delete(NS + "delete_node_flows_by_flow_id", fp);
|
sqlSession.delete(NS + "deleteNodeFlowsByFlowId", fp);
|
||||||
log.info("화면 삭제 시 플로우 삭제: screenId={}, flowId={}", screenId, flowId);
|
log.info("화면 삭제 시 플로우 삭제: screenId={}, flowId={}", screenId, flowId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -223,9 +223,9 @@ public class ScreenManagementService extends BaseService {
|
|||||||
params.put("screen_id", screenId);
|
params.put("screen_id", screenId);
|
||||||
params.put("deleted_by", userId);
|
params.put("deleted_by", userId);
|
||||||
params.put("delete_reason", deleteReason);
|
params.put("delete_reason", deleteReason);
|
||||||
sqlSession.update(NS + "soft_delete_screen", params);
|
sqlSession.update(NS + "softDeleteScreen", params);
|
||||||
sqlSession.update(NS + "deactivate_menu_assignments_by_screen", params);
|
sqlSession.update(NS + "deactivateMenuAssignmentsByScreen", params);
|
||||||
sqlSession.delete(NS + "delete_screen_group_links", params);
|
sqlSession.delete(NS + "deleteScreenGroupLinks", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 화면 일괄 소프트 삭제 */
|
/** 화면 일괄 소프트 삭제 */
|
||||||
@@ -241,7 +241,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("screen_name", screenName);
|
params.put("screen_name", screenName);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
int cnt = sqlSession.selectOne(NS + "check_duplicate_screen_name", params);
|
int cnt = sqlSession.selectOne(NS + "checkDuplicateScreenName", params);
|
||||||
return cnt > 0;
|
return cnt > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,9 +256,9 @@ public class ScreenManagementService extends BaseService {
|
|||||||
params.put("size", size);
|
params.put("size", size);
|
||||||
params.put("offset", (page - 1) * size);
|
params.put("offset", (page - 1) * size);
|
||||||
|
|
||||||
List<Map<String, Object>> data = sqlSession.selectList(NS + "select_deleted_screen_list", params);
|
List<Map<String, Object>> data = sqlSession.selectList(NS + "selectDeletedScreenList", params);
|
||||||
int total = sqlSession.selectOne(NS + "count_deleted_screen_list", params);
|
int total = sqlSession.selectOne(NS + "countDeletedScreenList", params);
|
||||||
data = commonService.toCamelCaseKeysList(data);
|
// snake_case 통일: camelCase 변환 제거
|
||||||
|
|
||||||
Map<String, Object> result = new LinkedHashMap<>();
|
Map<String, Object> result = new LinkedHashMap<>();
|
||||||
result.put("data", data);
|
result.put("data", data);
|
||||||
@@ -281,7 +281,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
Map<String, Object> ckParams = new HashMap<>();
|
Map<String, Object> ckParams = new HashMap<>();
|
||||||
ckParams.put("screen_code", screenCode);
|
ckParams.put("screen_code", screenCode);
|
||||||
ckParams.put("screen_id", screenId);
|
ckParams.put("screen_id", screenId);
|
||||||
int cnt = sqlSession.selectOne(NS + "check_screen_code_for_restore", ckParams);
|
int cnt = sqlSession.selectOne(NS + "checkScreenCodeForRestore", ckParams);
|
||||||
if (cnt > 0) {
|
if (cnt > 0) {
|
||||||
throw new IllegalStateException("SCREEN_CODE_CONFLICT");
|
throw new IllegalStateException("SCREEN_CODE_CONFLICT");
|
||||||
}
|
}
|
||||||
@@ -290,8 +290,8 @@ public class ScreenManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("screen_id", screenId);
|
params.put("screen_id", screenId);
|
||||||
params.put("restored_by", userId);
|
params.put("restored_by", userId);
|
||||||
sqlSession.update(NS + "restore_screen", params);
|
sqlSession.update(NS + "restoreScreen", params);
|
||||||
sqlSession.update(NS + "reactivate_menu_assignments_by_screen", params);
|
sqlSession.update(NS + "reactivateMenuAssignmentsByScreen", params);
|
||||||
return getScreenById(screenId);
|
return getScreenById(screenId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -301,8 +301,8 @@ public class ScreenManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("screen_id", screenId);
|
params.put("screen_id", screenId);
|
||||||
sqlSession.delete(NS + "permanentDeleteLayoutV1", params);
|
sqlSession.delete(NS + "permanentDeleteLayoutV1", params);
|
||||||
sqlSession.delete(NS + "permanent_delete_menu_assignments_by_screen", params);
|
sqlSession.delete(NS + "permanentDeleteMenuAssignmentsByScreen", params);
|
||||||
sqlSession.delete(NS + "permanent_delete_screen", params);
|
sqlSession.delete(NS + "permanentDeleteScreen", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 영구 삭제 (일괄) */
|
/** 영구 삭제 (일괄) */
|
||||||
@@ -324,7 +324,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
int lockId = companyCode.chars().sum();
|
int lockId = companyCode.chars().sum();
|
||||||
Map<String, Object> lockParams = new HashMap<>();
|
Map<String, Object> lockParams = new HashMap<>();
|
||||||
lockParams.put("lock_id", (long) lockId);
|
lockParams.put("lock_id", (long) lockId);
|
||||||
sqlSession.selectOne(NS + "pg_advisory_xact_lock", lockParams);
|
sqlSession.selectOne(NS + "pgAdvisoryXactLock", lockParams);
|
||||||
|
|
||||||
return calcNextScreenCode(companyCode);
|
return calcNextScreenCode(companyCode);
|
||||||
}
|
}
|
||||||
@@ -335,11 +335,11 @@ public class ScreenManagementService extends BaseService {
|
|||||||
int lockId = companyCode.chars().sum();
|
int lockId = companyCode.chars().sum();
|
||||||
Map<String, Object> lockParams = new HashMap<>();
|
Map<String, Object> lockParams = new HashMap<>();
|
||||||
lockParams.put("lock_id", (long) lockId);
|
lockParams.put("lock_id", (long) lockId);
|
||||||
sqlSession.selectOne(NS + "pg_advisory_xact_lock", lockParams);
|
sqlSession.selectOne(NS + "pgAdvisoryXactLock", lockParams);
|
||||||
|
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("pattern", companyCode + "_%");
|
params.put("pattern", companyCode + "_%");
|
||||||
List<Map<String, Object>> existing = sqlSession.selectList(NS + "select_screen_codes_by_pattern", params);
|
List<Map<String, Object>> existing = sqlSession.selectList(NS + "selectScreenCodesByPattern", params);
|
||||||
|
|
||||||
Pattern numPattern = Pattern.compile("^" + Pattern.quote(companyCode) + "_(\\d+)$");
|
Pattern numPattern = Pattern.compile("^" + Pattern.quote(companyCode) + "_(\\d+)$");
|
||||||
int maxNumber = existing.stream()
|
int maxNumber = existing.stream()
|
||||||
@@ -366,7 +366,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> copyScreen(Integer screenId, String newName,
|
public Map<String, Object> copyScreen(Integer screenId, String newName,
|
||||||
String companyCode, String userId) {
|
String companyCode, String userId) {
|
||||||
Map<String, Object> original = sqlSession.selectOne(NS + "select_screen_for_copy", Map.of("screen_id", screenId));
|
Map<String, Object> original = sqlSession.selectOne(NS + "selectScreenForCopy", Map.of("screen_id", screenId));
|
||||||
if (original == null) throw new IllegalArgumentException("복사할 화면을 찾을 수 없습니다.");
|
if (original == null) throw new IllegalArgumentException("복사할 화면을 찾을 수 없습니다.");
|
||||||
|
|
||||||
String newCode = generateScreenCode(companyCode);
|
String newCode = generateScreenCode(companyCode);
|
||||||
@@ -385,7 +385,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
insertParams.put("rest_api_endpoint", original.get("rest_api_endpoint"));
|
insertParams.put("rest_api_endpoint", original.get("rest_api_endpoint"));
|
||||||
insertParams.put("rest_api_json_path", original.get("rest_api_json_path"));
|
insertParams.put("rest_api_json_path", original.get("rest_api_json_path"));
|
||||||
|
|
||||||
Map<String, Object> newScreen = sqlSession.selectOne(NS + "insert_screen_copy", insertParams);
|
Map<String, Object> newScreen = sqlSession.selectOne(NS + "insertScreenCopy", insertParams);
|
||||||
Integer newScreenId = toInteger(newScreen.get("screen_id"));
|
Integer newScreenId = toInteger(newScreen.get("screen_id"));
|
||||||
|
|
||||||
// Layout V1 복사
|
// Layout V1 복사
|
||||||
@@ -449,13 +449,13 @@ public class ScreenManagementService extends BaseService {
|
|||||||
// ═══════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════
|
||||||
|
|
||||||
public List<Map<String, Object>> getTables() {
|
public List<Map<String, Object>> getTables() {
|
||||||
return sqlSession.selectList(NS + "select_public_tables", new HashMap<>());
|
return sqlSession.selectList(NS + "selectPublicTables", new HashMap<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getTableInfo(String tableName) {
|
public Map<String, Object> getTableInfo(String tableName) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
return sqlSession.selectOne(NS + "select_table_info_by_name", params);
|
return sqlSession.selectOne(NS + "selectTableInfoByName", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getTableColumns(String tableName, String companyCode) {
|
public Map<String, Object> getTableColumns(String tableName, String companyCode) {
|
||||||
@@ -463,8 +463,8 @@ public class ScreenManagementService extends BaseService {
|
|||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
|
|
||||||
List<Map<String, Object>> columns = sqlSession.selectList(NS + "select_table_columns_info", params);
|
List<Map<String, Object>> columns = sqlSession.selectList(NS + "selectTableColumnsInfo", params);
|
||||||
List<Map<String, Object>> typeColumns = sqlSession.selectList(NS + "select_table_type_columns_info", params);
|
List<Map<String, Object>> typeColumns = sqlSession.selectList(NS + "selectTableTypeColumnsInfo", params);
|
||||||
|
|
||||||
Map<String, Object> result = new LinkedHashMap<>();
|
Map<String, Object> result = new LinkedHashMap<>();
|
||||||
result.put("columns", columns);
|
result.put("columns", columns);
|
||||||
@@ -704,7 +704,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
Map<String, Object> tp = new HashMap<>();
|
Map<String, Object> tp = new HashMap<>();
|
||||||
tp.put("screen_id", screenId);
|
tp.put("screen_id", screenId);
|
||||||
tp.put("table_name", tableName);
|
tp.put("table_name", tableName);
|
||||||
sqlSession.update(NS + "update_screen_main_table", tp);
|
sqlSession.update(NS + "updateScreenMainTable", tp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -716,7 +716,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("screen_id", screenId);
|
params.put("screen_id", screenId);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
return sqlSession.selectOne(NS + "select_layout_pop", params);
|
return sqlSession.selectOne(NS + "selectLayoutPop", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -728,7 +728,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
params.put("layout_data", layoutData);
|
params.put("layout_data", layoutData);
|
||||||
params.put("user_id", userId);
|
params.put("user_id", userId);
|
||||||
sqlSession.insert(NS + "upsert_layout_pop", params);
|
sqlSession.insert(NS + "upsertLayoutPop", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -736,13 +736,13 @@ public class ScreenManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("screen_id", screenId);
|
params.put("screen_id", screenId);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
sqlSession.delete(NS + "delete_layout_pop_by_screen", params);
|
sqlSession.delete(NS + "deleteLayoutPopByScreen", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Map<String, Object>> getScreenIdsWithPopLayout(String companyCode) {
|
public List<Map<String, Object>> getScreenIdsWithPopLayout(String companyCode) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
return sqlSession.selectList(NS + "select_screen_ids_with_pop_layout", params);
|
return sqlSession.selectList(NS + "selectScreenIdsWithPopLayout", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ═══════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════
|
||||||
@@ -753,7 +753,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("screen_id", screenId);
|
params.put("screen_id", screenId);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
return sqlSession.selectList(NS + "select_layers_by_screen", params);
|
return sqlSession.selectList(NS + "selectLayersByScreen", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getLayerLayout(Integer screenId, Integer layerId, String companyCode) {
|
public Map<String, Object> getLayerLayout(Integer screenId, Integer layerId, String companyCode) {
|
||||||
@@ -761,7 +761,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
params.put("screen_id", screenId);
|
params.put("screen_id", screenId);
|
||||||
params.put("layer_id", layerId);
|
params.put("layer_id", layerId);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
return sqlSession.selectOne(NS + "select_layer_layout", params);
|
return sqlSession.selectOne(NS + "selectLayerLayout", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -770,7 +770,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
params.put("screen_id", screenId);
|
params.put("screen_id", screenId);
|
||||||
params.put("layer_id", layerId);
|
params.put("layer_id", layerId);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
return sqlSession.delete(NS + "delete_layer_by_id", params) > 0;
|
return sqlSession.delete(NS + "deleteLayerById", params) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -782,7 +782,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
params.put("condition_config", toJsonString(body.get("condition_config")));
|
params.put("condition_config", toJsonString(body.get("condition_config")));
|
||||||
if (body.containsKey("layer_name")) params.put("layer_name", body.get("layer_name"));
|
if (body.containsKey("layer_name")) params.put("layer_name", body.get("layer_name"));
|
||||||
sqlSession.update(NS + "update_layer_condition", params);
|
sqlSession.update(NS + "updateLayerCondition", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ═══════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════
|
||||||
@@ -793,7 +793,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("screen_id", screenId);
|
params.put("screen_id", screenId);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
return sqlSession.selectList(NS + "select_zones_by_screen", params);
|
return sqlSession.selectList(NS + "selectZonesByScreen", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -809,7 +809,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
params.put("trigger_component_id", body.get("trigger_component_id"));
|
params.put("trigger_component_id", body.get("trigger_component_id"));
|
||||||
params.put("trigger_operator", body.get("trigger_operator"));
|
params.put("trigger_operator", body.get("trigger_operator"));
|
||||||
|
|
||||||
Map<String, Object> zone = sqlSession.selectOne(NS + "insert_zone", params);
|
Map<String, Object> zone = sqlSession.selectOne(NS + "insertZone", params);
|
||||||
|
|
||||||
// 새 레이어 생성 (zone에 연결)
|
// 새 레이어 생성 (zone에 연결)
|
||||||
Integer newLayerId = calcNextLayerId(screenId, companyCode);
|
Integer newLayerId = calcNextLayerId(screenId, companyCode);
|
||||||
@@ -820,7 +820,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
layerParams.put("layer_name", body.getOrDefault("zone_name", "새 레이어"));
|
layerParams.put("layer_name", body.getOrDefault("zone_name", "새 레이어"));
|
||||||
layerParams.put("layout_data", "{\"components\":[]}");
|
layerParams.put("layout_data", "{\"components\":[]}");
|
||||||
layerParams.put("condition_config", "{}");
|
layerParams.put("condition_config", "{}");
|
||||||
sqlSession.insert(NS + "insert_layer_for_zone", layerParams);
|
sqlSession.insert(NS + "insertLayerForZone", layerParams);
|
||||||
|
|
||||||
Map<String, Object> result = new LinkedHashMap<>();
|
Map<String, Object> result = new LinkedHashMap<>();
|
||||||
result.put("zone", zone);
|
result.put("zone", zone);
|
||||||
@@ -833,7 +833,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>(body);
|
Map<String, Object> params = new HashMap<>(body);
|
||||||
params.put("zone_id", zoneId);
|
params.put("zone_id", zoneId);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
return sqlSession.update(NS + "update_zone", params) > 0;
|
return sqlSession.update(NS + "updateZone", params) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -842,12 +842,12 @@ public class ScreenManagementService extends BaseService {
|
|||||||
Map<String, Object> clearParams = new HashMap<>();
|
Map<String, Object> clearParams = new HashMap<>();
|
||||||
clearParams.put("zone_id_str", String.valueOf(zoneId));
|
clearParams.put("zone_id_str", String.valueOf(zoneId));
|
||||||
clearParams.put("company_code", companyCode);
|
clearParams.put("company_code", companyCode);
|
||||||
sqlSession.update(NS + "clear_zone_condition_configs", clearParams);
|
sqlSession.update(NS + "clearZoneConditionConfigs", clearParams);
|
||||||
|
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("zone_id", zoneId);
|
params.put("zone_id", zoneId);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
return sqlSession.delete(NS + "delete_zone_by_id", params) > 0;
|
return sqlSession.delete(NS + "deleteZoneById", params) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -861,7 +861,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
params.put("layer_name", body.getOrDefault("layer_name", "새 레이어"));
|
params.put("layer_name", body.getOrDefault("layer_name", "새 레이어"));
|
||||||
params.put("layout_data", "{\"components\":[]}");
|
params.put("layout_data", "{\"components\":[]}");
|
||||||
params.put("condition_config", toJsonString(body.getOrDefault("condition_config", new HashMap<>())));
|
params.put("condition_config", toJsonString(body.getOrDefault("condition_config", new HashMap<>())));
|
||||||
sqlSession.insert(NS + "insert_layer_for_zone", params);
|
sqlSession.insert(NS + "insertLayerForZone", params);
|
||||||
|
|
||||||
Map<String, Object> result = new LinkedHashMap<>();
|
Map<String, Object> result = new LinkedHashMap<>();
|
||||||
result.put("layer_id", newLayerId);
|
result.put("layer_id", newLayerId);
|
||||||
@@ -876,14 +876,14 @@ public class ScreenManagementService extends BaseService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> assignScreenToMenu(Integer screenId, Map<String, Object> body,
|
public Map<String, Object> assignScreenToMenu(Integer screenId, Map<String, Object> body,
|
||||||
String companyCode, String userId) {
|
String companyCode, String userId) {
|
||||||
Integer menuObjid = toInteger(body.get("menu_objid"));
|
String menuObjid = String.valueOf(body.get("menu_objid"));
|
||||||
|
|
||||||
// 기존 할당 체크
|
// 기존 할당 체크
|
||||||
Map<String, Object> ckParams = new HashMap<>();
|
Map<String, Object> ckParams = new HashMap<>();
|
||||||
ckParams.put("screen_id", screenId);
|
ckParams.put("screen_id", screenId);
|
||||||
ckParams.put("menu_objid", menuObjid);
|
ckParams.put("menu_objid", menuObjid);
|
||||||
ckParams.put("company_code", companyCode);
|
ckParams.put("company_code", companyCode);
|
||||||
Map<String, Object> existing = sqlSession.selectOne(NS + "check_menu_assignment_exists", ckParams);
|
Map<String, Object> existing = sqlSession.selectOne(NS + "checkMenuAssignmentExists", ckParams);
|
||||||
if (existing != null) throw new IllegalStateException("ALREADY_ASSIGNED");
|
if (existing != null) throw new IllegalStateException("ALREADY_ASSIGNED");
|
||||||
|
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
@@ -892,13 +892,13 @@ public class ScreenManagementService extends BaseService {
|
|||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
params.put("display_order", body.getOrDefault("display_order", 0));
|
params.put("display_order", body.getOrDefault("display_order", 0));
|
||||||
params.put("created_by", userId);
|
params.put("created_by", userId);
|
||||||
sqlSession.insert(NS + "insert_menu_assignment", params);
|
sqlSession.insert(NS + "insertMenuAssignment", params);
|
||||||
|
|
||||||
// screen_code 조회 → menu_info 업데이트
|
// screen_code 조회 → menu_info 업데이트
|
||||||
Map<String, Object> screenCodeRow = sqlSession.selectOne(NS + "select_screen_code", Map.of("screen_id", screenId));
|
Map<String, Object> screenCodeRow = sqlSession.selectOne(NS + "selectScreenCode", Map.of("screen_id", screenId));
|
||||||
String screenCode = screenCodeRow != null ? (String) screenCodeRow.get("screen_code") : null;
|
String screenCode = screenCodeRow != null ? (String) screenCodeRow.get("screen_code") : null;
|
||||||
|
|
||||||
Map<String, Object> menuTypeRow = sqlSession.selectOne(NS + "select_menu_type", Map.of("menu_objid", menuObjid));
|
Map<String, Object> menuTypeRow = sqlSession.selectOne(NS + "selectMenuType", Map.of("menu_objid", menuObjid));
|
||||||
String menuType = menuTypeRow != null ? (String) menuTypeRow.get("menu_type") : null;
|
String menuType = menuTypeRow != null ? (String) menuTypeRow.get("menu_type") : null;
|
||||||
|
|
||||||
if (screenCode != null) {
|
if (screenCode != null) {
|
||||||
@@ -907,7 +907,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
updateParams.put("menu_objid", menuObjid);
|
updateParams.put("menu_objid", menuObjid);
|
||||||
updateParams.put("menu_url", menuUrl);
|
updateParams.put("menu_url", menuUrl);
|
||||||
updateParams.put("screen_code", screenCode);
|
updateParams.put("screen_code", screenCode);
|
||||||
sqlSession.update(NS + "update_menu_info_assign", updateParams);
|
sqlSession.update(NS + "updateMenuInfoAssign", updateParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> result = new LinkedHashMap<>();
|
Map<String, Object> result = new LinkedHashMap<>();
|
||||||
@@ -918,26 +918,26 @@ public class ScreenManagementService extends BaseService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Map<String, Object>> getScreensByMenu(Integer menuObjid, String companyCode) {
|
public List<Map<String, Object>> getScreensByMenu(String menuObjid, String companyCode) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("menu_objid", menuObjid);
|
params.put("menu_objid", menuObjid);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
return sqlSession.selectList(NS + "select_screens_by_menu", params);
|
return sqlSession.selectList(NS + "selectScreensByMenu", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void unassignScreenFromMenu(Integer screenId, Integer menuObjid, String companyCode) {
|
public void unassignScreenFromMenu(Integer screenId, String menuObjid, String companyCode) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("screen_id", screenId);
|
params.put("screen_id", screenId);
|
||||||
params.put("menu_objid", menuObjid);
|
params.put("menu_objid", menuObjid);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
sqlSession.delete(NS + "delete_menu_assignment", params);
|
sqlSession.delete(NS + "deleteMenuAssignment", params);
|
||||||
sqlSession.update(NS + "update_menu_info_unassign", Map.of("menu_objid", menuObjid));
|
sqlSession.update(NS + "updateMenuInfoUnassign", Map.of("menu_objid", menuObjid));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public int cleanupDeletedMenuAssignments() {
|
public int cleanupDeletedMenuAssignments() {
|
||||||
return sqlSession.update(NS + "cleanup_deleted_menu_assignments", new HashMap<>());
|
return sqlSession.update(NS + "cleanupDeletedMenuAssignments", new HashMap<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
// ═══════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════
|
||||||
@@ -977,7 +977,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("screen_ids", screenIds);
|
params.put("screen_ids", screenIds);
|
||||||
params.put("source_company_code", sourceCompanyCode);
|
params.put("source_company_code", sourceCompanyCode);
|
||||||
List<Map<String, Object>> assignments = sqlSession.selectList(NS + "select_menu_assignments_for_copy", params);
|
List<Map<String, Object>> assignments = sqlSession.selectList(NS + "selectMenuAssignmentsForCopy", params);
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (Map<String, Object> a : assignments) {
|
for (Map<String, Object> a : assignments) {
|
||||||
@@ -987,7 +987,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
ip.put("company_code", targetCompanyCode);
|
ip.put("company_code", targetCompanyCode);
|
||||||
ip.put("display_order", a.get("display_order"));
|
ip.put("display_order", a.get("display_order"));
|
||||||
ip.put("created_by", userId);
|
ip.put("created_by", userId);
|
||||||
sqlSession.insert(NS + "insert_menu_assignment_copy", ip);
|
sqlSession.insert(NS + "insertMenuAssignmentCopy", ip);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
@@ -1002,21 +1002,21 @@ public class ScreenManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("source_company_code", sourceCompanyCode);
|
params.put("source_company_code", sourceCompanyCode);
|
||||||
|
|
||||||
List<Map<String, Object>> categories = sqlSession.selectList(NS + "select_code_category_for_copy", params);
|
List<Map<String, Object>> categories = sqlSession.selectList(NS + "selectCodeCategoryForCopy", params);
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (Map<String, Object> cat : categories) {
|
for (Map<String, Object> cat : categories) {
|
||||||
Map<String, Object> cp = new HashMap<>(cat);
|
Map<String, Object> cp = new HashMap<>(cat);
|
||||||
cp.put("target_company_code", targetCompanyCode);
|
cp.put("target_company_code", targetCompanyCode);
|
||||||
sqlSession.insert(NS + "upsert_code_category", cp);
|
sqlSession.insert(NS + "upsertCodeCategory", cp);
|
||||||
|
|
||||||
Map<String, Object> codeParams = new HashMap<>();
|
Map<String, Object> codeParams = new HashMap<>();
|
||||||
codeParams.put("source_company_code", sourceCompanyCode);
|
codeParams.put("source_company_code", sourceCompanyCode);
|
||||||
codeParams.put("code_category", cat.get("category_code"));
|
codeParams.put("code_category", cat.get("category_code"));
|
||||||
List<Map<String, Object>> codes = sqlSession.selectList(NS + "select_code_info_for_copy", codeParams);
|
List<Map<String, Object>> codes = sqlSession.selectList(NS + "selectCodeInfoForCopy", codeParams);
|
||||||
for (Map<String, Object> code : codes) {
|
for (Map<String, Object> code : codes) {
|
||||||
Map<String, Object> cop = new HashMap<>(code);
|
Map<String, Object> cop = new HashMap<>(code);
|
||||||
cop.put("target_company_code", targetCompanyCode);
|
cop.put("target_company_code", targetCompanyCode);
|
||||||
sqlSession.insert(NS + "upsert_code_info", cop);
|
sqlSession.insert(NS + "upsertCodeInfo", cop);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1031,18 +1031,18 @@ public class ScreenManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("source_company_code", sourceCompanyCode);
|
params.put("source_company_code", sourceCompanyCode);
|
||||||
|
|
||||||
List<Map<String, Object>> trees = sqlSession.selectList(NS + "select_category_tree_for_copy", params);
|
List<Map<String, Object>> trees = sqlSession.selectList(NS + "selectCategoryTreeForCopy", params);
|
||||||
for (Map<String, Object> t : trees) {
|
for (Map<String, Object> t : trees) {
|
||||||
Map<String, Object> tp = new HashMap<>(t);
|
Map<String, Object> tp = new HashMap<>(t);
|
||||||
tp.put("target_company_code", targetCompanyCode);
|
tp.put("target_company_code", targetCompanyCode);
|
||||||
sqlSession.insert(NS + "upsert_category_tree", tp);
|
sqlSession.insert(NS + "upsertCategoryTree", tp);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Map<String, Object>> values = sqlSession.selectList(NS + "select_category_value_for_copy", params);
|
List<Map<String, Object>> values = sqlSession.selectList(NS + "selectCategoryValueForCopy", params);
|
||||||
for (Map<String, Object> v : values) {
|
for (Map<String, Object> v : values) {
|
||||||
Map<String, Object> vp = new HashMap<>(v);
|
Map<String, Object> vp = new HashMap<>(v);
|
||||||
vp.put("target_company_code", targetCompanyCode);
|
vp.put("target_company_code", targetCompanyCode);
|
||||||
sqlSession.insert(NS + "upsert_category_value", vp);
|
sqlSession.insert(NS + "upsertCategoryValue", vp);
|
||||||
}
|
}
|
||||||
return trees.size() + values.size();
|
return trees.size() + values.size();
|
||||||
}
|
}
|
||||||
@@ -1055,11 +1055,11 @@ public class ScreenManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("source_company_code", sourceCompanyCode);
|
params.put("source_company_code", sourceCompanyCode);
|
||||||
|
|
||||||
List<Map<String, Object>> cols = sqlSession.selectList(NS + "select_table_type_columns_for_copy", params);
|
List<Map<String, Object>> cols = sqlSession.selectList(NS + "selectTableTypeColumnsForCopy", params);
|
||||||
for (Map<String, Object> col : cols) {
|
for (Map<String, Object> col : cols) {
|
||||||
Map<String, Object> cp = new HashMap<>(col);
|
Map<String, Object> cp = new HashMap<>(col);
|
||||||
cp.put("target_company_code", targetCompanyCode);
|
cp.put("target_company_code", targetCompanyCode);
|
||||||
sqlSession.insert(NS + "upsert_table_type_column", cp);
|
sqlSession.insert(NS + "upsertTableTypeColumn", cp);
|
||||||
}
|
}
|
||||||
return cols.size();
|
return cols.size();
|
||||||
}
|
}
|
||||||
@@ -1072,11 +1072,11 @@ public class ScreenManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("source_company_code", sourceCompanyCode);
|
params.put("source_company_code", sourceCompanyCode);
|
||||||
|
|
||||||
List<Map<String, Object>> rels = sqlSession.selectList(NS + "select_cascading_relation_for_copy", params);
|
List<Map<String, Object>> rels = sqlSession.selectList(NS + "selectCascadingRelationForCopy", params);
|
||||||
for (Map<String, Object> rel : rels) {
|
for (Map<String, Object> rel : rels) {
|
||||||
Map<String, Object> rp = new HashMap<>(rel);
|
Map<String, Object> rp = new HashMap<>(rel);
|
||||||
rp.put("target_company_code", targetCompanyCode);
|
rp.put("target_company_code", targetCompanyCode);
|
||||||
sqlSession.insert(NS + "upsert_cascading_relation", rp);
|
sqlSession.insert(NS + "upsertCascadingRelation", rp);
|
||||||
}
|
}
|
||||||
return rels.size();
|
return rels.size();
|
||||||
}
|
}
|
||||||
@@ -1089,7 +1089,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("screen_id", screenId);
|
params.put("screen_id", screenId);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
Map<String, Object> popLayout = sqlSession.selectOne(NS + "select_layout_pop", params);
|
Map<String, Object> popLayout = sqlSession.selectOne(NS + "selectLayoutPop", params);
|
||||||
|
|
||||||
List<Integer> linkedScreenIds = new ArrayList<>();
|
List<Integer> linkedScreenIds = new ArrayList<>();
|
||||||
if (popLayout != null) {
|
if (popLayout != null) {
|
||||||
@@ -1101,7 +1101,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
if (!linkedScreenIds.isEmpty()) {
|
if (!linkedScreenIds.isEmpty()) {
|
||||||
Map<String, Object> idsParams = new HashMap<>();
|
Map<String, Object> idsParams = new HashMap<>();
|
||||||
idsParams.put("ids", linkedScreenIds);
|
idsParams.put("ids", linkedScreenIds);
|
||||||
linkedScreens = sqlSession.selectList(NS + "select_screens_by_ids", idsParams);
|
linkedScreens = sqlSession.selectList(NS + "selectScreensByIds", idsParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> result = new LinkedHashMap<>();
|
Map<String, Object> result = new LinkedHashMap<>();
|
||||||
@@ -1125,7 +1125,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
Map<String, Object> existsParams = new HashMap<>();
|
Map<String, Object> existsParams = new HashMap<>();
|
||||||
existsParams.put("screen_code", screenCode);
|
existsParams.put("screen_code", screenCode);
|
||||||
existsParams.put("company_code", targetCompanyCode);
|
existsParams.put("company_code", targetCompanyCode);
|
||||||
Map<String, Object> existing = sqlSession.selectOne(NS + "select_screen_by_code", existsParams);
|
Map<String, Object> existing = sqlSession.selectOne(NS + "selectScreenByCode", existsParams);
|
||||||
|
|
||||||
Integer targetScreenId;
|
Integer targetScreenId;
|
||||||
if (existing == null) {
|
if (existing == null) {
|
||||||
@@ -1139,7 +1139,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
insertParams.put("created_by", userId);
|
insertParams.put("created_by", userId);
|
||||||
insertParams.put("db_source_type", screenDef.get("db_source_type"));
|
insertParams.put("db_source_type", screenDef.get("db_source_type"));
|
||||||
insertParams.put("data_source_type", screenDef.get("data_source_type"));
|
insertParams.put("data_source_type", screenDef.get("data_source_type"));
|
||||||
Map<String, Object> created = sqlSession.selectOne(NS + "insert_screen_for_deploy", insertParams);
|
Map<String, Object> created = sqlSession.selectOne(NS + "insertScreenForDeploy", insertParams);
|
||||||
targetScreenId = toInteger(created.get("screen_id"));
|
targetScreenId = toInteger(created.get("screen_id"));
|
||||||
} else {
|
} else {
|
||||||
targetScreenId = toInteger(existing.get("screen_id"));
|
targetScreenId = toInteger(existing.get("screen_id"));
|
||||||
@@ -1149,7 +1149,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
Map<String, Object> sourceParams = new HashMap<>();
|
Map<String, Object> sourceParams = new HashMap<>();
|
||||||
sourceParams.put("screen_id", toInteger(screenDef.get("screen_id")));
|
sourceParams.put("screen_id", toInteger(screenDef.get("screen_id")));
|
||||||
sourceParams.put("company_code", sourceCompanyCode);
|
sourceParams.put("company_code", sourceCompanyCode);
|
||||||
Map<String, Object> sourceLayout = sqlSession.selectOne(NS + "select_layout_pop", sourceParams);
|
Map<String, Object> sourceLayout = sqlSession.selectOne(NS + "selectLayoutPop", sourceParams);
|
||||||
|
|
||||||
if (sourceLayout != null) {
|
if (sourceLayout != null) {
|
||||||
Map<String, Object> deployParams = new HashMap<>();
|
Map<String, Object> deployParams = new HashMap<>();
|
||||||
@@ -1157,7 +1157,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
deployParams.put("company_code", targetCompanyCode);
|
deployParams.put("company_code", targetCompanyCode);
|
||||||
deployParams.put("layout_data", toJsonString(sourceLayout.get("layout_data")));
|
deployParams.put("layout_data", toJsonString(sourceLayout.get("layout_data")));
|
||||||
deployParams.put("user_id", userId);
|
deployParams.put("user_id", userId);
|
||||||
sqlSession.insert(NS + "upsert_pop_layout_deploy", deployParams);
|
sqlSession.insert(NS + "upsertPopLayoutDeploy", deployParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> result = new LinkedHashMap<>();
|
Map<String, Object> result = new LinkedHashMap<>();
|
||||||
@@ -1181,7 +1181,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
private List<Map<String, Object>> detectLinkedScreensInternal(Integer screenId, String companyCode) {
|
private List<Map<String, Object>> detectLinkedScreensInternal(Integer screenId, String companyCode) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("screen_id", screenId);
|
params.put("screen_id", screenId);
|
||||||
List<Map<String, Object>> layouts = sqlSession.selectList(NS + "select_layouts_for_linked_modal", params);
|
List<Map<String, Object>> layouts = sqlSession.selectList(NS + "selectLayoutsForLinkedModal", params);
|
||||||
|
|
||||||
Set<Integer> linkedIds = new LinkedHashSet<>();
|
Set<Integer> linkedIds = new LinkedHashSet<>();
|
||||||
for (Map<String, Object> layout : layouts) {
|
for (Map<String, Object> layout : layouts) {
|
||||||
@@ -1198,7 +1198,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
|
|
||||||
Map<String, Object> idsParams = new HashMap<>();
|
Map<String, Object> idsParams = new HashMap<>();
|
||||||
idsParams.put("ids", new ArrayList<>(linkedIds));
|
idsParams.put("ids", new ArrayList<>(linkedIds));
|
||||||
return sqlSession.selectList(NS + "select_screens_by_ids", idsParams);
|
return sqlSession.selectList(NS + "selectScreensByIds", idsParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** JSON 노드 트리를 재귀 탐색하여 screenId 참조 수집 */
|
/** JSON 노드 트리를 재귀 탐색하여 screenId 참조 수집 */
|
||||||
@@ -1353,7 +1353,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("table_names", new ArrayList<>(tableNames));
|
params.put("table_names", new ArrayList<>(tableNames));
|
||||||
try {
|
try {
|
||||||
List<Map<String, Object>> labels = sqlSession.selectList(NS + "select_table_labels_by_names", params);
|
List<Map<String, Object>> labels = sqlSession.selectList(NS + "selectTableLabelsByNames", params);
|
||||||
Map<String, String> labelMap = new HashMap<>();
|
Map<String, String> labelMap = new HashMap<>();
|
||||||
for (Map<String, Object> row : labels) {
|
for (Map<String, Object> row : labels) {
|
||||||
labelMap.put((String) row.get("table_name"), (String) row.get("table_label"));
|
labelMap.put((String) row.get("table_name"), (String) row.get("table_label"));
|
||||||
@@ -1369,7 +1369,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
private String calcNextScreenCode(String companyCode) {
|
private String calcNextScreenCode(String companyCode) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("pattern", companyCode + "_%");
|
params.put("pattern", companyCode + "_%");
|
||||||
List<Map<String, Object>> existing = sqlSession.selectList(NS + "select_screen_codes_by_pattern", params);
|
List<Map<String, Object>> existing = sqlSession.selectList(NS + "selectScreenCodesByPattern", params);
|
||||||
|
|
||||||
Pattern numPattern = Pattern.compile("^" + Pattern.quote(companyCode) + "_(\\d+)$");
|
Pattern numPattern = Pattern.compile("^" + Pattern.quote(companyCode) + "_(\\d+)$");
|
||||||
int maxNumber = existing.stream()
|
int maxNumber = existing.stream()
|
||||||
@@ -1389,7 +1389,7 @@ public class ScreenManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("screen_id", screenId);
|
params.put("screen_id", screenId);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
Map<String, Object> row = sqlSession.selectOne(NS + "select_max_layer_id", params);
|
Map<String, Object> row = sqlSession.selectOne(NS + "selectMaxLayerId", params);
|
||||||
int maxId = row != null ? toInt(row.getOrDefault("max_id", 1), 1) : 1;
|
int maxId = row != null ? toInt(row.getOrDefault("max_id", 1), 1) : 1;
|
||||||
return maxId + 1;
|
return maxId + 1;
|
||||||
}
|
}
|
||||||
@@ -1416,4 +1416,10 @@ public class ScreenManagementService extends BaseService {
|
|||||||
try { return Integer.parseInt(val.toString()); }
|
try { return Integer.parseInt(val.toString()); }
|
||||||
catch (NumberFormatException e) { return null; }
|
catch (NumberFormatException e) { return null; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** snake_case 우선, camelCase fallback으로 request body 파라미터 추출 */
|
||||||
|
private Object bp(Map<String, Object> body, String snakeKey, String camelKey) {
|
||||||
|
Object val = body.get(snakeKey);
|
||||||
|
return val != null ? val : body.get(camelKey);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,12 +21,12 @@ public class TableCategoryValueService extends BaseService {
|
|||||||
public List<Map<String, Object>> getCategoryColumns(Map<String, Object> params) {
|
public List<Map<String, Object>> getCategoryColumns(Map<String, Object> params) {
|
||||||
log.info("카테고리 컬럼 목록 조회: tableName={}, companyCode={}",
|
log.info("카테고리 컬럼 목록 조회: tableName={}, companyCode={}",
|
||||||
params.get("table_name"), params.get("company_code"));
|
params.get("table_name"), params.get("company_code"));
|
||||||
return sqlSession.selectList(NS + "get_category_column_list", params);
|
return sqlSession.selectList(NS + "getCategoryColumnList", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Map<String, Object>> getAllCategoryColumns(Map<String, Object> params) {
|
public List<Map<String, Object>> getAllCategoryColumns(Map<String, Object> params) {
|
||||||
log.info("전체 카테고리 컬럼 목록 조회: companyCode={}", params.get("company_code"));
|
log.info("전체 카테고리 컬럼 목록 조회: companyCode={}", params.get("company_code"));
|
||||||
return sqlSession.selectList(NS + "get_all_category_column_list", params);
|
return sqlSession.selectList(NS + "getAllCategoryColumnList", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ══════════════════════════════════════════════════════════════
|
// ══════════════════════════════════════════════════════════════
|
||||||
@@ -37,7 +37,7 @@ public class TableCategoryValueService extends BaseService {
|
|||||||
log.info("카테고리 값 목록 조회: tableName={}, columnName={}, companyCode={}",
|
log.info("카테고리 값 목록 조회: tableName={}, columnName={}, companyCode={}",
|
||||||
params.get("table_name"), params.get("column_name"), params.get("company_code"));
|
params.get("table_name"), params.get("column_name"), params.get("company_code"));
|
||||||
|
|
||||||
List<Map<String, Object>> flatList = sqlSession.selectList(NS + "get_category_value_list", params);
|
List<Map<String, Object>> flatList = sqlSession.selectList(NS + "getCategoryValueList", params);
|
||||||
List<Map<String, Object>> hierarchy = buildHierarchy(flatList, null);
|
List<Map<String, Object>> hierarchy = buildHierarchy(flatList, null);
|
||||||
|
|
||||||
log.info("카테고리 값 {}개 조회 완료 (평면)", flatList.size());
|
log.info("카테고리 값 {}개 조회 완료 (평면)", flatList.size());
|
||||||
@@ -59,12 +59,12 @@ public class TableCategoryValueService extends BaseService {
|
|||||||
log.info("카테고리 값 추가: tableName={}, columnName={}, valueCode={}, companyCode={}",
|
log.info("카테고리 값 추가: tableName={}, columnName={}, valueCode={}, companyCode={}",
|
||||||
tableName, columnName, valueCode, companyCode);
|
tableName, columnName, valueCode, companyCode);
|
||||||
|
|
||||||
Integer codeDup = sqlSession.selectOne(NS + "count_duplicate_code", params);
|
Integer codeDup = sqlSession.selectOne(NS + "countDuplicateCode", params);
|
||||||
if (codeDup != null && codeDup > 0) {
|
if (codeDup != null && codeDup > 0) {
|
||||||
throw new IllegalArgumentException("이미 존재하는 코드입니다");
|
throw new IllegalArgumentException("이미 존재하는 코드입니다");
|
||||||
}
|
}
|
||||||
|
|
||||||
Integer labelDup = sqlSession.selectOne(NS + "count_duplicate_label", params);
|
Integer labelDup = sqlSession.selectOne(NS + "countDuplicateLabel", params);
|
||||||
if (labelDup != null && labelDup > 0) {
|
if (labelDup != null && labelDup > 0) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"이미 동일한 이름의 카테고리 값이 존재합니다: \"" + valueLabel + "\"");
|
"이미 동일한 이름의 카테고리 값이 존재합니다: \"" + valueLabel + "\"");
|
||||||
@@ -75,14 +75,14 @@ public class TableCategoryValueService extends BaseService {
|
|||||||
if (params.get("is_active") == null) params.put("is_active", true);
|
if (params.get("is_active") == null) params.put("is_active", true);
|
||||||
if (params.get("is_default") == null) params.put("is_default", false);
|
if (params.get("is_default") == null) params.put("is_default", false);
|
||||||
|
|
||||||
sqlSession.insert(NS + "insert_category_value", params);
|
sqlSession.insert(NS + "insertCategoryValue", params);
|
||||||
long valueId = toLong(params.get("value_id"));
|
long valueId = toLong(params.get("value_id"));
|
||||||
|
|
||||||
log.info("카테고리 값 추가 완료: valueId={}", valueId);
|
log.info("카테고리 값 추가 완료: valueId={}", valueId);
|
||||||
|
|
||||||
Map<String, Object> fetchP = new HashMap<>();
|
Map<String, Object> fetchP = new HashMap<>();
|
||||||
fetchP.put("value_id", valueId);
|
fetchP.put("value_id", valueId);
|
||||||
return sqlSession.selectOne(NS + "get_category_value_info", fetchP);
|
return sqlSession.selectOne(NS + "getCategoryValueInfo", fetchP);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -93,7 +93,7 @@ public class TableCategoryValueService extends BaseService {
|
|||||||
log.info("카테고리 값 수정: valueId={}, companyCode={}", valueId, companyCode);
|
log.info("카테고리 값 수정: valueId={}, companyCode={}", valueId, companyCode);
|
||||||
|
|
||||||
if (params.get("value_label") != null) {
|
if (params.get("value_label") != null) {
|
||||||
Map<String, Object> current = sqlSession.selectOne(NS + "get_category_value_label_info",
|
Map<String, Object> current = sqlSession.selectOne(NS + "getCategoryValueLabelInfo",
|
||||||
Map.of("value_id", valueId));
|
Map.of("value_id", valueId));
|
||||||
if (current != null) {
|
if (current != null) {
|
||||||
Map<String, Object> labelP = new HashMap<>();
|
Map<String, Object> labelP = new HashMap<>();
|
||||||
@@ -102,7 +102,7 @@ public class TableCategoryValueService extends BaseService {
|
|||||||
labelP.put("company_code", current.get("company_code"));
|
labelP.put("company_code", current.get("company_code"));
|
||||||
labelP.put("value_label", params.get("value_label"));
|
labelP.put("value_label", params.get("value_label"));
|
||||||
labelP.put("value_id", valueId);
|
labelP.put("value_id", valueId);
|
||||||
Integer dup = sqlSession.selectOne(NS + "count_duplicate_label_exclude_self", labelP);
|
Integer dup = sqlSession.selectOne(NS + "countDuplicateLabelExcludeSelf", labelP);
|
||||||
if (dup != null && dup > 0) {
|
if (dup != null && dup > 0) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"이미 동일한 이름의 카테고리 값이 존재합니다: \""
|
"이미 동일한 이름의 카테고리 값이 존재합니다: \""
|
||||||
@@ -112,15 +112,15 @@ public class TableCategoryValueService extends BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
params.put("value_id", valueId);
|
params.put("value_id", valueId);
|
||||||
Integer rows = sqlSession.selectOne(NS + "update_category_value", params);
|
Integer rows = sqlSession.selectOne(NS + "updateCategoryValue", params);
|
||||||
if (rows == null || rows == 0) {
|
if (rows == null || rows == 0) {
|
||||||
// update returns affected rows via selectOne workaround; use update method instead
|
// update returns affected rows via selectOne workaround; use update method instead
|
||||||
sqlSession.update(NS + "update_category_value", params);
|
sqlSession.update(NS + "updateCategoryValue", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> fetchP = new HashMap<>();
|
Map<String, Object> fetchP = new HashMap<>();
|
||||||
fetchP.put("value_id", valueId);
|
fetchP.put("value_id", valueId);
|
||||||
return sqlSession.selectOne(NS + "get_category_value_info", fetchP);
|
return sqlSession.selectOne(NS + "getCategoryValueInfo", fetchP);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ══════════════════════════════════════════════════════════════
|
// ══════════════════════════════════════════════════════════════
|
||||||
@@ -134,7 +134,7 @@ public class TableCategoryValueService extends BaseService {
|
|||||||
|
|
||||||
log.info("카테고리 값 삭제: valueId={}, companyCode={}", valueId, companyCode);
|
log.info("카테고리 값 삭제: valueId={}, companyCode={}", valueId, companyCode);
|
||||||
|
|
||||||
List<Map<String, Object>> childRows = sqlSession.selectList(NS + "get_child_value_id_list", params);
|
List<Map<String, Object>> childRows = sqlSession.selectList(NS + "getChildValueIdList", params);
|
||||||
List<Long> allIds = new ArrayList<>();
|
List<Long> allIds = new ArrayList<>();
|
||||||
allIds.add(valueId);
|
allIds.add(valueId);
|
||||||
childRows.forEach(r -> allIds.add(toLong(r.get("value_id"))));
|
childRows.forEach(r -> allIds.add(toLong(r.get("value_id"))));
|
||||||
@@ -151,7 +151,7 @@ public class TableCategoryValueService extends BaseService {
|
|||||||
Map<String, Object> delP = new HashMap<>();
|
Map<String, Object> delP = new HashMap<>();
|
||||||
delP.put("value_id", id);
|
delP.put("value_id", id);
|
||||||
delP.put("company_code", companyCode);
|
delP.put("company_code", companyCode);
|
||||||
sqlSession.delete(NS + "delete_value_by_id", delP);
|
sqlSession.delete(NS + "deleteValueById", delP);
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info("카테고리 값 삭제 완료: totalDeleted={}", allIds.size());
|
log.info("카테고리 값 삭제 완료: totalDeleted={}", allIds.size());
|
||||||
@@ -161,7 +161,7 @@ public class TableCategoryValueService extends BaseService {
|
|||||||
public void bulkDeleteCategoryValues(Map<String, Object> params) {
|
public void bulkDeleteCategoryValues(Map<String, Object> params) {
|
||||||
log.info("카테고리 값 일괄 삭제: count={}, companyCode={}",
|
log.info("카테고리 값 일괄 삭제: count={}, companyCode={}",
|
||||||
((List<?>) params.get("value_ids")).size(), params.get("company_code"));
|
((List<?>) params.get("value_ids")).size(), params.get("company_code"));
|
||||||
sqlSession.update(NS + "bulk_soft_delete_values", params);
|
sqlSession.update(NS + "bulkSoftDeleteValues", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -176,7 +176,7 @@ public class TableCategoryValueService extends BaseService {
|
|||||||
p.put("value_id", toLong(rawIds.get(i)));
|
p.put("value_id", toLong(rawIds.get(i)));
|
||||||
p.put("value_order", i + 1);
|
p.put("value_order", i + 1);
|
||||||
p.put("company_code", companyCode);
|
p.put("company_code", companyCode);
|
||||||
sqlSession.update(NS + "update_value_order", p);
|
sqlSession.update(NS + "updateValueOrder", p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,7 +188,7 @@ public class TableCategoryValueService extends BaseService {
|
|||||||
log.info("컬럼 매핑 조회: tableName={}, menuObjid={}, companyCode={}",
|
log.info("컬럼 매핑 조회: tableName={}, menuObjid={}, companyCode={}",
|
||||||
params.get("table_name"), params.get("menu_objid"), params.get("company_code"));
|
params.get("table_name"), params.get("menu_objid"), params.get("company_code"));
|
||||||
|
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "get_column_mapping_list", params);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "getColumnMappingList", params);
|
||||||
|
|
||||||
Map<String, Object> mapping = new LinkedHashMap<>();
|
Map<String, Object> mapping = new LinkedHashMap<>();
|
||||||
for (Map<String, Object> row : rows) {
|
for (Map<String, Object> row : rows) {
|
||||||
@@ -208,14 +208,14 @@ public class TableCategoryValueService extends BaseService {
|
|||||||
log.info("컬럼 매핑 생성: tableName={}, logical={}, physical={}, companyCode={}",
|
log.info("컬럼 매핑 생성: tableName={}, logical={}, physical={}, companyCode={}",
|
||||||
tableName, logicalColumnName, physicalColumnName, params.get("company_code"));
|
tableName, logicalColumnName, physicalColumnName, params.get("company_code"));
|
||||||
|
|
||||||
Integer colExists = sqlSession.selectOne(NS + "check_physical_column_exists", params);
|
Integer colExists = sqlSession.selectOne(NS + "checkPhysicalColumnExists", params);
|
||||||
if (colExists == null || colExists == 0) {
|
if (colExists == null || colExists == 0) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"테이블 " + tableName + "에 컬럼 " + physicalColumnName + "이(가) 존재하지 않습니다");
|
"테이블 " + tableName + "에 컬럼 " + physicalColumnName + "이(가) 존재하지 않습니다");
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlSession.insert(NS + "upsert_column_mapping", params);
|
sqlSession.insert(NS + "upsertColumnMapping", params);
|
||||||
Map<String, Object> result = sqlSession.selectOne(NS + "get_column_mapping_info", params);
|
Map<String, Object> result = sqlSession.selectOne(NS + "getColumnMappingInfo", params);
|
||||||
|
|
||||||
log.info("컬럼 매핑 생성 완료: mappingId={}", result != null ? result.get("mapping_id") : "?");
|
log.info("컬럼 매핑 생성 완료: mappingId={}", result != null ? result.get("mapping_id") : "?");
|
||||||
return result;
|
return result;
|
||||||
@@ -224,12 +224,12 @@ public class TableCategoryValueService extends BaseService {
|
|||||||
public List<Map<String, Object>> getLogicalColumns(Map<String, Object> params) {
|
public List<Map<String, Object>> getLogicalColumns(Map<String, Object> params) {
|
||||||
log.info("논리적 컬럼 목록 조회: tableName={}, menuObjid={}, companyCode={}",
|
log.info("논리적 컬럼 목록 조회: tableName={}, menuObjid={}, companyCode={}",
|
||||||
params.get("table_name"), params.get("menu_objid"), params.get("company_code"));
|
params.get("table_name"), params.get("menu_objid"), params.get("company_code"));
|
||||||
return sqlSession.selectList(NS + "get_logical_column_list", params);
|
return sqlSession.selectList(NS + "getLogicalColumnList", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void deleteColumnMapping(Map<String, Object> params) {
|
public void deleteColumnMapping(Map<String, Object> params) {
|
||||||
int deleted = sqlSession.delete(NS + "delete_column_mapping_by_id", params);
|
int deleted = sqlSession.delete(NS + "deleteColumnMappingById", params);
|
||||||
if (deleted == 0) {
|
if (deleted == 0) {
|
||||||
throw new IllegalArgumentException("컬럼 매핑을 찾을 수 없거나 권한이 없습니다");
|
throw new IllegalArgumentException("컬럼 매핑을 찾을 수 없거나 권한이 없습니다");
|
||||||
}
|
}
|
||||||
@@ -238,7 +238,7 @@ public class TableCategoryValueService extends BaseService {
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public int deleteColumnMappingsByColumn(Map<String, Object> params) {
|
public int deleteColumnMappingsByColumn(Map<String, Object> params) {
|
||||||
int deleted = sqlSession.delete(NS + "delete_column_mappings_by_column", params);
|
int deleted = sqlSession.delete(NS + "deleteColumnMappingsByColumn", params);
|
||||||
log.info("테이블+컬럼 기준 매핑 삭제 완료: tableName={}, columnName={}, deletedCount={}",
|
log.info("테이블+컬럼 기준 매핑 삭제 완료: tableName={}, columnName={}, deletedCount={}",
|
||||||
params.get("table_name"), params.get("column_name"), deleted);
|
params.get("table_name"), params.get("column_name"), deleted);
|
||||||
return deleted;
|
return deleted;
|
||||||
@@ -257,7 +257,7 @@ public class TableCategoryValueService extends BaseService {
|
|||||||
log.info("카테고리 코드로 라벨 조회: count={}, companyCode={}",
|
log.info("카테고리 코드로 라벨 조회: count={}, companyCode={}",
|
||||||
((List<?>) rawCodes).size(), params.get("company_code"));
|
((List<?>) rawCodes).size(), params.get("company_code"));
|
||||||
|
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "get_label_list_by_codes", params);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "getLabelListByCodes", params);
|
||||||
|
|
||||||
Map<String, Object> labels = new LinkedHashMap<>();
|
Map<String, Object> labels = new LinkedHashMap<>();
|
||||||
for (Map<String, Object> row : rows) {
|
for (Map<String, Object> row : rows) {
|
||||||
@@ -277,11 +277,11 @@ public class TableCategoryValueService extends BaseService {
|
|||||||
public List<Map<String, Object>> getSecondLevelMenus(Map<String, Object> params) {
|
public List<Map<String, Object>> getSecondLevelMenus(Map<String, Object> params) {
|
||||||
log.info("2레벨 메뉴 목록 조회: companyCode={}", params.get("company_code"));
|
log.info("2레벨 메뉴 목록 조회: companyCode={}", params.get("company_code"));
|
||||||
|
|
||||||
Integer hasCC = sqlSession.selectOne(NS + "check_menu_info_has_company_code", null);
|
Integer hasCC = sqlSession.selectOne(NS + "checkMenuInfoHasCompanyCode", null);
|
||||||
params.put("has_company_code", hasCC != null && hasCC > 0);
|
params.put("has_company_code", hasCC != null && hasCC > 0);
|
||||||
log.info("menu_info.company_code 컬럼 존재 여부: {}", hasCC != null && hasCC > 0);
|
log.info("menu_info.company_code 컬럼 존재 여부: {}", hasCC != null && hasCC > 0);
|
||||||
|
|
||||||
List<Map<String, Object>> menus = sqlSession.selectList(NS + "get_second_level_menu_list", params);
|
List<Map<String, Object>> menus = sqlSession.selectList(NS + "getSecondLevelMenuList", params);
|
||||||
log.info("2레벨 메뉴 {}개 조회 완료", menus.size());
|
log.info("2레벨 메뉴 {}개 조회 완료", menus.size());
|
||||||
return menus;
|
return menus;
|
||||||
}
|
}
|
||||||
@@ -295,7 +295,7 @@ public class TableCategoryValueService extends BaseService {
|
|||||||
p.put("value_id", valueId);
|
p.put("value_id", valueId);
|
||||||
p.put("company_code", companyCode);
|
p.put("company_code", companyCode);
|
||||||
|
|
||||||
Map<String, Object> valueInfo = sqlSession.selectOne(NS + "get_category_value_usage_info", p);
|
Map<String, Object> valueInfo = sqlSession.selectOne(NS + "getCategoryValueUsageInfo", p);
|
||||||
if (valueInfo == null) {
|
if (valueInfo == null) {
|
||||||
throw new IllegalArgumentException("카테고리 값을 찾을 수 없습니다");
|
throw new IllegalArgumentException("카테고리 값을 찾을 수 없습니다");
|
||||||
}
|
}
|
||||||
@@ -310,7 +310,7 @@ public class TableCategoryValueService extends BaseService {
|
|||||||
|
|
||||||
if (safeTable.isEmpty() || safeColumn.isEmpty()) return;
|
if (safeTable.isEmpty() || safeColumn.isEmpty()) return;
|
||||||
|
|
||||||
Integer tableExists = sqlSession.selectOne(NS + "check_table_exists_for_usage",
|
Integer tableExists = sqlSession.selectOne(NS + "checkTableExistsForUsage",
|
||||||
Map.of("table_name", safeTable));
|
Map.of("table_name", safeTable));
|
||||||
if (tableExists == null || tableExists == 0) return;
|
if (tableExists == null || tableExists == 0) return;
|
||||||
|
|
||||||
@@ -319,10 +319,10 @@ public class TableCategoryValueService extends BaseService {
|
|||||||
countP.put("safe_column_name", safeColumn);
|
countP.put("safe_column_name", safeColumn);
|
||||||
countP.put("value_code", valueCode);
|
countP.put("value_code", valueCode);
|
||||||
countP.put("company_code", companyCode);
|
countP.put("company_code", companyCode);
|
||||||
Integer count = sqlSession.selectOne(NS + "count_value_usage_in_table", countP);
|
Integer count = sqlSession.selectOne(NS + "countValueUsageInTable", countP);
|
||||||
|
|
||||||
if (count != null && count > 0) {
|
if (count != null && count > 0) {
|
||||||
List<Map<String, Object>> menus = sqlSession.selectList(NS + "get_menu_list_using_table",
|
List<Map<String, Object>> menus = sqlSession.selectList(NS + "getMenuListUsingTable",
|
||||||
Map.of("table_name", tableName, "company_code", companyCode));
|
Map.of("table_name", tableName, "company_code", companyCode));
|
||||||
|
|
||||||
StringBuilder msg = new StringBuilder();
|
StringBuilder msg = new StringBuilder();
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class TableHistoryService extends BaseService {
|
|||||||
String logTableName = tableName + "_log";
|
String logTableName = tableName + "_log";
|
||||||
params.put("log_table_name", logTableName);
|
params.put("log_table_name", logTableName);
|
||||||
|
|
||||||
Map<String, Object> row = sqlSession.selectOne(NS + "check_history_table_exists", params);
|
Map<String, Object> row = sqlSession.selectOne(NS + "checkHistoryTableExists", params);
|
||||||
boolean exists = Boolean.TRUE.equals(row != null ? row.get("exists") : Boolean.FALSE);
|
boolean exists = Boolean.TRUE.equals(row != null ? row.get("exists") : Boolean.FALSE);
|
||||||
String message = exists ? "이력 테이블이 존재합니다." : "이력 테이블이 존재하지 않습니다.";
|
String message = exists ? "이력 테이블이 존재합니다." : "이력 테이블이 존재하지 않습니다.";
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ public class TableHistoryService extends BaseService {
|
|||||||
|
|
||||||
public List<Map<String, Object>> getTableHistorySummary(Map<String, Object> params) {
|
public List<Map<String, Object>> getTableHistorySummary(Map<String, Object> params) {
|
||||||
prepareLogTableName(params);
|
prepareLogTableName(params);
|
||||||
return withTableNotFound(() -> sqlSession.selectList(NS + "select_table_history_summary", params));
|
return withTableNotFound(() -> sqlSession.selectList(NS + "selectTableHistorySummary", params));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getAllTableHistory(Map<String, Object> params) {
|
public Map<String, Object> getAllTableHistory(Map<String, Object> params) {
|
||||||
@@ -46,8 +46,8 @@ public class TableHistoryService extends BaseService {
|
|||||||
int limit = (int) params.get("limit");
|
int limit = (int) params.get("limit");
|
||||||
int offset = (int) params.get("offset");
|
int offset = (int) params.get("offset");
|
||||||
|
|
||||||
List<Map<String, Object>> records = withTableNotFound(() -> sqlSession.selectList(NS + "select_all_table_history", params));
|
List<Map<String, Object>> records = withTableNotFound(() -> sqlSession.selectList(NS + "selectAllTableHistory", params));
|
||||||
Integer totalObj = withTableNotFound(() -> sqlSession.selectOne(NS + "count_all_table_history", params));
|
Integer totalObj = withTableNotFound(() -> sqlSession.selectOne(NS + "countAllTableHistory", params));
|
||||||
int total = totalObj != null ? totalObj : 0;
|
int total = totalObj != null ? totalObj : 0;
|
||||||
|
|
||||||
return buildPaginatedResult(records, total, limit, offset, (offset + limit) < total);
|
return buildPaginatedResult(records, total, limit, offset, (offset + limit) < total);
|
||||||
@@ -61,8 +61,8 @@ public class TableHistoryService extends BaseService {
|
|||||||
int limit = (int) params.get("limit");
|
int limit = (int) params.get("limit");
|
||||||
int offset = (int) params.get("offset");
|
int offset = (int) params.get("offset");
|
||||||
|
|
||||||
List<Map<String, Object>> records = withTableNotFound(() -> sqlSession.selectList(NS + "select_record_history", params));
|
List<Map<String, Object>> records = withTableNotFound(() -> sqlSession.selectList(NS + "selectRecordHistory", params));
|
||||||
Integer totalObj = withTableNotFound(() -> sqlSession.selectOne(NS + "count_record_history", params));
|
Integer totalObj = withTableNotFound(() -> sqlSession.selectOne(NS + "countRecordHistory", params));
|
||||||
int total = totalObj != null ? totalObj : 0;
|
int total = totalObj != null ? totalObj : 0;
|
||||||
|
|
||||||
return buildPaginatedResult(records, total, limit, offset, (offset + records.size()) < total);
|
return buildPaginatedResult(records, total, limit, offset, (offset + records.size()) < total);
|
||||||
@@ -70,7 +70,7 @@ public class TableHistoryService extends BaseService {
|
|||||||
|
|
||||||
public List<Map<String, Object>> getRecordTimeline(Map<String, Object> params) {
|
public List<Map<String, Object>> getRecordTimeline(Map<String, Object> params) {
|
||||||
prepareLogTableName(params);
|
prepareLogTableName(params);
|
||||||
return withTableNotFound(() -> sqlSession.selectList(NS + "select_record_timeline", params));
|
return withTableNotFound(() -> sqlSession.selectList(NS + "selectRecordTimeline", params));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ─── Private helpers ───────────────────────────────────────────
|
// ─── Private helpers ───────────────────────────────────────────
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class TableManagementService extends BaseService {
|
|||||||
// ──────────────────────────────────────────────────
|
// ──────────────────────────────────────────────────
|
||||||
|
|
||||||
public List<Map<String, Object>> getTableList() {
|
public List<Map<String, Object>> getTableList() {
|
||||||
List<Map<String, Object>> tables = sqlSession.selectList(NS + "get_table_list");
|
List<Map<String, Object>> tables = sqlSession.selectList(NS + "getTableList");
|
||||||
// columnCount Long → Integer 변환 (Node 호환)
|
// columnCount Long → Integer 변환 (Node 호환)
|
||||||
for (Map<String, Object> t : tables) {
|
for (Map<String, Object> t : tables) {
|
||||||
Object cnt = t.get("column_count");
|
Object cnt = t.get("column_count");
|
||||||
@@ -52,15 +52,15 @@ public class TableManagementService extends BaseService {
|
|||||||
params.put("size", size);
|
params.put("size", size);
|
||||||
params.put("offset", (long) (page - 1) * size);
|
params.put("offset", (long) (page - 1) * size);
|
||||||
|
|
||||||
Integer totalObj = sqlSession.selectOne(NS + "get_column_list_cnt", params);
|
Integer totalObj = sqlSession.selectOne(NS + "getColumnListCnt", params);
|
||||||
int total = totalObj != null ? totalObj : 0;
|
int total = totalObj != null ? totalObj : 0;
|
||||||
List<Map<String, Object>> columns;
|
List<Map<String, Object>> columns;
|
||||||
|
|
||||||
if (companyCode != null && !companyCode.isBlank()) {
|
if (companyCode != null && !companyCode.isBlank()) {
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
columns = sqlSession.selectList(NS + "get_column_list_with_company", params);
|
columns = sqlSession.selectList(NS + "getColumnListWithCompany", params);
|
||||||
} else {
|
} else {
|
||||||
columns = sqlSession.selectList(NS + "get_column_list", params);
|
columns = sqlSession.selectList(NS + "getColumnList", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
int totalPages = total == 0 ? 1 : (int) Math.ceil((double) total / size);
|
int totalPages = total == 0 ? 1 : (int) Math.ceil((double) total / size);
|
||||||
@@ -80,13 +80,13 @@ public class TableManagementService extends BaseService {
|
|||||||
public List<Map<String, Object>> getTableSchema(String tableName) {
|
public List<Map<String, Object>> getTableSchema(String tableName) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
return sqlSession.selectList(NS + "get_table_schema_list", params);
|
return sqlSession.selectList(NS + "getTableSchemaList", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean checkTableExists(String tableName) {
|
public boolean checkTableExists(String tableName) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
Map<String, Object> result = sqlSession.selectOne(NS + "check_table_exists", params);
|
Map<String, Object> result = sqlSession.selectOne(NS + "checkTableExists", params);
|
||||||
Object exists = result != null ? result.get("exists") : null;
|
Object exists = result != null ? result.get("exists") : null;
|
||||||
return Boolean.TRUE.equals(exists);
|
return Boolean.TRUE.equals(exists);
|
||||||
}
|
}
|
||||||
@@ -95,7 +95,7 @@ public class TableManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("table_name", sanitize(tableName));
|
params.put("table_name", sanitize(tableName));
|
||||||
params.put("column_name", sanitize(columnName));
|
params.put("column_name", sanitize(columnName));
|
||||||
Integer cntObj = sqlSession.selectOne(NS + "check_table_has_column", params);
|
Integer cntObj = sqlSession.selectOne(NS + "checkTableHasColumn", params);
|
||||||
return cntObj != null && cntObj > 0;
|
return cntObj != null && cntObj > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ public class TableManagementService extends BaseService {
|
|||||||
public Map<String, Object> getTableLabels(String tableName) {
|
public Map<String, Object> getTableLabels(String tableName) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
return sqlSession.selectOne(NS + "get_table_label_info", params);
|
return sqlSession.selectOne(NS + "getTableLabelInfo", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -115,14 +115,14 @@ public class TableManagementService extends BaseService {
|
|||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
params.put("display_name", displayName);
|
params.put("display_name", displayName);
|
||||||
params.put("description", description != null ? description : "");
|
params.put("description", description != null ? description : "");
|
||||||
sqlSession.update(NS + "upsert_table_label", params);
|
sqlSession.update(NS + "upsertTableLabel", params);
|
||||||
log.info("테이블 라벨 업데이트: {}", tableName);
|
log.info("테이블 라벨 업데이트: {}", tableName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ensureTableInLabels(String tableName) {
|
private void ensureTableInLabels(String tableName) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
sqlSession.insert(NS + "insert_table_label_if_not_exists", params);
|
sqlSession.insert(NS + "insertTableLabelIfNotExists", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ──────────────────────────────────────────────────
|
// ──────────────────────────────────────────────────
|
||||||
@@ -133,7 +133,7 @@ public class TableManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
params.put("column_name", columnName);
|
params.put("column_name", columnName);
|
||||||
return sqlSession.selectOne(NS + "get_column_label_info", params);
|
return sqlSession.selectOne(NS + "getColumnLabelInfo", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ──────────────────────────────────────────────────
|
// ──────────────────────────────────────────────────
|
||||||
@@ -161,7 +161,7 @@ public class TableManagementService extends BaseService {
|
|||||||
params.put("is_visible", settings.getOrDefault("is_visible", true));
|
params.put("is_visible", settings.getOrDefault("is_visible", true));
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
params.put("category_ref", "category".equals(inputType) ? settings.get("category_ref") : null);
|
params.put("category_ref", "category".equals(inputType) ? settings.get("category_ref") : null);
|
||||||
sqlSession.update(NS + "upsert_column_settings", params);
|
sqlSession.update(NS + "upsertColumnSettings", params);
|
||||||
|
|
||||||
// 화면 레이아웃 동기화
|
// 화면 레이아웃 동기화
|
||||||
syncScreenLayouts(tableName, columnName, inputType, companyCode);
|
syncScreenLayouts(tableName, columnName, inputType, companyCode);
|
||||||
@@ -194,7 +194,7 @@ public class TableManagementService extends BaseService {
|
|||||||
params.put("clear_entity", false);
|
params.put("clear_entity", false);
|
||||||
params.put("clear_code", false);
|
params.put("clear_code", false);
|
||||||
params.put("clear_category", false);
|
params.put("clear_category", false);
|
||||||
sqlSession.update(NS + "upsert_column_input_type", params);
|
sqlSession.update(NS + "upsertColumnInputType", params);
|
||||||
log.info("컬럼 웹타입 설정: {}.{} = {}", tableName, columnName, finalType);
|
log.info("컬럼 웹타입 설정: {}.{} = {}", tableName, columnName, finalType);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,7 +212,7 @@ public class TableManagementService extends BaseService {
|
|||||||
params.put("clear_entity", !"entity".equals(finalType));
|
params.put("clear_entity", !"entity".equals(finalType));
|
||||||
params.put("clear_code", !"code".equals(finalType));
|
params.put("clear_code", !"code".equals(finalType));
|
||||||
params.put("clear_category", !"category".equals(finalType));
|
params.put("clear_category", !"category".equals(finalType));
|
||||||
sqlSession.update(NS + "upsert_column_input_type", params);
|
sqlSession.update(NS + "upsertColumnInputType", params);
|
||||||
syncScreenLayouts(tableName, columnName, finalType, companyCode);
|
syncScreenLayouts(tableName, columnName, finalType, companyCode);
|
||||||
log.info("컬럼 입력타입 설정: {}.{} = {}, company={}", tableName, columnName, finalType, companyCode);
|
log.info("컬럼 입력타입 설정: {}.{} = {}, company={}", tableName, columnName, finalType, companyCode);
|
||||||
}
|
}
|
||||||
@@ -221,7 +221,7 @@ public class TableManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
return sqlSession.selectList(NS + "get_column_input_type_list", params);
|
return sqlSession.selectList(NS + "getColumnInputTypeList", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ──────────────────────────────────────────────────
|
// ──────────────────────────────────────────────────
|
||||||
@@ -232,7 +232,7 @@ public class TableManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
|
|
||||||
List<Map<String, Object>> pkResult = sqlSession.selectList(NS + "get_table_primary_key_list", params);
|
List<Map<String, Object>> pkResult = sqlSession.selectList(NS + "getTablePrimaryKeyList", params);
|
||||||
Map<String, Object> primaryKey = new HashMap<>();
|
Map<String, Object> primaryKey = new HashMap<>();
|
||||||
if (!pkResult.isEmpty()) {
|
if (!pkResult.isEmpty()) {
|
||||||
Map<String, Object> pk = pkResult.get(0);
|
Map<String, Object> pk = pkResult.get(0);
|
||||||
@@ -243,7 +243,7 @@ public class TableManagementService extends BaseService {
|
|||||||
primaryKey.put("columns", List.of());
|
primaryKey.put("columns", List.of());
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Map<String, Object>> indexResult = sqlSession.selectList(NS + "get_table_index_list", params);
|
List<Map<String, Object>> indexResult = sqlSession.selectList(NS + "getTableIndexList", params);
|
||||||
List<Map<String, Object>> indexes = indexResult.stream().map(row -> {
|
List<Map<String, Object>> indexes = indexResult.stream().map(row -> {
|
||||||
Map<String, Object> idx = new HashMap<>();
|
Map<String, Object> idx = new HashMap<>();
|
||||||
idx.put("name", row.get("index_name"));
|
idx.put("name", row.get("index_name"));
|
||||||
@@ -264,7 +264,7 @@ public class TableManagementService extends BaseService {
|
|||||||
// 기존 PK 삭제
|
// 기존 PK 삭제
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("table_name", safeTable);
|
params.put("table_name", safeTable);
|
||||||
List<Map<String, Object>> existingPk = sqlSession.selectList(NS + "get_table_primary_key_list", params);
|
List<Map<String, Object>> existingPk = sqlSession.selectList(NS + "getTablePrimaryKeyList", params);
|
||||||
if (!existingPk.isEmpty()) {
|
if (!existingPk.isEmpty()) {
|
||||||
String constraintName = (String) existingPk.get(0).get("constraint_name");
|
String constraintName = (String) existingPk.get(0).get("constraint_name");
|
||||||
jdbcTemplate.execute(
|
jdbcTemplate.execute(
|
||||||
@@ -315,7 +315,7 @@ public class TableManagementService extends BaseService {
|
|||||||
params.put("column_name", columnName);
|
params.put("column_name", columnName);
|
||||||
params.put("is_nullable", nullable ? "Y" : "N");
|
params.put("is_nullable", nullable ? "Y" : "N");
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
sqlSession.update(NS + "upsert_nullable", params);
|
sqlSession.update(NS + "upsertNullable", params);
|
||||||
log.info("NOT NULL 토글: {}.{} nullable={}, company={}", tableName, columnName, nullable, companyCode);
|
log.info("NOT NULL 토글: {}.{} nullable={}, company={}", tableName, columnName, nullable, companyCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -327,7 +327,7 @@ public class TableManagementService extends BaseService {
|
|||||||
params.put("column_name", columnName);
|
params.put("column_name", columnName);
|
||||||
params.put("is_unique", unique ? "Y" : "N");
|
params.put("is_unique", unique ? "Y" : "N");
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
sqlSession.update(NS + "upsert_unique", params);
|
sqlSession.update(NS + "upsertUnique", params);
|
||||||
log.info("UNIQUE 토글: {}.{} unique={}, company={}", tableName, columnName, unique, companyCode);
|
log.info("UNIQUE 토글: {}.{} unique={}, company={}", tableName, columnName, unique, companyCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -341,7 +341,7 @@ public class TableManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
List<Map<String, Object>> notNullCols = sqlSession.selectList(NS + "get_not_null_column_list", params);
|
List<Map<String, Object>> notNullCols = sqlSession.selectList(NS + "getNotNullColumnList", params);
|
||||||
|
|
||||||
List<String> violations = new ArrayList<>();
|
List<String> violations = new ArrayList<>();
|
||||||
for (Map<String, Object> col : notNullCols) {
|
for (Map<String, Object> col : notNullCols) {
|
||||||
@@ -361,7 +361,7 @@ public class TableManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
List<Map<String, Object>> uniqueCols = sqlSession.selectList(NS + "get_unique_column_list", params);
|
List<Map<String, Object>> uniqueCols = sqlSession.selectList(NS + "getUniqueColumnList", params);
|
||||||
|
|
||||||
String safeTable = sanitize(tableName);
|
String safeTable = sanitize(tableName);
|
||||||
List<String> violations = new ArrayList<>();
|
List<String> violations = new ArrayList<>();
|
||||||
@@ -635,7 +635,7 @@ public class TableManagementService extends BaseService {
|
|||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
params.put("is_active", isActive);
|
params.put("is_active", isActive);
|
||||||
params.put("log_columns", String.join(",", targetCols));
|
params.put("log_columns", String.join(",", targetCols));
|
||||||
sqlSession.update(NS + "upsert_log_config", params);
|
sqlSession.update(NS + "upsertLogConfig", params);
|
||||||
|
|
||||||
log.info("로그 테이블 생성: {}", safeLog);
|
log.info("로그 테이블 생성: {}", safeLog);
|
||||||
}
|
}
|
||||||
@@ -643,7 +643,7 @@ public class TableManagementService extends BaseService {
|
|||||||
public Map<String, Object> getLogConfig(String tableName) {
|
public Map<String, Object> getLogConfig(String tableName) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
return sqlSession.selectOne(NS + "get_log_config_info", params);
|
return sqlSession.selectOne(NS + "getLogConfigInfo", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getLogData(String tableName, int page, int size) {
|
public Map<String, Object> getLogData(String tableName, int page, int size) {
|
||||||
@@ -677,7 +677,7 @@ public class TableManagementService extends BaseService {
|
|||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
params.put("is_active", isActive);
|
params.put("is_active", isActive);
|
||||||
params.put("log_columns", "");
|
params.put("log_columns", "");
|
||||||
sqlSession.update(NS + "upsert_log_config", params);
|
sqlSession.update(NS + "upsertLogConfig", params);
|
||||||
log.info("로그 테이블 토글: {} → {}", tableName, isActive);
|
log.info("로그 테이블 토글: {} → {}", tableName, isActive);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -687,7 +687,7 @@ public class TableManagementService extends BaseService {
|
|||||||
|
|
||||||
public Map<String, Object> checkDatabaseConnection() {
|
public Map<String, Object> checkDatabaseConnection() {
|
||||||
try {
|
try {
|
||||||
sqlSession.selectOne(NS + "check_database_connection", null);
|
sqlSession.selectOne(NS + "checkDatabaseConnection", null);
|
||||||
return Map.of("connected", true, "message", "데이터베이스 연결 정상");
|
return Map.of("connected", true, "message", "데이터베이스 연결 정상");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("DB 연결 실패", e);
|
log.error("DB 연결 실패", e);
|
||||||
@@ -702,20 +702,20 @@ public class TableManagementService extends BaseService {
|
|||||||
public List<Map<String, Object>> getCategoryColumnsByCompany(String companyCode) {
|
public List<Map<String, Object>> getCategoryColumnsByCompany(String companyCode) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
return sqlSession.selectList(NS + "get_category_column_list_by_company", params);
|
return sqlSession.selectList(NS + "getCategoryColumnListByCompany", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Map<String, Object>> getNumberingColumnsByCompany(String companyCode) {
|
public List<Map<String, Object>> getNumberingColumnsByCompany(String companyCode) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
return sqlSession.selectList(NS + "get_numbering_column_list_by_company", params);
|
return sqlSession.selectList(NS + "getNumberingColumnListByCompany", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Map<String, Object>> getCategoryColumnsByMenu(String companyCode, Object menuObjid) {
|
public List<Map<String, Object>> getCategoryColumnsByMenu(String companyCode, Object menuObjid) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
params.put("menu_objid", menuObjid);
|
params.put("menu_objid", menuObjid);
|
||||||
return sqlSession.selectList(NS + "get_category_column_list_by_menu", params);
|
return sqlSession.selectList(NS + "getCategoryColumnListByMenu", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ──────────────────────────────────────────────────
|
// ──────────────────────────────────────────────────
|
||||||
@@ -728,7 +728,7 @@ public class TableManagementService extends BaseService {
|
|||||||
params.put("left_table", leftTable);
|
params.put("left_table", leftTable);
|
||||||
params.put("right_table", rightTable);
|
params.put("right_table", rightTable);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
List<Map<String, Object>> relations = sqlSession.selectList(NS + "get_entity_relation_list", params);
|
List<Map<String, Object>> relations = sqlSession.selectList(NS + "getEntityRelationList", params);
|
||||||
Map<String, Object> result = new HashMap<>();
|
Map<String, Object> result = new HashMap<>();
|
||||||
result.put("left_table", leftTable);
|
result.put("left_table", leftTable);
|
||||||
result.put("right_table", rightTable);
|
result.put("right_table", rightTable);
|
||||||
@@ -740,7 +740,7 @@ public class TableManagementService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("table_name", tableName);
|
params.put("table_name", tableName);
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
return sqlSession.selectList(NS + "get_referenced_by_table_list", params);
|
return sqlSession.selectList(NS + "getReferencedByTableList", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ──────────────────────────────────────────────────
|
// ──────────────────────────────────────────────────
|
||||||
@@ -900,7 +900,7 @@ public class TableManagementService extends BaseService {
|
|||||||
p.put("input_type", inputType);
|
p.put("input_type", inputType);
|
||||||
p.put("company_code", companyCode);
|
p.put("company_code", companyCode);
|
||||||
p.put("component_id", mapInputTypeToComponentId(inputType));
|
p.put("component_id", mapInputTypeToComponentId(inputType));
|
||||||
sqlSession.update(NS + "sync_screen_layouts_input_type", p);
|
sqlSession.update(NS + "syncScreenLayoutsInputType", p);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.warn("화면 레이아웃 동기화 실패 (무시됨): {}.{}", tableName, columnName);
|
log.warn("화면 레이아웃 동기화 실패 (무시됨): {}.{}", tableName, columnName);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,16 +25,16 @@ public class TaxInvoiceService extends BaseService {
|
|||||||
public Map<String, Object> getTaxInvoiceList(Map<String, Object> params) {
|
public Map<String, Object> getTaxInvoiceList(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
commonService.applyPagination(params);
|
commonService.applyPagination(params);
|
||||||
int totalCount = sqlSession.selectOne(NS + "get_tax_invoice_list_cnt", params);
|
int totalCount = sqlSession.selectOne(NS + "getTaxInvoiceListCnt", params);
|
||||||
List<Map<String, Object>> list = sqlSession.selectList(NS + "get_tax_invoice_list", params);
|
List<Map<String, Object>> list = sqlSession.selectList(NS + "getTaxInvoiceList", params);
|
||||||
return commonService.buildListResponse(list, totalCount, params);
|
return commonService.buildListResponse(list, totalCount, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getTaxInvoiceInfo(Map<String, Object> params) {
|
public Map<String, Object> getTaxInvoiceInfo(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
Map<String, Object> invoice = sqlSession.selectOne(NS + "get_tax_invoice_info", params);
|
Map<String, Object> invoice = sqlSession.selectOne(NS + "getTaxInvoiceInfo", params);
|
||||||
if (invoice == null) return null;
|
if (invoice == null) return null;
|
||||||
List<Map<String, Object>> items = sqlSession.selectList(NS + "get_tax_invoice_items", params);
|
List<Map<String, Object>> items = sqlSession.selectList(NS + "getTaxInvoiceItems", params);
|
||||||
Map<String, Object> result = new HashMap<>();
|
Map<String, Object> result = new HashMap<>();
|
||||||
result.put("invoice", invoice);
|
result.put("invoice", invoice);
|
||||||
result.put("items", items);
|
result.put("items", items);
|
||||||
@@ -48,7 +48,7 @@ public class TaxInvoiceService extends BaseService {
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
params.put("prefix", prefix + "%");
|
params.put("prefix", prefix + "%");
|
||||||
String lastNum = sqlSession.selectOne(NS + "get_last_invoice_number", params);
|
String lastNum = sqlSession.selectOne(NS + "getLastInvoiceNumber", params);
|
||||||
int nextNum = 1;
|
int nextNum = 1;
|
||||||
if (lastNum != null && !lastNum.isEmpty()) {
|
if (lastNum != null && !lastNum.isEmpty()) {
|
||||||
String[] parts = lastNum.split("-");
|
String[] parts = lastNum.split("-");
|
||||||
@@ -71,7 +71,7 @@ public class TaxInvoiceService extends BaseService {
|
|||||||
params.put("total_amount", DecimalUtils.toBigDecimal(params.get("total_amount")));
|
params.put("total_amount", DecimalUtils.toBigDecimal(params.get("total_amount")));
|
||||||
String invoiceNumber = generateInvoiceNumber((String) params.get("company_code"));
|
String invoiceNumber = generateInvoiceNumber((String) params.get("company_code"));
|
||||||
params.put("invoice_number", invoiceNumber);
|
params.put("invoice_number", invoiceNumber);
|
||||||
sqlSession.insert(NS + "insert_tax_invoice", params);
|
sqlSession.insert(NS + "insertTaxInvoice", params);
|
||||||
Object itemsObj = params.get("items");
|
Object itemsObj = params.get("items");
|
||||||
if (itemsObj instanceof List<?> itemsList) {
|
if (itemsObj instanceof List<?> itemsList) {
|
||||||
for (int i = 0; i < itemsList.size(); i++) {
|
for (int i = 0; i < itemsList.size(); i++) {
|
||||||
@@ -83,7 +83,7 @@ public class TaxInvoiceService extends BaseService {
|
|||||||
item.put("supply_amount", DecimalUtils.toBigDecimal(item.get("supply_amount")));
|
item.put("supply_amount", DecimalUtils.toBigDecimal(item.get("supply_amount")));
|
||||||
item.put("tax_amount", DecimalUtils.toBigDecimal(item.get("tax_amount")));
|
item.put("tax_amount", DecimalUtils.toBigDecimal(item.get("tax_amount")));
|
||||||
item.put("unit_price", DecimalUtils.toBigDecimal(item.get("unit_price")));
|
item.put("unit_price", DecimalUtils.toBigDecimal(item.get("unit_price")));
|
||||||
sqlSession.insert(NS + "insert_tax_invoice_item", item);
|
sqlSession.insert(NS + "insertTaxInvoiceItem", item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return params;
|
return params;
|
||||||
@@ -92,7 +92,7 @@ public class TaxInvoiceService extends BaseService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> updateTaxInvoice(Map<String, Object> params) {
|
public Map<String, Object> updateTaxInvoice(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
Map<String, Object> existing = sqlSession.selectOne(NS + "get_tax_invoice_info", params);
|
Map<String, Object> existing = sqlSession.selectOne(NS + "getTaxInvoiceInfo", params);
|
||||||
if (existing == null) {
|
if (existing == null) {
|
||||||
throw new RuntimeException("세금계산서를 찾을 수 없습니다.");
|
throw new RuntimeException("세금계산서를 찾을 수 없습니다.");
|
||||||
}
|
}
|
||||||
@@ -102,10 +102,10 @@ public class TaxInvoiceService extends BaseService {
|
|||||||
if (params.get("supply_amount") != null) params.put("supply_amount", DecimalUtils.toBigDecimal(params.get("supply_amount")));
|
if (params.get("supply_amount") != null) params.put("supply_amount", DecimalUtils.toBigDecimal(params.get("supply_amount")));
|
||||||
if (params.get("tax_amount") != null) params.put("tax_amount", DecimalUtils.toBigDecimal(params.get("tax_amount")));
|
if (params.get("tax_amount") != null) params.put("tax_amount", DecimalUtils.toBigDecimal(params.get("tax_amount")));
|
||||||
if (params.get("total_amount") != null) params.put("total_amount", DecimalUtils.toBigDecimal(params.get("total_amount")));
|
if (params.get("total_amount") != null) params.put("total_amount", DecimalUtils.toBigDecimal(params.get("total_amount")));
|
||||||
sqlSession.update(NS + "update_tax_invoice", params);
|
sqlSession.update(NS + "updateTaxInvoice", params);
|
||||||
Object itemsObj = params.get("items");
|
Object itemsObj = params.get("items");
|
||||||
if (itemsObj != null) {
|
if (itemsObj != null) {
|
||||||
sqlSession.delete(NS + "delete_tax_invoice_items_by_invoice_id", params);
|
sqlSession.delete(NS + "deleteTaxInvoiceItemsByInvoiceId", params);
|
||||||
if (itemsObj instanceof List<?> itemsList) {
|
if (itemsObj instanceof List<?> itemsList) {
|
||||||
for (int i = 0; i < itemsList.size(); i++) {
|
for (int i = 0; i < itemsList.size(); i++) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -116,7 +116,7 @@ public class TaxInvoiceService extends BaseService {
|
|||||||
item.put("supply_amount", DecimalUtils.toBigDecimal(item.get("supply_amount")));
|
item.put("supply_amount", DecimalUtils.toBigDecimal(item.get("supply_amount")));
|
||||||
item.put("tax_amount", DecimalUtils.toBigDecimal(item.get("tax_amount")));
|
item.put("tax_amount", DecimalUtils.toBigDecimal(item.get("tax_amount")));
|
||||||
item.put("unit_price", DecimalUtils.toBigDecimal(item.get("unit_price")));
|
item.put("unit_price", DecimalUtils.toBigDecimal(item.get("unit_price")));
|
||||||
sqlSession.insert(NS + "insert_tax_invoice_item", item);
|
sqlSession.insert(NS + "insertTaxInvoiceItem", item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -126,36 +126,36 @@ public class TaxInvoiceService extends BaseService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> deleteTaxInvoice(Map<String, Object> params) {
|
public Map<String, Object> deleteTaxInvoice(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
Map<String, Object> existing = sqlSession.selectOne(NS + "get_tax_invoice_info", params);
|
Map<String, Object> existing = sqlSession.selectOne(NS + "getTaxInvoiceInfo", params);
|
||||||
if (existing == null) {
|
if (existing == null) {
|
||||||
throw new RuntimeException("세금계산서를 찾을 수 없습니다.");
|
throw new RuntimeException("세금계산서를 찾을 수 없습니다.");
|
||||||
}
|
}
|
||||||
if (!"draft".equals(existing.get("invoice_status"))) {
|
if (!"draft".equals(existing.get("invoice_status"))) {
|
||||||
throw new RuntimeException("발행된 세금계산서는 삭제할 수 없습니다.");
|
throw new RuntimeException("발행된 세금계산서는 삭제할 수 없습니다.");
|
||||||
}
|
}
|
||||||
sqlSession.delete(NS + "delete_tax_invoice_items_by_invoice_id", params);
|
sqlSession.delete(NS + "deleteTaxInvoiceItemsByInvoiceId", params);
|
||||||
sqlSession.delete(NS + "delete_tax_invoice", params);
|
sqlSession.delete(NS + "deleteTaxInvoice", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> issueTaxInvoice(Map<String, Object> params) {
|
public Map<String, Object> issueTaxInvoice(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
int updated = sqlSession.update(NS + "issue_tax_invoice", params);
|
int updated = sqlSession.update(NS + "issueTaxInvoice", params);
|
||||||
if (updated == 0) {
|
if (updated == 0) {
|
||||||
throw new RuntimeException("세금계산서를 찾을 수 없거나 이미 발행된 상태입니다.");
|
throw new RuntimeException("세금계산서를 찾을 수 없거나 이미 발행된 상태입니다.");
|
||||||
}
|
}
|
||||||
return sqlSession.selectOne(NS + "get_tax_invoice_info", params);
|
return sqlSession.selectOne(NS + "getTaxInvoiceInfo", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> cancelTaxInvoice(Map<String, Object> params) {
|
public Map<String, Object> cancelTaxInvoice(Map<String, Object> params) {
|
||||||
commonService.applyCompanyCodeFilter(params);
|
commonService.applyCompanyCodeFilter(params);
|
||||||
int updated = sqlSession.update(NS + "cancel_tax_invoice", params);
|
int updated = sqlSession.update(NS + "cancelTaxInvoice", params);
|
||||||
if (updated == 0) {
|
if (updated == 0) {
|
||||||
throw new RuntimeException("세금계산서를 찾을 수 없거나 취소할 수 없는 상태입니다.");
|
throw new RuntimeException("세금계산서를 찾을 수 없거나 취소할 수 없는 상태입니다.");
|
||||||
}
|
}
|
||||||
return sqlSession.selectOne(NS + "get_tax_invoice_info", params);
|
return sqlSession.selectOne(NS + "getTaxInvoiceInfo", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getMonthlyStats(Map<String, Object> params) {
|
public Map<String, Object> getMonthlyStats(Map<String, Object> params) {
|
||||||
@@ -167,7 +167,7 @@ public class TaxInvoiceService extends BaseService {
|
|||||||
String endDate = firstDay.withDayOfMonth(firstDay.lengthOfMonth()).toString();
|
String endDate = firstDay.withDayOfMonth(firstDay.lengthOfMonth()).toString();
|
||||||
params.put("start_date", startDate);
|
params.put("start_date", startDate);
|
||||||
params.put("end_date", endDate);
|
params.put("end_date", endDate);
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "get_monthly_stats", params);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "getMonthlyStats", params);
|
||||||
Map<String, Object> sales = new HashMap<>();
|
Map<String, Object> sales = new HashMap<>();
|
||||||
sales.put("count", 0);
|
sales.put("count", 0);
|
||||||
sales.put("supply_amount", BigDecimal.ZERO);
|
sales.put("supply_amount", BigDecimal.ZERO);
|
||||||
@@ -207,9 +207,9 @@ public class TaxInvoiceService extends BaseService {
|
|||||||
params.put("start_date", startDate);
|
params.put("start_date", startDate);
|
||||||
params.put("end_date", endDate);
|
params.put("end_date", endDate);
|
||||||
}
|
}
|
||||||
List<Map<String, Object>> byCostType = sqlSession.selectList(NS + "get_cost_type_stats", params);
|
List<Map<String, Object>> byCostType = sqlSession.selectList(NS + "getCostTypeStats", params);
|
||||||
List<Map<String, Object>> byMonth = sqlSession.selectList(NS + "get_cost_type_stats_by_month", params);
|
List<Map<String, Object>> byMonth = sqlSession.selectList(NS + "getCostTypeStatsByMonth", params);
|
||||||
Map<String, Object> summary = sqlSession.selectOne(NS + "get_cost_type_stats_summary", params);
|
Map<String, Object> summary = sqlSession.selectOne(NS + "getCostTypeStatsSummary", params);
|
||||||
for (Map<String, Object> row : byCostType) {
|
for (Map<String, Object> row : byCostType) {
|
||||||
row.put("supply_amount", DecimalUtils.toBigDecimal(row.get("supply_amount")));
|
row.put("supply_amount", DecimalUtils.toBigDecimal(row.get("supply_amount")));
|
||||||
row.put("tax_amount", DecimalUtils.toBigDecimal(row.get("tax_amount")));
|
row.put("tax_amount", DecimalUtils.toBigDecimal(row.get("tax_amount")));
|
||||||
|
|||||||
@@ -67,10 +67,10 @@ public class TemplateStandardService extends BaseService {
|
|||||||
params.put("limit", limit);
|
params.put("limit", limit);
|
||||||
params.put("offset", offset);
|
params.put("offset", offset);
|
||||||
|
|
||||||
List<Map<String, Object>> templates = sqlSession.selectList(NS + "get_template_standard_list", params);
|
List<Map<String, Object>> templates = sqlSession.selectList(NS + "getTemplateStandardList", params);
|
||||||
templates.forEach(this::deserializeJsonFields);
|
templates.forEach(this::deserializeJsonFields);
|
||||||
|
|
||||||
Integer totalObj = sqlSession.selectOne(NS + "get_template_standard_list_cnt", params);
|
Integer totalObj = sqlSession.selectOne(NS + "getTemplateStandardListCnt", params);
|
||||||
int total = totalObj != null ? totalObj : 0;
|
int total = totalObj != null ? totalObj : 0;
|
||||||
|
|
||||||
Map<String, Object> result = new LinkedHashMap<>();
|
Map<String, Object> result = new LinkedHashMap<>();
|
||||||
@@ -87,7 +87,7 @@ public class TemplateStandardService extends BaseService {
|
|||||||
public Map<String, Object> getTemplateStandardInfo(String templateCode) {
|
public Map<String, Object> getTemplateStandardInfo(String templateCode) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("template_code", templateCode);
|
params.put("template_code", templateCode);
|
||||||
Map<String, Object> row = sqlSession.selectOne(NS + "get_template_standard_info", params);
|
Map<String, Object> row = sqlSession.selectOne(NS + "getTemplateStandardInfo", params);
|
||||||
deserializeJsonFields(row);
|
deserializeJsonFields(row);
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
@@ -101,7 +101,7 @@ public class TemplateStandardService extends BaseService {
|
|||||||
|
|
||||||
Map<String, Object> checkParams = new HashMap<>();
|
Map<String, Object> checkParams = new HashMap<>();
|
||||||
checkParams.put("template_code", templateCode);
|
checkParams.put("template_code", templateCode);
|
||||||
if (sqlSession.selectOne(NS + "get_template_standard_info", checkParams) != null) {
|
if (sqlSession.selectOne(NS + "getTemplateStandardInfo", checkParams) != null) {
|
||||||
throw new IllegalArgumentException("템플릿 코드 '" + templateCode + "'는 이미 존재합니다.");
|
throw new IllegalArgumentException("템플릿 코드 '" + templateCode + "'는 이미 존재합니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ public class TemplateStandardService extends BaseService {
|
|||||||
params.putIfAbsent("is_public", "N");
|
params.putIfAbsent("is_public", "N");
|
||||||
serializeJsonFields(params);
|
serializeJsonFields(params);
|
||||||
|
|
||||||
sqlSession.insert(NS + "insert_template_standard", params);
|
sqlSession.insert(NS + "insertTemplateStandard", params);
|
||||||
|
|
||||||
return getTemplateStandardInfo(templateCode);
|
return getTemplateStandardInfo(templateCode);
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ public class TemplateStandardService extends BaseService {
|
|||||||
params.put("template_code", templateCode);
|
params.put("template_code", templateCode);
|
||||||
serializeJsonFields(params);
|
serializeJsonFields(params);
|
||||||
|
|
||||||
int updated = sqlSession.update(NS + "update_template_standard", params);
|
int updated = sqlSession.update(NS + "updateTemplateStandard", params);
|
||||||
if (updated == 0) return null;
|
if (updated == 0) return null;
|
||||||
|
|
||||||
return getTemplateStandardInfo(templateCode);
|
return getTemplateStandardInfo(templateCode);
|
||||||
@@ -136,7 +136,7 @@ public class TemplateStandardService extends BaseService {
|
|||||||
public boolean deleteTemplateStandard(String templateCode) {
|
public boolean deleteTemplateStandard(String templateCode) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("template_code", templateCode);
|
params.put("template_code", templateCode);
|
||||||
return sqlSession.delete(NS + "delete_template_standard", params) > 0;
|
return sqlSession.delete(NS + "deleteTemplateStandard", params) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -145,7 +145,7 @@ public class TemplateStandardService extends BaseService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public void updateTemplateStandardSortOrder(List<Map<String, Object>> templates) {
|
public void updateTemplateStandardSortOrder(List<Map<String, Object>> templates) {
|
||||||
for (Map<String, Object> t : templates) {
|
for (Map<String, Object> t : templates) {
|
||||||
sqlSession.update(NS + "update_template_standard_sort_order", t);
|
sqlSession.update(NS + "updateTemplateStandardSortOrder", t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ public class TemplateStandardService extends BaseService {
|
|||||||
|
|
||||||
Map<String, Object> checkParams = new HashMap<>();
|
Map<String, Object> checkParams = new HashMap<>();
|
||||||
checkParams.put("template_code", newCode);
|
checkParams.put("template_code", newCode);
|
||||||
if (sqlSession.selectOne(NS + "get_template_standard_info", checkParams) != null) {
|
if (sqlSession.selectOne(NS + "getTemplateStandardInfo", checkParams) != null) {
|
||||||
throw new IllegalArgumentException("템플릿 코드 '" + newCode + "'는 이미 존재합니다.");
|
throw new IllegalArgumentException("템플릿 코드 '" + newCode + "'는 이미 존재합니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,7 +193,7 @@ public class TemplateStandardService extends BaseService {
|
|||||||
// layout_config / default_size가 이미 Object이면 직렬화
|
// layout_config / default_size가 이미 Object이면 직렬화
|
||||||
serializeJsonFields(newTemplate);
|
serializeJsonFields(newTemplate);
|
||||||
|
|
||||||
sqlSession.insert(NS + "insert_template_standard", newTemplate);
|
sqlSession.insert(NS + "insertTemplateStandard", newTemplate);
|
||||||
return getTemplateStandardInfo(newCode);
|
return getTemplateStandardInfo(newCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,7 +203,7 @@ public class TemplateStandardService extends BaseService {
|
|||||||
public List<String> getTemplateStandardCategoryList(String companyCode) {
|
public List<String> getTemplateStandardCategoryList(String companyCode) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("company_code", companyCode);
|
params.put("company_code", companyCode);
|
||||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "get_template_standard_category_list", params);
|
List<Map<String, Object>> rows = sqlSession.selectList(NS + "getTemplateStandardCategoryList", params);
|
||||||
List<String> categories = new ArrayList<>();
|
List<String> categories = new ArrayList<>();
|
||||||
for (Map<String, Object> row : rows) {
|
for (Map<String, Object> row : rows) {
|
||||||
Object cat = row.get("category");
|
Object cat = row.get("category");
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ public class TodoService extends BaseService {
|
|||||||
|
|
||||||
public Map<String, Object> getTodoList(Map<String, Object> params) {
|
public Map<String, Object> getTodoList(Map<String, Object> params) {
|
||||||
commonService.applyPagination(params);
|
commonService.applyPagination(params);
|
||||||
Integer totalObj = sqlSession.selectOne(NS + "get_todo_list_cnt", params);
|
Integer totalObj = sqlSession.selectOne(NS + "getTodoListCnt", params);
|
||||||
int totalCount = totalObj != null ? totalObj : 0;
|
int totalCount = totalObj != null ? totalObj : 0;
|
||||||
List<Map<String, Object>> list = sqlSession.selectList(NS + "get_todo_list", params);
|
List<Map<String, Object>> list = sqlSession.selectList(NS + "getTodoList", params);
|
||||||
|
|
||||||
// stats 계산
|
// stats 계산
|
||||||
Map<String, Object> stats = new LinkedHashMap<>();
|
Map<String, Object> stats = new LinkedHashMap<>();
|
||||||
@@ -40,26 +40,26 @@ public class TodoService extends BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getTodoInfo(Map<String, Object> params) {
|
public Map<String, Object> getTodoInfo(Map<String, Object> params) {
|
||||||
return sqlSession.selectOne(NS + "get_todo_info", params);
|
return sqlSession.selectOne(NS + "getTodoInfo", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> insertTodo(Map<String, Object> params) {
|
public Map<String, Object> insertTodo(Map<String, Object> params) {
|
||||||
String id = UUID.randomUUID().toString();
|
String id = UUID.randomUUID().toString();
|
||||||
params.put("id", id);
|
params.put("id", id);
|
||||||
sqlSession.insert(NS + "insert_todo", params);
|
sqlSession.insert(NS + "insertTodo", params);
|
||||||
return sqlSession.selectOne(NS + "get_todo_info", Map.of("id", id));
|
return sqlSession.selectOne(NS + "getTodoInfo", Map.of("id", id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> updateTodo(Map<String, Object> params) {
|
public Map<String, Object> updateTodo(Map<String, Object> params) {
|
||||||
sqlSession.update(NS + "update_todo", params);
|
sqlSession.update(NS + "updateTodo", params);
|
||||||
return sqlSession.selectOne(NS + "get_todo_info", Map.of("id", params.get("id")));
|
return sqlSession.selectOne(NS + "getTodoInfo", Map.of("id", params.get("id")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Map<String, Object> deleteTodo(Map<String, Object> params) {
|
public Map<String, Object> deleteTodo(Map<String, Object> params) {
|
||||||
sqlSession.delete(NS + "delete_todo", params);
|
sqlSession.delete(NS + "deleteTodo", params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ public class TodoService extends BaseService {
|
|||||||
Map<String, Object> p = new HashMap<>();
|
Map<String, Object> p = new HashMap<>();
|
||||||
p.put("id", todoIds.get(i));
|
p.put("id", todoIds.get(i));
|
||||||
p.put("display_order", i);
|
p.put("display_order", i);
|
||||||
sqlSession.update(NS + "update_todo_order", p);
|
sqlSession.update(NS + "updateTodoOrder", p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ spring:
|
|||||||
mybatis:
|
mybatis:
|
||||||
mapper-locations: classpath:mapper/*.xml
|
mapper-locations: classpath:mapper/*.xml
|
||||||
configuration:
|
configuration:
|
||||||
map-underscore-to-camel-case: true
|
map-underscore-to-camel-case: false
|
||||||
default-fetch-size: 100
|
default-fetch-size: 100
|
||||||
default-statement-timeout: 30
|
default-statement-timeout: 30
|
||||||
|
|
||||||
|
|||||||
@@ -32,17 +32,20 @@
|
|||||||
<if test="!include_inactive">
|
<if test="!include_inactive">
|
||||||
AND MENU.STATUS = 'active'
|
AND MENU.STATUS = 'active'
|
||||||
</if>
|
</if>
|
||||||
<choose>
|
|
||||||
<when test='user_type == "SUPER_ADMIN" and company_code == "*" and !is_management_screen'>
|
|
||||||
AND MENU.COMPANY_CODE = '*'
|
|
||||||
</when>
|
|
||||||
<when test='company_code != null and company_code != "*"'>
|
|
||||||
AND (MENU.COMPANY_CODE = #{company_code} OR MENU.COMPANY_CODE = '*')
|
|
||||||
</when>
|
|
||||||
</choose>
|
|
||||||
<if test="menu_type != null">
|
<if test="menu_type != null">
|
||||||
AND MENU.MENU_TYPE = CAST(#{menu_type} AS NUMERIC)
|
AND MENU.MENU_TYPE = CAST(#{menu_type} AS NUMERIC)
|
||||||
</if>
|
</if>
|
||||||
|
<choose>
|
||||||
|
<when test='!is_management_screen and menu_type != null and menu_type == "0"'>
|
||||||
|
AND MENU.COMPANY_CODE = '*'
|
||||||
|
</when>
|
||||||
|
<when test='company_code == "*" and !is_management_screen'>
|
||||||
|
AND MENU.COMPANY_CODE = '*'
|
||||||
|
</when>
|
||||||
|
<when test='company_code != null and company_code != "*"'>
|
||||||
|
AND MENU.COMPANY_CODE = #{company_code}
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
<if test='user_id != null and user_type != null and user_type != "SUPER_ADMIN" and !is_management_screen'>
|
<if test='user_id != null and user_type != null and user_type != "SUPER_ADMIN" and !is_management_screen'>
|
||||||
AND EXISTS (
|
AND EXISTS (
|
||||||
SELECT 1
|
SELECT 1
|
||||||
@@ -177,11 +180,11 @@
|
|||||||
AND MENU.MENU_TYPE = '1'
|
AND MENU.MENU_TYPE = '1'
|
||||||
AND MENU.STATUS = 'active'
|
AND MENU.STATUS = 'active'
|
||||||
<choose>
|
<choose>
|
||||||
<when test='user_type == "SUPER_ADMIN" and company_code == "*"'>
|
<when test='company_code == "*"'>
|
||||||
AND MENU.COMPANY_CODE = '*'
|
AND MENU.COMPANY_CODE = '*'
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
AND (MENU.COMPANY_CODE = #{company_code} OR MENU.COMPANY_CODE = '*')
|
AND MENU.COMPANY_CODE = #{company_code}
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
|
|
||||||
@@ -316,7 +319,8 @@
|
|||||||
<!-- 메뉴 등록 -->
|
<!-- 메뉴 등록 -->
|
||||||
<insert id="insertMenu" parameterType="map">
|
<insert id="insertMenu" parameterType="map">
|
||||||
INSERT INTO MENU_INFO (
|
INSERT INTO MENU_INFO (
|
||||||
MENU_TYPE
|
OBJID
|
||||||
|
, MENU_TYPE
|
||||||
, PARENT_OBJ_ID
|
, PARENT_OBJ_ID
|
||||||
, MENU_NAME_KOR
|
, MENU_NAME_KOR
|
||||||
, MENU_URL
|
, MENU_URL
|
||||||
@@ -330,7 +334,8 @@
|
|||||||
, LANG_KEY_DESC
|
, LANG_KEY_DESC
|
||||||
, MENU_ICON
|
, MENU_ICON
|
||||||
) VALUES (
|
) VALUES (
|
||||||
#{menu_type}
|
#{objid}
|
||||||
|
, #{menu_type}
|
||||||
, #{parent_obj_id}
|
, #{parent_obj_id}
|
||||||
, #{menu_name_kor}
|
, #{menu_name_kor}
|
||||||
, #{menu_url}
|
, #{menu_url}
|
||||||
|
|||||||
@@ -45,16 +45,15 @@
|
|||||||
, CRON_SCHEDULE
|
, CRON_SCHEDULE
|
||||||
, IS_ACTIVE
|
, IS_ACTIVE
|
||||||
, COMPANY_CODE
|
, COMPANY_CODE
|
||||||
, SAVE_MODE
|
|
||||||
, CONFLICT_KEY
|
|
||||||
, AUTH_SERVICE_NAME
|
|
||||||
, DATA_ARRAY_PATH
|
|
||||||
, EXECUTION_TYPE
|
|
||||||
, NODE_FLOW_ID
|
|
||||||
, NODE_FLOW_CONTEXT
|
|
||||||
, CREATED_BY
|
, CREATED_BY
|
||||||
, CREATED_DATE
|
, CREATED_DATE
|
||||||
, UPDATED_DATE
|
, UPDATED_DATE
|
||||||
|
<if test="save_mode != null">, SAVE_MODE</if>
|
||||||
|
<if test="conflict_key != null">, CONFLICT_KEY</if>
|
||||||
|
<if test="auth_service_name != null">, AUTH_SERVICE_NAME</if>
|
||||||
|
<if test="data_array_path != null">, DATA_ARRAY_PATH</if>
|
||||||
|
<if test="node_flow_id != null">, NODE_FLOW_ID</if>
|
||||||
|
<if test="node_flow_context != null">, NODE_FLOW_CONTEXT</if>
|
||||||
) VALUES (
|
) VALUES (
|
||||||
#{batch_name}
|
#{batch_name}
|
||||||
, #{description}
|
, #{description}
|
||||||
@@ -64,25 +63,15 @@
|
|||||||
<otherwise>'Y'</otherwise>
|
<otherwise>'Y'</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
, #{company_code}
|
, #{company_code}
|
||||||
, <choose>
|
|
||||||
<when test="save_mode != null">#{save_mode}</when>
|
|
||||||
<otherwise>'INSERT'</otherwise>
|
|
||||||
</choose>
|
|
||||||
, #{conflict_key}
|
|
||||||
, #{auth_service_name}
|
|
||||||
, #{data_array_path}
|
|
||||||
, <choose>
|
|
||||||
<when test="execution_type != null">#{execution_type}</when>
|
|
||||||
<otherwise>'mapping'</otherwise>
|
|
||||||
</choose>
|
|
||||||
, #{node_flow_id}
|
|
||||||
, <choose>
|
|
||||||
<when test="node_flow_context != null">#{node_flow_context}::jsonb</when>
|
|
||||||
<otherwise>NULL</otherwise>
|
|
||||||
</choose>
|
|
||||||
, #{created_by}
|
, #{created_by}
|
||||||
, NOW()
|
, NOW()
|
||||||
, NOW()
|
, NOW()
|
||||||
|
<if test="save_mode != null">, #{save_mode}</if>
|
||||||
|
<if test="conflict_key != null">, #{conflict_key}</if>
|
||||||
|
<if test="auth_service_name != null">, #{auth_service_name}</if>
|
||||||
|
<if test="data_array_path != null">, #{data_array_path}</if>
|
||||||
|
<if test="node_flow_id != null">, #{node_flow_id}</if>
|
||||||
|
<if test="node_flow_context != null">, #{node_flow_context}::jsonb</if>
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@@ -97,7 +86,7 @@
|
|||||||
<if test="conflict_key != null">CONFLICT_KEY = #{conflict_key},</if>
|
<if test="conflict_key != null">CONFLICT_KEY = #{conflict_key},</if>
|
||||||
<if test="auth_service_name != null">AUTH_SERVICE_NAME = #{auth_service_name},</if>
|
<if test="auth_service_name != null">AUTH_SERVICE_NAME = #{auth_service_name},</if>
|
||||||
<if test="data_array_path != null">DATA_ARRAY_PATH = #{data_array_path},</if>
|
<if test="data_array_path != null">DATA_ARRAY_PATH = #{data_array_path},</if>
|
||||||
<if test="execution_type != null">EXECUTION_TYPE = #{execution_type},</if>
|
<!-- execution_type column removed: does not exist in DB -->
|
||||||
<if test="node_flow_id != null">NODE_FLOW_ID = #{node_flow_id},</if>
|
<if test="node_flow_id != null">NODE_FLOW_ID = #{node_flow_id},</if>
|
||||||
<if test="node_flow_context != null">NODE_FLOW_CONTEXT = #{node_flow_context}::jsonb,</if>
|
<if test="node_flow_context != null">NODE_FLOW_CONTEXT = #{node_flow_context}::jsonb,</if>
|
||||||
<if test="updated_by != null">UPDATED_BY = #{updated_by},</if>
|
<if test="updated_by != null">UPDATED_BY = #{updated_by},</if>
|
||||||
|
|||||||
@@ -170,7 +170,7 @@
|
|||||||
AND KEY_ID != #{key_id}
|
AND KEY_ID != #{key_id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertMultilangKey" parameterType="map" useGeneratedKeys="true" keyProperty="keyId" keyColumn="key_id">
|
<insert id="insertMultilangKey" parameterType="map" useGeneratedKeys="true" keyProperty="key_id" keyColumn="key_id">
|
||||||
INSERT INTO MULTI_LANG_KEY_MASTER (
|
INSERT INTO MULTI_LANG_KEY_MASTER (
|
||||||
COMPANY_CODE
|
COMPANY_CODE
|
||||||
, USAGE_NOTE
|
, USAGE_NOTE
|
||||||
@@ -190,7 +190,7 @@
|
|||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<insert id="insertMultilangKeyWithCategory" parameterType="map" useGeneratedKeys="true" keyProperty="keyId" keyColumn="key_id">
|
<insert id="insertMultilangKeyWithCategory" parameterType="map" useGeneratedKeys="true" keyProperty="key_id" keyColumn="key_id">
|
||||||
INSERT INTO MULTI_LANG_KEY_MASTER (
|
INSERT INTO MULTI_LANG_KEY_MASTER (
|
||||||
COMPANY_CODE
|
COMPANY_CODE
|
||||||
, LANG_KEY
|
, LANG_KEY
|
||||||
|
|||||||
@@ -41,17 +41,18 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 권한 그룹 생성 (생성된 objid를 params에 반환) -->
|
<!-- 권한 그룹 생성 (생성된 objid를 params에 반환) -->
|
||||||
<insert id="insertRoleGroup" parameterType="map"
|
<insert id="insertRoleGroup" parameterType="map">
|
||||||
useGeneratedKeys="true" keyProperty="objid" keyColumn="objid">
|
|
||||||
INSERT INTO AUTHORITY_MASTER (
|
INSERT INTO AUTHORITY_MASTER (
|
||||||
AUTH_NAME
|
OBJID
|
||||||
|
, AUTH_NAME
|
||||||
, AUTH_CODE
|
, AUTH_CODE
|
||||||
, COMPANY_CODE
|
, COMPANY_CODE
|
||||||
, STATUS
|
, STATUS
|
||||||
, WRITER
|
, WRITER
|
||||||
, CREATED_DATE
|
, CREATED_DATE
|
||||||
) VALUES (
|
) VALUES (
|
||||||
#{auth_name}
|
#{objid}
|
||||||
|
, #{auth_name}
|
||||||
, #{auth_code}
|
, #{auth_code}
|
||||||
, #{company_code}
|
, #{company_code}
|
||||||
, 'active'
|
, 'active'
|
||||||
@@ -73,7 +74,7 @@
|
|||||||
<if test="status != null">
|
<if test="status != null">
|
||||||
STATUS = #{status},
|
STATUS = #{status},
|
||||||
</if>
|
</if>
|
||||||
MODDATE = NOW()
|
WRITER = #{writer}
|
||||||
WHERE OBJID = #{objid}
|
WHERE OBJID = #{objid}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
AND IS_ACTIVE != 'D'
|
AND IS_ACTIVE != 'D'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertScreen" parameterType="map" useGeneratedKeys="false">
|
<select id="insertScreen" parameterType="map" resultType="map">
|
||||||
INSERT INTO SCREEN_DEFINITIONS (
|
INSERT INTO SCREEN_DEFINITIONS (
|
||||||
SCREEN_NAME
|
SCREEN_NAME
|
||||||
, SCREEN_CODE
|
, SCREEN_CODE
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
, REST_API_CONNECTION_ID
|
, REST_API_CONNECTION_ID
|
||||||
, REST_API_ENDPOINT
|
, REST_API_ENDPOINT
|
||||||
, REST_API_JSON_PATH
|
, REST_API_JSON_PATH
|
||||||
</insert>
|
</select>
|
||||||
|
|
||||||
<select id="selectScreenList" parameterType="map" resultType="map">
|
<select id="selectScreenList" parameterType="map" resultType="map">
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
@@ -1,50 +1,35 @@
|
|||||||
version: "3.8"
|
version: "3.8"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# Node.js 백엔드
|
# Spring Boot 백엔드
|
||||||
backend:
|
backend:
|
||||||
build:
|
build:
|
||||||
context: ./backend-node
|
context: ./backend-spring
|
||||||
dockerfile: Dockerfile.win
|
dockerfile: ../docker/dev/backend-spring.Dockerfile
|
||||||
container_name: pms-backend-win
|
container_name: pms-backend-win
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8081:8081"
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=development
|
- SPRING_PROFILES_ACTIVE=dev
|
||||||
- PORT=8080
|
- SERVER_PORT=8081
|
||||||
- DATABASE_URL=postgresql://postgres:ph0909!!@39.117.244.52:11132/plm
|
- SPRING_DATASOURCE_URL=jdbc:postgresql://39.117.244.52:11132/testvex
|
||||||
|
- SPRING_DATASOURCE_USERNAME=postgres
|
||||||
|
- SPRING_DATASOURCE_PASSWORD=ph0909!!
|
||||||
- JWT_SECRET=ilshin-plm-super-secret-jwt-key-2024
|
- JWT_SECRET=ilshin-plm-super-secret-jwt-key-2024
|
||||||
- JWT_EXPIRES_IN=24h
|
- JWT_EXPIRATION=86400000
|
||||||
- ENCRYPTION_KEY=ilshin-plm-encryption-key-2024-secure-32bytes
|
- FILE_UPLOAD_DIR=./uploads
|
||||||
- CORS_ORIGIN=http://localhost:9771
|
|
||||||
- CORS_CREDENTIALS=true
|
|
||||||
- LOG_LEVEL=debug
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./backend-node:/app
|
- ./backend-spring:/app
|
||||||
- /app/node_modules
|
|
||||||
- /app/dist
|
|
||||||
networks:
|
networks:
|
||||||
- pms-network
|
- pms-network
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test:
|
test: ["CMD", "curl", "-f", "http://localhost:8081/health"]
|
||||||
[
|
|
||||||
"CMD",
|
|
||||||
"wget",
|
|
||||||
"--no-verbose",
|
|
||||||
"--tries=1",
|
|
||||||
"--spider",
|
|
||||||
"http://localhost:8080/health",
|
|
||||||
"||",
|
|
||||||
"exit",
|
|
||||||
"1",
|
|
||||||
]
|
|
||||||
interval: 30s
|
interval: 30s
|
||||||
timeout: 15s
|
timeout: 10s
|
||||||
retries: 5
|
retries: 3
|
||||||
start_period: 90s
|
start_period: 90s
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
pms-network:
|
pms-network:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
external: false
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "9771:3000"
|
- "9771:3000"
|
||||||
environment:
|
environment:
|
||||||
- NEXT_PUBLIC_API_URL=http://localhost:8080/api
|
- NEXT_PUBLIC_API_URL=http://localhost:8081/api
|
||||||
- WATCHPACK_POLLING=true
|
- WATCHPACK_POLLING=true
|
||||||
- NODE_OPTIONS=--max-old-space-size=4096
|
- NODE_OPTIONS=--max-old-space-size=4096
|
||||||
deploy:
|
deploy:
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# Spring Boot 백엔드 배포용 Dockerfile
|
||||||
|
FROM eclipse-temurin:21-jdk-alpine AS build
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY gradlew ./
|
||||||
|
COPY gradle ./gradle
|
||||||
|
RUN chmod +x gradlew
|
||||||
|
|
||||||
|
COPY build.gradle settings.gradle ./
|
||||||
|
RUN ./gradlew dependencies --no-daemon || true
|
||||||
|
|
||||||
|
COPY src ./src
|
||||||
|
RUN ./gradlew bootJar --no-daemon
|
||||||
|
|
||||||
|
# Runtime image
|
||||||
|
FROM eclipse-temurin:21-jre-alpine AS runner
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN apk add --no-cache curl
|
||||||
|
|
||||||
|
COPY --from=build /app/build/libs/*.jar app.jar
|
||||||
|
|
||||||
|
RUN mkdir -p logs uploads data && \
|
||||||
|
chown -R nobody:nobody /app && \
|
||||||
|
chmod -R 755 /app
|
||||||
|
|
||||||
|
EXPOSE 8081
|
||||||
|
USER nobody
|
||||||
|
CMD ["java", "-jar", "app.jar"]
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
# Base image (WACE Docker Hub)
|
|
||||||
FROM dockerhub.wace.me/node:20.19-alpine.linux AS base
|
|
||||||
WORKDIR /app
|
|
||||||
ENV NODE_ENV=production
|
|
||||||
# Install OpenSSL, curl (for healthcheck), and required certs
|
|
||||||
RUN apk add --no-cache openssl ca-certificates curl
|
|
||||||
|
|
||||||
# Dependencies stage (install production dependencies)
|
|
||||||
FROM base AS deps
|
|
||||||
COPY package*.json ./
|
|
||||||
RUN npm ci --omit=dev --prefer-offline --no-audit && npm cache clean --force
|
|
||||||
|
|
||||||
# Build stage (compile TypeScript)
|
|
||||||
FROM dockerhub.wace.me/node:20.19-alpine.linux AS build
|
|
||||||
WORKDIR /app
|
|
||||||
COPY package*.json ./
|
|
||||||
RUN npm ci --prefer-offline --no-audit && npm cache clean --force
|
|
||||||
COPY tsconfig.json ./
|
|
||||||
COPY src ./src
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
# Runtime image
|
|
||||||
FROM base AS runner
|
|
||||||
ENV NODE_ENV=production
|
|
||||||
|
|
||||||
# Copy production node_modules
|
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
|
||||||
# Copy built files
|
|
||||||
COPY --from=build /app/dist ./dist
|
|
||||||
# Copy package files
|
|
||||||
COPY package*.json ./
|
|
||||||
|
|
||||||
# 루트 디렉토리만 생성하고 node 유저에게 쓰기 권한 부여
|
|
||||||
# 하위 디렉토리는 애플리케이션이 런타임에 자동 생성
|
|
||||||
RUN mkdir -p logs uploads data && \
|
|
||||||
chown -R node:node /app && \
|
|
||||||
chmod -R 755 /app
|
|
||||||
|
|
||||||
EXPOSE 3001
|
|
||||||
USER node
|
|
||||||
CMD ["node", "dist/app.js"]
|
|
||||||
|
|
||||||
@@ -1,27 +1,22 @@
|
|||||||
version: "3.8"
|
version: "3.8"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# Node.js 백엔드
|
# Spring Boot 백엔드
|
||||||
backend:
|
backend:
|
||||||
build:
|
build:
|
||||||
context: ../../backend-node
|
context: ../../backend-spring
|
||||||
dockerfile: ../docker/deploy/backend.Dockerfile
|
dockerfile: ../docker/deploy/backend-spring.Dockerfile
|
||||||
container_name: pms-backend-prod
|
container_name: pms-backend-prod
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
NODE_ENV: production
|
SPRING_PROFILES_ACTIVE: prod
|
||||||
PORT: "3001"
|
SERVER_PORT: "8081"
|
||||||
HOST: 0.0.0.0
|
SPRING_DATASOURCE_URL: jdbc:postgresql://211.115.91.141:11134/vexplor
|
||||||
DATABASE_URL: postgresql://postgres:vexplor0909!!@211.115.91.141:11134/vexplor
|
SPRING_DATASOURCE_USERNAME: postgres
|
||||||
|
SPRING_DATASOURCE_PASSWORD: "vexplor0909!!"
|
||||||
JWT_SECRET: ilshin-plm-super-secret-jwt-key-2024
|
JWT_SECRET: ilshin-plm-super-secret-jwt-key-2024
|
||||||
JWT_EXPIRES_IN: 24h
|
JWT_EXPIRATION: "86400000"
|
||||||
CORS_ORIGIN: https://v1.vexplor.com,https://api.vexplor.com
|
FILE_UPLOAD_DIR: ./uploads
|
||||||
CORS_CREDENTIALS: "true"
|
|
||||||
LOG_LEVEL: info
|
|
||||||
ENCRYPTION_KEY: ilshin-plm-mail-encryption-key-32characters-2024-secure
|
|
||||||
KMA_API_KEY: ogdXr2e9T4iHV69nvV-IwA
|
|
||||||
ITS_API_KEY: d6b9befec3114d648284674b8fddcc32
|
|
||||||
EXPRESSWAY_API_KEY: ${EXPRESSWAY_API_KEY:-}
|
|
||||||
volumes:
|
volumes:
|
||||||
- backend_uploads:/app/uploads
|
- backend_uploads:/app/uploads
|
||||||
- backend_data:/app/data
|
- backend_data:/app/data
|
||||||
@@ -31,7 +26,7 @@ services:
|
|||||||
- traefik.http.routers.backend.entrypoints=websecure,web
|
- traefik.http.routers.backend.entrypoints=websecure,web
|
||||||
- traefik.http.routers.backend.tls=true
|
- traefik.http.routers.backend.tls=true
|
||||||
- traefik.http.routers.backend.tls.certresolver=le
|
- traefik.http.routers.backend.tls.certresolver=le
|
||||||
- traefik.http.services.backend.loadbalancer.server.port=3001
|
- traefik.http.services.backend.loadbalancer.server.port=8081
|
||||||
|
|
||||||
# Next.js 프론트엔드
|
# Next.js 프론트엔드
|
||||||
frontend:
|
frontend:
|
||||||
@@ -45,7 +40,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
NODE_ENV: production
|
NODE_ENV: production
|
||||||
NEXT_PUBLIC_API_URL: https://api.vexplor.com/api
|
NEXT_PUBLIC_API_URL: https://api.vexplor.com/api
|
||||||
SERVER_API_URL: "http://backend:3001"
|
SERVER_API_URL: "http://backend:8081"
|
||||||
NEXT_TELEMETRY_DISABLED: "1"
|
NEXT_TELEMETRY_DISABLED: "1"
|
||||||
PORT: "3000"
|
PORT: "3000"
|
||||||
HOSTNAME: 0.0.0.0
|
HOSTNAME: 0.0.0.0
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
# 개발용 Spring Boot 백엔드 Dockerfile
|
||||||
|
FROM eclipse-temurin:21-jdk-alpine
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# curl 설치 (헬스체크용)
|
||||||
|
RUN apk add --no-cache curl
|
||||||
|
|
||||||
|
# Gradle Wrapper 복사 및 의존성 캐싱
|
||||||
|
COPY gradlew ./
|
||||||
|
COPY gradle ./gradle
|
||||||
|
RUN chmod +x gradlew
|
||||||
|
|
||||||
|
COPY build.gradle settings.gradle ./
|
||||||
|
RUN ./gradlew dependencies --no-daemon || true
|
||||||
|
|
||||||
|
# 소스 코드는 볼륨 마운트로 처리
|
||||||
|
|
||||||
|
EXPOSE 8081
|
||||||
|
|
||||||
|
# 개발 서버 시작 (spring-boot-devtools 활용)
|
||||||
|
CMD ["./gradlew", "bootRun", "--no-daemon"]
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# 개발용 백엔드 Dockerfile
|
|
||||||
FROM node:20-bookworm-slim
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# 시스템 패키지 설치 (curl: 헬스 체크용)
|
|
||||||
RUN apt-get update \
|
|
||||||
&& apt-get install -y --no-install-recommends openssl ca-certificates curl \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# package.json 복사 및 의존성 설치 (개발 의존성 포함)
|
|
||||||
COPY package*.json ./
|
|
||||||
RUN npm ci --prefer-offline --no-audit
|
|
||||||
|
|
||||||
# 소스 코드는 볼륨 마운트로 처리
|
|
||||||
|
|
||||||
# 포트 노출
|
|
||||||
EXPOSE 8080
|
|
||||||
|
|
||||||
# 개발 서버 시작 (nodemon 사용)
|
|
||||||
CMD ["npm", "run", "dev"]
|
|
||||||
@@ -1,39 +1,34 @@
|
|||||||
services:
|
services:
|
||||||
# Node.js 백엔드
|
# Spring Boot 백엔드
|
||||||
backend:
|
backend:
|
||||||
build:
|
build:
|
||||||
context: ../../backend-node
|
context: ../../backend-spring
|
||||||
dockerfile: ../docker/dev/backend.Dockerfile
|
dockerfile: ../docker/dev/backend-spring.Dockerfile
|
||||||
container_name: pms-backend-mac
|
container_name: pms-backend-mac
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8081:8081"
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
- "host.docker.internal:host-gateway"
|
- "host.docker.internal:host-gateway"
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=development
|
- SPRING_PROFILES_ACTIVE=dev
|
||||||
- PORT=8080
|
- SERVER_PORT=8081
|
||||||
- DATABASE_URL=postgresql://postgres:ph0909!!@39.117.244.52:11132/plm
|
- SPRING_DATASOURCE_URL=jdbc:postgresql://39.117.244.52:11132/testvex
|
||||||
|
- SPRING_DATASOURCE_USERNAME=postgres
|
||||||
|
- SPRING_DATASOURCE_PASSWORD=ph0909!!
|
||||||
- JWT_SECRET=ilshin-plm-super-secret-jwt-key-2024
|
- JWT_SECRET=ilshin-plm-super-secret-jwt-key-2024
|
||||||
- JWT_EXPIRES_IN=24h
|
- JWT_EXPIRATION=86400000
|
||||||
- CORS_ORIGIN=http://localhost:9771
|
- FILE_UPLOAD_DIR=./uploads
|
||||||
- CORS_CREDENTIALS=true
|
|
||||||
- LOG_LEVEL=debug
|
|
||||||
- ENCRYPTION_KEY=ilshin-plm-mail-encryption-key-32characters-2024-secure
|
|
||||||
- KMA_API_KEY=ogdXr2e9T4iHV69nvV-IwA
|
|
||||||
- ITS_API_KEY=d6b9befec3114d648284674b8fddcc32
|
|
||||||
- EXPRESSWAY_API_KEY=${EXPRESSWAY_API_KEY:-}
|
|
||||||
volumes:
|
volumes:
|
||||||
- ../../backend-node:/app # 개발 모드: 코드 변경 시 자동 반영
|
- ../../backend-spring:/app
|
||||||
- /app/node_modules
|
|
||||||
networks:
|
networks:
|
||||||
- pms-network
|
- pms-network
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
|
test: ["CMD", "curl", "-f", "http://localhost:8081/health"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 3
|
retries: 3
|
||||||
start_period: 60s
|
start_period: 90s
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
pms-network:
|
pms-network:
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "9771:3000"
|
- "9771:3000"
|
||||||
environment:
|
environment:
|
||||||
- NEXT_PUBLIC_API_URL=http://localhost:8080/api
|
- NEXT_PUBLIC_API_URL=http://localhost:8081/api
|
||||||
- SERVER_API_URL=http://pms-backend-mac:8080
|
- SERVER_API_URL=http://pms-backend-mac:8081
|
||||||
- NODE_OPTIONS=--max-old-space-size=8192
|
- NODE_OPTIONS=--max-old-space-size=8192
|
||||||
- NEXT_TELEMETRY_DISABLED=1
|
- NEXT_TELEMETRY_DISABLED=1
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
# Spring Boot 백엔드 운영용 Dockerfile
|
||||||
|
FROM eclipse-temurin:21-jdk-alpine AS build
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Gradle Wrapper 복사
|
||||||
|
COPY gradlew ./
|
||||||
|
COPY gradle ./gradle
|
||||||
|
RUN chmod +x gradlew
|
||||||
|
|
||||||
|
# 의존성 캐싱
|
||||||
|
COPY build.gradle settings.gradle ./
|
||||||
|
RUN ./gradlew dependencies --no-daemon || true
|
||||||
|
|
||||||
|
# 소스 복사 및 빌드
|
||||||
|
COPY src ./src
|
||||||
|
RUN ./gradlew bootJar --no-daemon
|
||||||
|
|
||||||
|
# Runtime image
|
||||||
|
FROM eclipse-temurin:21-jre-alpine AS runner
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN apk add --no-cache curl
|
||||||
|
|
||||||
|
# 비특권 사용자 생성
|
||||||
|
RUN addgroup -S appgroup && adduser -S -G appgroup appuser
|
||||||
|
|
||||||
|
# JAR 복사
|
||||||
|
COPY --from=build /app/build/libs/*.jar app.jar
|
||||||
|
|
||||||
|
# 디렉토리 생성
|
||||||
|
RUN mkdir -p logs uploads data && \
|
||||||
|
chown -R appuser:appgroup /app && \
|
||||||
|
chmod -R 755 /app
|
||||||
|
|
||||||
|
EXPOSE 8081
|
||||||
|
USER appuser
|
||||||
|
CMD ["java", "-jar", "app.jar"]
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
# Base image (WACE Docker Hub)
|
|
||||||
FROM dockerhub.wace.me/node:20.19-alpine.linux AS base
|
|
||||||
WORKDIR /app
|
|
||||||
ENV NODE_ENV=production
|
|
||||||
# Install OpenSSL, curl (for healthcheck), and required certs
|
|
||||||
RUN apk add --no-cache openssl ca-certificates curl
|
|
||||||
|
|
||||||
# Dependencies stage (install production dependencies)
|
|
||||||
FROM base AS deps
|
|
||||||
COPY package*.json ./
|
|
||||||
RUN npm ci --omit=dev --prefer-offline --no-audit && npm cache clean --force
|
|
||||||
|
|
||||||
# Build stage (compile TypeScript)
|
|
||||||
FROM dockerhub.wace.me/node:20.19-alpine.linux AS build
|
|
||||||
WORKDIR /app
|
|
||||||
COPY package*.json ./
|
|
||||||
RUN npm ci --prefer-offline --no-audit && npm cache clean --force
|
|
||||||
COPY tsconfig.json ./
|
|
||||||
COPY src ./src
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
# Runtime image - base 이미지 재사용으로 중복 설치 제거
|
|
||||||
FROM base AS runner
|
|
||||||
ENV NODE_ENV=production
|
|
||||||
|
|
||||||
# Create non-root user (Alpine 방식)
|
|
||||||
RUN addgroup -S appgroup && adduser -S -G appgroup appuser
|
|
||||||
|
|
||||||
# Copy production node_modules
|
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
|
||||||
# Copy built files
|
|
||||||
COPY --from=build /app/dist ./dist
|
|
||||||
# Copy package files
|
|
||||||
COPY package*.json ./
|
|
||||||
|
|
||||||
# 루트 디렉토리만 생성하고 appuser에게 쓰기 권한 부여
|
|
||||||
# 하위 디렉토리는 애플리케이션이 런타임에 자동 생성
|
|
||||||
RUN mkdir -p logs uploads data && \
|
|
||||||
chown -R appuser:appgroup /app && \
|
|
||||||
chmod -R 755 /app
|
|
||||||
|
|
||||||
EXPOSE 8080
|
|
||||||
USER appuser
|
|
||||||
CMD ["node", "dist/app.js"]
|
|
||||||
@@ -1,36 +1,31 @@
|
|||||||
services:
|
services:
|
||||||
# Node.js 백엔드 (운영용)
|
# Spring Boot 백엔드 (운영용)
|
||||||
backend:
|
backend:
|
||||||
build:
|
build:
|
||||||
context: ../../backend-node
|
context: ../../backend-spring
|
||||||
dockerfile: ../docker/prod/backend.Dockerfile # 운영용 Dockerfile
|
dockerfile: ../docker/prod/backend-spring.Dockerfile
|
||||||
container_name: pms-backend-prod
|
container_name: pms-backend-prod
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080" # 호스트:컨테이너 포트 매핑
|
- "8081:8081"
|
||||||
networks:
|
networks:
|
||||||
- pms-network
|
- pms-network
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=production
|
- SPRING_PROFILES_ACTIVE=prod
|
||||||
- PORT=8080
|
- SERVER_PORT=8081
|
||||||
- HOST=0.0.0.0 # 모든 인터페이스에서 바인딩
|
- SPRING_DATASOURCE_URL=jdbc:postgresql://39.117.244.52:11132/plm
|
||||||
- DATABASE_URL=postgresql://postgres:ph0909!!@39.117.244.52:11132/plm
|
- SPRING_DATASOURCE_USERNAME=postgres
|
||||||
|
- SPRING_DATASOURCE_PASSWORD=ph0909!!
|
||||||
- JWT_SECRET=ilshin-plm-super-secret-jwt-key-2024
|
- JWT_SECRET=ilshin-plm-super-secret-jwt-key-2024
|
||||||
- JWT_EXPIRES_IN=24h
|
- JWT_EXPIRATION=86400000
|
||||||
- CORS_ORIGIN=http://192.168.0.70:5555,http://39.117.244.52:5555,http://localhost:9771
|
- FILE_UPLOAD_DIR=./uploads
|
||||||
- CORS_CREDENTIALS=true
|
|
||||||
- LOG_LEVEL=info
|
|
||||||
- ENCRYPTION_KEY=ilshin-plm-mail-encryption-key-32characters-2024-secure
|
|
||||||
- KMA_API_KEY=ogdXr2e9T4iHV69nvV-IwA
|
|
||||||
- ITS_API_KEY=d6b9befec3114d648284674b8fddcc32
|
|
||||||
- EXPRESSWAY_API_KEY=${EXPRESSWAY_API_KEY:-}
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
|
test: ["CMD", "curl", "-f", "http://localhost:8081/health"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 3
|
retries: 3
|
||||||
start_period: 60s
|
start_period: 90s
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
pms-network:
|
pms-network:
|
||||||
external: true # 외부에서 생성된 네트워크 사용
|
external: true
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ services:
|
|||||||
context: ../../frontend
|
context: ../../frontend
|
||||||
dockerfile: ../docker/prod/frontend.Dockerfile
|
dockerfile: ../docker/prod/frontend.Dockerfile
|
||||||
args:
|
args:
|
||||||
- NEXT_PUBLIC_API_URL=http://39.117.244.52:8080/api
|
- NEXT_PUBLIC_API_URL=http://39.117.244.52:8081/api
|
||||||
container_name: pms-frontend-linux
|
container_name: pms-frontend-linux
|
||||||
ports:
|
ports:
|
||||||
- "5555:5555"
|
- "5555:5555"
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=production
|
- NODE_ENV=production
|
||||||
- NEXT_PUBLIC_API_URL=http://39.117.244.52:8080/api
|
- NEXT_PUBLIC_API_URL=http://39.117.244.52:8081/api
|
||||||
networks:
|
networks:
|
||||||
- pms-network
|
- pms-network
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ COPY . .
|
|||||||
ENV NEXT_TELEMETRY_DISABLED 1
|
ENV NEXT_TELEMETRY_DISABLED 1
|
||||||
|
|
||||||
# 빌드 시 환경변수 설정 (ARG로 받아서 ENV로 설정)
|
# 빌드 시 환경변수 설정 (ARG로 받아서 ENV로 설정)
|
||||||
ARG NEXT_PUBLIC_API_URL=http://192.168.0.70:8080/api
|
ARG NEXT_PUBLIC_API_URL=http://192.168.0.70:8081/api
|
||||||
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
|
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
|
||||||
|
|
||||||
# Build the application
|
# Build the application
|
||||||
|
|||||||
@@ -0,0 +1,78 @@
|
|||||||
|
# 관리자 페이지 테스트 결과
|
||||||
|
|
||||||
|
> 테스트 일시: 2026-03-30
|
||||||
|
> 테스트 환경: localhost:9771 (Next.js) → localhost:8081 (Spring Boot)
|
||||||
|
> 테스트 계정: wace (최고 관리자)
|
||||||
|
> 테스트 도구: Puppeteer MCP (브라우저 자동화) + API 직접 호출
|
||||||
|
|
||||||
|
## 제외 메뉴
|
||||||
|
- 제어관리 (= 워크플로우) - API 미구현
|
||||||
|
- 연쇄관계관리 - 제외 요청
|
||||||
|
- 리포트 - 제외 요청
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 최종 CRUD 테스트 결과
|
||||||
|
|
||||||
|
| 메뉴 | Read | Create | Update | Delete | 브라우저 확인 |
|
||||||
|
|------|:----:|:------:|:------:|:------:|:----------:|
|
||||||
|
| 메뉴관리 | OK | OK | OK | OK | OK |
|
||||||
|
| 사용자관리 | OK | OK | OK | OK | OK |
|
||||||
|
| 회사관리 | OK | OK | OK | OK | OK |
|
||||||
|
| 권한관리 | OK | - | OK | - | OK |
|
||||||
|
| 권한 그룹관리 | OK | OK | OK | OK | OK |
|
||||||
|
| 다국어관리 | OK | OK | OK | OK | OK |
|
||||||
|
| 테이블 타입관리 | OK | - | - | - | OK |
|
||||||
|
| 공통코드관리 | OK | OK | OK | OK | OK (브라우저 저장 확인) |
|
||||||
|
| 화면관리 | OK | OK | OK | OK | OK (958개 화면) |
|
||||||
|
| POP화면관리 | OK | - | - | - | OK |
|
||||||
|
| 대시보드관리 | OK | OK | OK | OK | OK (날짜/생성자 정상) |
|
||||||
|
| 배치관리 | OK | OK | OK | OK | OK (10개 배치) |
|
||||||
|
| 메일관리 | OK(UI) | - | - | - | API 미구현 |
|
||||||
|
| 외부 커넥션 관리 | OK | OK | OK | OK | OK |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 수정 완료 목록
|
||||||
|
|
||||||
|
### 프론트엔드 수정 (7건)
|
||||||
|
|
||||||
|
| # | 버그 | 수정 파일 |
|
||||||
|
|---|------|-----------|
|
||||||
|
| 1 | 다국어관리 카테고리 이름 안 나옴 | multilang.ts, CategoryTree.tsx, KeyGenerateModal.tsx, i18nList/page.tsx |
|
||||||
|
| 2 | 대시보드관리 에러 (pagination.total undefined) | dashboard.ts, dashboardList/page.tsx |
|
||||||
|
| 3 | 대시보드관리 생성자 "-", 날짜 Invalid Date | dashboard.ts, dashboardList/page.tsx |
|
||||||
|
| 4 | 권한관리 데이터 전부 "-" | UserAuthTable.tsx |
|
||||||
|
| 5 | 공통코드 저장 400 에러 (camelCase→snake_case) | commonCode.ts (toSnakeCase 헬퍼 추가) |
|
||||||
|
| 6 | 화면관리 0개 표시 (응답 구조 불일치) | screen.ts (Spring 이중 래핑 처리) |
|
||||||
|
| 7 | 배치관리 목록 안 뜸 (API 경로 + 응답 형식) | batch.ts (endpoint + 응답 정규화) |
|
||||||
|
|
||||||
|
### 백엔드 수정 (8건)
|
||||||
|
|
||||||
|
| # | 버그 | 수정 파일 |
|
||||||
|
|---|------|-----------|
|
||||||
|
| 1 | 메뉴 Create - objid null | AdminService.java, mapper/admin.xml |
|
||||||
|
| 2 | 메뉴 Create - menu_name null | AdminService.java (menu_name→menu_name_kor 매핑) |
|
||||||
|
| 3 | 화면 Create - screen_name null | ScreenManagementService.java (bp() 헬퍼 - snake/camel 호환) |
|
||||||
|
| 4 | 사용자 Delete 미구현 | AdminController.java (deleteUser 엔드포인트 추가) |
|
||||||
|
| 5 | 권한그룹 Create - objid null | RoleController.java, mapper/role.xml |
|
||||||
|
| 6 | 권한그룹 Update - MODDATE 컬럼 미존재 | mapper/role.xml (MODDATE→WRITER) |
|
||||||
|
| 7 | 권한그룹 Delete - 트랜잭션 abort | RoleService.java (존재하지 않는 테이블 삭제 제거) |
|
||||||
|
| 8 | 배치 Create - execution_type 컬럼 미존재 | mapper/batch.xml, BatchController.java |
|
||||||
|
| 9 | 다국어 Create - key_id=0 반환 | mapper/multilang.xml (keyProperty 수정) |
|
||||||
|
|
||||||
|
### 공통 수정
|
||||||
|
|
||||||
|
| # | 내용 | 수정 파일 |
|
||||||
|
|---|------|-----------|
|
||||||
|
| 1 | ResponsiveDataView key undefined 방어코드 | ResponsiveDataView.tsx (fallback key 추가) |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 미수정 이슈
|
||||||
|
|
||||||
|
| # | 이슈 | 상태 |
|
||||||
|
|---|------|------|
|
||||||
|
| 1 | 메일관리 API 미구현 | `/api/mail/sent`, `/api/mail/accounts` 404 |
|
||||||
|
| 2 | 콘솔 로그 과다 | TabPageRenderer/AdminPageRenderer 반복 로그 |
|
||||||
|
| 3 | 11 Issues 표시 (하단) | 기존 TypeScript 에러 (이번 작업과 무관) |
|
||||||
@@ -54,8 +54,8 @@ export default function DashboardListPage() {
|
|||||||
page: currentPage,
|
page: currentPage,
|
||||||
limit: pageSize,
|
limit: pageSize,
|
||||||
});
|
});
|
||||||
setDashboards(result.dashboards);
|
setDashboards(result.dashboards || []);
|
||||||
setTotalCount(result.pagination.total);
|
setTotalCount(result.pagination?.total || 0);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Failed to load dashboards:", err);
|
console.error("Failed to load dashboards:", err);
|
||||||
setError(
|
setError(
|
||||||
@@ -131,12 +131,16 @@ export default function DashboardListPage() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const formatDate = (dateString: string) =>
|
const formatDate = (dateValue: string | number) => {
|
||||||
new Date(dateString).toLocaleDateString("ko-KR", {
|
if (!dateValue) return "-";
|
||||||
|
const date = new Date(dateValue);
|
||||||
|
if (isNaN(date.getTime())) return "-";
|
||||||
|
return date.toLocaleDateString("ko-KR", {
|
||||||
year: "numeric",
|
year: "numeric",
|
||||||
month: "2-digit",
|
month: "2-digit",
|
||||||
day: "2-digit",
|
day: "2-digit",
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// ResponsiveDataView 컬럼 정의
|
// ResponsiveDataView 컬럼 정의
|
||||||
const columns: RDVColumn<Dashboard>[] = [
|
const columns: RDVColumn<Dashboard>[] = [
|
||||||
@@ -160,22 +164,22 @@ export default function DashboardListPage() {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "createdByName",
|
key: "created_by_name",
|
||||||
label: "생성자",
|
label: "생성자",
|
||||||
width: "120px",
|
width: "120px",
|
||||||
render: (_v, row) => row.createdByName || row.createdBy || "-",
|
render: (_v, row) => row.created_by_name || row.created_by || "-",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "createdAt",
|
key: "created_date",
|
||||||
label: "생성일",
|
label: "생성일",
|
||||||
width: "120px",
|
width: "120px",
|
||||||
render: (_v, row) => formatDate(row.createdAt),
|
render: (_v, row) => formatDate(row.created_date),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "updatedAt",
|
key: "updated_date",
|
||||||
label: "수정일",
|
label: "수정일",
|
||||||
width: "120px",
|
width: "120px",
|
||||||
render: (_v, row) => formatDate(row.updatedAt),
|
render: (_v, row) => formatDate(row.updated_date),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -187,9 +191,9 @@ export default function DashboardListPage() {
|
|||||||
<span className="max-w-[200px] truncate">{d.description || "-"}</span>
|
<span className="max-w-[200px] truncate">{d.description || "-"}</span>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{ label: "생성자", render: (d) => d.createdByName || d.createdBy || "-" },
|
{ label: "생성자", render: (d) => d.created_by_name || d.created_by || "-" },
|
||||||
{ label: "생성일", render: (d) => formatDate(d.createdAt) },
|
{ label: "생성일", render: (d) => formatDate(d.created_date) },
|
||||||
{ label: "수정일", render: (d) => formatDate(d.updatedAt) },
|
{ label: "수정일", render: (d) => formatDate(d.updated_date) },
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -490,9 +490,9 @@ export default function I18nPage() {
|
|||||||
// 카테고리 변경 시 키 목록 다시 조회
|
// 카테고리 변경 시 키 목록 다시 조회
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!loading) {
|
if (!loading) {
|
||||||
fetchLangKeys(selectedCategory?.categoryId);
|
fetchLangKeys(selectedCategory?.category_id);
|
||||||
}
|
}
|
||||||
}, [selectedCategory?.categoryId]);
|
}, [selectedCategory?.category_id]);
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
@@ -712,7 +712,7 @@ export default function I18nPage() {
|
|||||||
<CardContent className="p-2">
|
<CardContent className="p-2">
|
||||||
<ScrollArea className="h-[500px]">
|
<ScrollArea className="h-[500px]">
|
||||||
<CategoryTree
|
<CategoryTree
|
||||||
selectedCategoryId={selectedCategory?.categoryId || null}
|
selectedCategoryId={selectedCategory?.category_id || null}
|
||||||
onSelectCategory={(cat) => setSelectedCategory(cat)}
|
onSelectCategory={(cat) => setSelectedCategory(cat)}
|
||||||
onDoubleClickCategory={(cat) => {
|
onDoubleClickCategory={(cat) => {
|
||||||
setSelectedCategory(cat);
|
setSelectedCategory(cat);
|
||||||
@@ -731,7 +731,7 @@ export default function I18nPage() {
|
|||||||
언어 키 목록
|
언어 키 목록
|
||||||
{selectedCategory && (
|
{selectedCategory && (
|
||||||
<Badge variant="secondary" className="ml-2">
|
<Badge variant="secondary" className="ml-2">
|
||||||
{selectedCategory.categoryName}
|
{selectedCategory.category_name}
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
</CardTitle>
|
</CardTitle>
|
||||||
@@ -892,7 +892,7 @@ export default function I18nPage() {
|
|||||||
companyCode={user?.company_code || ""}
|
companyCode={user?.company_code || ""}
|
||||||
isSuperAdmin={user?.company_code === "*"}
|
isSuperAdmin={user?.company_code === "*"}
|
||||||
onSuccess={() => {
|
onSuccess={() => {
|
||||||
fetchLangKeys(selectedCategory?.categoryId);
|
fetchLangKeys(selectedCategory?.category_id);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -91,10 +91,10 @@ export function UserAuthTable({ users, isLoading, paginationInfo, onEditAuth, on
|
|||||||
label: "사용자명",
|
label: "사용자명",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "company_name",
|
key: "company_code",
|
||||||
label: "회사",
|
label: "회사",
|
||||||
hideOnMobile: true,
|
hideOnMobile: true,
|
||||||
render: (_value, row) => <span>{row.company_name || row.company_code}</span>,
|
render: (value) => <span>{value || "-"}</span>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "dept_name",
|
key: "dept_name",
|
||||||
@@ -122,7 +122,7 @@ export function UserAuthTable({ users, isLoading, paginationInfo, onEditAuth, on
|
|||||||
const cardFields: RDVCardField<any>[] = [
|
const cardFields: RDVCardField<any>[] = [
|
||||||
{
|
{
|
||||||
label: "회사",
|
label: "회사",
|
||||||
render: (user) => <span>{user.company_name || user.company_code}</span>,
|
render: (user) => <span>{user.company_code || "-"}</span>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "부서",
|
label: "부서",
|
||||||
|
|||||||
@@ -692,7 +692,7 @@ export function CanvasElement({
|
|||||||
|
|
||||||
// 데이터 로딩
|
// 데이터 로딩
|
||||||
const loadChartData = useCallback(async () => {
|
const loadChartData = useCallback(async () => {
|
||||||
if (!element.dataSource?.query || element.type !== "chart") {
|
if (!element.data_source?.query || element.type !== "chart") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -702,14 +702,14 @@ export function CanvasElement({
|
|||||||
|
|
||||||
// 필터 적용 (날짜 필터 등)
|
// 필터 적용 (날짜 필터 등)
|
||||||
const { applyQueryFilters } = await import("./utils/queryHelpers");
|
const { applyQueryFilters } = await import("./utils/queryHelpers");
|
||||||
const filteredQuery = applyQueryFilters(element.dataSource.query, element.chartConfig);
|
const filteredQuery = applyQueryFilters(element.data_source.query, element.chart_config);
|
||||||
|
|
||||||
// 외부 DB vs 현재 DB 분기
|
// 외부 DB vs 현재 DB 분기
|
||||||
if (element.dataSource.connectionType === "external" && element.dataSource.externalConnectionId) {
|
if (element.data_source.connectionType === "external" && element.data_source.externalConnectionId) {
|
||||||
// 외부 DB
|
// 외부 DB
|
||||||
const { ExternalDbConnectionAPI } = await import("@/lib/api/externalDbConnection");
|
const { ExternalDbConnectionAPI } = await import("@/lib/api/externalDbConnection");
|
||||||
const externalResult = await ExternalDbConnectionAPI.executeQuery(
|
const externalResult = await ExternalDbConnectionAPI.executeQuery(
|
||||||
parseInt(element.dataSource.externalConnectionId),
|
parseInt(element.data_source.externalConnectionId),
|
||||||
filteredQuery,
|
filteredQuery,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -742,10 +742,10 @@ export function CanvasElement({
|
|||||||
setIsLoadingData(false);
|
setIsLoadingData(false);
|
||||||
}
|
}
|
||||||
}, [
|
}, [
|
||||||
element.dataSource?.query,
|
element.data_source?.query,
|
||||||
element.dataSource?.connectionType,
|
element.data_source?.connectionType,
|
||||||
element.dataSource?.externalConnectionId,
|
element.data_source?.externalConnectionId,
|
||||||
element.chartConfig,
|
element.chart_config,
|
||||||
element.type,
|
element.type,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -756,13 +756,13 @@ export function CanvasElement({
|
|||||||
|
|
||||||
// 자동 새로고침 설정
|
// 자동 새로고침 설정
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!element.dataSource?.refreshInterval || element.dataSource.refreshInterval === 0) {
|
if (!element.data_source?.refreshInterval || element.data_source.refreshInterval === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const interval = setInterval(loadChartData, element.dataSource.refreshInterval);
|
const interval = setInterval(loadChartData, element.data_source.refreshInterval);
|
||||||
return () => clearInterval(interval);
|
return () => clearInterval(interval);
|
||||||
}, [element.dataSource?.refreshInterval, loadChartData]);
|
}, [element.data_source?.refreshInterval, loadChartData]);
|
||||||
|
|
||||||
// 요소 삭제
|
// 요소 삭제
|
||||||
const handleRemove = useCallback(() => {
|
const handleRemove = useCallback(() => {
|
||||||
@@ -831,7 +831,7 @@ export function CanvasElement({
|
|||||||
onMouseDown={handleMouseDown}
|
onMouseDown={handleMouseDown}
|
||||||
>
|
>
|
||||||
{/* 헤더 - showHeader가 false이면 숨김 */}
|
{/* 헤더 - showHeader가 false이면 숨김 */}
|
||||||
{element.showHeader !== false && (
|
{element.show_header !== false && (
|
||||||
<div className="flex cursor-move items-center justify-between px-2 py-1">
|
<div className="flex cursor-move items-center justify-between px-2 py-1">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
{/* 차트 타입 전환 드롭다운 (차트일 경우만) */}
|
{/* 차트 타입 전환 드롭다운 (차트일 경우만) */}
|
||||||
@@ -872,8 +872,8 @@ export function CanvasElement({
|
|||||||
)}
|
)}
|
||||||
{/* 제목 */}
|
{/* 제목 */}
|
||||||
{!element.type || element.type !== "chart" ? (
|
{!element.type || element.type !== "chart" ? (
|
||||||
element.subtype === "map-summary-v2" && !element.customTitle ? null : (
|
element.subtype === "map-summary-v2" && !element.custom_title ? null : (
|
||||||
<span className="text-foreground text-xs font-bold">{element.customTitle || element.title}</span>
|
<span className="text-foreground text-xs font-bold">{element.custom_title || element.title}</span>
|
||||||
)
|
)
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
@@ -893,7 +893,7 @@ export function CanvasElement({
|
|||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
{/* 내용 */}
|
{/* 내용 */}
|
||||||
<div className={`relative px-2 pb-2 ${element.showHeader !== false ? "h-[calc(100%-32px)]" : "h-full"}`}>
|
<div className={`relative px-2 pb-2 ${element.show_header !== false ? "h-[calc(100%-32px)]" : "h-full"}`}>
|
||||||
{element.type === "chart" ? (
|
{element.type === "chart" ? (
|
||||||
// 차트 렌더링
|
// 차트 렌더링
|
||||||
<div className="bg-background h-full w-full">
|
<div className="bg-background h-full w-full">
|
||||||
@@ -1089,7 +1089,7 @@ export function CanvasElement({
|
|||||||
<div className="widget-interactive-area h-full w-full">
|
<div className="widget-interactive-area h-full w-full">
|
||||||
<YardManagement3DWidget
|
<YardManagement3DWidget
|
||||||
isEditMode={true}
|
isEditMode={true}
|
||||||
config={element.yardConfig}
|
config={element.yard_config}
|
||||||
onConfigChange={(newConfig) => {
|
onConfigChange={(newConfig) => {
|
||||||
// console.log("🏗️ 야드 설정 업데이트:", { elementId: element.id, newConfig });
|
// console.log("🏗️ 야드 설정 업데이트:", { elementId: element.id, newConfig });
|
||||||
onUpdate(element.id, { yardConfig: newConfig });
|
onUpdate(element.id, { yardConfig: newConfig });
|
||||||
|
|||||||
@@ -153,18 +153,18 @@ export function WidgetConfigSidebar({ element, isOpen, onClose, onApply }: Widge
|
|||||||
// 사이드바 열릴 때 초기화
|
// 사이드바 열릴 때 초기화
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isOpen && element) {
|
if (isOpen && element) {
|
||||||
setCustomTitle(element.customTitle || "");
|
setCustomTitle(element.custom_title || "");
|
||||||
setShowHeader(element.showHeader !== false);
|
setShowHeader(element.show_header !== false);
|
||||||
setDataSource(element.dataSource || { type: "database", connectionType: "current", refreshInterval: 0 });
|
setDataSource(element.data_source || { type: "database", connectionType: "current", refreshInterval: 0 });
|
||||||
// dataSources는 element.dataSources 또는 chartConfig.dataSources에서 가져옴
|
// dataSources는 element.data_sources 또는 chartConfig.dataSources에서 가져옴
|
||||||
setDataSources(element.dataSources || element.chartConfig?.dataSources || []);
|
setDataSources(element.data_sources || element.chart_config?.dataSources || []);
|
||||||
setQueryResult(null);
|
setQueryResult(null);
|
||||||
// 자동 새로고침 간격 초기화
|
// 자동 새로고침 간격 초기화
|
||||||
setRefreshInterval(element.chartConfig?.refreshInterval ?? 5);
|
setRefreshInterval(element.chart_config?.refreshInterval ?? 5);
|
||||||
|
|
||||||
// 리스트 위젯 설정 초기화
|
// 리스트 위젯 설정 초기화
|
||||||
if (element.subtype === "list-v2" && element.listConfig) {
|
if (element.subtype === "list-v2" && element.list_config) {
|
||||||
setListConfig(element.listConfig);
|
setListConfig(element.list_config);
|
||||||
} else {
|
} else {
|
||||||
setListConfig({
|
setListConfig({
|
||||||
viewMode: "table",
|
viewMode: "table",
|
||||||
@@ -179,10 +179,10 @@ export function WidgetConfigSidebar({ element, isOpen, onClose, onApply }: Widge
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 차트 설정 초기화
|
// 차트 설정 초기화
|
||||||
setChartConfig(element.chartConfig || {});
|
setChartConfig(element.chart_config || {});
|
||||||
|
|
||||||
// 커스텀 메트릭 설정 초기화
|
// 커스텀 메트릭 설정 초기화
|
||||||
setCustomMetricConfig(element.customMetricConfig || {});
|
setCustomMetricConfig(element.custom_metric_config || {});
|
||||||
} else if (!isOpen) {
|
} else if (!isOpen) {
|
||||||
// 사이드바 닫힐 때 초기화
|
// 사이드바 닫힐 때 초기화
|
||||||
setCustomTitle("");
|
setCustomTitle("");
|
||||||
@@ -600,8 +600,8 @@ export function WidgetConfigSidebar({ element, isOpen, onClose, onApply }: Widge
|
|||||||
{element.subtype === "map-summary-v2" && (
|
{element.subtype === "map-summary-v2" && (
|
||||||
<MapConfigSection
|
<MapConfigSection
|
||||||
queryResult={queryResult}
|
queryResult={queryResult}
|
||||||
refreshInterval={element.chartConfig?.refreshInterval || 5}
|
refreshInterval={element.chart_config?.refreshInterval || 5}
|
||||||
markerType={element.chartConfig?.markerType || "circle"}
|
markerType={element.chart_config?.markerType || "circle"}
|
||||||
onRefreshIntervalChange={(interval) => {
|
onRefreshIntervalChange={(interval) => {
|
||||||
setChartConfig((prev) => ({
|
setChartConfig((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
|
|||||||
@@ -60,13 +60,13 @@ export function ChartRenderer({ element, data, width, height = 200 }: ChartRende
|
|||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
// 이미 data가 전달된 경우 사용
|
// 이미 data가 전달된 경우 사용
|
||||||
if (data) {
|
if (data) {
|
||||||
const transformed = transformQueryResultToChartData(data, element.chartConfig || {});
|
const transformed = transformQueryResultToChartData(data, element.chart_config || {});
|
||||||
setChartData(transformed);
|
setChartData(transformed);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 데이터 소스가 설정되어 있으면 페칭
|
// 데이터 소스가 설정되어 있으면 페칭
|
||||||
if (element.dataSource && element.chartConfig) {
|
if (element.data_source && element.chart_config) {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
setError(null);
|
setError(null);
|
||||||
|
|
||||||
@@ -74,11 +74,11 @@ export function ChartRenderer({ element, data, width, height = 200 }: ChartRende
|
|||||||
let queryResult: QueryResult;
|
let queryResult: QueryResult;
|
||||||
|
|
||||||
// REST API vs Database 분기
|
// REST API vs Database 분기
|
||||||
if (element.dataSource.type === "api" && element.dataSource.endpoint) {
|
if (element.data_source.type === "api" && element.data_source.endpoint) {
|
||||||
// REST API - 백엔드 프록시를 통한 호출 (CORS 우회)
|
// REST API - 백엔드 프록시를 통한 호출 (CORS 우회)
|
||||||
const params = new URLSearchParams();
|
const params = new URLSearchParams();
|
||||||
if (element.dataSource.queryParams) {
|
if (element.data_source.queryParams) {
|
||||||
Object.entries(element.dataSource.queryParams).forEach(([key, value]) => {
|
Object.entries(element.data_source.queryParams).forEach(([key, value]) => {
|
||||||
if (key && value) {
|
if (key && value) {
|
||||||
params.append(key, String(value));
|
params.append(key, String(value));
|
||||||
}
|
}
|
||||||
@@ -91,9 +91,9 @@ export function ChartRenderer({ element, data, width, height = 200 }: ChartRende
|
|||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
url: element.dataSource.endpoint,
|
url: element.data_source.endpoint,
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: element.dataSource.headers || {},
|
headers: element.data_source.headers || {},
|
||||||
queryParams: Object.fromEntries(params),
|
queryParams: Object.fromEntries(params),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
@@ -112,13 +112,13 @@ export function ChartRenderer({ element, data, width, height = 200 }: ChartRende
|
|||||||
|
|
||||||
// JSON Path 처리
|
// JSON Path 처리
|
||||||
let processedData = apiData;
|
let processedData = apiData;
|
||||||
if (element.dataSource.jsonPath) {
|
if (element.data_source.jsonPath) {
|
||||||
const paths = element.dataSource.jsonPath.split(".");
|
const paths = element.data_source.jsonPath.split(".");
|
||||||
for (const path of paths) {
|
for (const path of paths) {
|
||||||
if (processedData && typeof processedData === "object" && path in processedData) {
|
if (processedData && typeof processedData === "object" && path in processedData) {
|
||||||
processedData = processedData[path];
|
processedData = processedData[path];
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`JSON Path "${element.dataSource.jsonPath}"에서 데이터를 찾을 수 없습니다`);
|
throw new Error(`JSON Path "${element.data_source.jsonPath}"에서 데이터를 찾을 수 없습니다`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -132,13 +132,13 @@ export function ChartRenderer({ element, data, width, height = 200 }: ChartRende
|
|||||||
totalRows: rows.length,
|
totalRows: rows.length,
|
||||||
executionTime: 0,
|
executionTime: 0,
|
||||||
};
|
};
|
||||||
} else if (element.dataSource.query) {
|
} else if (element.data_source.query) {
|
||||||
// Database (현재 DB 또는 외부 DB)
|
// Database (현재 DB 또는 외부 DB)
|
||||||
if (element.dataSource.connectionType === "external" && element.dataSource.externalConnectionId) {
|
if (element.data_source.connectionType === "external" && element.data_source.externalConnectionId) {
|
||||||
// 외부 DB - 필터 적용
|
// 외부 DB - 필터 적용
|
||||||
const filteredQuery = applyQueryFilters(element.dataSource.query, element.chartConfig);
|
const filteredQuery = applyQueryFilters(element.data_source.query, element.chart_config);
|
||||||
const result = await ExternalDbConnectionAPI.executeQuery(
|
const result = await ExternalDbConnectionAPI.executeQuery(
|
||||||
parseInt(element.dataSource.externalConnectionId),
|
parseInt(element.data_source.externalConnectionId),
|
||||||
filteredQuery,
|
filteredQuery,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ export function ChartRenderer({ element, data, width, height = 200 }: ChartRende
|
|||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
// 현재 DB - 필터 적용
|
// 현재 DB - 필터 적용
|
||||||
const filteredQuery = applyQueryFilters(element.dataSource.query, element.chartConfig);
|
const filteredQuery = applyQueryFilters(element.data_source.query, element.chart_config);
|
||||||
const result = await dashboardApi.executeQuery(filteredQuery);
|
const result = await dashboardApi.executeQuery(filteredQuery);
|
||||||
queryResult = {
|
queryResult = {
|
||||||
columns: result.columns,
|
columns: result.columns,
|
||||||
@@ -168,7 +168,7 @@ export function ChartRenderer({ element, data, width, height = 200 }: ChartRende
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ChartData로 변환
|
// ChartData로 변환
|
||||||
const transformed = transformQueryResultToChartData(queryResult, element.chartConfig);
|
const transformed = transformQueryResultToChartData(queryResult, element.chart_config);
|
||||||
setChartData(transformed);
|
setChartData(transformed);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const errorMessage = err instanceof Error ? err.message : "데이터 로딩 실패";
|
const errorMessage = err instanceof Error ? err.message : "데이터 로딩 실패";
|
||||||
@@ -182,21 +182,21 @@ export function ChartRenderer({ element, data, width, height = 200 }: ChartRende
|
|||||||
fetchData();
|
fetchData();
|
||||||
|
|
||||||
// 자동 새로고침 설정 (0이면 수동이므로 interval 설정 안 함)
|
// 자동 새로고침 설정 (0이면 수동이므로 interval 설정 안 함)
|
||||||
const refreshInterval = element.dataSource?.refreshInterval;
|
const refreshInterval = element.data_source?.refreshInterval;
|
||||||
if (refreshInterval && refreshInterval > 0) {
|
if (refreshInterval && refreshInterval > 0) {
|
||||||
const interval = setInterval(fetchData, refreshInterval);
|
const interval = setInterval(fetchData, refreshInterval);
|
||||||
return () => clearInterval(interval);
|
return () => clearInterval(interval);
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [
|
}, [
|
||||||
element.dataSource?.query,
|
element.data_source?.query,
|
||||||
element.dataSource?.connectionType,
|
element.data_source?.connectionType,
|
||||||
element.dataSource?.externalConnectionId,
|
element.data_source?.externalConnectionId,
|
||||||
element.dataSource?.refreshInterval,
|
element.data_source?.refreshInterval,
|
||||||
element.dataSource?.type,
|
element.data_source?.type,
|
||||||
element.dataSource?.endpoint,
|
element.data_source?.endpoint,
|
||||||
element.dataSource?.jsonPath,
|
element.data_source?.jsonPath,
|
||||||
element.chartConfig,
|
element.chart_config,
|
||||||
data,
|
data,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -227,10 +227,10 @@ export function ChartRenderer({ element, data, width, height = 200 }: ChartRende
|
|||||||
|
|
||||||
// 데이터나 설정이 없으면
|
// 데이터나 설정이 없으면
|
||||||
const isPieChart = element.subtype === "pie" || element.subtype === "donut";
|
const isPieChart = element.subtype === "pie" || element.subtype === "donut";
|
||||||
const isApiSource = element.dataSource?.type === "api";
|
const isApiSource = element.data_source?.type === "api";
|
||||||
const needsYAxis = !(isPieChart || isApiSource) || (!element.chartConfig?.aggregation && !element.chartConfig?.yAxis);
|
const needsYAxis = !(isPieChart || isApiSource) || (!element.chart_config?.aggregation && !element.chart_config?.yAxis);
|
||||||
|
|
||||||
if (!chartData || !element.chartConfig?.xAxis || (needsYAxis && !element.chartConfig?.yAxis)) {
|
if (!chartData || !element.chart_config?.xAxis || (needsYAxis && !element.chart_config?.yAxis)) {
|
||||||
return (
|
return (
|
||||||
<div className="flex h-full w-full items-center justify-center text-muted-foreground">
|
<div className="flex h-full w-full items-center justify-center text-muted-foreground">
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
@@ -269,7 +269,7 @@ export function ChartRenderer({ element, data, width, height = 200 }: ChartRende
|
|||||||
<Chart
|
<Chart
|
||||||
chartType={element.subtype}
|
chartType={element.subtype}
|
||||||
data={chartData}
|
data={chartData}
|
||||||
config={element.chartConfig}
|
config={element.chart_config}
|
||||||
width={finalWidth}
|
width={finalWidth}
|
||||||
height={finalHeight}
|
height={finalHeight}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -106,18 +106,18 @@ export interface DashboardElement {
|
|||||||
position: Position;
|
position: Position;
|
||||||
size: Size;
|
size: Size;
|
||||||
title: string;
|
title: string;
|
||||||
customTitle?: string; // 사용자 정의 제목 (옵션)
|
custom_title?: string;
|
||||||
showHeader?: boolean; // 헤더 표시 여부 (기본값: true)
|
show_header?: boolean;
|
||||||
content: string;
|
content: string;
|
||||||
dataSource?: ChartDataSource; // 데이터 소스 설정 (단일, 하위 호환용)
|
data_source?: ChartDataSource;
|
||||||
dataSources?: ChartDataSource[]; // 다중 데이터 소스 설정 (테스트 위젯용)
|
data_sources?: ChartDataSource[];
|
||||||
chartConfig?: ChartConfig; // 차트 설정
|
chart_config?: ChartConfig;
|
||||||
clockConfig?: ClockConfig; // 시계 설정
|
clock_config?: ClockConfig;
|
||||||
calendarConfig?: CalendarConfig; // 달력 설정
|
calendar_config?: CalendarConfig;
|
||||||
driverManagementConfig?: DriverManagementConfig; // 기사 관리 설정
|
driver_management_config?: DriverManagementConfig;
|
||||||
listConfig?: ListWidgetConfig; // 리스트 위젯 설정
|
list_config?: ListWidgetConfig;
|
||||||
yardConfig?: YardManagementConfig; // 3D 필드 설정
|
yard_config?: YardManagementConfig;
|
||||||
customMetricConfig?: CustomMetricConfig; // 사용자 커스텀 카드 설정
|
custom_metric_config?: CustomMetricConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DragData {
|
export interface DragData {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export function CalendarWidget({ element, onConfigUpdate }: CalendarWidgetProps)
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 기본 설정값
|
// 기본 설정값
|
||||||
const config = element.calendarConfig || {
|
const config = element.calendar_config || {
|
||||||
view: "month",
|
view: "month",
|
||||||
startWeekOn: "sunday",
|
startWeekOn: "sunday",
|
||||||
highlightWeekends: true,
|
highlightWeekends: true,
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export function ClockWidget({ element, onConfigUpdate }: ClockWidgetProps) {
|
|||||||
const [settingsOpen, setSettingsOpen] = useState(false);
|
const [settingsOpen, setSettingsOpen] = useState(false);
|
||||||
|
|
||||||
// 기본 설정값
|
// 기본 설정값
|
||||||
const config = element.clockConfig || {
|
const config = element.clock_config || {
|
||||||
style: "digital",
|
style: "digital",
|
||||||
timezone: "Asia/Seoul",
|
timezone: "Asia/Seoul",
|
||||||
showDate: true,
|
showDate: true,
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export function DriverManagementWidget({ element, onConfigUpdate }: DriverManage
|
|||||||
const [lastRefresh, setLastRefresh] = useState(new Date());
|
const [lastRefresh, setLastRefresh] = useState(new Date());
|
||||||
|
|
||||||
// 기본 설정
|
// 기본 설정
|
||||||
const config = element.driverManagementConfig || {
|
const config = element.driver_management_config || {
|
||||||
viewType: "list",
|
viewType: "list",
|
||||||
autoRefreshInterval: 30,
|
autoRefreshInterval: 30,
|
||||||
visibleColumns: DEFAULT_VISIBLE_COLUMNS,
|
visibleColumns: DEFAULT_VISIBLE_COLUMNS,
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export function ListWidget({ element, onConfigUpdate }: ListWidgetProps) {
|
|||||||
const [detailPopupLoading, setDetailPopupLoading] = useState(false);
|
const [detailPopupLoading, setDetailPopupLoading] = useState(false);
|
||||||
const [additionalDetailData, setAdditionalDetailData] = useState<Record<string, any> | null>(null);
|
const [additionalDetailData, setAdditionalDetailData] = useState<Record<string, any> | null>(null);
|
||||||
|
|
||||||
const config = element.listConfig || {
|
const config = element.list_config || {
|
||||||
columnMode: "auto",
|
columnMode: "auto",
|
||||||
viewMode: "table",
|
viewMode: "table",
|
||||||
columns: [],
|
columns: [],
|
||||||
@@ -329,7 +329,7 @@ export function ListWidget({ element, onConfigUpdate }: ListWidgetProps) {
|
|||||||
// 데이터 로드
|
// 데이터 로드
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const loadData = async () => {
|
const loadData = async () => {
|
||||||
if (!element.dataSource || (!element.dataSource.query && !element.dataSource.endpoint)) {
|
if (!element.data_source || (!element.data_source.query && !element.data_source.endpoint)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,11 +340,11 @@ export function ListWidget({ element, onConfigUpdate }: ListWidgetProps) {
|
|||||||
let queryResult: QueryResult;
|
let queryResult: QueryResult;
|
||||||
|
|
||||||
// REST API vs Database 분기
|
// REST API vs Database 분기
|
||||||
if (element.dataSource.type === "api" && element.dataSource.endpoint) {
|
if (element.data_source.type === "api" && element.data_source.endpoint) {
|
||||||
// REST API - 백엔드 프록시를 통한 호출
|
// REST API - 백엔드 프록시를 통한 호출
|
||||||
const params = new URLSearchParams();
|
const params = new URLSearchParams();
|
||||||
if (element.dataSource.queryParams) {
|
if (element.data_source.queryParams) {
|
||||||
element.dataSource.queryParams.forEach((item) => {
|
element.data_source.queryParams.forEach((item) => {
|
||||||
if (item.key && item.value) {
|
if (item.key && item.value) {
|
||||||
params.append(item.key, item.value);
|
params.append(item.key, item.value);
|
||||||
}
|
}
|
||||||
@@ -352,30 +352,30 @@ export function ListWidget({ element, onConfigUpdate }: ListWidgetProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 요청 메서드 (기본값: GET)
|
// 요청 메서드 (기본값: GET)
|
||||||
const requestMethod = element.dataSource.method || "GET";
|
const requestMethod = element.data_source.method || "GET";
|
||||||
|
|
||||||
// 요청 body (POST, PUT, PATCH인 경우)
|
// 요청 body (POST, PUT, PATCH인 경우)
|
||||||
let requestBody = undefined;
|
let requestBody = undefined;
|
||||||
if (["POST", "PUT", "PATCH"].includes(requestMethod) && element.dataSource.body) {
|
if (["POST", "PUT", "PATCH"].includes(requestMethod) && element.data_source.body) {
|
||||||
try {
|
try {
|
||||||
requestBody = typeof element.dataSource.body === "string"
|
requestBody = typeof element.data_source.body === "string"
|
||||||
? JSON.parse(element.dataSource.body)
|
? JSON.parse(element.data_source.body)
|
||||||
: element.dataSource.body;
|
: element.data_source.body;
|
||||||
} catch {
|
} catch {
|
||||||
requestBody = element.dataSource.body;
|
requestBody = element.data_source.body;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// headers를 KeyValuePair[] 에서 객체로 변환
|
// headers를 KeyValuePair[] 에서 객체로 변환
|
||||||
const headersObj: Record<string, string> = {};
|
const headersObj: Record<string, string> = {};
|
||||||
if (element.dataSource.headers && Array.isArray(element.dataSource.headers)) {
|
if (element.data_source.headers && Array.isArray(element.data_source.headers)) {
|
||||||
element.dataSource.headers.forEach((h: any) => {
|
element.data_source.headers.forEach((h: any) => {
|
||||||
if (h.key && h.value) {
|
if (h.key && h.value) {
|
||||||
headersObj[h.key] = h.value;
|
headersObj[h.key] = h.value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (element.dataSource.headers && typeof element.dataSource.headers === "object") {
|
} else if (element.data_source.headers && typeof element.data_source.headers === "object") {
|
||||||
Object.assign(headersObj, element.dataSource.headers);
|
Object.assign(headersObj, element.data_source.headers);
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await fetch(getApiUrl("/api/dashboards/fetch-external-api"), {
|
const response = await fetch(getApiUrl("/api/dashboards/fetch-external-api"), {
|
||||||
@@ -385,12 +385,12 @@ export function ListWidget({ element, onConfigUpdate }: ListWidgetProps) {
|
|||||||
},
|
},
|
||||||
credentials: "include",
|
credentials: "include",
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
url: element.dataSource.endpoint,
|
url: element.data_source.endpoint,
|
||||||
method: requestMethod,
|
method: requestMethod,
|
||||||
headers: headersObj,
|
headers: headersObj,
|
||||||
query_params: Object.fromEntries(params),
|
query_params: Object.fromEntries(params),
|
||||||
body: requestBody,
|
body: requestBody,
|
||||||
external_connection_id: element.dataSource.externalConnectionId,
|
external_connection_id: element.data_source.externalConnectionId,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -408,13 +408,13 @@ export function ListWidget({ element, onConfigUpdate }: ListWidgetProps) {
|
|||||||
|
|
||||||
// JSON Path 처리
|
// JSON Path 처리
|
||||||
let processedData = apiData;
|
let processedData = apiData;
|
||||||
if (element.dataSource.jsonPath) {
|
if (element.data_source.jsonPath) {
|
||||||
const paths = element.dataSource.jsonPath.split(".");
|
const paths = element.data_source.jsonPath.split(".");
|
||||||
for (const path of paths) {
|
for (const path of paths) {
|
||||||
if (processedData && typeof processedData === "object" && path in processedData) {
|
if (processedData && typeof processedData === "object" && path in processedData) {
|
||||||
processedData = processedData[path];
|
processedData = processedData[path];
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`JSON Path "${element.dataSource.jsonPath}"에서 데이터를 찾을 수 없습니다`);
|
throw new Error(`JSON Path "${element.data_source.jsonPath}"에서 데이터를 찾을 수 없습니다`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -428,14 +428,14 @@ export function ListWidget({ element, onConfigUpdate }: ListWidgetProps) {
|
|||||||
totalRows: rows.length,
|
totalRows: rows.length,
|
||||||
executionTime: 0,
|
executionTime: 0,
|
||||||
};
|
};
|
||||||
} else if (element.dataSource.query) {
|
} else if (element.data_source.query) {
|
||||||
// Database (현재 DB 또는 외부 DB)
|
// Database (현재 DB 또는 외부 DB)
|
||||||
if (element.dataSource.connectionType === "external" && element.dataSource.externalConnectionId) {
|
if (element.data_source.connectionType === "external" && element.data_source.externalConnectionId) {
|
||||||
// 외부 DB
|
// 외부 DB
|
||||||
const { ExternalDbConnectionAPI } = await import("@/lib/api/externalDbConnection");
|
const { ExternalDbConnectionAPI } = await import("@/lib/api/externalDbConnection");
|
||||||
const externalResult = await ExternalDbConnectionAPI.executeQuery(
|
const externalResult = await ExternalDbConnectionAPI.executeQuery(
|
||||||
parseInt(element.dataSource.externalConnectionId),
|
parseInt(element.data_source.externalConnectionId),
|
||||||
element.dataSource.query,
|
element.data_source.query,
|
||||||
);
|
);
|
||||||
if (!externalResult.success || !externalResult.data) {
|
if (!externalResult.success || !externalResult.data) {
|
||||||
throw new Error(externalResult.message || "외부 DB 쿼리 실행 실패");
|
throw new Error(externalResult.message || "외부 DB 쿼리 실행 실패");
|
||||||
@@ -450,7 +450,7 @@ export function ListWidget({ element, onConfigUpdate }: ListWidgetProps) {
|
|||||||
} else {
|
} else {
|
||||||
// 현재 DB
|
// 현재 DB
|
||||||
const { dashboardApi } = await import("@/lib/api/dashboard");
|
const { dashboardApi } = await import("@/lib/api/dashboard");
|
||||||
const result = await dashboardApi.executeQuery(element.dataSource.query);
|
const result = await dashboardApi.executeQuery(element.data_source.query);
|
||||||
queryResult = {
|
queryResult = {
|
||||||
columns: result.columns,
|
columns: result.columns,
|
||||||
rows: result.rows,
|
rows: result.rows,
|
||||||
@@ -473,17 +473,17 @@ export function ListWidget({ element, onConfigUpdate }: ListWidgetProps) {
|
|||||||
loadData();
|
loadData();
|
||||||
|
|
||||||
// 자동 새로고침 설정
|
// 자동 새로고침 설정
|
||||||
const refreshInterval = element.dataSource?.refreshInterval;
|
const refreshInterval = element.data_source?.refreshInterval;
|
||||||
if (refreshInterval && refreshInterval > 0) {
|
if (refreshInterval && refreshInterval > 0) {
|
||||||
const interval = setInterval(loadData, refreshInterval);
|
const interval = setInterval(loadData, refreshInterval);
|
||||||
return () => clearInterval(interval);
|
return () => clearInterval(interval);
|
||||||
}
|
}
|
||||||
}, [
|
}, [
|
||||||
element.dataSource?.query,
|
element.data_source?.query,
|
||||||
element.dataSource?.connectionType,
|
element.data_source?.connectionType,
|
||||||
element.dataSource?.externalConnectionId,
|
element.data_source?.externalConnectionId,
|
||||||
element.dataSource?.endpoint,
|
element.data_source?.endpoint,
|
||||||
element.dataSource?.refreshInterval,
|
element.data_source?.refreshInterval,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// 로딩 중
|
// 로딩 중
|
||||||
@@ -545,7 +545,7 @@ export function ListWidget({ element, onConfigUpdate }: ListWidgetProps) {
|
|||||||
<div className="flex h-full w-full flex-col p-4">
|
<div className="flex h-full w-full flex-col p-4">
|
||||||
{/* 제목 - 항상 표시 */}
|
{/* 제목 - 항상 표시 */}
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<h3 className="text-foreground text-sm font-semibold">{element.customTitle || element.title}</h3>
|
<h3 className="text-foreground text-sm font-semibold">{element.custom_title || element.title}</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 테이블 뷰 */}
|
{/* 테이블 뷰 */}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ function CategoryNode({
|
|||||||
// 기본값: 접힌 상태로 시작
|
// 기본값: 접힌 상태로 시작
|
||||||
const [isExpanded, setIsExpanded] = useState(false);
|
const [isExpanded, setIsExpanded] = useState(false);
|
||||||
const hasChildren = category.children && category.children.length > 0;
|
const hasChildren = category.children && category.children.length > 0;
|
||||||
const isSelected = selectedCategoryId === category.categoryId;
|
const isSelected = selectedCategoryId === category.category_id;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
@@ -75,7 +75,7 @@ function CategoryNode({
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{/* 카테고리 이름 */}
|
{/* 카테고리 이름 */}
|
||||||
<span className="truncate">{category.categoryName}</span>
|
<span className="truncate">{category.category_name}</span>
|
||||||
|
|
||||||
{/* prefix 표시 */}
|
{/* prefix 표시 */}
|
||||||
<span
|
<span
|
||||||
@@ -84,7 +84,7 @@ function CategoryNode({
|
|||||||
isSelected ? "text-primary-foreground/70" : "text-muted-foreground"
|
isSelected ? "text-primary-foreground/70" : "text-muted-foreground"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{category.keyPrefix}
|
{category.key_prefix}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ function CategoryNode({
|
|||||||
<div>
|
<div>
|
||||||
{category.children!.map((child) => (
|
{category.children!.map((child) => (
|
||||||
<CategoryNode
|
<CategoryNode
|
||||||
key={child.categoryId}
|
key={child.category_id}
|
||||||
category={child}
|
category={child}
|
||||||
level={level + 1}
|
level={level + 1}
|
||||||
selectedCategoryId={selectedCategoryId}
|
selectedCategoryId={selectedCategoryId}
|
||||||
@@ -183,7 +183,7 @@ export function CategoryTree({
|
|||||||
{/* 카테고리 트리 */}
|
{/* 카테고리 트리 */}
|
||||||
{categories.map((category) => (
|
{categories.map((category) => (
|
||||||
<CategoryNode
|
<CategoryNode
|
||||||
key={category.categoryId}
|
key={category.category_id}
|
||||||
category={category}
|
category={category}
|
||||||
level={0}
|
level={0}
|
||||||
selectedCategoryId={selectedCategoryId}
|
selectedCategoryId={selectedCategoryId}
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ export function KeyGenerateModal({
|
|||||||
loadCompanies();
|
loadCompanies();
|
||||||
}
|
}
|
||||||
if (selectedCategory) {
|
if (selectedCategory) {
|
||||||
loadCategoryPath(selectedCategory.categoryId);
|
loadCategoryPath(selectedCategory.category_id);
|
||||||
} else {
|
} else {
|
||||||
setCategoryPath([]);
|
setCategoryPath([]);
|
||||||
}
|
}
|
||||||
@@ -121,12 +121,12 @@ export function KeyGenerateModal({
|
|||||||
const loadLanguages = async () => {
|
const loadLanguages = async () => {
|
||||||
const response = await getLanguages();
|
const response = await getLanguages();
|
||||||
if (response.success && response.data) {
|
if (response.success && response.data) {
|
||||||
const activeLanguages = response.data.filter((l) => l.isActive === "Y");
|
const activeLanguages = response.data.filter((l) => l.is_active === "Y");
|
||||||
setLanguages(activeLanguages);
|
setLanguages(activeLanguages);
|
||||||
// 초기 텍스트 상태 설정
|
// 초기 텍스트 상태 설정
|
||||||
const initialTexts: Record<string, string> = {};
|
const initialTexts: Record<string, string> = {};
|
||||||
activeLanguages.forEach((lang) => {
|
activeLanguages.forEach((lang) => {
|
||||||
initialTexts[lang.langCode] = "";
|
initialTexts[lang.lang_code] = "";
|
||||||
});
|
});
|
||||||
setTexts(initialTexts);
|
setTexts(initialTexts);
|
||||||
}
|
}
|
||||||
@@ -150,7 +150,7 @@ export function KeyGenerateModal({
|
|||||||
setPreviewLoading(true);
|
setPreviewLoading(true);
|
||||||
try {
|
try {
|
||||||
const response = await previewKey(
|
const response = await previewKey(
|
||||||
selectedCategory.categoryId,
|
selectedCategory.category_id,
|
||||||
keyMeaning.trim().toLowerCase().replace(/\s+/g, "_"),
|
keyMeaning.trim().toLowerCase().replace(/\s+/g, "_"),
|
||||||
targetCompanyCode
|
targetCompanyCode
|
||||||
);
|
);
|
||||||
@@ -219,7 +219,7 @@ export function KeyGenerateModal({
|
|||||||
// 새 키 생성
|
// 새 키 생성
|
||||||
const response = await generateKey({
|
const response = await generateKey({
|
||||||
companyCode: targetCompanyCode,
|
companyCode: targetCompanyCode,
|
||||||
categoryId: selectedCategory.categoryId,
|
categoryId: selectedCategory.category_id,
|
||||||
keyMeaning: keyMeaning.trim().toLowerCase().replace(/\s+/g, "_"),
|
keyMeaning: keyMeaning.trim().toLowerCase().replace(/\s+/g, "_"),
|
||||||
usageNote: usageNote.trim() || undefined,
|
usageNote: usageNote.trim() || undefined,
|
||||||
texts: Object.entries(texts)
|
texts: Object.entries(texts)
|
||||||
@@ -243,7 +243,7 @@ export function KeyGenerateModal({
|
|||||||
|
|
||||||
// 생성될 키 미리보기
|
// 생성될 키 미리보기
|
||||||
const generatedKeyPreview = categoryPath.length > 0 && keyMeaning.trim()
|
const generatedKeyPreview = categoryPath.length > 0 && keyMeaning.trim()
|
||||||
? [...categoryPath.map((c) => c.keyPrefix), keyMeaning.trim().toLowerCase().replace(/\s+/g, "_")].join(".")
|
? [...categoryPath.map((c) => c.key_prefix), keyMeaning.trim().toLowerCase().replace(/\s+/g, "_")].join(".")
|
||||||
: "";
|
: "";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -267,9 +267,9 @@ export function KeyGenerateModal({
|
|||||||
<div className="mt-1 flex flex-wrap gap-1">
|
<div className="mt-1 flex flex-wrap gap-1">
|
||||||
{categoryPath.length > 0 ? (
|
{categoryPath.length > 0 ? (
|
||||||
categoryPath.map((cat, idx) => (
|
categoryPath.map((cat, idx) => (
|
||||||
<span key={cat.categoryId} className="flex items-center">
|
<span key={cat.category_id} className="flex items-center">
|
||||||
<Badge variant="secondary" className="text-xs">
|
<Badge variant="secondary" className="text-xs">
|
||||||
{cat.categoryName}
|
{cat.category_name}
|
||||||
</Badge>
|
</Badge>
|
||||||
{idx < categoryPath.length - 1 && (
|
{idx < categoryPath.length - 1 && (
|
||||||
<span className="mx-1 text-muted-foreground">/</span>
|
<span className="mx-1 text-muted-foreground">/</span>
|
||||||
@@ -434,14 +434,14 @@ export function KeyGenerateModal({
|
|||||||
<Label className="text-xs sm:text-sm">번역 텍스트 *</Label>
|
<Label className="text-xs sm:text-sm">번역 텍스트 *</Label>
|
||||||
<div className="mt-2 space-y-2">
|
<div className="mt-2 space-y-2">
|
||||||
{languages.map((lang) => (
|
{languages.map((lang) => (
|
||||||
<div key={lang.langCode} className="flex items-center gap-2">
|
<div key={lang.lang_code} className="flex items-center gap-2">
|
||||||
<Badge variant="outline" className="w-12 justify-center text-xs">
|
<Badge variant="outline" className="w-12 justify-center text-xs">
|
||||||
{lang.langCode}
|
{lang.lang_code}
|
||||||
</Badge>
|
</Badge>
|
||||||
<Input
|
<Input
|
||||||
value={texts[lang.langCode] || ""}
|
value={texts[lang.lang_code] || ""}
|
||||||
onChange={(e) => handleTextChange(lang.langCode, e.target.value)}
|
onChange={(e) => handleTextChange(lang.lang_code, e.target.value)}
|
||||||
placeholder={`${lang.langName} 텍스트`}
|
placeholder={`${lang.lang_name} 텍스트`}
|
||||||
className="h-8 flex-1 text-xs sm:h-9 sm:text-sm"
|
className="h-8 flex-1 text-xs sm:h-9 sm:text-sm"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -235,7 +235,7 @@ export function ResponsiveDataView<T>({
|
|||||||
<TableBody>
|
<TableBody>
|
||||||
{data.map((item, index) => (
|
{data.map((item, index) => (
|
||||||
<TableRow
|
<TableRow
|
||||||
key={keyExtractor(item)}
|
key={keyExtractor(item) ?? `row-${index}`}
|
||||||
className={cn(
|
className={cn(
|
||||||
"border-b transition-colors hover:bg-muted/50",
|
"border-b transition-colors hover:bg-muted/50",
|
||||||
onRowClick && "cursor-pointer"
|
onRowClick && "cursor-pointer"
|
||||||
@@ -270,11 +270,11 @@ export function ResponsiveDataView<T>({
|
|||||||
cardContainerClassName
|
cardContainerClassName
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{data.map((item) => {
|
{data.map((item, index) => {
|
||||||
const fields = resolveCardFields(item);
|
const fields = resolveCardFields(item);
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={keyExtractor(item)}
|
key={keyExtractor(item) ?? `card-${index}`}
|
||||||
className={cn(
|
className={cn(
|
||||||
"rounded-lg border bg-card p-4 shadow-sm transition-colors hover:bg-muted/50",
|
"rounded-lg border bg-card p-4 shadow-sm transition-colors hover:bg-muted/50",
|
||||||
onRowClick && "cursor-pointer"
|
onRowClick && "cursor-pointer"
|
||||||
|
|||||||
@@ -128,13 +128,13 @@ function renderWidget(element: DashboardElement) {
|
|||||||
case "yard-management-3d":
|
case "yard-management-3d":
|
||||||
// console.log("🏗️ 야드관리 위젯 렌더링:", {
|
// console.log("🏗️ 야드관리 위젯 렌더링:", {
|
||||||
// elementId: element.id,
|
// elementId: element.id,
|
||||||
// yardConfig: element.yardConfig,
|
// yardConfig: element.yard_config,
|
||||||
// yardConfigType: typeof element.yardConfig,
|
// yardConfigType: typeof element.yard_config,
|
||||||
// hasLayoutId: !!element.yardConfig?.layoutId,
|
// hasLayoutId: !!element.yard_config?.layoutId,
|
||||||
// layoutId: element.yardConfig?.layoutId,
|
// layoutId: element.yard_config?.layoutId,
|
||||||
// layoutName: element.yardConfig?.layoutName,
|
// layoutName: element.yard_config?.layoutName,
|
||||||
// });
|
// });
|
||||||
return <YardManagement3DWidget isEditMode={false} config={element.yardConfig} />;
|
return <YardManagement3DWidget isEditMode={false} config={element.yard_config} />;
|
||||||
|
|
||||||
case "work-history":
|
case "work-history":
|
||||||
return <WorkHistoryWidget element={element} />;
|
return <WorkHistoryWidget element={element} />;
|
||||||
@@ -142,9 +142,9 @@ function renderWidget(element: DashboardElement) {
|
|||||||
case "transport-stats":
|
case "transport-stats":
|
||||||
// console.log("📊 [DashboardViewer] CustomStatsWidget 렌더링:", {
|
// console.log("📊 [DashboardViewer] CustomStatsWidget 렌더링:", {
|
||||||
// elementId: element.id,
|
// elementId: element.id,
|
||||||
// hasDataSource: !!element.dataSource,
|
// hasDataSource: !!element.data_source,
|
||||||
// query: element.dataSource?.query?.substring(0, 50) + "...",
|
// query: element.data_source?.query?.substring(0, 50) + "...",
|
||||||
// dataSourceType: element.dataSource?.type,
|
// dataSourceType: element.data_source?.type,
|
||||||
// });
|
// });
|
||||||
return <CustomStatsWidget element={element} />;
|
return <CustomStatsWidget element={element} />;
|
||||||
|
|
||||||
@@ -431,7 +431,7 @@ export function DashboardViewer({
|
|||||||
|
|
||||||
// 개별 요소 데이터 로딩
|
// 개별 요소 데이터 로딩
|
||||||
const loadElementData = useCallback(async (element: DashboardElement) => {
|
const loadElementData = useCallback(async (element: DashboardElement) => {
|
||||||
if (!element.dataSource?.query || element.type !== "chart") {
|
if (!element.data_source?.query || element.type !== "chart") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -441,12 +441,12 @@ export function DashboardViewer({
|
|||||||
let result;
|
let result;
|
||||||
|
|
||||||
// 외부 DB vs 현재 DB 분기
|
// 외부 DB vs 현재 DB 분기
|
||||||
if (element.dataSource.connectionType === "external" && element.dataSource.externalConnectionId) {
|
if (element.data_source.connectionType === "external" && element.data_source.externalConnectionId) {
|
||||||
// 외부 DB
|
// 외부 DB
|
||||||
const { ExternalDbConnectionAPI } = await import("@/lib/api/externalDbConnection");
|
const { ExternalDbConnectionAPI } = await import("@/lib/api/externalDbConnection");
|
||||||
const externalResult = await ExternalDbConnectionAPI.executeQuery(
|
const externalResult = await ExternalDbConnectionAPI.executeQuery(
|
||||||
parseInt(element.dataSource.externalConnectionId),
|
parseInt(element.data_source.externalConnectionId),
|
||||||
element.dataSource.query,
|
element.data_source.query,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!externalResult.success) {
|
if (!externalResult.success) {
|
||||||
@@ -467,7 +467,7 @@ export function DashboardViewer({
|
|||||||
} else {
|
} else {
|
||||||
// 현재 DB
|
// 현재 DB
|
||||||
const { dashboardApi } = await import("@/lib/api/dashboard");
|
const { dashboardApi } = await import("@/lib/api/dashboard");
|
||||||
result = await dashboardApi.executeQuery(element.dataSource.query);
|
result = await dashboardApi.executeQuery(element.data_source.query);
|
||||||
|
|
||||||
const data: QueryResult = {
|
const data: QueryResult = {
|
||||||
columns: result.columns || [],
|
columns: result.columns || [],
|
||||||
@@ -652,15 +652,15 @@ function ViewerElement({ element, data, isLoading, onRefresh, isMobile, canvasWi
|
|||||||
className="border-border bg-background relative overflow-hidden rounded-lg border shadow-sm"
|
className="border-border bg-background relative overflow-hidden rounded-lg border shadow-sm"
|
||||||
style={{ minHeight: "300px" }}
|
style={{ minHeight: "300px" }}
|
||||||
>
|
>
|
||||||
{element.showHeader !== false && (
|
{element.show_header !== false && (
|
||||||
<div className="flex items-center justify-between px-2 py-1">
|
<div className="flex items-center justify-between px-2 py-1">
|
||||||
{/* map-summary-v2는 customTitle이 없으면 제목 숨김 */}
|
{/* map-summary-v2는 customTitle이 없으면 제목 숨김 */}
|
||||||
{element.subtype === "map-summary-v2" && !element.customTitle ? null : (
|
{element.subtype === "map-summary-v2" && !element.custom_title ? null : (
|
||||||
<h3 className="text-foreground text-xs font-semibold">{element.customTitle || element.title}</h3>
|
<h3 className="text-foreground text-xs font-semibold">{element.custom_title || element.title}</h3>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className={element.showHeader !== false ? "p-2" : "p-2"} style={{ minHeight: "250px" }}>
|
<div className={element.show_header !== false ? "p-2" : "p-2"} style={{ minHeight: "250px" }}>
|
||||||
{!isMounted ? (
|
{!isMounted ? (
|
||||||
<div className="flex h-full w-full items-center justify-center">
|
<div className="flex h-full w-full items-center justify-center">
|
||||||
<div className="border-primary h-6 w-6 animate-spin rounded-full border-2 border-t-transparent" />
|
<div className="border-primary h-6 w-6 animate-spin rounded-full border-2 border-t-transparent" />
|
||||||
@@ -698,15 +698,15 @@ function ViewerElement({ element, data, isLoading, onRefresh, isMobile, canvasWi
|
|||||||
height: element.size.height,
|
height: element.size.height,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{element.showHeader !== false && (
|
{element.show_header !== false && (
|
||||||
<div className="flex items-center justify-between px-2 py-1">
|
<div className="flex items-center justify-between px-2 py-1">
|
||||||
{/* map-summary-v2는 customTitle이 없으면 제목 숨김 */}
|
{/* map-summary-v2는 customTitle이 없으면 제목 숨김 */}
|
||||||
{element.subtype === "map-summary-v2" && !element.customTitle ? null : (
|
{element.subtype === "map-summary-v2" && !element.custom_title ? null : (
|
||||||
<h3 className="text-foreground text-xs font-semibold">{element.customTitle || element.title}</h3>
|
<h3 className="text-foreground text-xs font-semibold">{element.custom_title || element.title}</h3>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className={element.showHeader !== false ? "h-[calc(100%-32px)] w-full" : "h-full w-full"}>
|
<div className={element.show_header !== false ? "h-[calc(100%-32px)] w-full" : "h-full w-full"}>
|
||||||
{!isMounted ? (
|
{!isMounted ? (
|
||||||
<div className="flex h-full w-full items-center justify-center">
|
<div className="flex h-full w-full items-center justify-center">
|
||||||
<div className="border-primary h-6 w-6 animate-spin rounded-full border-2 border-t-transparent" />
|
<div className="border-primary h-6 w-6 animate-spin rounded-full border-2 border-t-transparent" />
|
||||||
@@ -716,7 +716,7 @@ function ViewerElement({ element, data, isLoading, onRefresh, isMobile, canvasWi
|
|||||||
element={element}
|
element={element}
|
||||||
data={data}
|
data={data}
|
||||||
width={undefined}
|
width={undefined}
|
||||||
height={element.showHeader !== false ? element.size.height - 32 : element.size.height}
|
height={element.show_header !== false ? element.size.height - 32 : element.size.height}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
renderWidget(element)
|
renderWidget(element)
|
||||||
|
|||||||
@@ -53,9 +53,9 @@ export default function CargoListWidget({ element }: CargoListWidgetProps) {
|
|||||||
Authorization: `Bearer ${token}`,
|
Authorization: `Bearer ${token}`,
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
query: element.dataSource.query,
|
query: element.data_source.query,
|
||||||
connection_type: element.dataSource.connectionType || "current",
|
connection_type: element.data_source.connectionType || "current",
|
||||||
connectionId: element.dataSource.externalConnectionId,
|
connectionId: element.data_source.externalConnectionId,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -109,9 +109,9 @@ export default function CustomMetricTestWidget({ element }: CustomMetricTestWidg
|
|||||||
Authorization: `Bearer ${token}`,
|
Authorization: `Bearer ${token}`,
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
query: element.dataSource.query,
|
query: element.data_source.query,
|
||||||
connectionType: element.dataSource.connectionType || "current",
|
connectionType: element.data_source.connectionType || "current",
|
||||||
connectionId: (element.dataSource as any).connectionId,
|
connectionId: (element.data_source as any).connectionId,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -154,12 +154,12 @@ export default function CustomMetricTestWidget({ element }: CustomMetricTestWidg
|
|||||||
Authorization: `Bearer ${token}`,
|
Authorization: `Bearer ${token}`,
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
method: (element.dataSource as any).method || "GET",
|
method: (element.data_source as any).method || "GET",
|
||||||
url: element.dataSource.endpoint,
|
url: element.data_source.endpoint,
|
||||||
headers: (element.dataSource as any).headers || {},
|
headers: (element.data_source as any).headers || {},
|
||||||
body: (element.dataSource as any).body,
|
body: (element.data_source as any).body,
|
||||||
authType: (element.dataSource as any).authType,
|
authType: (element.data_source as any).authType,
|
||||||
authConfig: (element.dataSource as any).authConfig,
|
authConfig: (element.data_source as any).authConfig,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -109,9 +109,9 @@ export default function CustomMetricWidget({ element }: CustomMetricWidgetProps)
|
|||||||
Authorization: `Bearer ${token}`,
|
Authorization: `Bearer ${token}`,
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
query: element.dataSource.query,
|
query: element.data_source.query,
|
||||||
connectionType: element.dataSource.connectionType || "current",
|
connectionType: element.data_source.connectionType || "current",
|
||||||
connectionId: (element.dataSource as any).connectionId,
|
connectionId: (element.data_source as any).connectionId,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -153,12 +153,12 @@ export default function CustomMetricWidget({ element }: CustomMetricWidgetProps)
|
|||||||
Authorization: `Bearer ${token}`,
|
Authorization: `Bearer ${token}`,
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
method: (element.dataSource as any).method || "GET",
|
method: (element.data_source as any).method || "GET",
|
||||||
url: element.dataSource.endpoint,
|
url: element.data_source.endpoint,
|
||||||
headers: (element.dataSource as any).headers || {},
|
headers: (element.data_source as any).headers || {},
|
||||||
body: (element.dataSource as any).body,
|
body: (element.data_source as any).body,
|
||||||
authType: (element.dataSource as any).authType,
|
authType: (element.data_source as any).authType,
|
||||||
authConfig: (element.dataSource as any).authConfig,
|
authConfig: (element.data_source as any).authConfig,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export default function CustomStatsWidget({ element, refreshInterval = 60000 }:
|
|||||||
|
|
||||||
// localStorage 키 생성 (쿼리 기반으로 고유하게 - 편집/보기 모드 공유)
|
// localStorage 키 생성 (쿼리 기반으로 고유하게 - 편집/보기 모드 공유)
|
||||||
const queryHash = element?.dataSource?.query
|
const queryHash = element?.dataSource?.query
|
||||||
? btoa(element.dataSource.query) // 전체 쿼리를 base64로 인코딩
|
? btoa(element.data_source.query) // 전체 쿼리를 base64로 인코딩
|
||||||
: "default";
|
: "default";
|
||||||
const storageKey = `custom-stats-widget-${queryHash}`;
|
const storageKey = `custom-stats-widget-${queryHash}`;
|
||||||
|
|
||||||
@@ -85,9 +85,9 @@ export default function CustomStatsWidget({ element, refreshInterval = 60000 }:
|
|||||||
Authorization: `Bearer ${token}`,
|
Authorization: `Bearer ${token}`,
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
query: element.dataSource.query,
|
query: element.data_source.query,
|
||||||
connectionType: element.dataSource.connectionType || "current",
|
connectionType: element.data_source.connectionType || "current",
|
||||||
externalConnectionId: element.dataSource.externalConnectionId,
|
externalConnectionId: element.data_source.externalConnectionId,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -54,9 +54,9 @@ export default function CustomerIssuesWidget({ element }: CustomerIssuesWidgetPr
|
|||||||
Authorization: `Bearer ${token}`,
|
Authorization: `Bearer ${token}`,
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
query: element.dataSource.query,
|
query: element.data_source.query,
|
||||||
connection_type: element.dataSource.connectionType || "current",
|
connection_type: element.data_source.connectionType || "current",
|
||||||
connectionId: element.dataSource.externalConnectionId,
|
connectionId: element.data_source.externalConnectionId,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -47,9 +47,9 @@ export default function DeliveryStatusSummaryWidget({ element }: DeliveryStatusS
|
|||||||
Authorization: `Bearer ${token}`,
|
Authorization: `Bearer ${token}`,
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
query: element.dataSource.query,
|
query: element.data_source.query,
|
||||||
connectionType: element.dataSource.connectionType || "current",
|
connectionType: element.data_source.connectionType || "current",
|
||||||
connectionId: element.dataSource.externalConnectionId,
|
connectionId: element.data_source.externalConnectionId,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ export default function DeliveryStatusWidget({ element, refreshInterval = 60000
|
|||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
Authorization: `Bearer ${typeof window !== "undefined" ? localStorage.getItem("authToken") || "" : ""}`,
|
Authorization: `Bearer ${typeof window !== "undefined" ? localStorage.getItem("authToken") || "" : ""}`,
|
||||||
},
|
},
|
||||||
body: JSON.stringify({ query: element.dataSource.query }),
|
body: JSON.stringify({ query: element.data_source.query }),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
|
|||||||
@@ -48,9 +48,9 @@ export default function DeliveryTodayStatsWidget({ element }: DeliveryTodayStats
|
|||||||
Authorization: `Bearer ${token}`,
|
Authorization: `Bearer ${token}`,
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
query: element.dataSource.query,
|
query: element.data_source.query,
|
||||||
connectionType: element.dataSource.connectionType || "current",
|
connectionType: element.data_source.connectionType || "current",
|
||||||
connectionId: element.dataSource.externalConnectionId,
|
connectionId: element.data_source.externalConnectionId,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ export default function ListSummaryWidget({ element }: ListSummaryWidgetProps) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const extractedTableName = extractTableName(element.dataSource.query);
|
const extractedTableName = extractTableName(element.data_source.query);
|
||||||
setTableName(extractedTableName);
|
setTableName(extractedTableName);
|
||||||
|
|
||||||
const token = localStorage.getItem("authToken");
|
const token = localStorage.getItem("authToken");
|
||||||
@@ -136,9 +136,9 @@ export default function ListSummaryWidget({ element }: ListSummaryWidgetProps) {
|
|||||||
Authorization: `Bearer ${token}`,
|
Authorization: `Bearer ${token}`,
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
query: element.dataSource.query,
|
query: element.data_source.query,
|
||||||
connectionType: element.dataSource.connectionType || "current",
|
connectionType: element.data_source.connectionType || "current",
|
||||||
connectionId: element.dataSource.connectionId,
|
connectionId: element.data_source.connectionId,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export function ListTestWidget({ element }: ListTestWidgetProps) {
|
|||||||
|
|
||||||
// 단일 데이터 소스 fallback (배열로 변환)
|
// 단일 데이터 소스 fallback (배열로 변환)
|
||||||
if (element?.dataSource) {
|
if (element?.dataSource) {
|
||||||
return [element.dataSource];
|
return [element.data_source];
|
||||||
}
|
}
|
||||||
|
|
||||||
return [];
|
return [];
|
||||||
@@ -71,7 +71,7 @@ export function ListTestWidget({ element }: ListTestWidgetProps) {
|
|||||||
// dataSources: dataSources,
|
// dataSources: dataSources,
|
||||||
// });
|
// });
|
||||||
|
|
||||||
const config = element.listConfig || {
|
const config = element.list_config || {
|
||||||
columnMode: "auto",
|
columnMode: "auto",
|
||||||
viewMode: "table",
|
viewMode: "table",
|
||||||
columns: [],
|
columns: [],
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ export default function MapSummaryWidget({ element }: MapSummaryWidgetProps) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const extractedTableName = extractTableName(element.dataSource.query);
|
const extractedTableName = extractTableName(element.data_source.query);
|
||||||
setTableName(extractedTableName);
|
setTableName(extractedTableName);
|
||||||
|
|
||||||
const token = localStorage.getItem("authToken");
|
const token = localStorage.getItem("authToken");
|
||||||
@@ -113,9 +113,9 @@ export default function MapSummaryWidget({ element }: MapSummaryWidgetProps) {
|
|||||||
Authorization: `Bearer ${token}`,
|
Authorization: `Bearer ${token}`,
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
query: element.dataSource.query,
|
query: element.data_source.query,
|
||||||
connectionType: element.dataSource.connectionType || "current",
|
connectionType: element.data_source.connectionType || "current",
|
||||||
connectionId: element.dataSource.connectionId,
|
connectionId: element.data_source.connectionId,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -127,8 +127,8 @@ export default function MapSummaryWidget({ element }: MapSummaryWidgetProps) {
|
|||||||
const rows = result.data.rows;
|
const rows = result.data.rows;
|
||||||
|
|
||||||
// 위도/경도 컬럼 찾기
|
// 위도/경도 컬럼 찾기
|
||||||
const latCol = element.chartConfig?.latitudeColumn || "latitude";
|
const latCol = element.chart_config?.latitudeColumn || "latitude";
|
||||||
const lngCol = element.chartConfig?.longitudeColumn || "longitude";
|
const lngCol = element.chart_config?.longitudeColumn || "longitude";
|
||||||
|
|
||||||
// 유효한 좌표 필터링 및 마커 데이터 생성
|
// 유효한 좌표 필터링 및 마커 데이터 생성
|
||||||
const markerData = rows
|
const markerData = rows
|
||||||
@@ -152,7 +152,7 @@ export default function MapSummaryWidget({ element }: MapSummaryWidgetProps) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// customTitle이 있으면 사용, 없으면 테이블명으로 자동 생성
|
// customTitle이 있으면 사용, 없으면 테이블명으로 자동 생성
|
||||||
const displayTitle = element.customTitle || (tableName ? `${translateTableName(tableName)} 위치` : "위치 지도");
|
const displayTitle = element.custom_title || (tableName ? `${translateTableName(tableName)} 위치` : "위치 지도");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex h-full w-full flex-col overflow-hidden bg-gradient-to-br from-background to-primary/10 p-2">
|
<div className="flex h-full w-full flex-col overflow-hidden bg-gradient-to-br from-background to-primary/10 p-2">
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user