feat/infer_dev_260107 #1
@@ -204,12 +204,12 @@ public class MapSheetMngApiController {
|
|||||||
@PostMapping(value = "/upload-pair", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
@PostMapping(value = "/upload-pair", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||||
public ApiResponseDto<MapSheetMngDto.DmlReturn> uploadPair(
|
public ApiResponseDto<MapSheetMngDto.DmlReturn> uploadPair(
|
||||||
@RequestPart("tfw") MultipartFile tfwFile,
|
@RequestPart("tfw") MultipartFile tfwFile,
|
||||||
@RequestPart("tif") MultipartFile tifFile,
|
@RequestParam(value = "tifFileName") String tifFile,
|
||||||
@RequestParam(value = "hstUid", required = false) Long hstUid,
|
@RequestParam(value = "tifFileSize") Long tifFileSize,
|
||||||
@RequestParam(value = "overwrite", required = false) boolean overwrite) {
|
@RequestParam(value = "hstUid", required = false) Long hstUid) {
|
||||||
|
|
||||||
return ApiResponseDto.createOK(
|
return ApiResponseDto.createOK(
|
||||||
mapSheetMngService.uploadPair(tfwFile, tifFile, hstUid, overwrite));
|
mapSheetMngService.uploadPair(tfwFile, tifFile, hstUid, tifFileSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "영상관리 > 파일조회", description = "영상관리 > 파일조회")
|
@Operation(summary = "영상관리 > 파일조회", description = "영상관리 > 파일조회")
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ public class MapSheetMngService {
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public DmlReturn uploadPair(
|
public DmlReturn uploadPair(
|
||||||
MultipartFile tfwFile, MultipartFile tifFile, Long hstUid, Boolean overwrite) {
|
MultipartFile tfwFile, String tifFile, Long hstUid, Long tifFileSize) {
|
||||||
|
|
||||||
String rootPath = syncRootDir;
|
String rootPath = syncRootDir;
|
||||||
String tmpPath = syncTmpDir;
|
String tmpPath = syncTmpDir;
|
||||||
@@ -134,7 +134,7 @@ public class MapSheetMngService {
|
|||||||
MngDto mngDto = mapSheetMngCoreService.findMapSheetMng(errDto.getMngYyyy());
|
MngDto mngDto = mapSheetMngCoreService.findMapSheetMng(errDto.getMngYyyy());
|
||||||
String targetYearDir = mngDto.getMngPath();
|
String targetYearDir = mngDto.getMngPath();
|
||||||
|
|
||||||
// 중복체크 -> 도엽/uuid 경로에 업로드 할 거라 overwrite 되지 않음
|
// 중복체크 -> 도엽50k/uuid 경로에 업로드 할 거라 overwrite 되지 않음
|
||||||
// if (!overwrite) {
|
// if (!overwrite) {
|
||||||
// dmlReturn =
|
// dmlReturn =
|
||||||
// this.duplicateFile(
|
// this.duplicateFile(
|
||||||
@@ -146,7 +146,7 @@ public class MapSheetMngService {
|
|||||||
|
|
||||||
// 멀티파트 파일 tmp폴더 저장(파일형식 체크를 위해)
|
// 멀티파트 파일 tmp폴더 저장(파일형식 체크를 위해)
|
||||||
String tfwTmpPath = tmpPath + tfwFile.getOriginalFilename();
|
String tfwTmpPath = tmpPath + tfwFile.getOriginalFilename();
|
||||||
String tifTmpPath = tmpPath + tifFile.getOriginalFilename();
|
String tifTmpPath = tmpPath + tifFile;
|
||||||
|
|
||||||
if (!FIleChecker.multipartSaveTo(tfwFile, tfwTmpPath)) {
|
if (!FIleChecker.multipartSaveTo(tfwFile, tfwTmpPath)) {
|
||||||
return new DmlReturn("fail", "UPLOAD ERROR");
|
return new DmlReturn("fail", "UPLOAD ERROR");
|
||||||
@@ -194,7 +194,7 @@ public class MapSheetMngService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tfwTargetPath = Paths.get(uploadPath).resolve(tfwFile.getOriginalFilename());
|
tfwTargetPath = Paths.get(uploadPath).resolve(tfwFile.getOriginalFilename());
|
||||||
tifTargetPath = Paths.get(uploadPath).resolve(tifFile.getOriginalFilename());
|
tifTargetPath = Paths.get(uploadPath).resolve(tifFile);
|
||||||
|
|
||||||
if (!Files.exists(tifTargetPath)) {
|
if (!Files.exists(tifTargetPath)) {
|
||||||
return new DmlReturn("fail", "TIF 파일이 정상적으로 업로드 되지 않았습니다. 확인해주세요.");
|
return new DmlReturn("fail", "TIF 파일이 정상적으로 업로드 되지 않았습니다. 확인해주세요.");
|
||||||
@@ -213,7 +213,7 @@ public class MapSheetMngService {
|
|||||||
updReqSyncCheckState.setHstUid(hstUid);
|
updReqSyncCheckState.setHstUid(hstUid);
|
||||||
updReqSyncCheckState.setFilePath(uploadPath);
|
updReqSyncCheckState.setFilePath(uploadPath);
|
||||||
updReqSyncCheckState.setSyncCheckTfwFileName(tfwFile.getOriginalFilename());
|
updReqSyncCheckState.setSyncCheckTfwFileName(tfwFile.getOriginalFilename());
|
||||||
updReqSyncCheckState.setSyncCheckTifFileName(tifFile.getOriginalFilename());
|
updReqSyncCheckState.setSyncCheckTifFileName(tifFile);
|
||||||
updReqSyncCheckState.setSyncCheckState("DONE");
|
updReqSyncCheckState.setSyncCheckState("DONE");
|
||||||
mapSheetMngCoreService.updateMapSheetMngHstSyncCheckState(updReqSyncCheckState);
|
mapSheetMngCoreService.updateMapSheetMngHstSyncCheckState(updReqSyncCheckState);
|
||||||
// 파일정보 업데이트
|
// 파일정보 업데이트
|
||||||
@@ -233,9 +233,9 @@ public class MapSheetMngService {
|
|||||||
|
|
||||||
mapSheetMngCoreService.mngFileSave(addReq);
|
mapSheetMngCoreService.mngFileSave(addReq);
|
||||||
|
|
||||||
addReq.setFileName(tifFile.getOriginalFilename());
|
addReq.setFileName(tifFile);
|
||||||
addReq.setFileExt("tif");
|
addReq.setFileExt("tif");
|
||||||
addReq.setFileSize(tifFile.getSize());
|
addReq.setFileSize(tifFileSize);
|
||||||
mapSheetMngCoreService.mngFileSave(addReq);
|
mapSheetMngCoreService.mngFileSave(addReq);
|
||||||
|
|
||||||
return new DmlReturn("success", "파일 업로드 완료되었습니다.");
|
return new DmlReturn("success", "파일 업로드 완료되었습니다.");
|
||||||
@@ -279,14 +279,12 @@ public class MapSheetMngService {
|
|||||||
return new DmlReturn("success", fileUids.size() + "개 파일이 사용설정되었습니다.");
|
return new DmlReturn("success", fileUids.size() + "개 파일이 사용설정되었습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public DmlReturn validationFile(MultipartFile tfwFile, MultipartFile tifFile) {
|
public DmlReturn validationFile(MultipartFile tfwFile, String tifFile) {
|
||||||
if (!FIleChecker.validationMultipart(tfwFile)) {
|
if (!FIleChecker.validationMultipart(tfwFile)) {
|
||||||
return new DmlReturn("fail", "TFW SIZE 오류");
|
return new DmlReturn("fail", "TFW SIZE 오류");
|
||||||
} else if (!FIleChecker.validationMultipart(tifFile)) {
|
|
||||||
return new DmlReturn("fail", "TFW SIZE 오류");
|
|
||||||
} else if (!FIleChecker.checkExtensions(tfwFile.getOriginalFilename(), "tfw")) {
|
} else if (!FIleChecker.checkExtensions(tfwFile.getOriginalFilename(), "tfw")) {
|
||||||
return new DmlReturn("fail", "TFW FILENAME ERROR");
|
return new DmlReturn("fail", "TFW FILENAME ERROR");
|
||||||
} else if (!FIleChecker.checkExtensions(tifFile.getOriginalFilename(), "tif")) {
|
} else if (!FIleChecker.checkExtensions(tifFile, "tif")) {
|
||||||
return new DmlReturn("fail", "TIF FILENAME ERROR");
|
return new DmlReturn("fail", "TIF FILENAME ERROR");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -132,15 +132,6 @@ public class MapSheetMngFileJobService {
|
|||||||
|
|
||||||
if (tfwCnt == 0 && tifCnt == 0) {
|
if (tfwCnt == 0 && tifCnt == 0) {
|
||||||
syncState = "NOFILE";
|
syncState = "NOFILE";
|
||||||
|
|
||||||
item.setUseInference("EXCEPT"); // hst 테이블 use_inference EXCEPT 하기
|
|
||||||
// tb_map_inkx_5k 테이블 자동 추론제외 update
|
|
||||||
mapSheetMngFileJobCoreService.updateException5kMapSheet(
|
|
||||||
item.getMapSheetNum(), CommonUseStatus.AUTO_EXCEPT);
|
|
||||||
} else {
|
|
||||||
// tb_map_inkx_5k 테이블 자동 추론제외 해제 -> 사용으로 처리
|
|
||||||
mapSheetMngFileJobCoreService.updateException5kMapSheet(
|
|
||||||
item.getMapSheetNum(), CommonUseStatus.USE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Basic item2 : basicList) {
|
for (Basic item2 : basicList) {
|
||||||
@@ -199,9 +190,19 @@ public class MapSheetMngFileJobService {
|
|||||||
// 도엽별 파일 체크 완료로 변경
|
// 도엽별 파일 체크 완료로 변경
|
||||||
item.setDataState("DONE");
|
item.setDataState("DONE");
|
||||||
|
|
||||||
|
// syncState가 DONE 이 아닐 때 자동추론 제외, DONE 이면 사용 처리
|
||||||
if (syncState.isEmpty()) {
|
if (syncState.isEmpty()) {
|
||||||
syncState = "DONE";
|
syncState = "DONE";
|
||||||
|
// tb_map_inkx_5k 테이블 자동 추론제외 해제 -> 사용으로 처리
|
||||||
|
mapSheetMngFileJobCoreService.updateException5kMapSheet(
|
||||||
|
item.getMapSheetNum(), CommonUseStatus.USE);
|
||||||
|
} else {
|
||||||
|
item.setUseInference("EXCEPT"); // hst 테이블 use_inference EXCEPT 하기
|
||||||
|
// tb_map_inkx_5k 테이블 자동 추론제외 update
|
||||||
|
mapSheetMngFileJobCoreService.updateException5kMapSheet(
|
||||||
|
item.getMapSheetNum(), CommonUseStatus.AUTO_EXCEPT);
|
||||||
}
|
}
|
||||||
|
|
||||||
item.setSyncState(syncState);
|
item.setSyncState(syncState);
|
||||||
|
|
||||||
mngHstDataSyncStateUpdate(item);
|
mngHstDataSyncStateUpdate(item);
|
||||||
|
|||||||
Reference in New Issue
Block a user