feat/infer_dev_260211 #137
@@ -6,7 +6,6 @@ import static com.kamco.cd.kamcoback.postgres.entity.QLabelingLabelerEntity.labe
|
|||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceEntity.mapSheetAnalDataInferenceEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceEntity.mapSheetAnalDataInferenceEntity;
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceGeomEntity.mapSheetAnalDataInferenceGeomEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceGeomEntity.mapSheetAnalDataInferenceGeomEntity;
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalInferenceEntity.mapSheetAnalInferenceEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalInferenceEntity.mapSheetAnalInferenceEntity;
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnDataGeomEntity.mapSheetLearnDataGeomEntity;
|
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapSheetLearnEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapSheetLearnEntity;
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMemberEntity.memberEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QMemberEntity.memberEntity;
|
||||||
|
|
||||||
@@ -490,17 +489,21 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
inspectionStatus = inspectionRemaining > 0 ? "진행중" : "완료";
|
inspectionStatus = inspectionRemaining > 0 ? "진행중" : "완료";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ZoneId zoneId = ZoneId.of("Asia/Seoul");
|
||||||
|
LocalDate targetDate = LocalDate.now(zoneId);
|
||||||
|
|
||||||
|
ZonedDateTime end = targetDate.plusDays(1).atStartOfDay(zoneId);
|
||||||
Long downloadPolygonCnt =
|
Long downloadPolygonCnt =
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(mapSheetLearnDataGeomEntity.geoUid.count())
|
.select(labelingAssignmentEntity.inferenceGeomUid.count())
|
||||||
.from(mapSheetLearnDataGeomEntity)
|
.from(labelingAssignmentEntity)
|
||||||
.innerJoin(labelingAssignmentEntity)
|
|
||||||
.on(labelingAssignmentEntity.inferenceGeomUid.eq(mapSheetLearnDataGeomEntity.geoUid))
|
|
||||||
.innerJoin(mapSheetAnalInferenceEntity)
|
.innerJoin(mapSheetAnalInferenceEntity)
|
||||||
.on(
|
.on(
|
||||||
labelingAssignmentEntity.analUid.eq(mapSheetAnalInferenceEntity.id),
|
labelingAssignmentEntity.analUid.eq(mapSheetAnalInferenceEntity.id),
|
||||||
mapSheetAnalInferenceEntity.id.eq(analUid))
|
mapSheetAnalInferenceEntity.id.eq(analUid))
|
||||||
.where(mapSheetLearnDataGeomEntity.fileCreateYn.isTrue())
|
.where(
|
||||||
|
labelingAssignmentEntity.inspectState.eq(InspectState.COMPLETE.getId()),
|
||||||
|
labelingAssignmentEntity.inspectStatDttm.lt(end))
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
|
|
||||||
return WorkProgressInfo.builder()
|
return WorkProgressInfo.builder()
|
||||||
@@ -670,17 +673,21 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
inspectionStatus = inspectionRemaining > 0 ? "진행중" : "완료";
|
inspectionStatus = inspectionRemaining > 0 ? "진행중" : "완료";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ZoneId zoneId = ZoneId.of("Asia/Seoul");
|
||||||
|
LocalDate targetDate = LocalDate.now(zoneId);
|
||||||
|
|
||||||
|
ZonedDateTime end = targetDate.plusDays(1).atStartOfDay(zoneId);
|
||||||
Long downloadPolygonCnt =
|
Long downloadPolygonCnt =
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(mapSheetLearnDataGeomEntity.geoUid.count())
|
.select(labelingAssignmentEntity.inferenceGeomUid.count())
|
||||||
.from(mapSheetLearnDataGeomEntity)
|
.from(labelingAssignmentEntity)
|
||||||
.innerJoin(labelingAssignmentEntity)
|
|
||||||
.on(labelingAssignmentEntity.inferenceGeomUid.eq(mapSheetLearnDataGeomEntity.geoUid))
|
|
||||||
.innerJoin(mapSheetAnalInferenceEntity)
|
.innerJoin(mapSheetAnalInferenceEntity)
|
||||||
.on(
|
.on(
|
||||||
labelingAssignmentEntity.analUid.eq(mapSheetAnalInferenceEntity.id),
|
labelingAssignmentEntity.analUid.eq(mapSheetAnalInferenceEntity.id),
|
||||||
mapSheetAnalInferenceEntity.uuid.eq(targetUuid))
|
mapSheetAnalInferenceEntity.uuid.eq(targetUuid))
|
||||||
.where(mapSheetLearnDataGeomEntity.fileCreateYn.isTrue())
|
.where(
|
||||||
|
labelingAssignmentEntity.inspectState.eq(InspectState.COMPLETE.getId()),
|
||||||
|
labelingAssignmentEntity.inspectStatDttm.lt(end))
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
|
|
||||||
return WorkProgressInfo.builder()
|
return WorkProgressInfo.builder()
|
||||||
|
|||||||
@@ -983,7 +983,8 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
.or(mapSheetMngHstEntity.syncCheckState.eq("DONE")));
|
.or(mapSheetMngHstEntity.syncCheckState.eq("DONE")));
|
||||||
|
|
||||||
// file_ext = 'tif'
|
// file_ext = 'tif'
|
||||||
whereBuilder.and(mapSheetMngFileEntity.fileExt.eq("tif"));
|
whereBuilder.and(
|
||||||
|
mapSheetMngFileEntity.fileExt.eq("tif").and(mapSheetMngFileEntity.fileDel.isFalse()));
|
||||||
|
|
||||||
// mng_yyyy = '2023'
|
// mng_yyyy = '2023'
|
||||||
if (yyyy != null && !yyyy.isEmpty()) {
|
if (yyyy != null && !yyyy.isEmpty()) {
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import java.nio.file.Path;
|
|||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
@@ -43,6 +42,11 @@ public class TrainingDataReviewJobService {
|
|||||||
exportGeojsonLabelingGeom(null);
|
exportGeojsonLabelingGeom(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 미사용 -> kamco-cd-cron GIT에 kamco-make-dataset-generation jar 생성 로직에 포함되어 해당 로직은 미사용
|
||||||
|
*
|
||||||
|
* @param baseDate
|
||||||
|
*/
|
||||||
public void exportGeojsonLabelingGeom(LocalDate baseDate) {
|
public void exportGeojsonLabelingGeom(LocalDate baseDate) {
|
||||||
|
|
||||||
// 1) 경로/파일명 결정
|
// 1) 경로/파일명 결정
|
||||||
@@ -51,7 +55,7 @@ public class TrainingDataReviewJobService {
|
|||||||
log.info("[Step 1-1] geojson 파일 생성할 경로: {}", targetDir);
|
log.info("[Step 1-1] geojson 파일 생성할 경로: {}", targetDir);
|
||||||
|
|
||||||
// 2) 진행중인 회차 중, complete_cnt 가 존재하는 회차 목록 가져오기
|
// 2) 진행중인 회차 중, complete_cnt 가 존재하는 회차 목록 가져오기
|
||||||
log.info("[Step 1-2] 진행중인 회차 중, complete_cnt 가 존재하는 회차 목록 가져오기");
|
log.info("[Step 1-2] 진행중(ING)인 회차 중, 검수완료한(complete_cnt) 갯수가 존재하는 회차 목록 가져오기");
|
||||||
List<AnalCntInfo> analList = trainingDataReviewJobCoreService.findAnalCntInfoList();
|
List<AnalCntInfo> analList = trainingDataReviewJobCoreService.findAnalCntInfoList();
|
||||||
log.info("[Step 1-3] 회차 리스트 건수: {}", analList == null ? 0 : analList.size());
|
log.info("[Step 1-3] 회차 리스트 건수: {}", analList == null ? 0 : analList.size());
|
||||||
|
|
||||||
@@ -61,19 +65,14 @@ public class TrainingDataReviewJobService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (AnalCntInfo info : analList) {
|
for (AnalCntInfo info : analList) {
|
||||||
log.info("[Step 2-1] 회차 폴리곤 전체 건수 == 파일 생성 건수 같은지 확인");
|
|
||||||
log.info("=== info.getAllCnt(): {}", info.getAllCnt());
|
|
||||||
log.info("=== info.getFileCnt(): {}", info.getFileCnt());
|
|
||||||
|
|
||||||
if (Objects.equals(info.getAllCnt(), info.getFileCnt())) {
|
|
||||||
log.info("[Step 2-2] 회차 폴리곤 전체 건수 == 파일 생성 건수 같아서 파일 생성 진행하지 않음 continue");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
String resultUid = info.getResultUid(); // 회차의 대문자 uid (폴더명으로 사용)
|
String resultUid = info.getResultUid(); // 회차의 대문자 uid (폴더명으로 사용)
|
||||||
|
|
||||||
// 3) 회차 + 어제까지 검수 완료된 총 데이터의 도엽별 목록 가져오기
|
// 3) 회차 + 어제까지 검수 완료된 총 데이터의 도엽별 목록 가져오기
|
||||||
log.info("[Step 3-1] 회차 + 어제까지 검수 완료된 총 데이터의 도엽별 목록 가져오기");
|
log.info("[Step 3-1] 회차 + 어제까지 검수 완료된 총 데이터의 도엽별 목록 가져오기");
|
||||||
|
log.info(" === 기준일자 baseDate : " + baseDate);
|
||||||
|
log.info(" === 검수완료일자 < 기준일자인 폴리곤의 도엽 목록을 조회");
|
||||||
|
|
||||||
List<AnalMapSheetList> analMapList =
|
List<AnalMapSheetList> analMapList =
|
||||||
trainingDataReviewJobCoreService.findCompletedAnalMapSheetList(
|
trainingDataReviewJobCoreService.findCompletedAnalMapSheetList(
|
||||||
info.getAnalUid(), baseDate);
|
info.getAnalUid(), baseDate);
|
||||||
@@ -123,9 +122,7 @@ public class TrainingDataReviewJobService {
|
|||||||
objectMapper.enable(SerializationFeature.INDENT_OUTPUT);
|
objectMapper.enable(SerializationFeature.INDENT_OUTPUT);
|
||||||
objectMapper.writeValue(outputPath.toFile(), collection);
|
objectMapper.writeValue(outputPath.toFile(), collection);
|
||||||
|
|
||||||
// geoUids : file_create_yn = true 로 업데이트
|
log.info("[Step 6-3] geoJson 파일 생성 완료");
|
||||||
log.info("[Step 6-3] learn_data_geom 에 file_create_yn = true 로 업데이트");
|
|
||||||
trainingDataReviewJobCoreService.updateLearnDataGeomFileCreateYn(geoUids);
|
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
|
|||||||
Reference in New Issue
Block a user