M->G 변환 #81

Merged
teddy merged 2 commits from feat/infer_dev_260211 into develop 2026-02-20 12:19:10 +09:00
3 changed files with 17 additions and 37 deletions

View File

@@ -248,7 +248,7 @@ public class InferenceResultService {
saveInferenceAiDto.setUuid(uuid);
saveInferenceAiDto.setBatchId(batchId);
saveInferenceAiDto.setStatus(Status.IN_PROGRESS.getId());
saveInferenceAiDto.setType("G1");
saveInferenceAiDto.setType(ModelType.G1.getId());
saveInferenceAiDto.setInferStartDttm(ZonedDateTime.now());
saveInferenceAiDto.setModelComparePath(modelComparePath.getFilePath());
saveInferenceAiDto.setModelTargetPath(modelTargetPath.getFilePath());
@@ -415,11 +415,11 @@ public class InferenceResultService {
String modelType = "";
if (modelInfo.getModelType().equals(ModelType.G1.getId())) {
modelType = "G1";
modelType = ModelType.G1.getId();
} else if (modelInfo.getModelType().equals(ModelType.G2.getId())) {
modelType = "G2";
modelType = ModelType.G2.getId();
} else {
modelType = "G3";
modelType = ModelType.G3.getId();
}
InferenceSendDto sendDto = new InferenceSendDto();

View File

@@ -19,6 +19,7 @@ import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.ResultList;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.SaveInferenceAiDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultsTestingDto;
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.MngListDto;
import com.kamco.cd.kamcoback.model.dto.ModelMngDto.ModelType;
import com.kamco.cd.kamcoback.postgres.entity.InferenceResultsTestingEntity;
import com.kamco.cd.kamcoback.postgres.entity.MapInkx5kEntity;
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceEntity;
@@ -110,7 +111,7 @@ public class InferenceResultCoreService {
MapSheetLearnEntity mapSheetLearnEntity = new MapSheetLearnEntity();
mapSheetLearnEntity.setTitle(req.getTitle());
mapSheetLearnEntity.setRunningModelType("G1");
mapSheetLearnEntity.setRunningModelType(ModelType.G1.getId());
mapSheetLearnEntity.setM1ModelUuid(req.getModel1Uuid());
mapSheetLearnEntity.setM2ModelUuid(req.getModel2Uuid());
mapSheetLearnEntity.setM3ModelUuid(req.getModel3Uuid());

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 호출
*