init
This commit is contained in:
@@ -0,0 +1,223 @@
|
||||
package com.kamco.cd.kamcoback.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.kamco.cd.kamcoback.inferface.EnumType;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.ToString;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
@Getter
|
||||
@ToString
|
||||
public class ApiResponseDto<T> {
|
||||
|
||||
private T data;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
private Error error;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
private T errorData;
|
||||
|
||||
@JsonIgnore private HttpStatus httpStatus;
|
||||
|
||||
@JsonIgnore private Long errorLogUid;
|
||||
|
||||
public ApiResponseDto(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
private ApiResponseDto(T data, HttpStatus httpStatus) {
|
||||
this.data = data;
|
||||
this.httpStatus = httpStatus;
|
||||
}
|
||||
|
||||
public ApiResponseDto(ApiResponseCode code) {
|
||||
this.error = new Error(code.getId(), code.getMessage());
|
||||
}
|
||||
|
||||
public ApiResponseDto(ApiResponseCode code, String message) {
|
||||
this.error = new Error(code.getId(), message);
|
||||
}
|
||||
|
||||
public ApiResponseDto(ApiResponseCode code, String message, HttpStatus httpStatus) {
|
||||
this.error = new Error(code.getId(), message);
|
||||
this.httpStatus = httpStatus;
|
||||
}
|
||||
|
||||
public ApiResponseDto(
|
||||
ApiResponseCode code, String message, HttpStatus httpStatus, Long errorLogUid) {
|
||||
this.error = new Error(code.getId(), message);
|
||||
this.httpStatus = httpStatus;
|
||||
this.errorLogUid = errorLogUid;
|
||||
}
|
||||
|
||||
public ApiResponseDto(ApiResponseCode code, String message, T errorData) {
|
||||
this.error = new Error(code.getId(), message);
|
||||
this.errorData = errorData;
|
||||
}
|
||||
|
||||
// HTTP 상태 코드가 내장된 ApiResponseDto 반환 메서드들
|
||||
public static <T> ApiResponseDto<T> createOK(T data) {
|
||||
return new ApiResponseDto<>(data, HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
public static <T> ApiResponseDto<T> ok(T data) {
|
||||
return new ApiResponseDto<>(data, HttpStatus.OK);
|
||||
}
|
||||
|
||||
public static <T> ApiResponseDto<ResponseObj> okObject(ResponseObj data) {
|
||||
if (data.getCode().equals(ApiResponseCode.OK)) {
|
||||
return new ApiResponseDto<>(data, HttpStatus.NO_CONTENT);
|
||||
} else {
|
||||
return new ApiResponseDto<>(data.getCode(), data.getMessage(), HttpStatus.CONFLICT);
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> ApiResponseDto<T> deleteOk(T data) {
|
||||
return new ApiResponseDto<>(data, HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
public static ApiResponseDto<String> createException(ApiResponseCode code) {
|
||||
return new ApiResponseDto<>(code);
|
||||
}
|
||||
|
||||
public static ApiResponseDto<String> createException(ApiResponseCode code, String message) {
|
||||
return new ApiResponseDto<>(code, message);
|
||||
}
|
||||
|
||||
public static ApiResponseDto<String> createException(
|
||||
ApiResponseCode code, String message, HttpStatus httpStatus) {
|
||||
return new ApiResponseDto<>(code, message, httpStatus);
|
||||
}
|
||||
|
||||
public static ApiResponseDto<String> createException(
|
||||
ApiResponseCode code, String message, HttpStatus httpStatus, Long errorLogUid) {
|
||||
return new ApiResponseDto<>(code, message, httpStatus, errorLogUid);
|
||||
}
|
||||
|
||||
public static <T> ApiResponseDto<T> createException(
|
||||
ApiResponseCode code, String message, T data) {
|
||||
return new ApiResponseDto<>(code, message, data);
|
||||
}
|
||||
|
||||
@Getter
|
||||
public static class Error {
|
||||
|
||||
private final String code;
|
||||
private final String message;
|
||||
|
||||
public Error(String code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
|
||||
/** Error가 아닌 Business상 성공이거나 실패인 경우, 메세지 함께 전달하기 위한 object */
|
||||
@Getter
|
||||
public static class ResponseObj {
|
||||
|
||||
private final ApiResponseCode code;
|
||||
private final String message;
|
||||
|
||||
public ResponseObj(ApiResponseCode code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum ApiResponseCode implements EnumType {
|
||||
|
||||
// @formatter:off
|
||||
OK("요청이 성공하였습니다."),
|
||||
BAD_REQUEST("요청 파라미터가 잘못되었습니다."),
|
||||
BAD_GATEWAY("네트워크 상태가 불안정합니다."),
|
||||
ALREADY_EXIST_MALL("이미 등록된 쇼핑센터입니다."),
|
||||
NOT_FOUND_MAP("지도를 찾을 수 없습니다."),
|
||||
UNAUTHORIZED("권한이 없습니다."),
|
||||
CONFLICT("이미 등록된 컨텐츠입니다."),
|
||||
NOT_FOUND("Resource를 찾을 수 없습니다."),
|
||||
NOT_FOUND_DATA("데이터를 찾을 수 없습니다."),
|
||||
NOT_FOUND_WEATHER_DATA("날씨 데이터를 찾을 수 없습니다."),
|
||||
FAIL_SEND_MESSAGE("메시지를 전송하지 못했습니다."),
|
||||
TOO_MANY_CONNECTED_MACHINES("연결된 기기가 너무 많습니다."),
|
||||
UNAUTHENTICATED("인증에 실패하였습니다."),
|
||||
INVALID_TOKEN("잘못된 토큰입니다."),
|
||||
EXPIRED_TOKEN("만료된 토큰입니다."),
|
||||
INTERNAL_SERVER_ERROR("서버에 문제가 발생 하였습니다."),
|
||||
FORBIDDEN("권한을 확인해주세요."),
|
||||
INVALID_PASSWORD("잘못된 비밀번호 입니다."),
|
||||
NOT_FOUND_CAR_IN("입차정보가 없습니다."),
|
||||
WRONG_STATUS("잘못된 상태입니다."),
|
||||
FAIL_VERIFICATION("인증에 실패하였습니다."),
|
||||
INVALID_EMAIL("잘못된 형식의 이메일입니다."),
|
||||
REQUIRED_EMAIL("이메일은 필수 항목입니다."),
|
||||
WRONG_PASSWORD("잘못된 패스워드입니다."),
|
||||
DUPLICATE_EMAIL("이미 가입된 이메일입니다."),
|
||||
DUPLICATE_DATA("이미 등록되어 있습니다."),
|
||||
DATA_INTEGRITY_ERROR("데이터 무결성이 위반되어 요청을 처리할수 없습니다."),
|
||||
FOREIGN_KEY_ERROR("참조 중인 데이터가 있어 삭제할 수 없습니다."),
|
||||
DUPLICATE_EMPLOYEEID("이미 가입된 사번입니다."),
|
||||
NOT_FOUND_USER_FOR_EMAIL("이메일로 유저를 찾을 수 없습니다."),
|
||||
NOT_FOUND_USER("사용자를 찾을 수 없습니다."),
|
||||
UNPROCESSABLE_ENTITY("이 데이터는 삭제할 수 없습니다."),
|
||||
LOGIN_ID_NOT_FOUND("아이디를 잘못 입력하셨습니다."),
|
||||
LOGIN_PASSWORD_MISMATCH("비밀번호를 잘못 입력하셨습니다."),
|
||||
LOGIN_PASSWORD_EXCEEDED("비밀번호 오류 횟수를 초과하여 이용하실 수 없습니다.\n로그인 오류에 대해 관리자에게 문의하시기 바랍니다."),
|
||||
INACTIVE_ID("사용할 수 없는 계정입니다."),
|
||||
INVALID_EMAIL_TOKEN(
|
||||
"You can only reset your password within 24 hours from when the email was sent.\n"
|
||||
+ "To reset your password again, please submit a new request through \"Forgot"
|
||||
+ " Password.\""),
|
||||
PAYLOAD_TOO_LARGE("업로드 용량 제한을 초과했습니다."),
|
||||
NOT_FOUND_TARGET_YEAR("기준년도 도엽을 찾을 수 없습니다."),
|
||||
NOT_FOUND_COMPARE_YEAR("비교년도 도엽을 찾을 수 없습니다."),
|
||||
FAIL_SAVE_MAP_SHEET("도엽 저장 중 오류가 발생했습니다."),
|
||||
FAIL_CREATE_MAP_SHEET_FILE("도엽 설정파일 생성 중 오류가 발생했습니다."),
|
||||
;
|
||||
// @formatter:on
|
||||
private final String message;
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public static ApiResponseCode getCode(String name) {
|
||||
return ApiResponseCode.valueOf(name.toUpperCase());
|
||||
}
|
||||
|
||||
public static String getMessage(String name) {
|
||||
return ApiResponseCode.valueOf(name.toUpperCase()).getText();
|
||||
}
|
||||
|
||||
public static ApiResponseCode from(String codeName, HttpStatus status) {
|
||||
|
||||
if (codeName != null && !codeName.isBlank()) {
|
||||
try {
|
||||
return ApiResponseCode.valueOf(codeName.toUpperCase());
|
||||
} catch (IllegalArgumentException ignore) {
|
||||
// fallback
|
||||
}
|
||||
}
|
||||
|
||||
if (status != null) {
|
||||
try {
|
||||
return ApiResponseCode.valueOf(status.name());
|
||||
} catch (IllegalArgumentException ignore) {
|
||||
// fallback
|
||||
}
|
||||
}
|
||||
|
||||
return INTERNAL_SERVER_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
159
imagery-make-dataset/src/main/java/com/kamco/cd/kamcoback/dto/FileDto.java
Executable file
159
imagery-make-dataset/src/main/java/com/kamco/cd/kamcoback/dto/FileDto.java
Executable file
@@ -0,0 +1,159 @@
|
||||
package com.kamco.cd.kamcoback.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
public class FileDto {
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class SrchFoldersDto {
|
||||
@Schema(description = "디렉토리경로(ROOT:/app/original-images)", example = "")
|
||||
@NotNull
|
||||
private String dirPath;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class SrchFilesDto {
|
||||
@Schema(description = "디렉토리경로", example = "D:\\kamco\\2022\\캠코_2021_2022_34602060_D1")
|
||||
@NotNull
|
||||
private String dirPath;
|
||||
|
||||
@Schema(description = "전체(*), cpg,dbf,geojson등", example = "*")
|
||||
@NotNull
|
||||
private String extension;
|
||||
|
||||
@Schema(description = "전체(*), 3878687.tif", example = "*")
|
||||
@NotNull
|
||||
private String fileNm;
|
||||
|
||||
@Schema(description = "파일명(name), 최종수정일(date)", example = "name")
|
||||
@NotNull
|
||||
private String sortType;
|
||||
|
||||
@Schema(description = "파일시작위치", example = "1")
|
||||
@NotNull
|
||||
private Integer startPos = 0;
|
||||
|
||||
@Schema(description = "파일종료위치", example = "100")
|
||||
@NotNull
|
||||
private Integer endPos = 100;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class SrchFilesDepthDto extends SrchFilesDto {
|
||||
@Schema(description = "최대폴더Depth", example = "5")
|
||||
@NotNull
|
||||
private Integer maxDepth;
|
||||
}
|
||||
|
||||
@Schema(name = "FolderDto", description = "폴더 정보")
|
||||
@Getter
|
||||
public static class FolderDto {
|
||||
private final String folderNm;
|
||||
private final String parentFolderNm;
|
||||
private final String parentPath;
|
||||
private final String fullPath;
|
||||
private final int depth;
|
||||
private final long childCnt;
|
||||
private final String lastModified;
|
||||
private final Boolean isValid;
|
||||
|
||||
public FolderDto(
|
||||
String folderNm,
|
||||
String parentFolderNm,
|
||||
String parentPath,
|
||||
String fullPath,
|
||||
int depth,
|
||||
long childCnt,
|
||||
String lastModified,
|
||||
Boolean isValid) {
|
||||
this.folderNm = folderNm;
|
||||
this.parentFolderNm = parentFolderNm;
|
||||
this.parentPath = parentPath;
|
||||
this.fullPath = fullPath;
|
||||
this.depth = depth;
|
||||
this.childCnt = childCnt;
|
||||
this.lastModified = lastModified;
|
||||
this.isValid = isValid;
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "FoldersDto", description = "폴더목록 정보")
|
||||
@Getter
|
||||
public static class FoldersDto {
|
||||
private final String dirPath;
|
||||
private final int folderTotCnt;
|
||||
private final int folderErrTotCnt;
|
||||
private final List<FolderDto> folders;
|
||||
|
||||
public FoldersDto(
|
||||
String dirPath, int folderTotCnt, int folderErrTotCnt, List<FolderDto> folders) {
|
||||
|
||||
this.dirPath = dirPath;
|
||||
this.folderTotCnt = folderTotCnt;
|
||||
this.folderErrTotCnt = folderErrTotCnt;
|
||||
this.folders = folders;
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "File Basic", description = "파일 기본 정보")
|
||||
@Getter
|
||||
public static class Basic {
|
||||
|
||||
private final String fileNm;
|
||||
private final String parentFolderNm;
|
||||
private final String parentPath;
|
||||
private final String fullPath;
|
||||
private final String extension;
|
||||
private final long fileSize;
|
||||
private final String lastModified;
|
||||
|
||||
public Basic(
|
||||
String fileNm,
|
||||
String parentFolderNm,
|
||||
String parentPath,
|
||||
String fullPath,
|
||||
String extension,
|
||||
long fileSize,
|
||||
String lastModified) {
|
||||
this.fileNm = fileNm;
|
||||
this.parentFolderNm = parentFolderNm;
|
||||
this.parentPath = parentPath;
|
||||
this.fullPath = fullPath;
|
||||
this.extension = extension;
|
||||
this.fileSize = fileSize;
|
||||
this.lastModified = lastModified;
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "FilesDto", description = "파일 목록 정보")
|
||||
@Getter
|
||||
public static class FilesDto {
|
||||
private final String dirPath;
|
||||
private final int fileTotCnt;
|
||||
private final long fileTotSize;
|
||||
private final List<Basic> files;
|
||||
|
||||
public FilesDto(String dirPath, int fileTotCnt, long fileTotSize, List<Basic> files) {
|
||||
|
||||
this.dirPath = dirPath;
|
||||
this.fileTotCnt = fileTotCnt;
|
||||
this.fileTotSize = fileTotSize;
|
||||
this.files = files;
|
||||
}
|
||||
}
|
||||
}
|
||||
467
imagery-make-dataset/src/main/java/com/kamco/cd/kamcoback/dto/MapSheetDto.java
Executable file
467
imagery-make-dataset/src/main/java/com/kamco/cd/kamcoback/dto/MapSheetDto.java
Executable file
@@ -0,0 +1,467 @@
|
||||
package com.kamco.cd.kamcoback.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.kamco.cd.kamcoback.enums.Enums;
|
||||
import com.kamco.cd.kamcoback.enums.MngStateType;
|
||||
import com.kamco.cd.kamcoback.enums.SyncStateType;
|
||||
import com.kamco.cd.kamcoback.inferface.EnumType;
|
||||
import com.kamco.cd.kamcoback.inferface.JsonFormatDttm;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
|
||||
public class MapSheetDto {
|
||||
|
||||
@Schema(name = "MngSearchReq", description = "영상관리 검색 요청")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class MngSearchReq {
|
||||
|
||||
// 페이징 파라미터
|
||||
@Schema(description = "페이지 번호 (0부터 시작) ", example = "0")
|
||||
private int page = 0;
|
||||
|
||||
@Schema(description = "페이지 크기", example = "20")
|
||||
private int size = 20;
|
||||
|
||||
@Schema(description = "년도", example = "2025")
|
||||
private Integer mngYyyy;
|
||||
|
||||
public Pageable toPageable() {
|
||||
return PageRequest.of(page, size);
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "MngAddReq", description = "영상관리 생성 요청")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class AddReq {
|
||||
|
||||
@Schema(description = "관리년도", example = "2022")
|
||||
private int mngYyyy;
|
||||
|
||||
@Schema(description = "선택폴더경로", example = "D:\\app\\original-images\\2022")
|
||||
private String mngPath;
|
||||
|
||||
@JsonIgnore private Long createdUid;
|
||||
}
|
||||
|
||||
@Schema(name = "DeleteFileReq", description = "파일 삭제 요청")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class DeleteFileReq {
|
||||
|
||||
@Schema(description = "파일 경로", example = "/app/original-images/2024/00000001.tif")
|
||||
private String filePath;
|
||||
}
|
||||
|
||||
@Schema(name = "MngDto", description = "영상관리 검색 리턴")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class MngDto {
|
||||
|
||||
private int rowNum;
|
||||
private int mngYyyy;
|
||||
private String mngPath;
|
||||
private String mngState;
|
||||
private String syncState;
|
||||
private String syncDataCheckState;
|
||||
private Long syncTotCnt;
|
||||
private Long syncStateDoneCnt;
|
||||
private Long syncDataCheckDoneCnt;
|
||||
private Long syncNotPaireCnt;
|
||||
private Long syncNotPaireExecCnt;
|
||||
private Long syncDuplicateCnt;
|
||||
private Long syncDuplicateExecCnt;
|
||||
private Long syncFaultCnt;
|
||||
private Long syncFaultExecCnt;
|
||||
private Long syncNoFileCnt;
|
||||
private Long syncNoFileExecCnt;
|
||||
@JsonFormatDttm private ZonedDateTime rgstStrtDttm;
|
||||
@JsonFormatDttm private ZonedDateTime rgstEndDttm;
|
||||
|
||||
public String getSyncState() {
|
||||
|
||||
if (this.syncStateDoneCnt == 0) {
|
||||
return "NOTYET";
|
||||
} else if (this.syncStateDoneCnt < this.syncTotCnt) {
|
||||
return "PROCESSING";
|
||||
}
|
||||
|
||||
return "DONE";
|
||||
}
|
||||
|
||||
public String getDataCheckState() {
|
||||
|
||||
if (this.syncDataCheckDoneCnt == 0) {
|
||||
return "NOTYET";
|
||||
} else if (this.syncDataCheckDoneCnt < this.syncTotCnt) {
|
||||
return "PROCESSING";
|
||||
}
|
||||
|
||||
return "DONE";
|
||||
}
|
||||
|
||||
public double getSyncStateDoneRate() {
|
||||
if (this.syncTotCnt == null || this.syncTotCnt == 0) {
|
||||
return 0.0;
|
||||
}
|
||||
return (double) this.syncStateDoneCnt / this.syncTotCnt * 100.0;
|
||||
}
|
||||
|
||||
public double getSyncDataCheckDoneRate() {
|
||||
if (this.syncTotCnt == null || this.syncTotCnt == 0) {
|
||||
return 0.0;
|
||||
}
|
||||
return (double) this.syncDataCheckDoneCnt / this.syncTotCnt * 100.0;
|
||||
}
|
||||
|
||||
public long getSyncErrorTotCnt() {
|
||||
return this.syncNotPaireCnt + this.syncDuplicateCnt + this.syncFaultCnt;
|
||||
}
|
||||
|
||||
public long getSyncErrorExecTotCnt() {
|
||||
return this.syncNotPaireExecCnt + this.syncDuplicateExecCnt + this.syncFaultExecCnt;
|
||||
}
|
||||
|
||||
public String getMngState() {
|
||||
|
||||
String mngState = "DONE";
|
||||
|
||||
if (this.syncStateDoneCnt == 0) {
|
||||
mngState = "NOTYET";
|
||||
} else if (this.syncStateDoneCnt < this.syncTotCnt) {
|
||||
mngState = "PROCESSING";
|
||||
}
|
||||
|
||||
if ((this.syncNotPaireExecCnt + this.syncDuplicateExecCnt + this.syncFaultExecCnt) > 0) {
|
||||
mngState = "TAKINGERROR";
|
||||
}
|
||||
|
||||
return mngState;
|
||||
}
|
||||
|
||||
public String getMngStateName() {
|
||||
String enumId = this.getMngState();
|
||||
if (enumId == null || enumId.isEmpty()) {
|
||||
enumId = "NOTYET";
|
||||
}
|
||||
|
||||
MngStateType type = Enums.fromId(MngStateType.class, enumId);
|
||||
return type.getText();
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "ErrorSearchReq", description = "영상관리 오류데이터 검색 요청")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class ErrorSearchReq {
|
||||
|
||||
// 페이징 파라미터
|
||||
@Schema(description = "페이지 번호 (0부터 시작) ", example = "0")
|
||||
private int page = 0;
|
||||
|
||||
@Schema(description = "페이지 크기", example = "20")
|
||||
private int size = 20;
|
||||
|
||||
@Schema(description = "정렬", example = "id desc")
|
||||
private String sort;
|
||||
|
||||
@Schema(description = "오류종류(페어누락:NOTPAIR,중복파일:DUPLICATE,손상파일:FAULT)", example = "NOTPAIR")
|
||||
private String syncState;
|
||||
|
||||
@Schema(description = "처리유형(처리:DONE,미처리:NOTYET)", example = "DONE")
|
||||
private String syncCheckState;
|
||||
|
||||
@Schema(description = "검색어", example = "부산3959")
|
||||
private String searchValue;
|
||||
|
||||
@Schema(description = "년도", example = "2025")
|
||||
private Integer mngYyyy;
|
||||
|
||||
public Pageable toPageable() {
|
||||
if (sort != null && !sort.isEmpty()) {
|
||||
String[] sortParams = sort.split(",");
|
||||
String property = sortParams[0];
|
||||
Sort.Direction direction =
|
||||
sortParams.length > 1 ? Sort.Direction.fromString(sortParams[1]) : Sort.Direction.ASC;
|
||||
return PageRequest.of(page, size, Sort.by(direction, property));
|
||||
}
|
||||
return PageRequest.of(page, size);
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "ErrorDataDto", description = "영상관리 오류데이터 검색 리턴")
|
||||
@Getter
|
||||
@Setter
|
||||
public static class ErrorDataDto {
|
||||
|
||||
private Long hstUid;
|
||||
private Integer mngYyyy;
|
||||
private String mapSheetNum;
|
||||
private String refMapSheetNum;
|
||||
private String map50kName;
|
||||
private String map5kName;
|
||||
private String mapSrcName;
|
||||
private Integer mapCodeSrc;
|
||||
@JsonFormatDttm private ZonedDateTime createdDttm;
|
||||
|
||||
private String syncState;
|
||||
private String syncStateName;
|
||||
private String syncTfwFileName;
|
||||
private String syncTifFileName;
|
||||
|
||||
private String errorCheckState;
|
||||
private String errorCheckStateName;
|
||||
private String errorCheckTfwFileName;
|
||||
private String errorCheckTifFileName;
|
||||
|
||||
// private List<MngFIleDto> fileArray;
|
||||
|
||||
public ErrorDataDto(
|
||||
Long hstUid,
|
||||
Integer mngYyyy,
|
||||
String mapSheetNum,
|
||||
String refMapSheetNum,
|
||||
String map50kName,
|
||||
String map5kName,
|
||||
String mapSrcName,
|
||||
Integer mapCodeSrc,
|
||||
ZonedDateTime createdDttm,
|
||||
String syncState,
|
||||
String syncTfwFileName,
|
||||
String syncTifFileName,
|
||||
String errorCheckState,
|
||||
String errorCheckTfwFileName,
|
||||
String errorCheckTifFileName) {
|
||||
this.hstUid = hstUid;
|
||||
this.mngYyyy = mngYyyy;
|
||||
this.mapSheetNum = mapSheetNum;
|
||||
this.refMapSheetNum = refMapSheetNum;
|
||||
this.map50kName = map50kName;
|
||||
this.map5kName = map5kName;
|
||||
this.mapSrcName = mapSrcName;
|
||||
this.mapCodeSrc = mapCodeSrc;
|
||||
this.createdDttm = createdDttm;
|
||||
this.syncState = syncState;
|
||||
this.syncStateName = getSyncStateName(syncState);
|
||||
this.syncTfwFileName = syncTfwFileName;
|
||||
this.syncTifFileName = syncTifFileName;
|
||||
this.errorCheckState = errorCheckState;
|
||||
this.errorCheckStateName = getSyncStateName(errorCheckState);
|
||||
this.errorCheckTfwFileName = errorCheckTfwFileName;
|
||||
this.errorCheckTifFileName = errorCheckTifFileName;
|
||||
}
|
||||
|
||||
private String getSyncStateName(String enumId) {
|
||||
if (enumId == null || enumId.isEmpty()) {
|
||||
enumId = "NOTYET";
|
||||
}
|
||||
|
||||
SyncStateType type = Enums.fromId(SyncStateType.class, enumId);
|
||||
return type.getText();
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "SyncCheckStateReqUpdateDto", description = "영상관리 오류처리 상태변경요청")
|
||||
@Getter
|
||||
@Setter
|
||||
public static class SyncCheckStateReqUpdateDto {
|
||||
|
||||
private Long hstUid;
|
||||
private String filePath;
|
||||
private String syncCheckTfwFileName;
|
||||
private String syncCheckTifFileName;
|
||||
private String syncCheckState;
|
||||
}
|
||||
|
||||
@Schema(name = "MngFIleDto", description = "관리파일정보")
|
||||
@Getter
|
||||
@Setter
|
||||
public static class MngFIleDto {
|
||||
|
||||
private Long fileUid;
|
||||
private String filePath;
|
||||
private String fileName;
|
||||
private Long fileSize;
|
||||
private String fileState;
|
||||
private Long hstUid;
|
||||
}
|
||||
|
||||
@Schema(name = "DmlReturn", description = "영상관리 DML 수행 후 리턴")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class DmlReturn {
|
||||
|
||||
private String flag;
|
||||
private String message;
|
||||
}
|
||||
|
||||
@Schema(name = "MngFileAddReq", description = "영상관리파일 등록 요청")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class MngFileAddReq {
|
||||
|
||||
private int mngYyyy;
|
||||
private String mapSheetNum;
|
||||
private String refMapSheetNum;
|
||||
private String filePath;
|
||||
private String fileName;
|
||||
private String fileExt;
|
||||
private Long hstUid;
|
||||
private Long fileSize;
|
||||
private String fileState;
|
||||
}
|
||||
|
||||
@Schema(name = "MngFilesDto", description = "영상파일내역 검색 리턴")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class MngFilesDto {
|
||||
|
||||
private long fileUid;
|
||||
private int mngYyyy;
|
||||
private String mapSheetNum;
|
||||
private String refMapSheetNum;
|
||||
private String filePath;
|
||||
private String fileName;
|
||||
private String fileExt;
|
||||
private Long hstUid;
|
||||
private Long fileSize;
|
||||
}
|
||||
|
||||
@Schema(name = "ResisterYearList", description = "영상파일 등록을 위한 연도 list")
|
||||
@Getter
|
||||
public static class ResisterYearList {
|
||||
|
||||
private Integer current;
|
||||
private List<Integer> years;
|
||||
|
||||
public ResisterYearList(Integer current, List<Integer> years) {
|
||||
this.current = current;
|
||||
this.years = years;
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum MapSheetState implements EnumType {
|
||||
// @formatter:off
|
||||
DONE("완료"),
|
||||
NOTYET("처리대기");
|
||||
// @formatter:on
|
||||
|
||||
private final String message;
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText() {
|
||||
return message;
|
||||
}
|
||||
}
|
||||
|
||||
// 연도리스틀 조회시 사용하는 request Dto
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public static class YearSearchReq {
|
||||
|
||||
private String status;
|
||||
|
||||
// 페이징 파라미터
|
||||
private int page = 0;
|
||||
private int size = 20;
|
||||
private String sort;
|
||||
|
||||
@Builder
|
||||
public YearSearchReq(String status, int page, int size, String sort) {
|
||||
this.status = status;
|
||||
this.page = page;
|
||||
this.size = size;
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public Pageable toPageable() {
|
||||
if (sort != null && !sort.isEmpty()) {
|
||||
String[] sortParams = sort.split(",");
|
||||
String property = sortParams[0];
|
||||
Sort.Direction direction =
|
||||
sortParams.length > 1 ? Sort.Direction.fromString(sortParams[1]) : Sort.Direction.ASC;
|
||||
return PageRequest.of(page, size, Sort.by(direction, property));
|
||||
}
|
||||
return PageRequest.of(page, size);
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "MngListDto", description = "영상파일내역 검색 목록")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class MngListDto {
|
||||
|
||||
private int mngYyyy;
|
||||
private String mapSheetNum;
|
||||
private String mapSheetName;
|
||||
private Integer beforeYear;
|
||||
private Boolean isSuccess;
|
||||
}
|
||||
|
||||
@Schema(name = "MngListDto", description = "영상파일내역 검색 목록")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class MngListCompareDto {
|
||||
|
||||
private String mngYyyy;
|
||||
private String mapSheetNum;
|
||||
private Integer beforeYear;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class TotalListDto {
|
||||
|
||||
private String mapSheetNum;
|
||||
private Integer beforeYear;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class MngYyyyDto {
|
||||
private Integer yyyy;
|
||||
private String mngPath;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
package com.kamco.cd.kamcoback.dto;
|
||||
|
||||
import com.kamco.cd.kamcoback.inferface.JsonFormatDttm;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.ZonedDateTime;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
public class MapSheetMngDto {
|
||||
|
||||
@Schema(name = "MngSearchReq", description = "영상관리 검색 요청")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class MngSearchReq {
|
||||
|
||||
// 페이징 파라미터
|
||||
@Schema(description = "페이지 번호 (0부터 시작) ", example = "0")
|
||||
private int page = 0;
|
||||
|
||||
@Schema(description = "페이지 크기", example = "20")
|
||||
private int size = 20;
|
||||
|
||||
@Schema(description = "년도", example = "2025")
|
||||
private Integer mngYyyy;
|
||||
|
||||
public Pageable toPageable() {
|
||||
return PageRequest.of(page, size);
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "MngDto", description = "영상관리 검색 리턴")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class MngDto {
|
||||
private int rowNum;
|
||||
private int mngYyyy;
|
||||
private String mngState;
|
||||
private String syncState;
|
||||
private String syncCheckState;
|
||||
private Long syncTotCnt;
|
||||
private Long syncStateDoneCnt;
|
||||
private Long syncCheckStateDoneCnt;
|
||||
private Long syncNotFileCnt;
|
||||
private Long syncTypeErrorCnt;
|
||||
private Long syncSizeErrorCnt;
|
||||
@JsonFormatDttm private ZonedDateTime rgstStrtDttm;
|
||||
@JsonFormatDttm private ZonedDateTime rgstEndDttm;
|
||||
}
|
||||
|
||||
@Schema(name = "MngHstDto", description = "영상관리내역 검색 리턴")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class MngHstDto {
|
||||
private long hstUid;
|
||||
private int mngYyyy;
|
||||
private String mapSheetNum;
|
||||
private String refMapSheetNum;
|
||||
private String dataState;
|
||||
private String syncState;
|
||||
private String syncCheckState;
|
||||
@JsonFormatDttm private ZonedDateTime syncStrtDttm;
|
||||
@JsonFormatDttm private ZonedDateTime syncEndDttm;
|
||||
@JsonFormatDttm private ZonedDateTime syncCheckStrtDttm;
|
||||
@JsonFormatDttm private ZonedDateTime syncCheckEndDttm;
|
||||
|
||||
private String mapSheetPath;
|
||||
private String syncTifFileName;
|
||||
private String syncTfwFileName;
|
||||
private String useInference;
|
||||
private String syncMngPath;
|
||||
}
|
||||
|
||||
@Schema(name = "MngFileAddReq", description = "영상관리파일 등록 요청")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class MngFileAddReq {
|
||||
private int mngYyyy;
|
||||
private String mapSheetNum;
|
||||
private String refMapSheetNum;
|
||||
private String filePath;
|
||||
private String fileName;
|
||||
private String fileExt;
|
||||
private Long hstUid;
|
||||
private Long fileSize;
|
||||
private String fileState;
|
||||
}
|
||||
|
||||
@Schema(name = "MngFilesDto", description = "영상관리내역 검색 리턴")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class MngFilesDto {
|
||||
private long fileUid;
|
||||
private int mngYyyy;
|
||||
private String mapSheetNum;
|
||||
private String refMapSheetNum;
|
||||
private String filePath;
|
||||
private String fileName;
|
||||
private String fileExt;
|
||||
private Long hstUid;
|
||||
private Long fileSize;
|
||||
}
|
||||
|
||||
@Schema(name = "MngListCompareDto", description = "영상파일 비교가능 이전년도정보")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class MngListCompareDto {
|
||||
|
||||
private String mngYyyy;
|
||||
private String mapSheetNum;
|
||||
private Integer beforeYear;
|
||||
}
|
||||
|
||||
@Schema(name = "DmlReturn", description = "영상관리 DML 수행 후 리턴")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class DmlReturn {
|
||||
private String flag;
|
||||
private String message;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user