영상관리파일삭제, 년도목록 조회 수정
This commit is contained in:
@@ -179,7 +179,7 @@ public class FIleChecker {
|
|||||||
if (isWindows) {
|
if (isWindows) {
|
||||||
// 윈도우용
|
// 윈도우용
|
||||||
command.add("cmd.exe"); // 윈도우 명령 프롬프트 실행
|
command.add("cmd.exe"); // 윈도우 명령 프롬프트 실행
|
||||||
command.add("/c"); // 명령어를 수행하고 종료한다는 옵션
|
command.add("/c"); // 명령어를 수행하고 종료한다는 옵션
|
||||||
command.add("gdalinfo");
|
command.add("gdalinfo");
|
||||||
command.add(filePath);
|
command.add(filePath);
|
||||||
command.add("|");
|
command.add("|");
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class MapSheetMngApiController {
|
|||||||
private final CommonCodeService commonCodeService;
|
private final CommonCodeService commonCodeService;
|
||||||
private final MapSheetMngService mapSheetMngService;
|
private final MapSheetMngService mapSheetMngService;
|
||||||
|
|
||||||
@Operation(summary = "영상데이터관리목록 조회", description = "영상데이터관리목록 조회")
|
@Operation(summary = "영상 데이터 관리 목록 조회", description = "영상 데이터 관리 목록 조회")
|
||||||
@ApiResponses(
|
@ApiResponses(
|
||||||
value = {
|
value = {
|
||||||
@ApiResponse(
|
@ApiResponse(
|
||||||
@@ -47,7 +47,7 @@ public class MapSheetMngApiController {
|
|||||||
return ApiResponseDto.ok(mapSheetMngService.findMapSheetMngList());
|
return ApiResponseDto.ok(mapSheetMngService.findMapSheetMngList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "영상데이터관리 상세", description = "영상데이터관리 상세")
|
@Operation(summary = "영상 데이터 관리 상세", description = "영상 데이터 관리 상세")
|
||||||
@ApiResponses(
|
@ApiResponses(
|
||||||
value = {
|
value = {
|
||||||
@ApiResponse(
|
@ApiResponse(
|
||||||
@@ -105,12 +105,26 @@ public class MapSheetMngApiController {
|
|||||||
return ApiResponseDto.ok(mapSheetMngService.mngComplete(mngYyyy));
|
return ApiResponseDto.ok(mapSheetMngService.mngComplete(mngYyyy));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Operation(summary = "영상 데이터 관리 년도 목록", description = "영상 데이터 관리 년도 목록")
|
||||||
* 오류데이터 목록 조회
|
@ApiResponses(
|
||||||
*
|
value = {
|
||||||
* @param searchReq
|
@ApiResponse(
|
||||||
* @return
|
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<List<Integer>> findMapSheetMngYyyyList() {
|
||||||
|
|
||||||
|
return ApiResponseDto.ok(mapSheetMngService.findMapSheetMngYyyyList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/error-list")
|
@PostMapping("/error-list")
|
||||||
public ApiResponseDto<Page<MapSheetMngDto.ErrorDataDto>> findMapSheetErrorList(
|
public ApiResponseDto<Page<MapSheetMngDto.ErrorDataDto>> findMapSheetErrorList(
|
||||||
@RequestBody @Valid MapSheetMngDto.ErrorSearchReq searchReq) {
|
@RequestBody @Valid MapSheetMngDto.ErrorSearchReq searchReq) {
|
||||||
@@ -137,7 +151,6 @@ public class MapSheetMngApiController {
|
|||||||
return ApiResponseDto.ok(mapSheetMngService.uploadProcess(hstUidList));
|
return ApiResponseDto.ok(mapSheetMngService.uploadProcess(hstUidList));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "오류데이터 팝업 > 추론 제외", description = "오류데이터 팝업 > 추론 제외")
|
@Operation(summary = "오류데이터 팝업 > 추론 제외", description = "오류데이터 팝업 > 추론 제외")
|
||||||
@PutMapping("/except-inference")
|
@PutMapping("/except-inference")
|
||||||
public ApiResponseDto<MapSheetMngDto.DmlReturn> updateExceptUseInference(
|
public ApiResponseDto<MapSheetMngDto.DmlReturn> updateExceptUseInference(
|
||||||
@@ -154,33 +167,29 @@ public class MapSheetMngApiController {
|
|||||||
return ApiResponseDto.createOK(mapSheetMngService.uploadPair(tfwFile, tifFile, hstUid));
|
return ApiResponseDto.createOK(mapSheetMngService.uploadPair(tfwFile, tifFile, hstUid));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/mng-file-list")
|
@GetMapping("/mng-file-list")
|
||||||
public ApiResponseDto<List<MapSheetMngDto.MngFilesDto>> findHstUidToMapSheetFileList(
|
public ApiResponseDto<List<MapSheetMngDto.MngFilesDto>> findHstUidToMapSheetFileList(
|
||||||
@RequestParam @Valid Long hstUid) {
|
@RequestParam @Valid Long hstUid) {
|
||||||
return ApiResponseDto.ok(mapSheetMngService.findHstUidToMapSheetFileList(hstUid));
|
return ApiResponseDto.ok(mapSheetMngService.findHstUidToMapSheetFileList(hstUid));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "영상관리 > 파일삭제", description = "영상관리 > 파일삭제")
|
@Operation(summary = "영상관리 > 파일삭제", description = "영상관리 > 파일삭제")
|
||||||
@ApiResponses(
|
@ApiResponses(
|
||||||
value = {
|
value = {
|
||||||
@ApiResponse(
|
@ApiResponse(
|
||||||
responseCode = "201",
|
responseCode = "201",
|
||||||
description = "파일삭제 처리 성공",
|
description = "파일삭제 처리 성공",
|
||||||
content =
|
content =
|
||||||
@Content(
|
@Content(
|
||||||
mediaType = "application/json",
|
mediaType = "application/json",
|
||||||
schema = @Schema(implementation = Long.class))),
|
schema = @Schema(implementation = Long.class))),
|
||||||
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content),
|
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content),
|
||||||
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
|
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
|
||||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||||
})
|
})
|
||||||
@PutMapping("/del-mng-files")
|
@PutMapping("/del-mng-files")
|
||||||
public ApiResponseDto<MapSheetMngDto.DmlReturn> deleteByFileUidMngFile(@RequestParam @Valid List<Long> fileUids) {
|
public ApiResponseDto<MapSheetMngDto.DmlReturn> deleteByFileUidMngFile(
|
||||||
|
@RequestParam @Valid List<Long> fileUids) {
|
||||||
return ApiResponseDto.ok(mapSheetMngService.deleteByFileUidMngFile(fileUids));
|
return ApiResponseDto.ok(mapSheetMngService.deleteByFileUidMngFile(fileUids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.responses.ApiResponses;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
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.bind.annotation.RestController;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
@Tag(name = "영상 관리", description = "영상 관리 API")
|
@Tag(name = "영상 관리", description = "영상 관리 API")
|
||||||
@RestController
|
@RestController
|
||||||
|
|||||||
@@ -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.enums.SyncStateType;
|
||||||
import com.kamco.cd.kamcoback.common.utils.Enums;
|
import com.kamco.cd.kamcoback.common.utils.Enums;
|
||||||
import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm;
|
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 io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import java.time.ZonedDateTime;
|
import java.time.ZonedDateTime;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -107,10 +106,9 @@ public class MapSheetMngDto {
|
|||||||
return this.syncNotPaireExecCnt + this.syncDuplicateExecCnt + this.syncFaultExecCnt;
|
return this.syncNotPaireExecCnt + this.syncDuplicateExecCnt + this.syncFaultExecCnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getMngStateName() {
|
public String getMngStateName() {
|
||||||
String enumId = this.mngState;
|
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);
|
MngStateType type = Enums.fromId(MngStateType.class, enumId);
|
||||||
return type.getText();
|
return type.getText();
|
||||||
@@ -181,8 +179,7 @@ public class MapSheetMngDto {
|
|||||||
private String errorCheckTfwFileName;
|
private String errorCheckTfwFileName;
|
||||||
private String errorCheckTifFileName;
|
private String errorCheckTifFileName;
|
||||||
|
|
||||||
//private List<MngFIleDto> fileArray;
|
// private List<MngFIleDto> fileArray;
|
||||||
|
|
||||||
|
|
||||||
public ErrorDataDto(
|
public ErrorDataDto(
|
||||||
Long hstUid,
|
Long hstUid,
|
||||||
@@ -214,7 +211,7 @@ public class MapSheetMngDto {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String getSyncStateName(String enumId) {
|
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);
|
SyncStateType type = Enums.fromId(SyncStateType.class, enumId);
|
||||||
return type.getText();
|
return type.getText();
|
||||||
@@ -259,5 +256,4 @@ public class MapSheetMngDto {
|
|||||||
private Long hstUid;
|
private Long hstUid;
|
||||||
private Long fileSize;
|
private Long fileSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,17 +2,12 @@ package com.kamco.cd.kamcoback.mapsheet.service;
|
|||||||
|
|
||||||
import static java.lang.String.CASE_INSENSITIVE_ORDER;
|
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;
|
||||||
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.DmlReturn;
|
||||||
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.ErrorDataDto;
|
|
||||||
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.MngFilesDto;
|
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;
|
||||||
@@ -224,11 +219,16 @@ public class MapSheetMngService {
|
|||||||
return mapSheetMngCoreService.findMapSheetMngList();
|
return mapSheetMngCoreService.findMapSheetMngList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Integer> findMapSheetMngYyyyList() {
|
||||||
|
return mapSheetMngCoreService.findMapSheetMngYyyyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy) {
|
public MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy) {
|
||||||
return mapSheetMngCoreService.findMapSheetMng(mngYyyy);
|
return mapSheetMngCoreService.findMapSheetMng(mngYyyy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public MapSheetMngDto.DmlReturn mngComplete(int mngYyyy) {
|
public MapSheetMngDto.DmlReturn mngComplete(int mngYyyy) {
|
||||||
|
|
||||||
@@ -272,59 +272,55 @@ public class MapSheetMngService {
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public DmlReturn uploadPair(
|
public DmlReturn uploadPair(
|
||||||
MultipartFile tfwFile,
|
MultipartFile tfwFile,
|
||||||
MultipartFile tifFile,
|
MultipartFile tifFile,
|
||||||
//String targetPath,
|
// String targetPath,
|
||||||
Long hstUid) {
|
Long hstUid) {
|
||||||
|
|
||||||
// 파일 유효성 검증
|
// 파일 유효성 검증
|
||||||
if (tfwFile == null || tfwFile.isEmpty() || tfwFile.getSize() == 0) {
|
if (tfwFile == null || tfwFile.isEmpty() || tfwFile.getSize() == 0) {
|
||||||
return new DmlReturn("fail", "TFW SIZE 오류");
|
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 DmlReturn("fail", "TIF SIZE 오류");
|
return new DmlReturn("fail", "TIF SIZE 오류");
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ! tfwFile.getOriginalFilename()
|
if (!tfwFile
|
||||||
.substring(tfwFile.getOriginalFilename().lastIndexOf('.') + 1)
|
.getOriginalFilename()
|
||||||
.toLowerCase()
|
.substring(tfwFile.getOriginalFilename().lastIndexOf('.') + 1)
|
||||||
.equals("tfw") )
|
.toLowerCase()
|
||||||
{
|
.equals("tfw")) {
|
||||||
return new DmlReturn("fail", "TFW TYPE ERROR");
|
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 DmlReturn("fail", "TIF TYPE ERROR");
|
||||||
return new DmlReturn("fail", "TIF TYPE ERROR");
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//싱크파일목록 가저오기
|
// 싱크파일목록 가저오기
|
||||||
List<MngFilesDto> mngFiles = mapSheetMngCoreService.findIdToMapSheetFileList(hstUid);
|
List<MngFilesDto> mngFiles = mapSheetMngCoreService.findIdToMapSheetFileList(hstUid);
|
||||||
String uploadPath = "";
|
String uploadPath = "";
|
||||||
for (MngFilesDto dto : mngFiles) {
|
for (MngFilesDto dto : mngFiles) {
|
||||||
uploadPath = dto.getFilePath();
|
uploadPath = dto.getFilePath();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( uploadPath.isEmpty() ) {
|
if (uploadPath.isEmpty()) {
|
||||||
//ErrorDataDto errDto = mapSheetMngCoreService.findMapSheetError(hstUid);
|
// ErrorDataDto errDto = mapSheetMngCoreService.findMapSheetError(hstUid);
|
||||||
//uploadPath = FileConfig.rootSyncDir+"\\"+errDto.getMapSheetNum();
|
// uploadPath = FileConfig.rootSyncDir+"\\"+errDto.getMapSheetNum();
|
||||||
}
|
}
|
||||||
|
|
||||||
//tfw가 있는 경우
|
// tfw가 있는 경우
|
||||||
//tif가 있는 경우
|
// tif가 있는 경우
|
||||||
|
|
||||||
return new DmlReturn("success", "파일 업로드 완료되었습니다.");
|
return new DmlReturn("success", "파일 업로드 완료되었습니다.");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public List<MapSheetMngDto.MngFilesDto> findHstUidToMapSheetFileList(Long hstUid) {
|
public List<MapSheetMngDto.MngFilesDto> findHstUidToMapSheetFileList(Long hstUid) {
|
||||||
return mapSheetMngCoreService.findHstUidToMapSheetFileList(hstUid);
|
return mapSheetMngCoreService.findHstUidToMapSheetFileList(hstUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public MapSheetMngDto.DmlReturn deleteByFileUidMngFile(List<Long> fileUids) {
|
public MapSheetMngDto.DmlReturn deleteByFileUidMngFile(List<Long> fileUids) {
|
||||||
|
|
||||||
@@ -334,5 +330,4 @@ public class MapSheetMngService {
|
|||||||
|
|
||||||
return new MapSheetMngDto.DmlReturn("success", fileUids.size() + "개 파일이 삭제되었습니다.");
|
return new MapSheetMngDto.DmlReturn("success", fileUids.size() + "개 파일이 삭제되었습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,11 @@ public class MapSheetMngCoreService {
|
|||||||
return mapSheetMngRepository.findMapSheetMngList();
|
return mapSheetMngRepository.findMapSheetMngList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Integer> findMapSheetMngYyyyList() {
|
||||||
|
return mapSheetMngRepository.findMapSheetMngYyyyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy) {
|
public MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy) {
|
||||||
return mapSheetMngRepository.findMapSheetMng(mngYyyy);
|
return mapSheetMngRepository.findMapSheetMng(mngYyyy);
|
||||||
}
|
}
|
||||||
@@ -44,13 +49,12 @@ public class MapSheetMngCoreService {
|
|||||||
mapSheetMngRepository.MapSheetMngComplete(mngYyyy);
|
mapSheetMngRepository.MapSheetMngComplete(mngYyyy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(
|
public Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(
|
||||||
MapSheetMngDto.@Valid ErrorSearchReq searchReq) {
|
MapSheetMngDto.@Valid ErrorSearchReq searchReq) {
|
||||||
return mapSheetMngRepository.findMapSheetErrorList(searchReq);
|
return mapSheetMngRepository.findMapSheetErrorList(searchReq);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MapSheetMngDto.ErrorDataDto findMapSheetError(Long hstUid){
|
public MapSheetMngDto.ErrorDataDto findMapSheetError(Long hstUid) {
|
||||||
return mapSheetMngRepository.findMapSheetError(hstUid);
|
return mapSheetMngRepository.findMapSheetError(hstUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +62,6 @@ public class MapSheetMngCoreService {
|
|||||||
return mapSheetMngRepository.findIdToMapSheetFileList(hstUid);
|
return mapSheetMngRepository.findIdToMapSheetFileList(hstUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public MapSheetMngDto.DmlReturn uploadProcess(@Valid List<Long> hstUidList) {
|
public MapSheetMngDto.DmlReturn uploadProcess(@Valid List<Long> hstUidList) {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
if (!Objects.isNull(hstUidList) && !hstUidList.isEmpty()) {
|
if (!Objects.isNull(hstUidList) && !hstUidList.isEmpty()) {
|
||||||
@@ -207,8 +210,7 @@ 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) {
|
||||||
public List<MapSheetMngDto.MngFilesDto> findHstUidToMapSheetFileList(Long hstUid){
|
|
||||||
return mapSheetMngRepository.findHstUidToMapSheetFileList(hstUid);
|
return mapSheetMngRepository.findHstUidToMapSheetFileList(hstUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,5 +219,4 @@ public class MapSheetMngCoreService {
|
|||||||
|
|
||||||
return new MapSheetMngDto.DmlReturn("success", fileUid + " : 삭제되었습니다.");
|
return new MapSheetMngDto.DmlReturn("success", fileUid + " : 삭제되었습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ public interface MapSheetMngRepositoryCustom {
|
|||||||
|
|
||||||
List<MapSheetMngDto.MngDto> findMapSheetMngList();
|
List<MapSheetMngDto.MngDto> findMapSheetMngList();
|
||||||
|
|
||||||
|
List<Integer> findMapSheetMngYyyyList();
|
||||||
|
|
||||||
MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy);
|
MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy);
|
||||||
|
|
||||||
void MapSheetMngComplete(int mngYyyy);
|
void MapSheetMngComplete(int mngYyyy);
|
||||||
|
|||||||
@@ -167,6 +167,18 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
return foundContent;
|
return foundContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Integer> findMapSheetMngYyyyList(){
|
||||||
|
List<Integer> 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) {
|
public MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy) {
|
||||||
|
|
||||||
BooleanBuilder whereBuilder = new BooleanBuilder();
|
BooleanBuilder whereBuilder = new BooleanBuilder();
|
||||||
@@ -367,72 +379,71 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
return new PageImpl<>(foundContent, pageable, countQuery);
|
return new PageImpl<>(foundContent, pageable, countQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MapSheetMngDto.ErrorDataDto findMapSheetError(Long hstUid){
|
public MapSheetMngDto.ErrorDataDto findMapSheetError(Long hstUid) {
|
||||||
|
|
||||||
BooleanBuilder whereBuilder = new BooleanBuilder();
|
BooleanBuilder whereBuilder = new BooleanBuilder();
|
||||||
whereBuilder.and( mapSheetMngHstEntity.hstUid.eq(hstUid));
|
whereBuilder.and(mapSheetMngHstEntity.hstUid.eq(hstUid));
|
||||||
|
|
||||||
MapSheetMngDto.ErrorDataDto foundContent =
|
MapSheetMngDto.ErrorDataDto foundContent =
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(
|
.select(
|
||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
MapSheetMngDto.ErrorDataDto.class,
|
MapSheetMngDto.ErrorDataDto.class,
|
||||||
mapSheetMngHstEntity.hstUid,
|
mapSheetMngHstEntity.hstUid,
|
||||||
mapSheetMngHstEntity.mapSheetNum,
|
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)
|
||||||
Expressions.stringTemplate(
|
.as("map50kName"),
|
||||||
"concat({0},substring({1}, 6, 8))",
|
Expressions.stringTemplate(
|
||||||
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum).as("map5kName"),
|
"concat({0},substring({1}, 6, 8))",
|
||||||
Expressions.stringTemplate(
|
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum)
|
||||||
"concat({0},substring({1}, 6, 8))",
|
.as("map5kName"),
|
||||||
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum).as("mapSrcName"),
|
Expressions.stringTemplate(
|
||||||
mapInkx5kEntity.fid,
|
"concat({0},substring({1}, 6, 8))",
|
||||||
mapSheetMngHstEntity.createdDate,
|
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum)
|
||||||
mapSheetMngHstEntity.syncState,
|
.as("mapSrcName"),
|
||||||
mapSheetMngHstEntity.syncTfwFileName,
|
mapInkx5kEntity.fid,
|
||||||
mapSheetMngHstEntity.syncTifFileName,
|
mapSheetMngHstEntity.createdDate,
|
||||||
mapSheetMngHstEntity.syncCheckState,
|
mapSheetMngHstEntity.syncState,
|
||||||
mapSheetMngHstEntity.syncCheckTfwFileName,
|
mapSheetMngHstEntity.syncTfwFileName,
|
||||||
mapSheetMngHstEntity.syncCheckTifFileName
|
mapSheetMngHstEntity.syncTifFileName,
|
||||||
)
|
mapSheetMngHstEntity.syncCheckState,
|
||||||
)
|
mapSheetMngHstEntity.syncCheckTfwFileName,
|
||||||
.from(mapSheetMngHstEntity)
|
mapSheetMngHstEntity.syncCheckTifFileName))
|
||||||
.innerJoin(mapInkx5kEntity).on(mapSheetMngHstEntity.mapSheetNum.eq(mapInkx5kEntity.mapidcdNo))
|
.from(mapSheetMngHstEntity)
|
||||||
.where(whereBuilder)
|
.innerJoin(mapInkx5kEntity)
|
||||||
.fetchOne();
|
.on(mapSheetMngHstEntity.mapSheetNum.eq(mapInkx5kEntity.mapidcdNo))
|
||||||
|
.where(whereBuilder)
|
||||||
|
.fetchOne();
|
||||||
|
|
||||||
return foundContent;
|
return foundContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MapSheetMngDto.MngFilesDto> findIdToMapSheetFileList(Long hstUid){
|
public List<MapSheetMngDto.MngFilesDto> findIdToMapSheetFileList(Long hstUid) {
|
||||||
|
|
||||||
BooleanBuilder whereBuilder = new BooleanBuilder();
|
BooleanBuilder whereBuilder = new BooleanBuilder();
|
||||||
whereBuilder.and( mapSheetMngFileEntity.hstUid.eq(hstUid) );
|
whereBuilder.and(mapSheetMngFileEntity.hstUid.eq(hstUid));
|
||||||
|
|
||||||
List<MapSheetMngDto.MngFilesDto> foundContent =
|
List<MapSheetMngDto.MngFilesDto> foundContent =
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(
|
.select(
|
||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
MapSheetMngDto.MngFilesDto.class,
|
MapSheetMngDto.MngFilesDto.class,
|
||||||
mapSheetMngFileEntity.fileUid,
|
mapSheetMngFileEntity.fileUid,
|
||||||
mapSheetMngFileEntity.mngYyyy,
|
mapSheetMngFileEntity.mngYyyy,
|
||||||
mapSheetMngFileEntity.mapSheetNum,
|
mapSheetMngFileEntity.mapSheetNum,
|
||||||
mapSheetMngFileEntity.refMapSheetNum,
|
mapSheetMngFileEntity.refMapSheetNum,
|
||||||
mapSheetMngFileEntity.filePath,
|
mapSheetMngFileEntity.filePath,
|
||||||
mapSheetMngFileEntity.fileName,
|
mapSheetMngFileEntity.fileName,
|
||||||
mapSheetMngFileEntity.fileExt,
|
mapSheetMngFileEntity.fileExt,
|
||||||
mapSheetMngFileEntity.hstUid,
|
mapSheetMngFileEntity.hstUid,
|
||||||
mapSheetMngFileEntity.fileSize
|
mapSheetMngFileEntity.fileSize))
|
||||||
)
|
.from(mapSheetMngFileEntity)
|
||||||
)
|
.where(whereBuilder)
|
||||||
.from(mapSheetMngFileEntity)
|
.fetch();
|
||||||
.where(whereBuilder)
|
|
||||||
.fetch();
|
|
||||||
|
|
||||||
return foundContent;
|
return foundContent;
|
||||||
}
|
}
|
||||||
@@ -440,68 +451,64 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
@Override
|
@Override
|
||||||
public List<MapSheetMngDto.MngFilesDto> findHstUidToMapSheetFileList(Long hstUid) {
|
public List<MapSheetMngDto.MngFilesDto> findHstUidToMapSheetFileList(Long hstUid) {
|
||||||
BooleanBuilder whereBuilder = new BooleanBuilder();
|
BooleanBuilder whereBuilder = new BooleanBuilder();
|
||||||
whereBuilder.and( mapSheetMngFileEntity.hstUid.eq(hstUid) );
|
whereBuilder.and(mapSheetMngFileEntity.hstUid.eq(hstUid));
|
||||||
|
|
||||||
List<MapSheetMngDto.MngFilesDto> foundContent =
|
List<MapSheetMngDto.MngFilesDto> foundContent =
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(
|
.select(
|
||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
MapSheetMngDto.MngFilesDto.class,
|
MapSheetMngDto.MngFilesDto.class,
|
||||||
mapSheetMngFileEntity.fileUid,
|
mapSheetMngFileEntity.fileUid,
|
||||||
mapSheetMngFileEntity.mngYyyy,
|
mapSheetMngFileEntity.mngYyyy,
|
||||||
mapSheetMngFileEntity.mapSheetNum,
|
mapSheetMngFileEntity.mapSheetNum,
|
||||||
mapSheetMngFileEntity.refMapSheetNum,
|
mapSheetMngFileEntity.refMapSheetNum,
|
||||||
mapSheetMngFileEntity.filePath,
|
mapSheetMngFileEntity.filePath,
|
||||||
mapSheetMngFileEntity.fileName,
|
mapSheetMngFileEntity.fileName,
|
||||||
mapSheetMngFileEntity.fileExt,
|
mapSheetMngFileEntity.fileExt,
|
||||||
mapSheetMngFileEntity.hstUid,
|
mapSheetMngFileEntity.hstUid,
|
||||||
mapSheetMngFileEntity.fileSize
|
mapSheetMngFileEntity.fileSize))
|
||||||
)
|
.from(mapSheetMngFileEntity)
|
||||||
)
|
.where(whereBuilder)
|
||||||
.from(mapSheetMngFileEntity)
|
.orderBy(mapSheetMngFileEntity.fileExt.desc())
|
||||||
.where(whereBuilder)
|
.fetch();
|
||||||
.orderBy(mapSheetMngFileEntity.fileExt.desc())
|
|
||||||
.fetch();
|
|
||||||
|
|
||||||
return foundContent;
|
return foundContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MapSheetMngDto.MngFilesDto findYyyyToMapSheetFilePath(int mngYyyy){
|
public MapSheetMngDto.MngFilesDto findYyyyToMapSheetFilePath(int mngYyyy) {
|
||||||
|
|
||||||
BooleanBuilder whereBuilder = new BooleanBuilder();
|
BooleanBuilder whereBuilder = new BooleanBuilder();
|
||||||
whereBuilder.and( mapSheetMngFileEntity.mngYyyy.eq(mngYyyy) );
|
whereBuilder.and(mapSheetMngFileEntity.mngYyyy.eq(mngYyyy));
|
||||||
|
|
||||||
MapSheetMngDto.MngFilesDto foundContent =
|
MapSheetMngDto.MngFilesDto foundContent =
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(
|
.select(
|
||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
MapSheetMngDto.MngFilesDto.class,
|
MapSheetMngDto.MngFilesDto.class,
|
||||||
mapSheetMngFileEntity.fileUid,
|
mapSheetMngFileEntity.fileUid,
|
||||||
mapSheetMngFileEntity.mngYyyy,
|
mapSheetMngFileEntity.mngYyyy,
|
||||||
mapSheetMngFileEntity.mapSheetNum,
|
mapSheetMngFileEntity.mapSheetNum,
|
||||||
mapSheetMngFileEntity.refMapSheetNum,
|
mapSheetMngFileEntity.refMapSheetNum,
|
||||||
mapSheetMngFileEntity.filePath,
|
mapSheetMngFileEntity.filePath,
|
||||||
mapSheetMngFileEntity.fileName,
|
mapSheetMngFileEntity.fileName,
|
||||||
mapSheetMngFileEntity.fileExt,
|
mapSheetMngFileEntity.fileExt,
|
||||||
mapSheetMngFileEntity.hstUid,
|
mapSheetMngFileEntity.hstUid,
|
||||||
mapSheetMngFileEntity.fileSize
|
mapSheetMngFileEntity.fileSize))
|
||||||
)
|
.from(mapSheetMngFileEntity)
|
||||||
)
|
.where(whereBuilder)
|
||||||
.from(mapSheetMngFileEntity)
|
.fetchOne();
|
||||||
.where(whereBuilder)
|
|
||||||
.fetchOne();
|
|
||||||
|
|
||||||
return foundContent;
|
return foundContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MapSheetMngComplete(int mngYyyy) {
|
public void MapSheetMngComplete(int mngYyyy) {
|
||||||
long execCount =
|
long execCount =
|
||||||
queryFactory
|
queryFactory
|
||||||
.update(mapSheetMngEntity)
|
.update(mapSheetMngEntity)
|
||||||
.set(mapSheetMngEntity.mngState, "COMPLETE")
|
.set(mapSheetMngEntity.mngState, "COMPLETE")
|
||||||
.where(mapSheetMngEntity.mngYyyy.eq(mngYyyy))
|
.where(mapSheetMngEntity.mngYyyy.eq(mngYyyy))
|
||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -557,12 +564,12 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteByFileUidMngFile(Long fileUid){
|
public void deleteByFileUidMngFile(Long fileUid) {
|
||||||
long deletedFileCount =
|
long deletedFileCount =
|
||||||
queryFactory
|
queryFactory
|
||||||
.delete(mapSheetMngFileEntity)
|
.delete(mapSheetMngFileEntity)
|
||||||
.where(mapSheetMngFileEntity.fileUid.eq(fileUid))
|
.where(mapSheetMngFileEntity.fileUid.eq(fileUid))
|
||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user