영상관리파일삭제, 년도목록 조회 수정

This commit is contained in:
Moon
2025-12-18 10:59:09 +09:00
parent 9d1d9aff69
commit 21f1e9fc3c
8 changed files with 199 additions and 193 deletions

View File

@@ -2,17 +2,12 @@ package com.kamco.cd.kamcoback.mapsheet.service;
import static java.lang.String.CASE_INSENSITIVE_ORDER;
import com.kamco.cd.kamcoback.common.exception.DuplicateFileException;
import com.kamco.cd.kamcoback.common.exception.ValidationException;
import com.kamco.cd.kamcoback.common.utils.FIleChecker;
import com.kamco.cd.kamcoback.config.FileConfig;
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto;
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.FilesDto;
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.SrchFilesDepthDto;
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.SrchFilesDto;
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto;
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.DmlReturn;
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.ErrorDataDto;
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.MngFilesDto;
import com.kamco.cd.kamcoback.postgres.core.MapSheetMngCoreService;
import jakarta.validation.Valid;
@@ -224,11 +219,16 @@ public class MapSheetMngService {
return mapSheetMngCoreService.findMapSheetMngList();
}
public List<Integer> findMapSheetMngYyyyList() {
return mapSheetMngCoreService.findMapSheetMngYyyyList();
}
public MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy) {
return mapSheetMngCoreService.findMapSheetMng(mngYyyy);
}
@Transactional
public MapSheetMngDto.DmlReturn mngComplete(int mngYyyy) {
@@ -272,59 +272,55 @@ public class MapSheetMngService {
@Transactional
public DmlReturn uploadPair(
MultipartFile tfwFile,
MultipartFile tifFile,
//String targetPath,
Long hstUid) {
MultipartFile tfwFile,
MultipartFile tifFile,
// String targetPath,
Long hstUid) {
// 파일 유효성 검증
if (tfwFile == null || tfwFile.isEmpty() || tfwFile.getSize() == 0) {
return new DmlReturn("fail", "TFW SIZE 오류");
}else if (tifFile == null || tifFile.isEmpty() || tifFile.getSize() == 0) {
return new DmlReturn("fail", "TIF SIZE 오류");
}
// 파일 유효성 검증
if (tfwFile == null || tfwFile.isEmpty() || tfwFile.getSize() == 0) {
return new DmlReturn("fail", "TFW SIZE 오류");
} else if (tifFile == null || tifFile.isEmpty() || tifFile.getSize() == 0) {
return new DmlReturn("fail", "TIF SIZE 오류");
}
if( ! tfwFile.getOriginalFilename()
.substring(tfwFile.getOriginalFilename().lastIndexOf('.') + 1)
.toLowerCase()
.equals("tfw") )
{
return new DmlReturn("fail", "TFW TYPE ERROR");
}else if( ! tifFile.getOriginalFilename()
if (!tfwFile
.getOriginalFilename()
.substring(tfwFile.getOriginalFilename().lastIndexOf('.') + 1)
.toLowerCase()
.equals("tfw")) {
return new DmlReturn("fail", "TFW TYPE ERROR");
} else if (!tifFile
.getOriginalFilename()
.substring(tifFile.getOriginalFilename().lastIndexOf('.') + 1)
.toLowerCase()
.equals("tif") )
{
return new DmlReturn("fail", "TIF TYPE ERROR");
}
.equals("tif")) {
return new DmlReturn("fail", "TIF TYPE ERROR");
}
//싱크파일목록 가저오기
List<MngFilesDto> mngFiles = mapSheetMngCoreService.findIdToMapSheetFileList(hstUid);
String uploadPath = "";
for (MngFilesDto dto : mngFiles) {
uploadPath = dto.getFilePath();
break;
}
// 싱크파일목록 가저오기
List<MngFilesDto> mngFiles = mapSheetMngCoreService.findIdToMapSheetFileList(hstUid);
String uploadPath = "";
for (MngFilesDto dto : mngFiles) {
uploadPath = dto.getFilePath();
break;
}
if( uploadPath.isEmpty() ) {
//ErrorDataDto errDto = mapSheetMngCoreService.findMapSheetError(hstUid);
//uploadPath = FileConfig.rootSyncDir+"\\"+errDto.getMapSheetNum();
}
if (uploadPath.isEmpty()) {
// ErrorDataDto errDto = mapSheetMngCoreService.findMapSheetError(hstUid);
// uploadPath = FileConfig.rootSyncDir+"\\"+errDto.getMapSheetNum();
}
//tfw가 있는 경우
//tif가 있는 경우
// tfw가 있는 경우
// tif가 있는 경우
return new DmlReturn("success", "파일 업로드 완료되었습니다.");
}
public List<MapSheetMngDto.MngFilesDto> findHstUidToMapSheetFileList(Long hstUid) {
return mapSheetMngCoreService.findHstUidToMapSheetFileList(hstUid);
}
@Transactional
public MapSheetMngDto.DmlReturn deleteByFileUidMngFile(List<Long> fileUids) {
@@ -334,5 +330,4 @@ public class MapSheetMngService {
return new MapSheetMngDto.DmlReturn("success", fileUids.size() + "개 파일이 삭제되었습니다.");
}
}