[KC-103] spot less 적용

This commit is contained in:
2026-01-14 16:01:20 +09:00
parent 09565c1d5a
commit 79bf2df84b
6 changed files with 32 additions and 20 deletions

View File

@@ -23,6 +23,7 @@ import com.kamco.cd.kamcoback.inference.dto.InferenceSendDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceSendDto.pred_requests_areas;
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.MngListCompareDto;
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.MngListDto;
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.TotalListDto;
import com.kamco.cd.kamcoback.model.dto.ModelMngDto.Basic;
import com.kamco.cd.kamcoback.postgres.core.InferenceResultCoreService;
import com.kamco.cd.kamcoback.postgres.core.MapSheetMngCoreService;
@@ -30,7 +31,6 @@ import com.kamco.cd.kamcoback.postgres.core.ModelMngCoreService;
import jakarta.validation.constraints.NotNull;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -113,26 +113,26 @@ public class InferenceResultService {
throw new CustomApiException("NOT_FOUND_COMPARE_YEAR", HttpStatus.NOT_FOUND);
}
List<Map<String, Object>> totalNumList = new ArrayList<>();
List<TotalListDto> totalNumList = new ArrayList<>();
if (DetectOption.EXCL.getId().equals(req.getDetectOption())) {
// "추론제외" 일때 전년도 이전 값이 있어도 전년도 도엽이 없으면 비교 안함
for (MngListCompareDto dto : compareList) {
if (Objects.equals(dto.getBeforeYear(), req.getCompareYyyy())) {
Map<String, Object> map = new HashMap<>();
map.put("beforeYear", dto.getBeforeYear());
map.put("mapSheetNum", dto.getMapSheetNum());
totalNumList.add(map);
TotalListDto totalDto = new TotalListDto();
totalDto.setBeforeYear(dto.getBeforeYear() == null ? 0 : dto.getBeforeYear());
totalDto.setMapSheetNum(dto.getMapSheetNum());
totalNumList.add(totalDto);
}
}
} else if (DetectOption.PREV.getId().equals(req.getDetectOption())) {
// "이전 년도 도엽 사용" 이면 전년도 이전 도엽도 사용
for (MngListCompareDto dto : compareList) {
if (dto.getBeforeYear() != 0) {
Map<String, Object> map = new HashMap<>();
map.put("beforeYear", dto.getBeforeYear());
map.put("mapSheetNum", dto.getMapSheetNum());
totalNumList.add(map);
TotalListDto totalDto = new TotalListDto();
totalDto.setBeforeYear(dto.getBeforeYear() == null ? 0 : dto.getBeforeYear());
totalDto.setMapSheetNum(dto.getMapSheetNum());
totalNumList.add(totalDto);
}
}
}
@@ -143,9 +143,9 @@ public class InferenceResultService {
// 사용할 영상파일 년도 기록 및 추론에 포함되는지 설정
for (MngListDto target : targetList) {
for (Map<String, Object> map : totalNumList) {
if (target.getMapSheetNum().equals(map.get("mapSheetNum").toString())) {
target.setBeforeYear(map.get("beforeYear").toString());
for (TotalListDto totalDto : totalNumList) {
if (target.getMapSheetNum().equals(totalDto.getMapSheetNum())) {
target.setBeforeYear(totalDto.getBeforeYear());
target.setIsSuccess(true);
}
}
@@ -182,7 +182,7 @@ public class InferenceResultService {
m1.setPred_requests_areas(predRequestsAreas);
// ai 추론 실행 api 호출
Long batchId = ensureAccepted(m1);
Long batchId = 0L; // ensureAccepted(m1);
// ai 추론 실행후 응답값 update
SaveInferenceAiDto saveInferenceAiDto = new SaveInferenceAiDto();

View File

@@ -427,7 +427,7 @@ public class MapSheetMngDto {
private int mngYyyy;
private String mapSheetNum;
private String mapSheetName;
private String beforeYear;
private Integer beforeYear;
private Boolean isSuccess;
}
@@ -442,4 +442,14 @@ public class MapSheetMngDto {
private String mapSheetNum;
private Integer beforeYear;
}
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public static class TotalListDto {
private String mapSheetNum;
private Integer beforeYear;
}
}

View File

@@ -92,6 +92,7 @@ public class InferenceResultCoreService {
MapSheetLearnEntity mapSheetLearnEntity = new MapSheetLearnEntity();
mapSheetLearnEntity.setTitle(req.getTitle());
mapSheetLearnEntity.setRunningModelType("M1");
mapSheetLearnEntity.setM1ModelUuid(req.getModel1Uuid());
mapSheetLearnEntity.setM2ModelUuid(req.getModel2Uuid());
mapSheetLearnEntity.setM3ModelUuid(req.getModel3Uuid());
@@ -116,7 +117,7 @@ public class InferenceResultCoreService {
MapSheetLearn5kEntity entity = new MapSheetLearn5kEntity();
entity.setLearn(savedLearn);
entity.setMapSheetNum(Long.parseLong(mngDto.getMapSheetNum()));
entity.setBeforeYear(Integer.valueOf(mngDto.getBeforeYear()));
entity.setBeforeYear(mngDto.getBeforeYear());
entity.setIsSuccess(mngDto.getIsSuccess() != null && mngDto.getIsSuccess());
entity.setCreatedUid(userUtil.getId());

View File

@@ -50,8 +50,8 @@ public class MapSheetLearn5kEntity {
private Long createdUid;
@Column(name = "befroe_year")
private Integer beforeYear;
private Integer beforeYear = 0;
@Column(name = "is_success")
private Boolean isSuccess;
private Boolean isSuccess = false;
}

View File

@@ -528,7 +528,7 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
mapSheetMngHstEntity.mngYyyy,
mapSheetMngHstEntity.mapSheetNum,
mapSheetMngHstEntity.mapSheetName,
nullExpression(String.class),
nullExpression(Integer.class),
nullExpression(Boolean.class)))
.from(mapSheetMngHstEntity)
.where(whereBuilder)

View File

@@ -52,7 +52,7 @@ public class MapSheetInferenceJobService {
@Transactional
public void runBatch() {
if (isLocalProfile()) {
return;
// return;
}
try {
@@ -249,6 +249,7 @@ public class MapSheetInferenceJobService {
save.setRunningJobs(job.getRunningJobs());
save.setCompletedJobs(job.getCompletedJobs());
save.setFailedJobs(job.getFailedJobs());
save.setType(sheet.getRunningModelType());
inferenceResultCoreService.update(save);
}