Merge pull request 'feat/infer_dev_260107' (#319) from feat/infer_dev_260107 into develop

Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/319
This commit is contained in:
2026-01-22 21:12:35 +09:00
9 changed files with 121 additions and 14 deletions

View File

@@ -63,4 +63,13 @@ public class MapSheetMngFileJobCoreService {
public Integer findNotYetMapSheetMng() { public Integer findNotYetMapSheetMng() {
return mapSheetMngFileJobRepository.findNotYetMapSheetMng(); return mapSheetMngFileJobRepository.findNotYetMapSheetMng();
} }
public Long findByHstMapSheetBeforeYyyyListCount(int strtYyyy, int endYyyy, String mapSheetNum) {
return mapSheetMngFileJobRepository.findByHstMapSheetBeforeYyyyListCount(
strtYyyy, endYyyy, mapSheetNum);
}
public void updateException5kMapSheet(String mapSheetNum) {
mapSheetMngFileJobRepository.updateException5kMapSheet(mapSheetNum);
}
} }

View File

@@ -18,4 +18,8 @@ public interface MapSheetMngFileJobRepositoryCustom {
public void mngDataState(int mngYyyy, String mngState); public void mngDataState(int mngYyyy, String mngState);
public Integer findNotYetMapSheetMng(); public Integer findNotYetMapSheetMng();
public Long findByHstMapSheetBeforeYyyyListCount(int strtYyyy, int endYyyy, String mapSheetNum);
public void updateException5kMapSheet(String mapSheetNum);
} }

View File

@@ -1,8 +1,10 @@
package com.kamco.cd.kamcoback.postgres.repository.scheduler; package com.kamco.cd.kamcoback.postgres.repository.scheduler;
import static com.kamco.cd.kamcoback.postgres.entity.QMapInkx5kEntity.mapInkx5kEntity;
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetMngEntity.mapSheetMngEntity; import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetMngEntity.mapSheetMngEntity;
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetMngHstEntity.mapSheetMngHstEntity; import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetMngHstEntity.mapSheetMngHstEntity;
import com.kamco.cd.kamcoback.common.enums.CommonUseStatus;
import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngHstEntity; import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngHstEntity;
import com.kamco.cd.kamcoback.scheduler.dto.MapSheetMngDto; import com.kamco.cd.kamcoback.scheduler.dto.MapSheetMngDto;
import com.kamco.cd.kamcoback.scheduler.dto.MapSheetMngDto.MngHstDto; import com.kamco.cd.kamcoback.scheduler.dto.MapSheetMngDto.MngHstDto;
@@ -168,6 +170,7 @@ public class MapSheetMngFileJobRepositoryImpl extends QuerydslRepositorySupport
.set(mapSheetMngHstEntity.mapSheetPath, updateReq.getMapSheetPath()) .set(mapSheetMngHstEntity.mapSheetPath, updateReq.getMapSheetPath())
.set(mapSheetMngHstEntity.syncTfwFileName, updateReq.getSyncTfwFileName()) .set(mapSheetMngHstEntity.syncTfwFileName, updateReq.getSyncTfwFileName())
.set(mapSheetMngHstEntity.syncTifFileName, updateReq.getSyncTifFileName()) .set(mapSheetMngHstEntity.syncTifFileName, updateReq.getSyncTifFileName())
.set(mapSheetMngHstEntity.useInference, updateReq.getUseInference())
.where(mapSheetMngHstEntity.hstUid.eq(updateReq.getHstUid())) .where(mapSheetMngHstEntity.hstUid.eq(updateReq.getHstUid()))
.execute(); .execute();
} else { } else {
@@ -185,6 +188,7 @@ public class MapSheetMngFileJobRepositoryImpl extends QuerydslRepositorySupport
.set(mapSheetMngHstEntity.mapSheetPath, updateReq.getMapSheetPath()) .set(mapSheetMngHstEntity.mapSheetPath, updateReq.getMapSheetPath())
.set(mapSheetMngHstEntity.syncTfwFileName, updateReq.getSyncTfwFileName()) .set(mapSheetMngHstEntity.syncTfwFileName, updateReq.getSyncTfwFileName())
.set(mapSheetMngHstEntity.syncTifFileName, updateReq.getSyncTifFileName()) .set(mapSheetMngHstEntity.syncTifFileName, updateReq.getSyncTifFileName())
.set(mapSheetMngHstEntity.useInference, updateReq.getUseInference())
.where(mapSheetMngHstEntity.hstUid.eq(updateReq.getHstUid())) .where(mapSheetMngHstEntity.hstUid.eq(updateReq.getHstUid()))
.execute(); .execute();
} }
@@ -213,6 +217,7 @@ public class MapSheetMngFileJobRepositoryImpl extends QuerydslRepositorySupport
mapSheetMngHstEntity.mapSheetPath, mapSheetMngHstEntity.mapSheetPath,
mapSheetMngHstEntity.syncCheckTfwFileName, mapSheetMngHstEntity.syncCheckTfwFileName,
mapSheetMngHstEntity.syncCheckTifFileName, mapSheetMngHstEntity.syncCheckTifFileName,
mapSheetMngHstEntity.useInference,
mapSheetMngEntity.mngPath)) mapSheetMngEntity.mngPath))
.from(mapSheetMngHstEntity) .from(mapSheetMngHstEntity)
.join(mapSheetMngEntity) .join(mapSheetMngEntity)
@@ -226,4 +231,38 @@ public class MapSheetMngFileJobRepositoryImpl extends QuerydslRepositorySupport
return foundContent; return foundContent;
} }
@Override
public Long findByHstMapSheetBeforeYyyyListCount(int strtYyyy, int endYyyy, String mapSheetNum) {
Long countQuery =
queryFactory
.select(mapSheetMngHstEntity.mngYyyy.count())
.from(mapSheetMngHstEntity)
.where(
mapSheetMngHstEntity
.mngYyyy
.goe(strtYyyy)
.and(mapSheetMngHstEntity.mngYyyy.loe(endYyyy))
.and(mapSheetMngHstEntity.mapSheetNum.eq(mapSheetNum))
.and(mapSheetMngHstEntity.useInference.eq("USE"))
.and(
mapSheetMngHstEntity
.syncState
.eq("DONE")
.or(mapSheetMngHstEntity.syncCheckState.eq("DONE"))))
.fetchOne();
return countQuery;
}
@Override
public void updateException5kMapSheet(String mapSheetNum) {
long updateCount =
queryFactory
.update(mapInkx5kEntity)
.set(mapInkx5kEntity.useInference, CommonUseStatus.EXCEPT)
.where(mapInkx5kEntity.mapidcdNo.eq(mapSheetNum))
.execute();
}
} }

