파일싱크 수정

This commit is contained in:
Harry M. You
2025-12-05 16:42:44 +09:00
parent fba9a14035
commit 21cc84f86a
5 changed files with 29 additions and 16 deletions

View File

@@ -157,7 +157,8 @@ public class FIleChecker {
//윈도우용 //윈도우용
command.add("cmd.exe"); // 윈도우 명령 프롬프트 실행 command.add("cmd.exe"); // 윈도우 명령 프롬프트 실행
command.add("/c"); // 명령어를 수행하고 종료한다는 옵션 command.add("/c"); // 명령어를 수행하고 종료한다는 옵션
command.add("C:\\Program Files\\QGIS 3.44.4\\bin\\gdalinfo"); //command.add("C:\\Program Files\\QGIS 3.44.4\\bin\\gdalinfo");
command.add("gdalinfo");
command.add(filePath); command.add(filePath);
command.add("|"); command.add("|");
command.add("findstr"); command.add("findstr");

View File

@@ -108,7 +108,7 @@ public class MapSheetMngFileCheckerApiController {
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
}) })
@PostMapping("/sync-process") @PostMapping("/sync-process")
public ApiResponseDto<MapSheetMngDto.DmlReturn> uploadProcess( public ApiResponseDto<ImageryDto.SyncReturn> syncProcess(
@RequestBody @Valid ImageryDto.searchReq searchReq) { @RequestBody @Valid ImageryDto.searchReq searchReq) {
return ApiResponseDto.ok(mapSheetMngFileCheckerService.syncProcess(searchReq)); return ApiResponseDto.ok(mapSheetMngFileCheckerService.syncProcess(searchReq));
} }

View File

@@ -83,6 +83,18 @@ public class ImageryDto {
private Long hstUid; private Long hstUid;
} }
@Schema(name = "SyncReturn", description = "영상파일싱크 수행 후 리턴")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public static class SyncReturn {
private String flag;
private int syncCnt;
private int tfwErrCnt;
private int tifErrCnt;
}
} }

View File

@@ -303,7 +303,7 @@ public class MapSheetMngFileCheckerService {
} }
public MapSheetMngDto.DmlReturn syncProcess(ImageryDto.searchReq searchReq) { public ImageryDto.SyncReturn syncProcess(ImageryDto.searchReq searchReq) {
return mapSheetMngFileCheckerCoreService.syncProcess(searchReq); return mapSheetMngFileCheckerCoreService.syncProcess(searchReq);
} }

View File

@@ -36,35 +36,35 @@ public class MapSheetMngFileCheckerCoreService {
private String activeEnv; private String activeEnv;
public MapSheetMngDto.DmlReturn syncProcess(ImageryDto.searchReq searchReq) { public ImageryDto.SyncReturn syncProcess(ImageryDto.searchReq searchReq) {
int count = 0; String flag = "SUCCESS";
int syncCnt = 0;
int tfwErrCnt = 0;
int tifErrCnt = 0;
//대상파일목록 가저오기 //대상파일목록 가저오기
Page<ImageryDto.SyncDto> pageImagerySyncDto = mapSheetMngFileCheckerRepository.findImagerySyncList(searchReq); Page<ImageryDto.SyncDto> pageImagerySyncDto = mapSheetMngFileCheckerRepository.findImagerySyncList(searchReq);
for (ImageryDto.SyncDto dto : pageImagerySyncDto.getContent()) { for (ImageryDto.SyncDto dto : pageImagerySyncDto.getContent()) {
boolean isTfwFile = true; boolean isTfwFile = true;
isTfwFile = FIleChecker.checkTfw(dto.getMiddlePath()+dto.getFilename()); isTfwFile = FIleChecker.checkTfw(dto.getMiddlePath()+dto.getFilename());
//boolean isCogTiffFile = true;
//isCogTiffFile = FIleChecker.checkGeoTiff("D:\\kamco_cog\\36713\\36713073_cog.tif");
boolean isGdalInfoTiffFile = true; boolean isGdalInfoTiffFile = true;
//isGdalInfoTiffFile = FIleChecker.cmmndGdalInfo("D:\\kamco_cog\\36713\\36713073_cog.tif"); isGdalInfoTiffFile = FIleChecker.cmmndGdalInfo(dto.getCogMiddlePath()+dto.getCogFilename());
isGdalInfoTiffFile = FIleChecker.cmmndGdalInfo("D:/kamco_cog/36713/36713073_cog.tif"); //isGdalInfoTiffFile = FIleChecker.cmmndGdalInfo("D:/kamco_cog/36713/36713073_cog.tif");
System.out.println("isTfwFile == " + isTfwFile);
System.out.println("isGdalInfoTiffFile == " + isGdalInfoTiffFile);
// 여기에 처리 로직 작성
syncCnt = syncCnt + 1;
if( !isTfwFile )tfwErrCnt = tfwErrCnt + 1;
if( !isGdalInfoTiffFile )tifErrCnt = tifErrCnt + 1;
// 예: 특정 작업 수행 // 예: 특정 작업 수행
// someService.process(dto); // someService.process(dto);
} }
return new MapSheetMngDto.DmlReturn("success", count + "개 업로드 성공하였습니다."); if( tfwErrCnt > 0 || tifErrCnt > 0 )flag = "ERROR";
return new ImageryDto.SyncReturn(flag, syncCnt, tfwErrCnt, tifErrCnt);
} }
} }