영상관리 중복파일제거 수정
This commit is contained in:
@@ -5,11 +5,15 @@ 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;
|
||||
import java.io.File;
|
||||
@@ -267,7 +271,7 @@ public class MapSheetMngService {
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public MapSheetMngDto.DmlReturn uploadPair(
|
||||
public DmlReturn uploadPair(
|
||||
MultipartFile tfwFile,
|
||||
MultipartFile tifFile,
|
||||
//String targetPath,
|
||||
@@ -275,9 +279,9 @@ public class MapSheetMngService {
|
||||
|
||||
// 파일 유효성 검증
|
||||
if (tfwFile == null || tfwFile.isEmpty() || tfwFile.getSize() == 0) {
|
||||
return new MapSheetMngDto.DmlReturn("fail", "TFW 파일이(0Byte) 비어있습니다.");
|
||||
return new DmlReturn("fail", "TFW SIZE 오류");
|
||||
}else if (tifFile == null || tifFile.isEmpty() || tifFile.getSize() == 0) {
|
||||
return new MapSheetMngDto.DmlReturn("fail", "TIF 파일이(0Byte) 비어있습니다.");
|
||||
return new DmlReturn("fail", "TIF SIZE 오류");
|
||||
}
|
||||
|
||||
if( ! tfwFile.getOriginalFilename()
|
||||
@@ -285,19 +289,39 @@ public class MapSheetMngService {
|
||||
.toLowerCase()
|
||||
.equals("tfw") )
|
||||
{
|
||||
return new MapSheetMngDto.DmlReturn("fail", "파일명이 TFW형식이 아닙니다.");
|
||||
return new DmlReturn("fail", "TFW TYPE ERROR");
|
||||
}else if( ! tifFile.getOriginalFilename()
|
||||
.substring(tifFile.getOriginalFilename().lastIndexOf('.') + 1)
|
||||
.toLowerCase()
|
||||
.equals("tif") )
|
||||
{
|
||||
return new MapSheetMngDto.DmlReturn("fail", "파일명이 TIF형식이 아닙니다.");
|
||||
return new DmlReturn("fail", "TIF TYPE ERROR");
|
||||
}
|
||||
|
||||
//싱크파일목록 가저오기
|
||||
List<MngFilesDto> mngFiles = mapSheetMngCoreService.findIdToMapSheetFileList(hstUid);
|
||||
String uploadPath = "";
|
||||
for (MngFilesDto dto : mngFiles) {
|
||||
uploadPath = dto.getFilePath();
|
||||
break;
|
||||
}
|
||||
|
||||
return new MapSheetMngDto.DmlReturn("success", "파일 업로드 완료되었습니다.");
|
||||
if( uploadPath.isEmpty() ) {
|
||||
//ErrorDataDto errDto = mapSheetMngCoreService.findMapSheetError(hstUid);
|
||||
//uploadPath = FileConfig.rootSyncDir+"\\"+errDto.getMapSheetNum();
|
||||
}
|
||||
|
||||
//tfw가 있는 경우
|
||||
//tif가 있는 경우
|
||||
|
||||
return new DmlReturn("success", "파일 업로드 완료되었습니다.");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<MapSheetMngDto.MngFilesDto> findHstUidToMapSheetFileList(Long hstUid) {
|
||||
return mapSheetMngCoreService.findHstUidToMapSheetFileList(hstUid);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user