View File

@@ -42,7 +42,7 @@ public class MapSheetMngFileJobController {
} }
} }
@Scheduled(fixedDelay = 1000 * 5) @Scheduled(fixedDelay = 1000 * 10)
public void mngFileSyncJob00() { public void mngFileSyncJob00() {
if (!isSchedulerEnabled || !isFileSyncSchedulerEnabled) return; if (!isSchedulerEnabled || !isFileSyncSchedulerEnabled) return;

View File

@@ -76,7 +76,7 @@ public class MapSheetMngDto {
private String mapSheetPath; private String mapSheetPath;
private String syncTifFileName; private String syncTifFileName;
private String syncTfwFileName; private String syncTfwFileName;
private String useInference;
private String syncMngPath; private String syncMngPath;
} }
@@ -114,6 +114,18 @@ public class MapSheetMngDto {
private Long fileSize; private Long fileSize;
} }
@Schema(name = "MngListCompareDto", description = "영상파일 비교가능 이전년도정보")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public static class MngListCompareDto {
private String mngYyyy;
private String mapSheetNum;
private Integer beforeYear;
}
@Schema(name = "DmlReturn", description = "영상관리 DML 수행 후 리턴") @Schema(name = "DmlReturn", description = "영상관리 DML 수행 후 리턴")
@Getter @Getter
@Setter @Setter

View File

