Merge pull request 'feat/dev_251201' (#144) from feat/dev_251201 into develop

Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/144
This commit is contained in:
2026-01-05 16:33:30 +09:00
5 changed files with 58 additions and 44 deletions

View File

@@ -41,8 +41,6 @@ import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Objects;
import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
@@ -72,6 +70,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
.from(mapSheetAnalDataInferenceGeomEntity)
.where(
lastId == null ? null : mapSheetAnalDataInferenceGeomEntity.geoUid.gt(lastId),
mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull(),
mapSheetAnalDataInferenceGeomEntity.compareYyyy.eq(compareYyyy),
mapSheetAnalDataInferenceGeomEntity.targetYyyy.eq(targetYyyy),
mapSheetAnalDataInferenceGeomEntity.stage.eq(stage),
@@ -160,6 +159,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
.select(mapSheetAnalDataInferenceGeomEntity.geoUid.count())
.from(mapSheetAnalDataInferenceGeomEntity)
.where(
mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull(),
mapSheetAnalDataInferenceGeomEntity.compareYyyy.eq(compareYyyy),
mapSheetAnalDataInferenceGeomEntity.targetYyyy.eq(targetYyyy),
mapSheetAnalDataInferenceGeomEntity.stage.eq(stage),
@@ -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,39 +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) {
if (dateTime == null) {

View File

@@ -137,6 +137,11 @@ public class LabelWorkRepositoryImpl extends QuerydslRepositorySupport
.then(1L)
.otherwise(0L)
.sum(),
new CaseBuilder()
.when(mapSheetAnalDataInferenceGeomEntity.labelState.eq("ASSIGNED"))
.then(1L)
.otherwise(0L)
.sum(),
new CaseBuilder()
.when(mapSheetAnalDataInferenceGeomEntity.labelState.eq("STOP"))
.then(1L)