M->G 변환
This commit is contained in:
@@ -248,7 +248,7 @@ public class InferenceResultService {
|
|||||||
saveInferenceAiDto.setUuid(uuid);
|
saveInferenceAiDto.setUuid(uuid);
|
||||||
saveInferenceAiDto.setBatchId(batchId);
|
saveInferenceAiDto.setBatchId(batchId);
|
||||||
saveInferenceAiDto.setStatus(Status.IN_PROGRESS.getId());
|
saveInferenceAiDto.setStatus(Status.IN_PROGRESS.getId());
|
||||||
saveInferenceAiDto.setType("G1");
|
saveInferenceAiDto.setType(ModelType.G1.getId());
|
||||||
saveInferenceAiDto.setInferStartDttm(ZonedDateTime.now());
|
saveInferenceAiDto.setInferStartDttm(ZonedDateTime.now());
|
||||||
saveInferenceAiDto.setModelComparePath(modelComparePath.getFilePath());
|
saveInferenceAiDto.setModelComparePath(modelComparePath.getFilePath());
|
||||||
saveInferenceAiDto.setModelTargetPath(modelTargetPath.getFilePath());
|
saveInferenceAiDto.setModelTargetPath(modelTargetPath.getFilePath());
|
||||||
@@ -415,11 +415,11 @@ public class InferenceResultService {
|
|||||||
String modelType = "";
|
String modelType = "";
|
||||||
|
|
||||||
if (modelInfo.getModelType().equals(ModelType.G1.getId())) {
|
if (modelInfo.getModelType().equals(ModelType.G1.getId())) {
|
||||||
modelType = "G1";
|
modelType = ModelType.G1.getId();
|
||||||
} else if (modelInfo.getModelType().equals(ModelType.G2.getId())) {
|
} else if (modelInfo.getModelType().equals(ModelType.G2.getId())) {
|
||||||
modelType = "G2";
|
modelType = ModelType.G2.getId();
|
||||||
} else {
|
} else {
|
||||||
modelType = "G3";
|
modelType = ModelType.G3.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
InferenceSendDto sendDto = new InferenceSendDto();
|
InferenceSendDto sendDto = new InferenceSendDto();
|
||||||
|
|||||||
@@ -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.InferenceResultDto.SaveInferenceAiDto;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultsTestingDto;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultsTestingDto;
|
||||||
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.MngListDto;
|
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.InferenceResultsTestingEntity;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.MapInkx5kEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.MapInkx5kEntity;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceEntity;
|
||||||
@@ -110,7 +111,7 @@ public class InferenceResultCoreService {
|
|||||||
|
|
||||||
MapSheetLearnEntity mapSheetLearnEntity = new MapSheetLearnEntity();
|
MapSheetLearnEntity mapSheetLearnEntity = new MapSheetLearnEntity();
|
||||||
mapSheetLearnEntity.setTitle(req.getTitle());
|
mapSheetLearnEntity.setTitle(req.getTitle());
|
||||||
mapSheetLearnEntity.setRunningModelType("G1");
|
mapSheetLearnEntity.setRunningModelType(ModelType.G1.getId());
|
||||||
mapSheetLearnEntity.setM1ModelUuid(req.getModel1Uuid());
|
mapSheetLearnEntity.setM1ModelUuid(req.getModel1Uuid());
|
||||||
mapSheetLearnEntity.setM2ModelUuid(req.getModel2Uuid());
|
mapSheetLearnEntity.setM2ModelUuid(req.getModel2Uuid());
|
||||||
mapSheetLearnEntity.setM3ModelUuid(req.getModel3Uuid());
|
mapSheetLearnEntity.setM3ModelUuid(req.getModel3Uuid());
|
||||||
|
|||||||
@@ -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.SaveInferenceAiDto;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.Status;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.Status;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceSendDto;
|
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.postgres.core.InferenceResultCoreService;
|
||||||
import com.kamco.cd.kamcoback.scheduler.dto.BatchStatusDto;
|
import com.kamco.cd.kamcoback.scheduler.dto.BatchStatusDto;
|
||||||
import com.kamco.cd.kamcoback.scheduler.dto.JobStatusDto;
|
import com.kamco.cd.kamcoback.scheduler.dto.JobStatusDto;
|
||||||
@@ -216,7 +217,7 @@ public class MapSheetInferenceJobService {
|
|||||||
updateProcessingEndTimeByModel(job, sheet.getUuid(), now, currentType);
|
updateProcessingEndTimeByModel(job, sheet.getUuid(), now, currentType);
|
||||||
|
|
||||||
// M3이면 전체 종료
|
// M3이면 전체 종료
|
||||||
if ("G3".equals(currentType)) {
|
if (ModelType.G3.getId().equals(currentType)) {
|
||||||
endAll(sheet, now);
|
endAll(sheet, now);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -240,7 +241,7 @@ public class MapSheetInferenceJobService {
|
|||||||
save.setUuid(sheet.getUuid());
|
save.setUuid(sheet.getUuid());
|
||||||
save.setStatus(Status.END.getId());
|
save.setStatus(Status.END.getId());
|
||||||
save.setInferEndDttm(now);
|
save.setInferEndDttm(now);
|
||||||
save.setType("G3"); // 마지막 모델 기준
|
save.setType(ModelType.G3.getId()); // 마지막 모델 기준
|
||||||
inferenceResultCoreService.update(save);
|
inferenceResultCoreService.update(save);
|
||||||
|
|
||||||
// 추론 종료일때 geom 데이터 저장
|
// 추론 종료일때 geom 데이터 저장
|
||||||
@@ -266,11 +267,11 @@ public class MapSheetInferenceJobService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private String nextModelType(String currentType) {
|
private String nextModelType(String currentType) {
|
||||||
if ("G1".equals(currentType)) {
|
if (ModelType.G1.getId().equals(currentType)) {
|
||||||
return "G2";
|
return ModelType.G2.getId();
|
||||||
}
|
}
|
||||||
if ("G2".equals(currentType)) {
|
if (ModelType.G2.getId().equals(currentType)) {
|
||||||
return "G3";
|
return ModelType.G3.getId();
|
||||||
}
|
}
|
||||||
throw new IllegalArgumentException("Unknown runningModelType: " + currentType);
|
throw new IllegalArgumentException("Unknown runningModelType: " + currentType);
|
||||||
}
|
}
|
||||||
@@ -283,13 +284,13 @@ public class MapSheetInferenceJobService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private UUID resolveModelUuid(InferenceBatchSheet sheet, String type) {
|
private UUID resolveModelUuid(InferenceBatchSheet sheet, String type) {
|
||||||
if ("G1".equals(type)) {
|
if (ModelType.G1.getId().equals(type)) {
|
||||||
return sheet.getM1ModelUuid();
|
return sheet.getM1ModelUuid();
|
||||||
}
|
}
|
||||||
if ("G2".equals(type)) {
|
if (ModelType.G2.getId().equals(type)) {
|
||||||
return sheet.getM2ModelUuid();
|
return sheet.getM2ModelUuid();
|
||||||
}
|
}
|
||||||
if ("G3".equals(type)) {
|
if (ModelType.G3.getId().equals(type)) {
|
||||||
return sheet.getM3ModelUuid();
|
return sheet.getM3ModelUuid();
|
||||||
}
|
}
|
||||||
throw new IllegalArgumentException("Unknown type: " + type);
|
throw new IllegalArgumentException("Unknown type: " + type);
|
||||||
@@ -332,9 +333,6 @@ public class MapSheetInferenceJobService {
|
|||||||
InferenceProgressDto progressDto =
|
InferenceProgressDto progressDto =
|
||||||
inferenceResultCoreService.getInferenceAiResultById(id, modelUuid);
|
inferenceResultCoreService.getInferenceAiResultById(id, modelUuid);
|
||||||
|
|
||||||
// ai 에 맞는 모델 명으로 변경
|
|
||||||
String inferenceType = modelToInferenceType(type);
|
|
||||||
|
|
||||||
InferenceSendDto.pred_requests_areas predRequestsAreas =
|
InferenceSendDto.pred_requests_areas predRequestsAreas =
|
||||||
new InferenceSendDto.pred_requests_areas();
|
new InferenceSendDto.pred_requests_areas();
|
||||||
predRequestsAreas.setInput1_year(progressDto.getPred_requests_areas().getInput1_year());
|
predRequestsAreas.setInput1_year(progressDto.getPred_requests_areas().getInput1_year());
|
||||||
@@ -355,7 +353,7 @@ public class MapSheetInferenceJobService {
|
|||||||
m.setCls_model_path(
|
m.setCls_model_path(
|
||||||
Paths.get(progressDto.getCdModelClsPath(), progressDto.getCdModelClsFileName()).toString());
|
Paths.get(progressDto.getCdModelClsPath(), progressDto.getCdModelClsFileName()).toString());
|
||||||
m.setCls_model_version(progressDto.getClsModelVersion());
|
m.setCls_model_version(progressDto.getClsModelVersion());
|
||||||
m.setCd_model_type(inferenceType);
|
m.setCd_model_type(type);
|
||||||
m.setPriority(progressDto.getPriority());
|
m.setPriority(progressDto.getPriority());
|
||||||
|
|
||||||
// log.info("InferenceSendDto={}", m);
|
// log.info("InferenceSendDto={}", m);
|
||||||
@@ -372,25 +370,6 @@ public class MapSheetInferenceJobService {
|
|||||||
inferenceResultCoreService.update(saveInferenceAiDto);
|
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 호출
|
* api 호출
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user