M->G 변환

This commit is contained in:
2026-02-20 12:18:20 +09:00
parent 4dc5c196ca
commit 84b2149f78
3 changed files with 17 additions and 37 deletions

View File

@@ -11,6 +11,7 @@ import com.kamco.cd.kamcoback.inference.dto.InferenceProgressDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.SaveInferenceAiDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.Status;
import com.kamco.cd.kamcoback.inference.dto.InferenceSendDto;
import com.kamco.cd.kamcoback.model.dto.ModelMngDto.ModelType;
import com.kamco.cd.kamcoback.postgres.core.InferenceResultCoreService;
import com.kamco.cd.kamcoback.scheduler.dto.BatchStatusDto;
import com.kamco.cd.kamcoback.scheduler.dto.JobStatusDto;
@@ -216,7 +217,7 @@ public class MapSheetInferenceJobService {
updateProcessingEndTimeByModel(job, sheet.getUuid(), now, currentType);
// M3이면 전체 종료
if ("G3".equals(currentType)) {
if (ModelType.G3.getId().equals(currentType)) {
endAll(sheet, now);
return;
}
@@ -240,7 +241,7 @@ public class MapSheetInferenceJobService {
save.setUuid(sheet.getUuid());
save.setStatus(Status.END.getId());
save.setInferEndDttm(now);
save.setType("G3"); // 마지막 모델 기준
save.setType(ModelType.G3.getId()); // 마지막 모델 기준
inferenceResultCoreService.update(save);
// 추론 종료일때 geom 데이터 저장
@@ -266,11 +267,11 @@ public class MapSheetInferenceJobService {
* @return
*/
private String nextModelType(String currentType) {
if ("G1".equals(currentType)) {
return "G2";
if (ModelType.G1.getId().equals(currentType)) {
return ModelType.G2.getId();
}
if ("G2".equals(currentType)) {
return "G3";
if (ModelType.G2.getId().equals(currentType)) {
return ModelType.G3.getId();
}
throw new IllegalArgumentException("Unknown runningModelType: " + currentType);
}
@@ -283,13 +284,13 @@ public class MapSheetInferenceJobService {
* @return
*/
private UUID resolveModelUuid(InferenceBatchSheet sheet, String type) {
if ("G1".equals(type)) {
if (ModelType.G1.getId().equals(type)) {
return sheet.getM1ModelUuid();
}
if ("G2".equals(type)) {
if (ModelType.G2.getId().equals(type)) {
return sheet.getM2ModelUuid();
}
if ("G3".equals(type)) {
if (ModelType.G3.getId().equals(type)) {
return sheet.getM3ModelUuid();
}
throw new IllegalArgumentException("Unknown type: " + type);
@@ -332,9 +333,6 @@ public class MapSheetInferenceJobService {
InferenceProgressDto progressDto =
inferenceResultCoreService.getInferenceAiResultById(id, modelUuid);
// ai 에 맞는 모델 명으로 변경
String inferenceType = modelToInferenceType(type);
InferenceSendDto.pred_requests_areas predRequestsAreas =
new InferenceSendDto.pred_requests_areas();
predRequestsAreas.setInput1_year(progressDto.getPred_requests_areas().getInput1_year());
@@ -355,7 +353,7 @@ public class MapSheetInferenceJobService {
m.setCls_model_path(
Paths.get(progressDto.getCdModelClsPath(), progressDto.getCdModelClsFileName()).toString());
m.setCls_model_version(progressDto.getClsModelVersion());
m.setCd_model_type(inferenceType);
m.setCd_model_type(type);
m.setPriority(progressDto.getPriority());
// log.info("InferenceSendDto={}", m);
@@ -372,25 +370,6 @@ public class MapSheetInferenceJobService {
inferenceResultCoreService.update(saveInferenceAiDto);
}
/**
* ai 에 맞는 모델 명으로 변경
*
* @param type 모델 타입
* @return String
*/
private String modelToInferenceType(String type) {
if ("G1".equals(type)) {
return "G1";
}
if ("G2".equals(type)) {
return "G2";
}
if ("G3".equals(type)) {
return "G3";
}
throw new IllegalArgumentException("Unknown type: " + type);
}
/**
* api 호출
*