파일싱크 수정
This commit is contained in:
@@ -157,7 +157,8 @@ public class FIleChecker {
|
||||
//윈도우용
|
||||
command.add("cmd.exe"); // 윈도우 명령 프롬프트 실행
|
||||
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("|");
|
||||
command.add("findstr");
|
||||
|
||||
@@ -108,7 +108,7 @@ public class MapSheetMngFileCheckerApiController {
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@PostMapping("/sync-process")
|
||||
public ApiResponseDto<MapSheetMngDto.DmlReturn> uploadProcess(
|
||||
public ApiResponseDto<ImageryDto.SyncReturn> syncProcess(
|
||||
@RequestBody @Valid ImageryDto.searchReq searchReq) {
|
||||
return ApiResponseDto.ok(mapSheetMngFileCheckerService.syncProcess(searchReq));
|
||||
}
|
||||
|
||||
@@ -83,6 +83,18 @@ public class ImageryDto {
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,35 +36,35 @@ public class MapSheetMngFileCheckerCoreService {
|
||||
private String activeEnv;
|
||||
|
||||
|
||||
public MapSheetMngDto.DmlReturn syncProcess(ImageryDto.searchReq searchReq) {
|
||||
int count = 0;
|
||||
public ImageryDto.SyncReturn syncProcess(ImageryDto.searchReq searchReq) {
|
||||
String flag = "SUCCESS";
|
||||
int syncCnt = 0;
|
||||
int tfwErrCnt = 0;
|
||||
int tifErrCnt = 0;
|
||||
|
||||
//대상파일목록 가저오기
|
||||
Page<ImageryDto.SyncDto> pageImagerySyncDto = mapSheetMngFileCheckerRepository.findImagerySyncList(searchReq);
|
||||
|
||||
|
||||
for (ImageryDto.SyncDto dto : pageImagerySyncDto.getContent()) {
|
||||
|
||||
boolean isTfwFile = true;
|
||||
isTfwFile = FIleChecker.checkTfw(dto.getMiddlePath()+dto.getFilename());
|
||||
|
||||
//boolean isCogTiffFile = true;
|
||||
//isCogTiffFile = FIleChecker.checkGeoTiff("D:\\kamco_cog\\36713\\36713073_cog.tif");
|
||||
|
||||
boolean isGdalInfoTiffFile = true;
|
||||
//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);
|
||||
// 여기에 처리 로직 작성
|
||||
isGdalInfoTiffFile = FIleChecker.cmmndGdalInfo(dto.getCogMiddlePath()+dto.getCogFilename());
|
||||
//isGdalInfoTiffFile = FIleChecker.cmmndGdalInfo("D:/kamco_cog/36713/36713073_cog.tif");
|
||||
|
||||
syncCnt = syncCnt + 1;
|
||||
if( !isTfwFile )tfwErrCnt = tfwErrCnt + 1;
|
||||
if( !isGdalInfoTiffFile )tifErrCnt = tifErrCnt + 1;
|
||||
|
||||
// 예: 특정 작업 수행
|
||||
// someService.process(dto);
|
||||
}
|
||||
|
||||
return new MapSheetMngDto.DmlReturn("success", count + "개 업로드 성공하였습니다.");
|
||||
if( tfwErrCnt > 0 || tifErrCnt > 0 )flag = "ERROR";
|
||||
|
||||
return new ImageryDto.SyncReturn(flag, syncCnt, tfwErrCnt, tifErrCnt);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user