Merge remote-tracking branch 'origin/feat/infer_dev_260107' into feat/infer_dev_260107

This commit is contained in:
2026-01-14 15:24:22 +09:00
8 changed files with 173 additions and 5 deletions

View File

@@ -3,6 +3,7 @@ package com.kamco.cd.kamcoback.postgres.core;
import com.kamco.cd.kamcoback.common.exception.CustomApiException;
import com.kamco.cd.kamcoback.common.utils.UserUtil;
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.AnalResultInfo;
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.Dashboard;
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.InferenceBatchSheet;
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.MapSheet;
@@ -382,4 +383,8 @@ public class InferenceResultCoreService {
public Integer getLearnStage(Integer compareYear, Integer targetYear) {
return mapSheetLearnRepository.getLearnStage(compareYear, targetYear);
}
public AnalResultInfo getInferenceResultInfo(String uuid) {
return mapSheetLearnRepository.getInferenceResultInfo(uuid);
}
}

View File

@@ -1,5 +1,6 @@
package com.kamco.cd.kamcoback.postgres.repository.Inference;
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.AnalResultInfo;
import com.kamco.cd.kamcoback.inference.dto.InferenceProgressDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto;
@@ -27,4 +28,6 @@ public interface MapSheetLearnRepositoryCustom {
UUID getProcessing();
Integer getLearnStage(Integer compareYear, Integer targetYear);
AnalResultInfo getInferenceResultInfo(String uuid);
}

View File

@@ -5,6 +5,7 @@ import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapShe
import static com.kamco.cd.kamcoback.postgres.entity.QSystemMetricEntity.systemMetricEntity;
import com.kamco.cd.kamcoback.common.utils.DateRange;
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.AnalResultInfo;
import com.kamco.cd.kamcoback.inference.dto.InferenceProgressDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto;
@@ -261,4 +262,35 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
return stage == null ? 1 : stage + 1;
}
@Override
public AnalResultInfo getInferenceResultInfo(String uuid) {
QModelMngEntity m1 = new QModelMngEntity("m1");
QModelMngEntity m2 = new QModelMngEntity("m2");
QModelMngEntity m3 = new QModelMngEntity("m3");
return queryFactory
.select(
Projections.constructor(
AnalResultInfo.class,
mapSheetLearnEntity.title,
m1.modelVer,
m2.modelVer,
m3.modelVer,
mapSheetLearnEntity.compareYyyy,
mapSheetLearnEntity.targetYyyy,
mapSheetLearnEntity.detectOption,
mapSheetLearnEntity.mapSheetScope,
mapSheetLearnEntity.inferStartDttm,
mapSheetLearnEntity.inferEndDttm))
.from(mapSheetLearnEntity)
.leftJoin(m1)
.on(mapSheetLearnEntity.m1ModelUuid.eq(m1.uuid))
.leftJoin(m2)
.on(mapSheetLearnEntity.m2ModelUuid.eq(m2.uuid))
.leftJoin(m3)
.on(mapSheetLearnEntity.m3ModelUuid.eq(m3.uuid))
.where(mapSheetLearnEntity.uuid.eq(UUID.fromString(uuid)))
.fetchOne();
}
}

View File

@@ -1514,12 +1514,20 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
mapSheetAnalInferenceEntity.createdDttm,
mapSheetAnalInferenceEntity.inspectionClosedYn,
mapSheetAnalInferenceEntity.updatedDttm)
.orderBy(mapSheetAnalInferenceEntity.id.desc())
.orderBy(
// 진행중인 작업이 최상단 (remainCnt > 0)
new CaseBuilder()
.when(totalCnt.subtract(completeCnt).subtract(skipCnt).gt(0L))
.then(0)
.otherwise(1)
.asc(),
// 최신 작업순 (반영일 기준)
mapSheetAnalInferenceEntity.gukyuinApplyDttm.desc())
.offset(pageable.getOffset())
.limit(pageable.getPageSize())
.fetch();
// rowNum remainCnt, percent를 Java에서 계산
// rowNum, remainCnt, percent, status를 Java에서 계산
int startRow = (int) pageable.getOffset() + 1;
for (int i = 0; i < list.size(); i++) {
WorkHistoryDto dto = list.get(i);
@@ -1537,6 +1545,13 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
} else {
dto.setPercent(0.0);
}
// status 계산 (잔여건수가 0이고 진행률이 100%면 "완료", 아니면 "진행중")
if (dto.getRemainCnt() == 0 && dto.getPercent() >= 100.0) {
dto.setStatus("완료");
} else {
dto.setStatus("진행중");
}
}
Long countQuery =
@@ -1605,12 +1620,20 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
mapSheetAnalInferenceEntity.createdDttm,
mapSheetAnalInferenceEntity.inspectionClosedYn,
mapSheetAnalInferenceEntity.updatedDttm)
.orderBy(mapSheetAnalInferenceEntity.id.desc())
.orderBy(
// 진행중인 작업이 최상단 (remainCnt > 0)
new CaseBuilder()
.when(totalCnt.subtract(completeCnt).subtract(skipCnt).gt(0L))
.then(0)
.otherwise(1)
.asc(),
// 최신 작업순 (반영일 기준)
mapSheetAnalInferenceEntity.gukyuinApplyDttm.desc())
.offset(pageable.getOffset())
.limit(pageable.getPageSize())
.fetch();
// rowNum remainCnt, percent를 Java에서 계산
// rowNum, remainCnt, percent, status를 Java에서 계산
int startRow = (int) pageable.getOffset() + 1;
for (int i = 0; i < list.size(); i++) {
WorkHistoryDto dto = list.get(i);
@@ -1628,6 +1651,13 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
} else {
dto.setPercent(0.0);
}
// status 계산 (잔여건수가 0이고 진행률이 100%면 "완료", 아니면 "진행중")
if (dto.getRemainCnt() == 0 && dto.getPercent() >= 100.0) {
dto.setStatus("완료");
} else {
dto.setStatus("진행중");
}
}
Long countQuery =