Merge pull request '추론 수정' (#112) from feat/infer_dev_260211 into develop

Reviewed-on: #112
This commit was merged in pull request #112.
This commit is contained in:
2026-02-27 08:29:22 +09:00
2 changed files with 55 additions and 19 deletions

View File

@@ -145,34 +145,59 @@ public class InferenceResultService {
*/ */
public UUID runExcl(InferenceResultDto.RegReq req) { public UUID runExcl(InferenceResultDto.RegReq req) {
// 기준연도 실행가능 도엽 조회 // 기준연도 실행가능 도엽 조회
List<MngListDto> mngList = List<MngListDto> targetMngList =
mapSheetMngCoreService.findExecutableSheets( mapSheetMngCoreService.getMapSheetMngHst(
req.getCompareYyyy(), req.getTargetYyyy(), req.getMapSheetScope(), req.getMapSheetNum());
req.getTargetYyyy(),
req.getMapSheetScope(),
req.getMapSheetNum());
if (mngList == null || mngList.isEmpty()) { // List<MngListDto> mngList =
// mapSheetMngCoreService.findExecutableSheets(
// req.getCompareYyyy(),
// req.getTargetYyyy(),
// req.getMapSheetScope(),
// req.getMapSheetNum());
if (targetMngList == null || targetMngList.isEmpty()) {
throw new CustomApiException("NOT_FOUND_MAP_SHEET_NUM", HttpStatus.NOT_FOUND); throw new CustomApiException("NOT_FOUND_MAP_SHEET_NUM", HttpStatus.NOT_FOUND);
} }
// 비교연도 실행가능 도엽 조회
List<MngListDto> compareMngList =
mapSheetMngCoreService.getMapSheetMngHst(
req.getCompareYyyy(), req.getMapSheetScope(), req.getMapSheetNum());
if (compareMngList == null || compareMngList.isEmpty()) {
throw new CustomApiException("NOT_FOUND_COMPARE_YEAR", HttpStatus.NOT_FOUND);
}
// compare 도엽번호 Set 구성
Set<String> compareSet =
compareMngList.stream()
.map(MngListDto::getMapSheetNum)
.filter(Objects::nonNull)
.collect(Collectors.toSet());
// 기준년도 비교년도 동일한 도엽번호만 담기
List<MngListDto> intersectionList =
targetMngList.stream()
.filter(dto -> dto.getMapSheetNum() != null)
.filter(dto -> compareSet.contains(dto.getMapSheetNum()))
.toList();
log.info("target size = {}", targetMngList.size());
log.info("compare size = {}", compareMngList.size());
log.info("intersection size = {}", intersectionList.size());
// 비교 연도 도엽번호를 꺼내와서 최종 추론 대상 도엽번호를 담기 // 비교 연도 도엽번호를 꺼내와서 최종 추론 대상 도엽번호를 담기
List<String> mapSheetNums = List<String> mapSheetNums =
mngList.stream() intersectionList.stream()
.map(MngListDto::getMapSheetNum) .map(MngListDto::getMapSheetNum)
.filter(Objects::nonNull) .filter(Objects::nonNull)
.distinct() .distinct()
.collect(Collectors.toList()); .toList();
// 기준연도 추론 실행가능 도엽 count int targetTotal = targetMngList.size();
int targetTotal = int compareTotal = compareMngList.size();
mapSheetMngCoreService.countExecutableSheetsDistinct( int intersection = intersectionList.size();
req.getTargetYyyy(), req.getMapSheetScope(), mapSheetNums);
// 비교연도 추론 실행가능 도엽 count
int compareTotal =
mapSheetMngCoreService.countExecutableSheetsDistinct(
req.getCompareYyyy(), req.getMapSheetScope(), mapSheetNums);
int intersection = mapSheetNums.size();
// ===== MapSheet Year Comparison ===== // ===== MapSheet Year Comparison =====
// target Total : 기준연도 실행가능 전체 도엽 수 // target Total : 기준연도 실행가능 전체 도엽 수
@@ -227,7 +252,7 @@ public class InferenceResultService {
// 추론 실행 // 추론 실행
return executeInference( return executeInference(
req, req,
mngList, // 전체 target 목록 intersectionList, // 전체 target 목록
mapSheetNums, // 최종 추론 대상 mapSheetNums, // 최종 추론 대상
compareScene, // compare geojson compareScene, // compare geojson
targetScene // target geojson targetScene // target geojson

View File

@@ -1239,6 +1239,17 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
whereBuilder.and(mapSheetMngHstEntity.mngYyyy.eq(year)); whereBuilder.and(mapSheetMngHstEntity.mngYyyy.eq(year));
whereBuilder.and(
JPAExpressions.selectOne()
.from(mapSheetMngFileEntity)
.where(
mapSheetMngFileEntity
.hstUid
.eq(mapSheetMngHstEntity.hstUid) // FK 관계에 맞게 유지
.and(mapSheetMngFileEntity.fileExt.eq("tif"))
.and(mapSheetMngFileEntity.fileState.eq("DONE")))
.exists());
BooleanBuilder likeBuilder = new BooleanBuilder(); BooleanBuilder likeBuilder = new BooleanBuilder();
if (MapSheetScope.PART.getId().equals(mapSheetScope)) { if (MapSheetScope.PART.getId().equals(mapSheetScope)) {