Merge remote-tracking branch 'origin/feat/infer_dev_260107' into feat/infer_dev_260107
This commit is contained in:
@@ -6,13 +6,16 @@ import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.Dashboard;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.Detail;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.MapSheet;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.MapSheetScope;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.ResultList;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceSendDto;
|
||||
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;
|
||||
import com.kamco.cd.kamcoback.postgres.core.ModelMngCoreService;
|
||||
import com.kamco.cd.kamcoback.scene.dto.MapInkxMngDto.Search5kReq;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -57,7 +60,24 @@ public class InferenceResultService {
|
||||
*/
|
||||
@Transactional
|
||||
public UUID saveInferenceInfo(InferenceResultDto.RegReq req) {
|
||||
UUID uuid = inferenceResultCoreService.saveInferenceInfo(req);
|
||||
|
||||
// 전체일때 5k도협 가져오기
|
||||
if (MapSheetScope.ALL.getId().equals(req.getMapSheetScope())) {
|
||||
Search5kReq mapReq = new Search5kReq();
|
||||
mapReq.setUseInference("USE");
|
||||
|
||||
List<String> mapSheetIds = new ArrayList<>();
|
||||
inferenceResultCoreService
|
||||
.findByMapidList(mapReq)
|
||||
.forEach(
|
||||
mapInkx5kEntity -> {
|
||||
mapSheetIds.add(mapInkx5kEntity.getMapidcdNo());
|
||||
});
|
||||
req.setMapSheetNum(mapSheetIds);
|
||||
System.out.println(mapSheetIds);
|
||||
}
|
||||
|
||||
// UUID uuid = inferenceResultCoreService.saveInferenceInfo(req);
|
||||
|
||||
// TODO tif 없으면 전년도 파일 조회 쿼리 추가해야함
|
||||
// TODO 도엽 개수를 target 기준으로 맞춰야함
|
||||
@@ -72,7 +92,7 @@ public class InferenceResultService {
|
||||
// ensureAccepted(m2);
|
||||
// ensureAccepted(m3);
|
||||
|
||||
return uuid;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -87,7 +87,7 @@ public class ModelMngService {
|
||||
modelMetricAddReq.setIou(0);
|
||||
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
String filePath = addReq.getClsModelPath()+addReq.getClsModelFileName();
|
||||
String filePath = addReq.getClsModelPath() + addReq.getClsModelFileName();
|
||||
String dataJson = null;
|
||||
try {
|
||||
dataJson = Files.readString(Path.of(filePath));
|
||||
@@ -109,7 +109,6 @@ public class ModelMngService {
|
||||
return new ApiResponseDto.ResponseObj(ApiResponseCode.NOT_FOUND, "JSON파일 오류");
|
||||
}
|
||||
|
||||
|
||||
modelMngCoreService.insertModelResultMetric(modelMetricAddReq);
|
||||
|
||||
return new ApiResponseDto.ResponseObj(ApiResponseDto.ApiResponseCode.OK, "등록되었습니다.");
|
||||
|
||||
@@ -16,6 +16,8 @@ import com.kamco.cd.kamcoback.postgres.repository.Inference.MapSheetAnalDataInfe
|
||||
import com.kamco.cd.kamcoback.postgres.repository.Inference.MapSheetLearn5kRepository;
|
||||
import com.kamco.cd.kamcoback.postgres.repository.Inference.MapSheetLearnRepository;
|
||||
import com.kamco.cd.kamcoback.postgres.repository.scene.MapInkx5kRepository;
|
||||
import com.kamco.cd.kamcoback.scene.dto.MapInkxMngDto;
|
||||
import com.kamco.cd.kamcoback.scene.dto.MapInkxMngDto.Search5kReq;
|
||||
import jakarta.persistence.EntityManager;
|
||||
import jakarta.persistence.EntityNotFoundException;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
@@ -71,14 +73,6 @@ public class InferenceResultCoreService {
|
||||
// learn 테이블 저장
|
||||
MapSheetLearnEntity savedLearn = mapSheetLearnRepository.save(mapSheetLearnEntity);
|
||||
|
||||
// if (req.getMapSheetScope().equals(MapSheetScope.ALL)) {
|
||||
// List<String> mapSheetIds = new ArrayList<>();
|
||||
// mapInkx5kRepository.findAll().forEach(mapInkx5kEntity -> {
|
||||
// mapSheetIds.add(mapInkx5kEntity.getMapidcdNo());
|
||||
// });
|
||||
// req.setMapSheetNum(mapSheetIds);
|
||||
// }
|
||||
|
||||
final int CHUNK = 1000;
|
||||
List<MapSheetLearn5kEntity> buffer = new ArrayList<>(CHUNK);
|
||||
List<String> mapSheetNumList = req.getMapSheetNum();
|
||||
@@ -214,4 +208,8 @@ public class InferenceResultCoreService {
|
||||
.map(MapInkx5kEntity::toEntity)
|
||||
.toList();
|
||||
}
|
||||
|
||||
public List<MapInkxMngDto.Basic> findByMapidList(Search5kReq req) {
|
||||
return mapInkx5kRepository.findByMapidList(req);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.kamco.cd.kamcoback.common.enums.CommonUseStatus;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapInkx5kEntity;
|
||||
import com.kamco.cd.kamcoback.scene.dto.MapInkxMngDto;
|
||||
import com.kamco.cd.kamcoback.scene.dto.MapInkxMngDto.MapList;
|
||||
import com.kamco.cd.kamcoback.scene.dto.MapInkxMngDto.Search5kReq;
|
||||
import com.kamco.cd.kamcoback.scene.dto.MapInkxMngDto.searchReq;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
@@ -26,5 +27,5 @@ public interface MapInkx5kRepositoryCustom {
|
||||
List<MapInkx5kEntity> findByMapSheetNumInAndUseInference(
|
||||
List<String> mapSheetNums, CommonUseStatus use);
|
||||
|
||||
Optional<MapInkx5kEntity> findByMapidList();
|
||||
List<MapInkxMngDto.Basic> findByMapidList(Search5kReq search5kReq);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,9 @@ import com.kamco.cd.kamcoback.postgres.entity.MapInkx5kEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.QMapInkx5kEntity;
|
||||
import com.kamco.cd.kamcoback.scene.dto.MapInkxMngDto;
|
||||
import com.kamco.cd.kamcoback.scene.dto.MapInkxMngDto.MapList;
|
||||
import com.kamco.cd.kamcoback.scene.dto.MapInkxMngDto.Search5kReq;
|
||||
import com.kamco.cd.kamcoback.scene.dto.MapInkxMngDto.searchReq;
|
||||
import com.querydsl.core.BooleanBuilder;
|
||||
import com.querydsl.core.types.Projections;
|
||||
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||
import com.querydsl.core.types.dsl.Expressions;
|
||||
@@ -16,6 +18,7 @@ import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -143,8 +146,31 @@ public class MapInkx5kRepositoryImpl extends QuerydslRepositorySupport
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<MapInkx5kEntity> findByMapidList() {
|
||||
return Optional.empty();
|
||||
public List<MapInkxMngDto.Basic> findByMapidList(Search5kReq search5kReq) {
|
||||
BooleanBuilder builder = new BooleanBuilder();
|
||||
|
||||
if (StringUtils.isNotBlank(search5kReq.getMapidcdNo())) {
|
||||
builder.and(mapInkx5kEntity.mapidcdNo.eq(search5kReq.getMapidcdNo()));
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(search5kReq.getUseInference())) {
|
||||
builder.and(
|
||||
mapInkx5kEntity.useInference.eq(
|
||||
CommonUseStatus.getEnumById(search5kReq.getUseInference())));
|
||||
}
|
||||
|
||||
return queryFactory
|
||||
.select(
|
||||
Projections.constructor(
|
||||
MapInkxMngDto.Basic.class,
|
||||
mapInkx5kEntity.fid,
|
||||
mapInkx5kEntity.mapidcdNo,
|
||||
mapInkx5kEntity.mapidNm,
|
||||
mapInkx5kEntity.geom,
|
||||
mapInkx5kEntity.useInference))
|
||||
.from(mapInkx5kEntity)
|
||||
.where(builder)
|
||||
.fetch();
|
||||
}
|
||||
|
||||
private BooleanExpression searchUseInference(CommonUseStatus useInference) {
|
||||
|
||||
@@ -15,6 +15,7 @@ import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.locationtech.jts.geom.Geometry;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
@@ -58,6 +59,20 @@ public class MapInkxMngDto {
|
||||
private ZonedDateTime updatedDttm;
|
||||
}
|
||||
|
||||
@Schema(name = "MapInkList", description = "5k 리스트")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class MapInkList {
|
||||
|
||||
private Integer fid;
|
||||
private String mapidcdNo;
|
||||
private String mapidNm;
|
||||
private Geometry geom;
|
||||
private String useInference;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Schema(name = "MapListEntity", description = "목록 항목")
|
||||
public static class MapListEntity {
|
||||
@@ -207,4 +222,14 @@ public class MapInkxMngDto {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class Search5kReq {
|
||||
|
||||
private String mapidcdNo;
|
||||
private String useInference;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user