From bd1f82a5d09d0adde1216286e30853b8a7a5dbda Mon Sep 17 00:00:00 2001 From: DanielLee <198891672+sanghyeonhd@users.noreply.github.com> Date: Mon, 5 Jan 2026 16:25:38 +0900 Subject: [PATCH] Bring Data fix --- .../label/LabelAllocateRepositoryImpl.java | 39 +++++++------------ 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryImpl.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryImpl.java index 1e68e5a9..53478db8 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryImpl.java @@ -648,9 +648,9 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto .select( mapSheetAnalInferenceEntity.compareYyyy, mapSheetAnalInferenceEntity.targetYyyy, - mapSheetAnalInferenceEntity.analTitle, + mapSheetAnalInferenceEntity.stage, mapSheetAnalInferenceEntity.gukyuinApplyDttm, - mapSheetAnalInferenceEntity.analStrtDttm, + mapSheetAnalInferenceEntity.createdDttm, mapSheetAnalInferenceEntity.uuid) .from(mapSheetAnalInferenceEntity) .where(mapSheetAnalInferenceEntity.id.eq(analUid)) @@ -662,23 +662,23 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto Integer compareYyyy = result.get(mapSheetAnalInferenceEntity.compareYyyy); Integer targetYyyy = result.get(mapSheetAnalInferenceEntity.targetYyyy); - String analTitle = result.get(mapSheetAnalInferenceEntity.analTitle); + Integer stage = result.get(mapSheetAnalInferenceEntity.stage); ZonedDateTime gukyuinApplyDttm = result.get(mapSheetAnalInferenceEntity.gukyuinApplyDttm); - ZonedDateTime analStrtDttm = result.get(mapSheetAnalInferenceEntity.analStrtDttm); + ZonedDateTime createdDttm = result.get(mapSheetAnalInferenceEntity.createdDttm); UUID uuid = result.get(mapSheetAnalInferenceEntity.uuid); // 변화탐지년도 생성 String detectionYear = (compareYyyy != null && targetYyyy != null) ? compareYyyy + "-" + targetYyyy : null; - // 회차 추출 (예: "8회차" → "8") - String round = extractRoundFromTitle(analTitle); + // 회차를 stage 컬럼에서 가져옴 + String round = stage != null ? String.valueOf(stage) : null; return ProjectInfo.builder() .detectionYear(detectionYear) .round(round) .reflectionDate(formatDate(gukyuinApplyDttm)) - .startDate(formatDate(analStrtDttm)) + .startDate(formatDate(createdDttm)) .uuid(uuid != null ? uuid.toString() : null) .build(); } @@ -691,9 +691,9 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto .select( mapSheetAnalInferenceEntity.compareYyyy, mapSheetAnalInferenceEntity.targetYyyy, - mapSheetAnalInferenceEntity.analTitle, + mapSheetAnalInferenceEntity.stage, mapSheetAnalInferenceEntity.gukyuinApplyDttm, - mapSheetAnalInferenceEntity.analStrtDttm, + mapSheetAnalInferenceEntity.createdDttm, mapSheetAnalInferenceEntity.uuid) .from(mapSheetAnalInferenceEntity) .orderBy( @@ -709,38 +709,27 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto Integer compareYyyy = result.get(mapSheetAnalInferenceEntity.compareYyyy); Integer targetYyyy = result.get(mapSheetAnalInferenceEntity.targetYyyy); - String analTitle = result.get(mapSheetAnalInferenceEntity.analTitle); + Integer stage = result.get(mapSheetAnalInferenceEntity.stage); ZonedDateTime gukyuinApplyDttm = result.get(mapSheetAnalInferenceEntity.gukyuinApplyDttm); - ZonedDateTime analStrtDttm = result.get(mapSheetAnalInferenceEntity.analStrtDttm); + ZonedDateTime createdDttm = result.get(mapSheetAnalInferenceEntity.createdDttm); UUID uuid = result.get(mapSheetAnalInferenceEntity.uuid); // 변화탐지년도 생성 String detectionYear = (compareYyyy != null && targetYyyy != null) ? compareYyyy + "-" + targetYyyy : null; - // 회차 추출 (예: "8회차" → "8") - String round = extractRoundFromTitle(analTitle); + // 회차를 stage 컬럼에서 가져옴 + String round = stage != null ? String.valueOf(stage) : null; return ProjectInfo.builder() .detectionYear(detectionYear) .round(round) .reflectionDate(formatDate(gukyuinApplyDttm)) - .startDate(formatDate(analStrtDttm)) + .startDate(formatDate(createdDttm)) .uuid(uuid != null ? uuid.toString() : null) .build(); } - /** 제목에서 회차 숫자 추출 예: "8회차", "제8회차" → "8" */ - private String extractRoundFromTitle(String title) { - if (title == null || title.isEmpty()) { - return null; - } - - Pattern pattern = Pattern.compile("(\\d+)회차"); - Matcher matcher = pattern.matcher(title); - - return matcher.find() ? matcher.group(1) : null; - } /** ZonedDateTime을 "yyyy-MM-dd" 형식으로 변환 */ private String formatDate(ZonedDateTime dateTime) {