feat: 업로드 경로 check
This commit is contained in:
@@ -19,11 +19,13 @@ import java.nio.file.Paths;
|
|||||||
import java.nio.file.StandardCopyOption;
|
import java.nio.file.StandardCopyOption;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
@@ -85,6 +87,7 @@ public class MapSheetMngService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 파일검증용 임시저장 폴더 확인
|
// 파일검증용 임시저장 폴더 확인
|
||||||
|
log.info("TmpPath > {}", tmpPath);
|
||||||
if (!FIleChecker.mkDir(tmpPath)) {
|
if (!FIleChecker.mkDir(tmpPath)) {
|
||||||
return new DmlReturn("fail", "CREATE TEMP FOLDER ERROR");
|
return new DmlReturn("fail", "CREATE TEMP FOLDER ERROR");
|
||||||
}
|
}
|
||||||
@@ -127,10 +130,15 @@ public class MapSheetMngService {
|
|||||||
|
|
||||||
if (tfwCnt > 0 || tifCnt > 0) {
|
if (tfwCnt > 0 || tifCnt > 0) {
|
||||||
String tfwtifMsg = "";
|
String tfwtifMsg = "";
|
||||||
if (tfwCnt > 0) tfwtifMsg = tfwFile.getOriginalFilename();
|
if (tfwCnt > 0) {
|
||||||
|
tfwtifMsg = tfwFile.getOriginalFilename();
|
||||||
|
}
|
||||||
if (tifCnt > 0) {
|
if (tifCnt > 0) {
|
||||||
if (tfwCnt > 0) tfwtifMsg = "," + tifFile.getOriginalFilename();
|
if (tfwCnt > 0) {
|
||||||
else tfwtifMsg = tifFile.getOriginalFilename();
|
tfwtifMsg = "," + tifFile.getOriginalFilename();
|
||||||
|
} else {
|
||||||
|
tfwtifMsg = tifFile.getOriginalFilename();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return new DmlReturn("duplicate", tfwtifMsg);
|
return new DmlReturn("duplicate", tfwtifMsg);
|
||||||
}
|
}
|
||||||
@@ -149,8 +157,12 @@ public class MapSheetMngService {
|
|||||||
return new DmlReturn("fail", "UPLOAD ERROR");
|
return new DmlReturn("fail", "UPLOAD ERROR");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!FIleChecker.cmmndGdalInfo(tifTmpPath)) return new DmlReturn("fail", "TIF TYPE ERROR");
|
if (!FIleChecker.cmmndGdalInfo(tifTmpPath)) {
|
||||||
if (!FIleChecker.checkTfw(tfwTmpPath)) return new DmlReturn("fail", "TFW TYPE ERROR");
|
return new DmlReturn("fail", "TIF TYPE ERROR");
|
||||||
|
}
|
||||||
|
if (!FIleChecker.checkTfw(tfwTmpPath)) {
|
||||||
|
return new DmlReturn("fail", "TFW TYPE ERROR");
|
||||||
|
}
|
||||||
|
|
||||||
// 싱크파일목록으로 업로드 경로 확인
|
// 싱크파일목록으로 업로드 경로 확인
|
||||||
List<MngFilesDto> mngFiles = mapSheetMngCoreService.findIdToMapSheetFileList(hstUid);
|
List<MngFilesDto> mngFiles = mapSheetMngCoreService.findIdToMapSheetFileList(hstUid);
|
||||||
@@ -247,7 +259,9 @@ public class MapSheetMngService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 중복제거 확인후 처리상태(DONE)변경
|
// 중복제거 확인후 처리상태(DONE)변경
|
||||||
if (hstUid > 0) mapSheetMngCoreService.updateByHstUidSyncCheckState(hstUid);
|
if (hstUid > 0) {
|
||||||
|
mapSheetMngCoreService.updateByHstUidSyncCheckState(hstUid);
|
||||||
|
}
|
||||||
|
|
||||||
return new DmlReturn("success", fileUids.size() + "개 파일이 삭제되었습니다.");
|
return new DmlReturn("success", fileUids.size() + "개 파일이 삭제되었습니다.");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user