영상관리 중복파일제거 수정
This commit is contained in:
@@ -139,10 +139,7 @@ public class MapSheetMngApiController {
|
|||||||
return ApiResponseDto.ok(mapSheetMngService.uploadProcess(hstUidList));
|
return ApiResponseDto.ok(mapSheetMngService.uploadProcess(hstUidList));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param hstUidList
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Operation(summary = "오류데이터 팝업 > 추론 제외", description = "오류데이터 팝업 > 추론 제외")
|
@Operation(summary = "오류데이터 팝업 > 추론 제외", description = "오류데이터 팝업 > 추론 제외")
|
||||||
@PutMapping("/except-inference")
|
@PutMapping("/except-inference")
|
||||||
public ApiResponseDto<MapSheetMngDto.DmlReturn> updateExceptUseInference(
|
public ApiResponseDto<MapSheetMngDto.DmlReturn> updateExceptUseInference(
|
||||||
@@ -162,4 +159,13 @@ public class MapSheetMngApiController {
|
|||||||
return ApiResponseDto.createOK(
|
return ApiResponseDto.createOK(
|
||||||
mapSheetMngService.uploadPair(tfwFile, tifFile, hstUid));
|
mapSheetMngService.uploadPair(tfwFile, tifFile, hstUid));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/mng-file-list")
|
||||||
|
public ApiResponseDto<List<MapSheetMngDto.MngFilesDto>> findHstUidToMapSheetFileList(
|
||||||
|
@RequestParam @Valid Long hstUid) {
|
||||||
|
return ApiResponseDto.ok(mapSheetMngService.findHstUidToMapSheetFileList(hstUid));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -164,6 +164,7 @@ public class MapSheetMngDto {
|
|||||||
public static class ErrorDataDto {
|
public static class ErrorDataDto {
|
||||||
// private Integer rowNum;
|
// private Integer rowNum;
|
||||||
private Long hstUid;
|
private Long hstUid;
|
||||||
|
private String mapSheetNum;
|
||||||
private String map50kName;
|
private String map50kName;
|
||||||
private String map5kName;
|
private String map5kName;
|
||||||
private String mapSrcName;
|
private String mapSrcName;
|
||||||
@@ -242,25 +243,21 @@ public class MapSheetMngDto {
|
|||||||
private String message;
|
private String message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Schema(name = "MngFilesDto", description = "영상파일내역 검색 리턴")
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum DataState implements EnumType {
|
public static class MngFilesDto {
|
||||||
NOTYET("대기중"),
|
private long fileUid;
|
||||||
PROCESSING("진행중"),
|
private int mngYyyy;
|
||||||
DONE("완료");
|
private String mapSheetNum;
|
||||||
|
private String refMapSheetNum;
|
||||||
private final String desc;
|
private String filePath;
|
||||||
|
private String fileName;
|
||||||
@Override
|
private String fileExt;
|
||||||
public String getId() {
|
private Long hstUid;
|
||||||
return name();
|
private Long fileSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getText() {
|
|
||||||
return desc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.DuplicateFileException;
|
||||||
import com.kamco.cd.kamcoback.common.exception.ValidationException;
|
import com.kamco.cd.kamcoback.common.exception.ValidationException;
|
||||||
import com.kamco.cd.kamcoback.common.utils.FIleChecker;
|
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;
|
||||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.FilesDto;
|
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.SrchFilesDepthDto;
|
||||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.SrchFilesDto;
|
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;
|
||||||
|
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 com.kamco.cd.kamcoback.postgres.core.MapSheetMngCoreService;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -267,7 +271,7 @@ public class MapSheetMngService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public MapSheetMngDto.DmlReturn uploadPair(
|
public DmlReturn uploadPair(
|
||||||
MultipartFile tfwFile,
|
MultipartFile tfwFile,
|
||||||
MultipartFile tifFile,
|
MultipartFile tifFile,
|
||||||
//String targetPath,
|
//String targetPath,
|
||||||
@@ -275,9 +279,9 @@ public class MapSheetMngService {
|
|||||||
|
|
||||||
// 파일 유효성 검증
|
// 파일 유효성 검증
|
||||||
if (tfwFile == null || tfwFile.isEmpty() || tfwFile.getSize() == 0) {
|
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) {
|
}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()
|
if( ! tfwFile.getOriginalFilename()
|
||||||
@@ -285,19 +289,39 @@ public class MapSheetMngService {
|
|||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.equals("tfw") )
|
.equals("tfw") )
|
||||||
{
|
{
|
||||||
return new MapSheetMngDto.DmlReturn("fail", "파일명이 TFW형식이 아닙니다.");
|
return new DmlReturn("fail", "TFW TYPE ERROR");
|
||||||
}else if( ! tifFile.getOriginalFilename()
|
}else if( ! tifFile.getOriginalFilename()
|
||||||
.substring(tifFile.getOriginalFilename().lastIndexOf('.') + 1)
|
.substring(tifFile.getOriginalFilename().lastIndexOf('.') + 1)
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.equals("tif") )
|
.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;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( uploadPath.isEmpty() ) {
|
||||||
|
//ErrorDataDto errDto = mapSheetMngCoreService.findMapSheetError(hstUid);
|
||||||
|
//uploadPath = FileConfig.rootSyncDir+"\\"+errDto.getMapSheetNum();
|
||||||
|
}
|
||||||
|
|
||||||
|
//tfw가 있는 경우
|
||||||
|
//tif가 있는 경우
|
||||||
|
|
||||||
|
return new DmlReturn("success", "파일 업로드 완료되었습니다.");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return new MapSheetMngDto.DmlReturn("success", "파일 업로드 완료되었습니다.");
|
|
||||||
|
|
||||||
|
public List<MapSheetMngDto.MngFilesDto> findHstUidToMapSheetFileList(Long hstUid) {
|
||||||
|
return mapSheetMngCoreService.findHstUidToMapSheetFileList(hstUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,9 @@ public class MapSheetMngCoreService {
|
|||||||
return mapSheetMngRepository.findMapSheetError(hstUid);
|
return mapSheetMngRepository.findMapSheetError(hstUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<MapSheetMngDto.MngFilesDto> findIdToMapSheetFileList(Long hstUid) {
|
||||||
|
return mapSheetMngRepository.findIdToMapSheetFileList(hstUid);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public MapSheetMngDto.DmlReturn uploadProcess(@Valid List<Long> hstUidList) {
|
public MapSheetMngDto.DmlReturn uploadProcess(@Valid List<Long> hstUidList) {
|
||||||
@@ -203,4 +206,10 @@ public class MapSheetMngCoreService {
|
|||||||
|
|
||||||
return new MapSheetMngDto.DmlReturn("success", saved.getMngYyyy().toString());
|
return new MapSheetMngDto.DmlReturn("success", saved.getMngYyyy().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<MapSheetMngDto.MngFilesDto> findHstUidToMapSheetFileList(Long hstUid){
|
||||||
|
return mapSheetMngRepository.findHstUidToMapSheetFileList(hstUid);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ public interface MapSheetMngRepositoryCustom {
|
|||||||
|
|
||||||
int insertMapSheetOrgDataToMapSheetMngHst(int mngYyyy);
|
int insertMapSheetOrgDataToMapSheetMngHst(int mngYyyy);
|
||||||
|
|
||||||
|
List<MapSheetMngDto.MngFilesDto> findHstUidToMapSheetFileList(Long hstUid);
|
||||||
|
|
||||||
|
MapSheetMngDto.MngFilesDto findYyyyToMapSheetFilePath(int mngYyyy);
|
||||||
|
|
||||||
void deleteByMngYyyyMngAll(int mngYyyy);
|
void deleteByMngYyyyMngAll(int mngYyyy);
|
||||||
|
|
||||||
void deleteByMngYyyyMng(int mngYyyy);
|
void deleteByMngYyyyMng(int mngYyyy);
|
||||||
@@ -32,5 +36,7 @@ public interface MapSheetMngRepositoryCustom {
|
|||||||
|
|
||||||
MapSheetMngDto.ErrorDataDto findMapSheetError(Long hstUid);
|
MapSheetMngDto.ErrorDataDto findMapSheetError(Long hstUid);
|
||||||
|
|
||||||
|
List<MapSheetMngDto.MngFilesDto> findIdToMapSheetFileList(Long hstUid);
|
||||||
|
|
||||||
void updateHstFileSizes(Long hstUid, long tifSizeBytes, long tfwSizeBytes, long totalSizeBytes);
|
void updateHstFileSizes(Long hstUid, long tifSizeBytes, long tfwSizeBytes, long totalSizeBytes);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -380,6 +380,7 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
MapSheetMngDto.ErrorDataDto.class,
|
MapSheetMngDto.ErrorDataDto.class,
|
||||||
mapSheetMngHstEntity.hstUid,
|
mapSheetMngHstEntity.hstUid,
|
||||||
|
mapSheetMngHstEntity.mapSheetNum,
|
||||||
Expressions.stringTemplate(
|
Expressions.stringTemplate(
|
||||||
"concat({0},substring({1}, 0, 6))",
|
"concat({0},substring({1}, 0, 6))",
|
||||||
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum).as("map50kName"),
|
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum).as("map50kName"),
|
||||||
@@ -407,6 +408,92 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
return foundContent;
|
return foundContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MapSheetMngDto.MngFilesDto> findIdToMapSheetFileList(Long hstUid){
|
||||||
|
|
||||||
|
BooleanBuilder whereBuilder = new BooleanBuilder();
|
||||||
|
whereBuilder.and( mapSheetMngFileEntity.hstUid.eq(hstUid) );
|
||||||
|
|
||||||
|
List<MapSheetMngDto.MngFilesDto> foundContent =
|
||||||
|
queryFactory
|
||||||
|
.select(
|
||||||
|
Projections.constructor(
|
||||||
|
MapSheetMngDto.MngFilesDto.class,
|
||||||
|
mapSheetMngFileEntity.fileUid,
|
||||||
|
mapSheetMngFileEntity.mngYyyy,
|
||||||
|
mapSheetMngFileEntity.mapSheetNum,
|
||||||
|
mapSheetMngFileEntity.refMapSheetNum,
|
||||||
|
mapSheetMngFileEntity.filePath,
|
||||||
|
mapSheetMngFileEntity.fileName,
|
||||||
|
mapSheetMngFileEntity.fileExt,
|
||||||
|
mapSheetMngFileEntity.hstUid,
|
||||||
|
mapSheetMngFileEntity.fileSize
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.from(mapSheetMngFileEntity)
|
||||||
|
.where(whereBuilder)
|
||||||
|
.fetch();
|
||||||
|
|
||||||
|
return foundContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MapSheetMngDto.MngFilesDto> findHstUidToMapSheetFileList(Long hstUid) {
|
||||||
|
BooleanBuilder whereBuilder = new BooleanBuilder();
|
||||||
|
whereBuilder.and( mapSheetMngFileEntity.hstUid.eq(hstUid) );
|
||||||
|
|
||||||
|
List<MapSheetMngDto.MngFilesDto> foundContent =
|
||||||
|
queryFactory
|
||||||
|
.select(
|
||||||
|
Projections.constructor(
|
||||||
|
MapSheetMngDto.MngFilesDto.class,
|
||||||
|
mapSheetMngFileEntity.fileUid,
|
||||||
|
mapSheetMngFileEntity.mngYyyy,
|
||||||
|
mapSheetMngFileEntity.mapSheetNum,
|
||||||
|
mapSheetMngFileEntity.refMapSheetNum,
|
||||||
|
mapSheetMngFileEntity.filePath,
|
||||||
|
mapSheetMngFileEntity.fileName,
|
||||||
|
mapSheetMngFileEntity.fileExt,
|
||||||
|
mapSheetMngFileEntity.hstUid,
|
||||||
|
mapSheetMngFileEntity.fileSize
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.from(mapSheetMngFileEntity)
|
||||||
|
.where(whereBuilder)
|
||||||
|
.orderBy(mapSheetMngFileEntity.fileExt.desc())
|
||||||
|
.fetch();
|
||||||
|
|
||||||
|
return foundContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MapSheetMngDto.MngFilesDto findYyyyToMapSheetFilePath(int mngYyyy){
|
||||||
|
|
||||||
|
BooleanBuilder whereBuilder = new BooleanBuilder();
|
||||||
|
whereBuilder.and( mapSheetMngFileEntity.mngYyyy.eq(mngYyyy) );
|
||||||
|
|
||||||
|
MapSheetMngDto.MngFilesDto foundContent =
|
||||||
|
queryFactory
|
||||||
|
.select(
|
||||||
|
Projections.constructor(
|
||||||
|
MapSheetMngDto.MngFilesDto.class,
|
||||||
|
mapSheetMngFileEntity.fileUid,
|
||||||
|
mapSheetMngFileEntity.mngYyyy,
|
||||||
|
mapSheetMngFileEntity.mapSheetNum,
|
||||||
|
mapSheetMngFileEntity.refMapSheetNum,
|
||||||
|
mapSheetMngFileEntity.filePath,
|
||||||
|
mapSheetMngFileEntity.fileName,
|
||||||
|
mapSheetMngFileEntity.fileExt,
|
||||||
|
mapSheetMngFileEntity.hstUid,
|
||||||
|
mapSheetMngFileEntity.fileSize
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.from(mapSheetMngFileEntity)
|
||||||
|
.where(whereBuilder)
|
||||||
|
.fetchOne();
|
||||||
|
|
||||||
|
return foundContent;
|
||||||
|
}
|
||||||
|
|
||||||
public void MapSheetMngComplete(int mngYyyy) {
|
public void MapSheetMngComplete(int mngYyyy) {
|
||||||
long execCount =
|
long execCount =
|
||||||
|
|||||||
Reference in New Issue
Block a user