spotlessApply

This commit is contained in:
2025-12-17 15:35:14 +09:00
parent d6b6e77a88
commit 3213b1e9a7
10 changed files with 82 additions and 111 deletions

View File

@@ -9,10 +9,9 @@ import lombok.Getter;
public enum MngStateType implements EnumType { public enum MngStateType implements EnumType {
NOTYET("미처리"), NOTYET("미처리"),
PROCESSING("진행중"), PROCESSING("진행중"),
DONE ("싱크완료"), DONE("싱크완료"),
COMPLETE("작업완료"); COMPLETE("작업완료");
private final String desc; private final String desc;
@Override @Override

View File

@@ -4,7 +4,6 @@ import com.kamco.cd.kamcoback.config.enums.EnumType;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
@Getter @Getter
@AllArgsConstructor @AllArgsConstructor
public enum SyncStateType implements EnumType { public enum SyncStateType implements EnumType {
@@ -28,5 +27,3 @@ public enum SyncStateType implements EnumType {
return desc; return desc;
} }
} }

View File

@@ -12,7 +12,6 @@ import org.springframework.stereotype.Component;
@Setter @Setter
public class FileConfig { public class FileConfig {
//private String rootSyncDir = "D:\\app\\original-images"; // private String rootSyncDir = "D:\\app\\original-images";
private String rootSyncDir = "/app/original-images"; private String rootSyncDir = "/app/original-images";
} }

View File

@@ -88,21 +88,20 @@ public class MapSheetMngApiController {
@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("/mng-complete") @PutMapping("/mng-complete")
public ApiResponseDto<MapSheetMngDto.DmlReturn> mngComplete( public ApiResponseDto<MapSheetMngDto.DmlReturn> mngComplete(@RequestParam @Valid int mngYyyy) {
@RequestParam @Valid int mngYyyy) {
return ApiResponseDto.ok(mapSheetMngService.mngComplete(mngYyyy)); return ApiResponseDto.ok(mapSheetMngService.mngComplete(mngYyyy));
} }
@@ -118,7 +117,6 @@ public class MapSheetMngApiController {
return ApiResponseDto.ok(mapSheetMngService.findMapSheetErrorList(searchReq)); return ApiResponseDto.ok(mapSheetMngService.findMapSheetErrorList(searchReq));
} }
@Operation(summary = "오류데이터 팝업 > 업로드 처리", description = "오류데이터 팝업 > 업로드 처리") @Operation(summary = "오류데이터 팝업 > 업로드 처리", description = "오류데이터 팝업 > 업로드 처리")
@ApiResponses( @ApiResponses(
value = { value = {
@@ -150,16 +148,12 @@ public class MapSheetMngApiController {
return ApiResponseDto.ok(mapSheetMngService.updateExceptUseInference(hstUidList)); return ApiResponseDto.ok(mapSheetMngService.updateExceptUseInference(hstUidList));
} }
@Operation(summary = "페어 파일 업로드", description = "TFW/TIF 두 파일을 쌍으로 업로드 및 검증") @Operation(summary = "페어 파일 업로드", description = "TFW/TIF 두 파일을 쌍으로 업로드 및 검증")
@PostMapping(value = "/upload-pair", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) @PostMapping(value = "/upload-pair", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public ApiResponseDto<MapSheetMngDto.DmlReturn> uploadPair( public ApiResponseDto<MapSheetMngDto.DmlReturn> uploadPair(
@RequestPart("tfw") MultipartFile tfwFile, @RequestPart("tfw") MultipartFile tfwFile,
@RequestPart("tif") MultipartFile tifFile, @RequestPart("tif") MultipartFile tifFile,
@RequestParam(value = "hstUid", required = false) Long hstUid) { @RequestParam(value = "hstUid", required = false) Long hstUid) {
return ApiResponseDto.createOK( return ApiResponseDto.createOK(mapSheetMngService.uploadPair(tfwFile, tifFile, hstUid));
mapSheetMngService.uploadPair(tfwFile, tifFile, hstUid));
} }
} }

View File

@@ -83,8 +83,6 @@ public class MapSheetMngFileCheckerApiController {
mapSheetMngFileCheckerService.uploadFile(file, targetPath, overwrite, hstUid)); mapSheetMngFileCheckerService.uploadFile(file, targetPath, overwrite, hstUid));
} }
@Operation(summary = "파일 삭제", description = "중복 파일 등 파일 삭제") @Operation(summary = "파일 삭제", description = "중복 파일 등 파일 삭제")
@PostMapping("/delete") @PostMapping("/delete")
public ApiResponseDto<Boolean> deleteFile(@RequestBody SrchFoldersDto dto) { public ApiResponseDto<Boolean> deleteFile(@RequestBody SrchFoldersDto dto) {

View File

@@ -107,10 +107,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();
@@ -180,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,
@@ -213,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();
@@ -242,8 +240,6 @@ public class MapSheetMngDto {
private String message; private String message;
} }
@Getter @Getter
@AllArgsConstructor @AllArgsConstructor
public enum DataState implements EnumType { public enum DataState implements EnumType {

View File

@@ -2,9 +2,6 @@ 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.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;
@@ -224,7 +221,6 @@ public class MapSheetMngService {
return mapSheetMngCoreService.findMapSheetMng(mngYyyy); return mapSheetMngCoreService.findMapSheetMng(mngYyyy);
} }
@Transactional @Transactional
public MapSheetMngDto.DmlReturn mngComplete(int mngYyyy) { public MapSheetMngDto.DmlReturn mngComplete(int mngYyyy) {
@@ -268,36 +264,32 @@ public class MapSheetMngService {
@Transactional @Transactional
public MapSheetMngDto.DmlReturn uploadPair( public MapSheetMngDto.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 MapSheetMngDto.DmlReturn("fail", "TFW 파일이(0Byte) 비어있습니다."); return new MapSheetMngDto.DmlReturn("fail", "TFW 파일이(0Byte) 비어있습니다.");
}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 MapSheetMngDto.DmlReturn("fail", "TIF 파일이(0Byte) 비어있습니다.");
} }
if( ! tfwFile.getOriginalFilename() if (!tfwFile
.substring(tfwFile.getOriginalFilename().lastIndexOf('.') + 1) .getOriginalFilename()
.toLowerCase() .substring(tfwFile.getOriginalFilename().lastIndexOf('.') + 1)
.equals("tfw") ) .toLowerCase()
{ .equals("tfw")) {
return new MapSheetMngDto.DmlReturn("fail", "파일명이 TFW형식이 아닙니다."); return new MapSheetMngDto.DmlReturn("fail", "파일명이 TFW형식이 아닙니다.");
}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 MapSheetMngDto.DmlReturn("fail", "파일명이 TIF형식이 아닙니다."); }
}
return new MapSheetMngDto.DmlReturn("success", "파일 업로드 완료되었습니다."); return new MapSheetMngDto.DmlReturn("success", "파일 업로드 완료되었습니다.");
} }
} }

View File

@@ -44,18 +44,15 @@ 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);
} }
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()) {

View File

@@ -5,12 +5,11 @@ import com.kamco.cd.kamcoback.log.dto.EventType;
import com.kamco.cd.kamcoback.postgres.CommonCreateEntity; import com.kamco.cd.kamcoback.postgres.CommonCreateEntity;
import jakarta.persistence.*; import jakarta.persistence.*;
import jakarta.validation.constraints.Size; import jakarta.validation.constraints.Size;
import java.time.ZonedDateTime;
import lombok.AccessLevel; import lombok.AccessLevel;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.time.ZonedDateTime;
@Entity @Entity
@Getter @Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED) @NoArgsConstructor(access = AccessLevel.PROTECTED)

View File

@@ -367,54 +367,54 @@ 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,
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;
} }
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