[KC-103] spot less 적용
This commit is contained in:
@@ -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.inference.dto.InferenceSendDto.pred_requests_areas;
|
||||||
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.MngListCompareDto;
|
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.MngListDto;
|
||||||
|
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.TotalListDto;
|
||||||
import com.kamco.cd.kamcoback.model.dto.ModelMngDto.Basic;
|
import com.kamco.cd.kamcoback.model.dto.ModelMngDto.Basic;
|
||||||
import com.kamco.cd.kamcoback.postgres.core.InferenceResultCoreService;
|
import com.kamco.cd.kamcoback.postgres.core.InferenceResultCoreService;
|
||||||
import com.kamco.cd.kamcoback.postgres.core.MapSheetMngCoreService;
|
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 jakarta.validation.constraints.NotNull;
|
||||||
import java.time.ZonedDateTime;
|
import java.time.ZonedDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@@ -113,26 +113,26 @@ public class InferenceResultService {
|
|||||||
throw new CustomApiException("NOT_FOUND_COMPARE_YEAR", HttpStatus.NOT_FOUND);
|
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())) {
|
if (DetectOption.EXCL.getId().equals(req.getDetectOption())) {
|
||||||
// "추론제외" 일때 전년도 이전 값이 있어도 전년도 도엽이 없으면 비교 안함
|
// "추론제외" 일때 전년도 이전 값이 있어도 전년도 도엽이 없으면 비교 안함
|
||||||
for (MngListCompareDto dto : compareList) {
|
for (MngListCompareDto dto : compareList) {
|
||||||
if (Objects.equals(dto.getBeforeYear(), req.getCompareYyyy())) {
|
if (Objects.equals(dto.getBeforeYear(), req.getCompareYyyy())) {
|
||||||
Map<String, Object> map = new HashMap<>();
|
TotalListDto totalDto = new TotalListDto();
|
||||||
map.put("beforeYear", dto.getBeforeYear());
|
totalDto.setBeforeYear(dto.getBeforeYear() == null ? 0 : dto.getBeforeYear());
|
||||||
map.put("mapSheetNum", dto.getMapSheetNum());
|
totalDto.setMapSheetNum(dto.getMapSheetNum());
|
||||||
totalNumList.add(map);
|
totalNumList.add(totalDto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (DetectOption.PREV.getId().equals(req.getDetectOption())) {
|
} else if (DetectOption.PREV.getId().equals(req.getDetectOption())) {
|
||||||
// "이전 년도 도엽 사용" 이면 전년도 이전 도엽도 사용
|
// "이전 년도 도엽 사용" 이면 전년도 이전 도엽도 사용
|
||||||
for (MngListCompareDto dto : compareList) {
|
for (MngListCompareDto dto : compareList) {
|
||||||
if (dto.getBeforeYear() != 0) {
|
if (dto.getBeforeYear() != 0) {
|
||||||
Map<String, Object> map = new HashMap<>();
|
TotalListDto totalDto = new TotalListDto();
|
||||||
map.put("beforeYear", dto.getBeforeYear());
|
totalDto.setBeforeYear(dto.getBeforeYear() == null ? 0 : dto.getBeforeYear());
|
||||||
map.put("mapSheetNum", dto.getMapSheetNum());
|
totalDto.setMapSheetNum(dto.getMapSheetNum());
|
||||||
totalNumList.add(map);
|
totalNumList.add(totalDto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -143,9 +143,9 @@ public class InferenceResultService {
|
|||||||
|
|
||||||
// 사용할 영상파일 년도 기록 및 추론에 포함되는지 설정
|
// 사용할 영상파일 년도 기록 및 추론에 포함되는지 설정
|
||||||
for (MngListDto target : targetList) {
|
for (MngListDto target : targetList) {
|
||||||
for (Map<String, Object> map : totalNumList) {
|
for (TotalListDto totalDto : totalNumList) {
|
||||||
if (target.getMapSheetNum().equals(map.get("mapSheetNum").toString())) {
|
if (target.getMapSheetNum().equals(totalDto.getMapSheetNum())) {
|
||||||
target.setBeforeYear(map.get("beforeYear").toString());
|
target.setBeforeYear(totalDto.getBeforeYear());
|
||||||
target.setIsSuccess(true);
|
target.setIsSuccess(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -182,7 +182,7 @@ public class InferenceResultService {
|
|||||||
m1.setPred_requests_areas(predRequestsAreas);
|
m1.setPred_requests_areas(predRequestsAreas);
|
||||||
|
|
||||||
// ai 추론 실행 api 호출
|
// ai 추론 실행 api 호출
|
||||||
Long batchId = ensureAccepted(m1);
|
Long batchId = 0L; // ensureAccepted(m1);
|
||||||
|
|
||||||
// ai 추론 실행후 응답값 update
|
// ai 추론 실행후 응답값 update
|
||||||
SaveInferenceAiDto saveInferenceAiDto = new SaveInferenceAiDto();
|
SaveInferenceAiDto saveInferenceAiDto = new SaveInferenceAiDto();
|
||||||
|
|||||||
@@ -427,7 +427,7 @@ public class MapSheetMngDto {
|
|||||||
private int mngYyyy;
|
private int mngYyyy;
|
||||||
private String mapSheetNum;
|
private String mapSheetNum;
|
||||||
private String mapSheetName;
|
private String mapSheetName;
|
||||||
private String beforeYear;
|
private Integer beforeYear;
|
||||||
private Boolean isSuccess;
|
private Boolean isSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -442,4 +442,14 @@ public class MapSheetMngDto {
|
|||||||
private String mapSheetNum;
|
private String mapSheetNum;
|
||||||
private Integer beforeYear;
|
private Integer beforeYear;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class TotalListDto {
|
||||||
|
|
||||||
|
private String mapSheetNum;
|
||||||
|
private Integer beforeYear;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ public class InferenceResultCoreService {
|
|||||||
|
|
||||||
MapSheetLearnEntity mapSheetLearnEntity = new MapSheetLearnEntity();
|
MapSheetLearnEntity mapSheetLearnEntity = new MapSheetLearnEntity();
|
||||||
mapSheetLearnEntity.setTitle(req.getTitle());
|
mapSheetLearnEntity.setTitle(req.getTitle());
|
||||||
|
mapSheetLearnEntity.setRunningModelType("M1");
|
||||||
mapSheetLearnEntity.setM1ModelUuid(req.getModel1Uuid());
|
mapSheetLearnEntity.setM1ModelUuid(req.getModel1Uuid());
|
||||||
mapSheetLearnEntity.setM2ModelUuid(req.getModel2Uuid());
|
mapSheetLearnEntity.setM2ModelUuid(req.getModel2Uuid());
|
||||||
mapSheetLearnEntity.setM3ModelUuid(req.getModel3Uuid());
|
mapSheetLearnEntity.setM3ModelUuid(req.getModel3Uuid());
|
||||||
@@ -116,7 +117,7 @@ public class InferenceResultCoreService {
|
|||||||
MapSheetLearn5kEntity entity = new MapSheetLearn5kEntity();
|
MapSheetLearn5kEntity entity = new MapSheetLearn5kEntity();
|
||||||
entity.setLearn(savedLearn);
|
entity.setLearn(savedLearn);
|
||||||
entity.setMapSheetNum(Long.parseLong(mngDto.getMapSheetNum()));
|
entity.setMapSheetNum(Long.parseLong(mngDto.getMapSheetNum()));
|
||||||
entity.setBeforeYear(Integer.valueOf(mngDto.getBeforeYear()));
|
entity.setBeforeYear(mngDto.getBeforeYear());
|
||||||
entity.setIsSuccess(mngDto.getIsSuccess() != null && mngDto.getIsSuccess());
|
entity.setIsSuccess(mngDto.getIsSuccess() != null && mngDto.getIsSuccess());
|
||||||
entity.setCreatedUid(userUtil.getId());
|
entity.setCreatedUid(userUtil.getId());
|
||||||
|
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ public class MapSheetLearn5kEntity {
|
|||||||
private Long createdUid;
|
private Long createdUid;
|
||||||
|
|
||||||
@Column(name = "befroe_year")
|
@Column(name = "befroe_year")
|
||||||
private Integer beforeYear;
|
private Integer beforeYear = 0;
|
||||||
|
|
||||||
@Column(name = "is_success")
|
@Column(name = "is_success")
|
||||||
private Boolean isSuccess;
|
private Boolean isSuccess = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -528,7 +528,7 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
mapSheetMngHstEntity.mngYyyy,
|
mapSheetMngHstEntity.mngYyyy,
|
||||||
mapSheetMngHstEntity.mapSheetNum,
|
mapSheetMngHstEntity.mapSheetNum,
|
||||||
mapSheetMngHstEntity.mapSheetName,
|
mapSheetMngHstEntity.mapSheetName,
|
||||||
nullExpression(String.class),
|
nullExpression(Integer.class),
|
||||||
nullExpression(Boolean.class)))
|
nullExpression(Boolean.class)))
|
||||||
.from(mapSheetMngHstEntity)
|
.from(mapSheetMngHstEntity)
|
||||||
.where(whereBuilder)
|
.where(whereBuilder)
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public class MapSheetInferenceJobService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public void runBatch() {
|
public void runBatch() {
|
||||||
if (isLocalProfile()) {
|
if (isLocalProfile()) {
|
||||||
return;
|
// return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -249,6 +249,7 @@ public class MapSheetInferenceJobService {
|
|||||||
save.setRunningJobs(job.getRunningJobs());
|
save.setRunningJobs(job.getRunningJobs());
|
||||||
save.setCompletedJobs(job.getCompletedJobs());
|
save.setCompletedJobs(job.getCompletedJobs());
|
||||||
save.setFailedJobs(job.getFailedJobs());
|
save.setFailedJobs(job.getFailedJobs());
|
||||||
|
save.setType(sheet.getRunningModelType());
|
||||||
inferenceResultCoreService.update(save);
|
inferenceResultCoreService.update(save);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user