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