diff --git a/src/main/java/com/kamco/cd/kamcoback/common/utils/FIleChecker.java b/src/main/java/com/kamco/cd/kamcoback/common/utils/FIleChecker.java index 9c150907..860a3a4e 100644 --- a/src/main/java/com/kamco/cd/kamcoback/common/utils/FIleChecker.java +++ b/src/main/java/com/kamco/cd/kamcoback/common/utils/FIleChecker.java @@ -179,7 +179,7 @@ public class FIleChecker { if (isWindows) { // 윈도우용 command.add("cmd.exe"); // 윈도우 명령 프롬프트 실행 - command.add("/c"); // 명령어를 수행하고 종료한다는 옵션 + command.add("/c"); // 명령어를 수행하고 종료한다는 옵션 command.add("gdalinfo"); command.add(filePath); command.add("|"); diff --git a/src/main/java/com/kamco/cd/kamcoback/mapsheet/MapSheetMngApiController.java b/src/main/java/com/kamco/cd/kamcoback/mapsheet/MapSheetMngApiController.java index 50fad7ed..69ff60e2 100644 --- a/src/main/java/com/kamco/cd/kamcoback/mapsheet/MapSheetMngApiController.java +++ b/src/main/java/com/kamco/cd/kamcoback/mapsheet/MapSheetMngApiController.java @@ -28,7 +28,7 @@ public class MapSheetMngApiController { private final CommonCodeService commonCodeService; private final MapSheetMngService mapSheetMngService; - @Operation(summary = "영상데이터관리목록 조회", description = "영상데이터관리목록 조회") + @Operation(summary = "영상 데이터 관리 목록 조회", description = "영상 데이터 관리 목록 조회") @ApiResponses( value = { @ApiResponse( @@ -47,7 +47,7 @@ public class MapSheetMngApiController { return ApiResponseDto.ok(mapSheetMngService.findMapSheetMngList()); } - @Operation(summary = "영상데이터관리 상세", description = "영상데이터관리 상세") + @Operation(summary = "영상 데이터 관리 상세", description = "영상 데이터 관리 상세") @ApiResponses( value = { @ApiResponse( @@ -105,12 +105,26 @@ public class MapSheetMngApiController { return ApiResponseDto.ok(mapSheetMngService.mngComplete(mngYyyy)); } - /** - * 오류데이터 목록 조회 - * - * @param searchReq - * @return - */ + @Operation(summary = "영상 데이터 관리 년도 목록", description = "영상 데이터 관리 년도 목록") + @ApiResponses( + value = { + @ApiResponse( + responseCode = "200", + description = "조회 성공", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = CommonCodeDto.Basic.class))), + @ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content), + @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) + }) + @PostMapping("/mng-year-list") + public ApiResponseDto> findMapSheetMngYyyyList() { + + return ApiResponseDto.ok(mapSheetMngService.findMapSheetMngYyyyList()); + } + + @PostMapping("/error-list") public ApiResponseDto> findMapSheetErrorList( @RequestBody @Valid MapSheetMngDto.ErrorSearchReq searchReq) { @@ -137,7 +151,6 @@ public class MapSheetMngApiController { return ApiResponseDto.ok(mapSheetMngService.uploadProcess(hstUidList)); } - @Operation(summary = "오류데이터 팝업 > 추론 제외", description = "오류데이터 팝업 > 추론 제외") @PutMapping("/except-inference") public ApiResponseDto updateExceptUseInference( @@ -154,33 +167,29 @@ public class MapSheetMngApiController { return ApiResponseDto.createOK(mapSheetMngService.uploadPair(tfwFile, tifFile, hstUid)); } - @GetMapping("/mng-file-list") public ApiResponseDto> findHstUidToMapSheetFileList( - @RequestParam @Valid Long hstUid) { + @RequestParam @Valid Long hstUid) { return ApiResponseDto.ok(mapSheetMngService.findHstUidToMapSheetFileList(hstUid)); } @Operation(summary = "영상관리 > 파일삭제", description = "영상관리 > 파일삭제") @ApiResponses( - value = { - @ApiResponse( - responseCode = "201", - description = "파일삭제 처리 성공", - content = - @Content( - mediaType = "application/json", - schema = @Schema(implementation = Long.class))), - @ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content), - @ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content), - @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) - }) + value = { + @ApiResponse( + responseCode = "201", + description = "파일삭제 처리 성공", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = Long.class))), + @ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content), + @ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content), + @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) + }) @PutMapping("/del-mng-files") - public ApiResponseDto deleteByFileUidMngFile(@RequestParam @Valid List fileUids) { + public ApiResponseDto deleteByFileUidMngFile( + @RequestParam @Valid List fileUids) { return ApiResponseDto.ok(mapSheetMngService.deleteByFileUidMngFile(fileUids)); } - - - - } diff --git a/src/main/java/com/kamco/cd/kamcoback/mapsheet/MapSheetMngFileCheckerApiController.java b/src/main/java/com/kamco/cd/kamcoback/mapsheet/MapSheetMngFileCheckerApiController.java index b57fa57e..f0a859bf 100644 --- a/src/main/java/com/kamco/cd/kamcoback/mapsheet/MapSheetMngFileCheckerApiController.java +++ b/src/main/java/com/kamco/cd/kamcoback/mapsheet/MapSheetMngFileCheckerApiController.java @@ -15,14 +15,10 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; -import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; @Tag(name = "영상 관리", description = "영상 관리 API") @RestController diff --git a/src/main/java/com/kamco/cd/kamcoback/mapsheet/dto/MapSheetMngDto.java b/src/main/java/com/kamco/cd/kamcoback/mapsheet/dto/MapSheetMngDto.java index 889597c9..abf3b3a2 100644 --- a/src/main/java/com/kamco/cd/kamcoback/mapsheet/dto/MapSheetMngDto.java +++ b/src/main/java/com/kamco/cd/kamcoback/mapsheet/dto/MapSheetMngDto.java @@ -4,7 +4,6 @@ import com.kamco.cd.kamcoback.common.enums.MngStateType; import com.kamco.cd.kamcoback.common.enums.SyncStateType; import com.kamco.cd.kamcoback.common.utils.Enums; import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm; -import com.kamco.cd.kamcoback.config.enums.EnumType; import io.swagger.v3.oas.annotations.media.Schema; import java.time.ZonedDateTime; import lombok.AllArgsConstructor; @@ -107,10 +106,9 @@ public class MapSheetMngDto { return this.syncNotPaireExecCnt + this.syncDuplicateExecCnt + this.syncFaultExecCnt; } - public String getMngStateName() { String enumId = this.mngState; - if( enumId == null || enumId.isEmpty())enumId = "NOTYET"; + if (enumId == null || enumId.isEmpty()) enumId = "NOTYET"; MngStateType type = Enums.fromId(MngStateType.class, enumId); return type.getText(); @@ -181,8 +179,7 @@ public class MapSheetMngDto { private String errorCheckTfwFileName; private String errorCheckTifFileName; - //private List fileArray; - + // private List fileArray; public ErrorDataDto( Long hstUid, @@ -214,7 +211,7 @@ public class MapSheetMngDto { } private String getSyncStateName(String enumId) { - if( enumId == null || enumId.isEmpty())enumId = "NOTYET"; + if (enumId == null || enumId.isEmpty()) enumId = "NOTYET"; SyncStateType type = Enums.fromId(SyncStateType.class, enumId); return type.getText(); @@ -259,5 +256,4 @@ public class MapSheetMngDto { private Long hstUid; private Long fileSize; } - } diff --git a/src/main/java/com/kamco/cd/kamcoback/mapsheet/service/MapSheetMngService.java b/src/main/java/com/kamco/cd/kamcoback/mapsheet/service/MapSheetMngService.java index d9090def..0147608a 100644 --- a/src/main/java/com/kamco/cd/kamcoback/mapsheet/service/MapSheetMngService.java +++ b/src/main/java/com/kamco/cd/kamcoback/mapsheet/service/MapSheetMngService.java @@ -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 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 mngFiles = mapSheetMngCoreService.findIdToMapSheetFileList(hstUid); - String uploadPath = ""; - for (MngFilesDto dto : mngFiles) { - uploadPath = dto.getFilePath(); - break; - } + // 싱크파일목록 가저오기 + List 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 findHstUidToMapSheetFileList(Long hstUid) { return mapSheetMngCoreService.findHstUidToMapSheetFileList(hstUid); } - @Transactional public MapSheetMngDto.DmlReturn deleteByFileUidMngFile(List fileUids) { @@ -334,5 +330,4 @@ public class MapSheetMngService { return new MapSheetMngDto.DmlReturn("success", fileUids.size() + "개 파일이 삭제되었습니다."); } - } diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/core/MapSheetMngCoreService.java b/src/main/java/com/kamco/cd/kamcoback/postgres/core/MapSheetMngCoreService.java index 986dfc94..adb05a62 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/core/MapSheetMngCoreService.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/core/MapSheetMngCoreService.java @@ -36,6 +36,11 @@ public class MapSheetMngCoreService { return mapSheetMngRepository.findMapSheetMngList(); } + public List findMapSheetMngYyyyList() { + return mapSheetMngRepository.findMapSheetMngYyyyList(); + } + + public MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy) { return mapSheetMngRepository.findMapSheetMng(mngYyyy); } @@ -44,13 +49,12 @@ public class MapSheetMngCoreService { mapSheetMngRepository.MapSheetMngComplete(mngYyyy); } - public Page findMapSheetErrorList( MapSheetMngDto.@Valid ErrorSearchReq searchReq) { return mapSheetMngRepository.findMapSheetErrorList(searchReq); } - public MapSheetMngDto.ErrorDataDto findMapSheetError(Long hstUid){ + public MapSheetMngDto.ErrorDataDto findMapSheetError(Long hstUid) { return mapSheetMngRepository.findMapSheetError(hstUid); } @@ -58,7 +62,6 @@ public class MapSheetMngCoreService { return mapSheetMngRepository.findIdToMapSheetFileList(hstUid); } - public MapSheetMngDto.DmlReturn uploadProcess(@Valid List hstUidList) { int count = 0; if (!Objects.isNull(hstUidList) && !hstUidList.isEmpty()) { @@ -207,8 +210,7 @@ public class MapSheetMngCoreService { return new MapSheetMngDto.DmlReturn("success", saved.getMngYyyy().toString()); } - - public List findHstUidToMapSheetFileList(Long hstUid){ + public List findHstUidToMapSheetFileList(Long hstUid) { return mapSheetMngRepository.findHstUidToMapSheetFileList(hstUid); } @@ -217,5 +219,4 @@ public class MapSheetMngCoreService { return new MapSheetMngDto.DmlReturn("success", fileUid + " : 삭제되었습니다."); } - } diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/mapsheet/MapSheetMngRepositoryCustom.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/mapsheet/MapSheetMngRepositoryCustom.java index 6626d575..3683f365 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/mapsheet/MapSheetMngRepositoryCustom.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/mapsheet/MapSheetMngRepositoryCustom.java @@ -11,6 +11,8 @@ public interface MapSheetMngRepositoryCustom { List findMapSheetMngList(); + List findMapSheetMngYyyyList(); + MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy); void MapSheetMngComplete(int mngYyyy); diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/mapsheet/MapSheetMngRepositoryImpl.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/mapsheet/MapSheetMngRepositoryImpl.java index 0c5f5483..044bb4a9 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/mapsheet/MapSheetMngRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/mapsheet/MapSheetMngRepositoryImpl.java @@ -167,6 +167,18 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport return foundContent; } + public List findMapSheetMngYyyyList(){ + List foundContent = + queryFactory + .select(mapSheetMngEntity.mngYyyy) + .from(mapSheetMngEntity) + .where(mapSheetMngEntity.mngState.ne("COMPLETE")) + .orderBy(mapSheetMngEntity.mngYyyy.desc()) + .fetch(); + + return foundContent; + } + public MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy) { BooleanBuilder whereBuilder = new BooleanBuilder(); @@ -367,72 +379,71 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport return new PageImpl<>(foundContent, pageable, countQuery); } - @Override - public MapSheetMngDto.ErrorDataDto findMapSheetError(Long hstUid){ + public MapSheetMngDto.ErrorDataDto findMapSheetError(Long hstUid) { BooleanBuilder whereBuilder = new BooleanBuilder(); - whereBuilder.and( mapSheetMngHstEntity.hstUid.eq(hstUid)); + whereBuilder.and(mapSheetMngHstEntity.hstUid.eq(hstUid)); MapSheetMngDto.ErrorDataDto foundContent = - queryFactory - .select( - Projections.constructor( - MapSheetMngDto.ErrorDataDto.class, - mapSheetMngHstEntity.hstUid, - mapSheetMngHstEntity.mapSheetNum, - Expressions.stringTemplate( - "concat({0},substring({1}, 0, 6))", - mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum).as("map50kName"), - Expressions.stringTemplate( - "concat({0},substring({1}, 6, 8))", - mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum).as("map5kName"), - Expressions.stringTemplate( - "concat({0},substring({1}, 6, 8))", - mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum).as("mapSrcName"), - mapInkx5kEntity.fid, - mapSheetMngHstEntity.createdDate, - mapSheetMngHstEntity.syncState, - mapSheetMngHstEntity.syncTfwFileName, - mapSheetMngHstEntity.syncTifFileName, - mapSheetMngHstEntity.syncCheckState, - mapSheetMngHstEntity.syncCheckTfwFileName, - mapSheetMngHstEntity.syncCheckTifFileName - ) - ) - .from(mapSheetMngHstEntity) - .innerJoin(mapInkx5kEntity).on(mapSheetMngHstEntity.mapSheetNum.eq(mapInkx5kEntity.mapidcdNo)) - .where(whereBuilder) - .fetchOne(); + queryFactory + .select( + Projections.constructor( + MapSheetMngDto.ErrorDataDto.class, + mapSheetMngHstEntity.hstUid, + mapSheetMngHstEntity.mapSheetNum, + Expressions.stringTemplate( + "concat({0},substring({1}, 0, 6))", + mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum) + .as("map50kName"), + Expressions.stringTemplate( + "concat({0},substring({1}, 6, 8))", + mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum) + .as("map5kName"), + Expressions.stringTemplate( + "concat({0},substring({1}, 6, 8))", + mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum) + .as("mapSrcName"), + mapInkx5kEntity.fid, + mapSheetMngHstEntity.createdDate, + mapSheetMngHstEntity.syncState, + mapSheetMngHstEntity.syncTfwFileName, + mapSheetMngHstEntity.syncTifFileName, + mapSheetMngHstEntity.syncCheckState, + mapSheetMngHstEntity.syncCheckTfwFileName, + mapSheetMngHstEntity.syncCheckTifFileName)) + .from(mapSheetMngHstEntity) + .innerJoin(mapInkx5kEntity) + .on(mapSheetMngHstEntity.mapSheetNum.eq(mapInkx5kEntity.mapidcdNo)) + .where(whereBuilder) + .fetchOne(); return foundContent; } @Override - public List findIdToMapSheetFileList(Long hstUid){ + public List findIdToMapSheetFileList(Long hstUid) { BooleanBuilder whereBuilder = new BooleanBuilder(); - whereBuilder.and( mapSheetMngFileEntity.hstUid.eq(hstUid) ); + whereBuilder.and(mapSheetMngFileEntity.hstUid.eq(hstUid)); List 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(); + 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; } @@ -440,68 +451,64 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport @Override public List findHstUidToMapSheetFileList(Long hstUid) { BooleanBuilder whereBuilder = new BooleanBuilder(); - whereBuilder.and( mapSheetMngFileEntity.hstUid.eq(hstUid) ); + whereBuilder.and(mapSheetMngFileEntity.hstUid.eq(hstUid)); List 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(); + 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){ + public MapSheetMngDto.MngFilesDto findYyyyToMapSheetFilePath(int mngYyyy) { BooleanBuilder whereBuilder = new BooleanBuilder(); - whereBuilder.and( mapSheetMngFileEntity.mngYyyy.eq(mngYyyy) ); + 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(); + 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) { long execCount = - queryFactory - .update(mapSheetMngEntity) - .set(mapSheetMngEntity.mngState, "COMPLETE") - .where(mapSheetMngEntity.mngYyyy.eq(mngYyyy)) - .execute(); + queryFactory + .update(mapSheetMngEntity) + .set(mapSheetMngEntity.mngState, "COMPLETE") + .where(mapSheetMngEntity.mngYyyy.eq(mngYyyy)) + .execute(); } @Override @@ -557,12 +564,12 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport } @Override - public void deleteByFileUidMngFile(Long fileUid){ + public void deleteByFileUidMngFile(Long fileUid) { long deletedFileCount = - queryFactory - .delete(mapSheetMngFileEntity) - .where(mapSheetMngFileEntity.fileUid.eq(fileUid)) - .execute(); + queryFactory + .delete(mapSheetMngFileEntity) + .where(mapSheetMngFileEntity.fileUid.eq(fileUid)) + .execute(); } @Override