@@ -3,10 +3,12 @@ package com.kamco.cd.kamcoback.scheduler.service;
import static java.lang.String.CASE_INSENSITIVE_ORDER; import static java.lang.String.CASE_INSENSITIVE_ORDER;
import com.kamco.cd.kamcoback.common.utils.FIleChecker; import com.kamco.cd.kamcoback.common.utils.FIleChecker;
import com.kamco.cd.kamcoback.common.utils.FIleChecker.Basic;
import com.kamco.cd.kamcoback.postgres.core.MapSheetMngFileJobCoreService; import com.kamco.cd.kamcoback.postgres.core.MapSheetMngFileJobCoreService;
import com.kamco.cd.kamcoback.scheduler.dto.FileDto; import com.kamco.cd.kamcoback.scheduler.dto.FileDto;
import com.kamco.cd.kamcoback.scheduler.dto.FileDto.SrchFilesDepthDto; import com.kamco.cd.kamcoback.scheduler.dto.FileDto.SrchFilesDepthDto;
import com.kamco.cd.kamcoback.scheduler.dto.MapSheetMngDto; import com.kamco.cd.kamcoback.scheduler.dto.MapSheetMngDto.DmlReturn;
import com.kamco.cd.kamcoback.scheduler.dto.MapSheetMngDto.MngFileAddReq;
import com.kamco.cd.kamcoback.scheduler.dto.MapSheetMngDto.MngHstDto; import com.kamco.cd.kamcoback.scheduler.dto.MapSheetMngDto.MngHstDto;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@@ -45,6 +47,12 @@ public class MapSheetMngFileJobService {
@Value("${file.sync-file-extention}") @Value("${file.sync-file-extention}")
private String syncFileExtention; private String syncFileExtention;
@Value("${file.sync-auto-exception-start-year}")
private int syncAutoExceptionStartYear;
@Value("${file.sync-auto-exception-before-year-cnt}")
private int syncAutoExceptionBeforeYearCnt;
public Integer checkMngFileSync() { public Integer checkMngFileSync() {
return mapSheetMngFileJobCoreService.findNotYetMapSheetMng(); return mapSheetMngFileJobCoreService.findNotYetMapSheetMng();
} }
@@ -62,7 +70,7 @@ public class MapSheetMngFileJobService {
int mngYyyy = 0; int mngYyyy = 0;
SrchFilesDepthDto srchDto = new SrchFilesDepthDto(); SrchFilesDepthDto srchDto = new SrchFilesDepthDto();
List<FIleChecker.Basic> basicList = new ArrayList<>(); List<Basic> basicList = new ArrayList<>();
if (mapSheetFileNotYetList.size() >= 1) { if (mapSheetFileNotYetList.size() >= 1) {
mngYyyy = mapSheetFileNotYetList.get(0).getMngYyyy(); mngYyyy = mapSheetFileNotYetList.get(0).getMngYyyy();
@@ -70,8 +78,14 @@ public class MapSheetMngFileJobService {
for (MngHstDto item : mapSheetFileNotYetList) { for (MngHstDto item : mapSheetFileNotYetList) {
// 5K도엽 자동추론제외
Long exceptCheckCnt =
this.mapSheetAutoExceptionUpdate(item.getMngYyyy(), item.getMapSheetNum());
// 도엽별 파일 체크 진행중으로 변경 // 도엽별 파일 체크 진행중으로 변경
item.setDataState("PROCESSING"); item.setDataState("PROCESSING");
item.setUseInference("USE");
if (exceptCheckCnt == 0) item.setUseInference("EXCEPT");
mngHstDataSyncStateUpdate(item); mngHstDataSyncStateUpdate(item);
// 1. MngHstDto 객체의 필드 값에 접근 // 1. MngHstDto 객체의 필드 값에 접근
@@ -121,12 +135,12 @@ public class MapSheetMngFileJobService {
if (tfwCnt == 0 && tifCnt == 0) syncState = "NOFILE"; if (tfwCnt == 0 && tifCnt == 0) syncState = "NOFILE";
for (FIleChecker.Basic item2 : basicList) { for (Basic item2 : basicList) {
// System.out.println("path: " + item2.getParentPath()); // System.out.println("path: " + item2.getParentPath());
// System.out.println("path: " + item2.getFileNm()); // System.out.println("path: " + item2.getFileNm());
// System.out.println("path: " + item2.getFullPath()); // System.out.println("path: " + item2.getFullPath());
MapSheetMngDto.MngFileAddReq addReq = new MapSheetMngDto.MngFileAddReq(); MngFileAddReq addReq = new MngFileAddReq();
addReq.setMngYyyy(item.getMngYyyy()); addReq.setMngYyyy(item.getMngYyyy());
addReq.setMapSheetNum(item.getMapSheetNum()); addReq.setMapSheetNum(item.getMapSheetNum());
addReq.setRefMapSheetNum(item.getRefMapSheetNum()); addReq.setRefMapSheetNum(item.getRefMapSheetNum());
@@ -175,13 +189,15 @@ public class MapSheetMngFileJobService {
} }
addReq.setFileState(fileState); addReq.setFileState(fileState);
MapSheetMngDto.DmlReturn DmlReturn = mngDataSave(addReq); DmlReturn DmlReturn = mngDataSave(addReq);
} }
// 도엽별 파일 체크 완료로 변경 // 도엽별 파일 체크 완료로 변경
item.setDataState("DONE"); item.setDataState("DONE");
if (syncState.isEmpty()) syncState = "DONE"; if (syncState.isEmpty()) syncState = "DONE";
item.setSyncState(syncState); item.setSyncState(syncState);
mngHstDataSyncStateUpdate(item); mngHstDataSyncStateUpdate(item);
} }
@@ -211,6 +227,34 @@ public class MapSheetMngFileJobService {
return notyetCnt; return notyetCnt;
} }
public Long mapSheetAutoExceptionUpdate(int mngYyyy, String mapSheetNum) {
// 2025년 이전 파일싱크는 무조건 이전3년이 존재하지 않으므로 자동추론제외를 진행하지 않는다.(전년도 파일이 무조건 존재하는 것으로 리턴)
if (syncAutoExceptionStartYear > mngYyyy) return 1L;
// List<String> mapSheetNums = new ArrayList<>();
// mapSheetNums.add(mapSheetNum);
int strtYyyy = mngYyyy - syncAutoExceptionBeforeYearCnt;
int endYyyy = mngYyyy - 1;
// 이전년도가 3개년인 도엽 확인
Long beforeCnt =
mapSheetMngFileJobCoreService.findByHstMapSheetBeforeYyyyListCount(
strtYyyy, endYyyy, mapSheetNum);
System.out.println("mapSheetAutoExceptionUpdate mapSheetNum == " + mapSheetNum);
System.out.println("mapSheetAutoExceptionUpdate strtYyyy == " + strtYyyy);
System.out.println("mapSheetAutoExceptionUpdate endYyyy == " + endYyyy);
System.out.println("mapSheetAutoExceptionUpdate beforeCnt == " + beforeCnt);
if (beforeCnt == 0) {
System.out.println("mapSheetAutoExceptionUpdate inference == 자동추론제외");
mapSheetMngFileJobCoreService.updateException5kMapSheet(mapSheetNum);
}
return beforeCnt;
}
public List<MngHstDto> findTargetMapSheetFileList(long targetNum, int pageSize) { public List<MngHstDto> findTargetMapSheetFileList(long targetNum, int pageSize) {
return mapSheetMngFileJobCoreService.findTargetMapSheetFileList(targetNum, pageSize); return mapSheetMngFileJobCoreService.findTargetMapSheetFileList(targetNum, pageSize);
} }
@@ -219,11 +263,11 @@ public class MapSheetMngFileJobService {
return mapSheetMngFileJobCoreService.findByMngYyyyTargetMapSheetNotYetCount(mngYyyy); return mapSheetMngFileJobCoreService.findByMngYyyyTargetMapSheetNotYetCount(mngYyyy);
} }
public MapSheetMngDto.DmlReturn mngHstDataSyncStateUpdate(MapSheetMngDto.MngHstDto UpdateReq) { public DmlReturn mngHstDataSyncStateUpdate(MngHstDto UpdateReq) {
return mapSheetMngFileJobCoreService.mngHstDataSyncStateUpdate(UpdateReq); return mapSheetMngFileJobCoreService.mngHstDataSyncStateUpdate(UpdateReq);
} }
public MapSheetMngDto.DmlReturn mngDataSave(MapSheetMngDto.MngFileAddReq AddReq) { public DmlReturn mngDataSave(MngFileAddReq AddReq) {
return mapSheetMngFileJobCoreService.mngFileSave(AddReq); return mapSheetMngFileJobCoreService.mngFileSave(AddReq);
} }

View File

@@ -92,6 +92,8 @@ file:
sync-root-dir: /kamco-nfs/images/ sync-root-dir: /kamco-nfs/images/
sync-tmp-dir: ${file.sync-root-dir}/tmp sync-tmp-dir: ${file.sync-root-dir}/tmp
sync-file-extention: tfw,tif sync-file-extention: tfw,tif
sync-auto-exception-start-year: 2025
sync-auto-exception-before-year-cnt: 3
#dataset-dir: D:/kamco-nfs/dataset/ #dataset-dir: D:/kamco-nfs/dataset/
dataset-dir: /kamco-nfs/dataset/export/ dataset-dir: /kamco-nfs/dataset/export/

View File

@@ -87,8 +87,3 @@ inference:
batch-url: http://10.100.0.11:8000/batches batch-url: http://10.100.0.11:8000/batches
geojson-dir: /kamco-nfs/requests/ geojson-dir: /kamco-nfs/requests/
jar-path: jar/makeshp-1.0.0.jar jar-path: jar/makeshp-1.0.0.jar
gukyuin:
#url: http://localhost:8080
url: http://192.168.2.129:5301
mast: ${gukyuin.url}/api/kcd/cdi/chn/mast

View File

@@ -47,6 +47,8 @@ file:
sync-root-dir: /kamco-nfs/images/ sync-root-dir: /kamco-nfs/images/
sync-tmp-dir: ${file.sync-root-dir}/tmp sync-tmp-dir: ${file.sync-root-dir}/tmp
sync-file-extention: tfw,tif sync-file-extention: tfw,tif
sync-auto-exception-start-year: 2025
sync-auto-exception-before-year-cnt: 3
#dataset-dir: D:/kamco-nfs/dataset/ #dataset-dir: D:/kamco-nfs/dataset/
dataset-dir: /kamco-nfs/dataset/export/ dataset-dir: /kamco-nfs/dataset/export/