batchId list 생성 수정

This commit is contained in:
2026-01-26 15:26:09 +09:00
parent 23e8e9b27c
commit f1f8753fbb

View File

@@ -38,8 +38,10 @@ import jakarta.validation.constraints.NotNull;
import java.time.ZonedDateTime; import java.time.ZonedDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.UUID; import java.util.UUID;
import java.util.function.Consumer; import java.util.function.Consumer;
import java.util.stream.Stream;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.dao.DataAccessException; import org.springframework.dao.DataAccessException;
@@ -263,10 +265,12 @@ public class InferenceResultCoreService {
applyModelUpdate(entity, request); applyModelUpdate(entity, request);
} }
List<Long> batchIds = new ArrayList<>(); List<Long> batchIds =
batchIds.add(entity.getM1ModelBatchId()); Stream.of(
batchIds.add(entity.getM2ModelBatchId()); entity.getM1ModelBatchId(), entity.getM2ModelBatchId(), entity.getM3ModelBatchId())
batchIds.add(entity.getM3ModelBatchId()); .filter(Objects::nonNull)
.distinct() // 중복 방지 (선택)
.toList();
// testing 추론결과 테이블 조회하여 탐지 개수 업데이트 // testing 추론결과 테이블 조회하여 탐지 개수 업데이트
Long testing = getInferenceResultCnt(batchIds); Long testing = getInferenceResultCnt(batchIds);
@@ -509,10 +513,7 @@ public class InferenceResultCoreService {
if (entity == null) { if (entity == null) {
throw new CustomApiException("NOT_FOUND_DATA", HttpStatus.NOT_FOUND); throw new CustomApiException("NOT_FOUND_DATA", HttpStatus.NOT_FOUND);
} }
// inferenceResultRepository
// .getInferenceUid(uuid)
// .orElseThrow(() -> new CustomApiException("NOT_FOUND_DATA",
// HttpStatus.NOT_FOUND));
InferenceLearnDto dto = new InferenceLearnDto(); InferenceLearnDto dto = new InferenceLearnDto();
dto.setUid(entity.getUid()); dto.setUid(entity.getUid());
dto.setM1ModelBatchId(entity.getM1ModelBatchId()); dto.setM1ModelBatchId(entity.getM1ModelBatchId());