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

@@ -101,8 +101,7 @@ public class MapSheetMngApiController {
@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) {
@@ -270,34 +266,30 @@ public class MapSheetMngService {
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
.getOriginalFilename()
.substring(tfwFile.getOriginalFilename().lastIndexOf('.') + 1) .substring(tfwFile.getOriginalFilename().lastIndexOf('.') + 1)
.toLowerCase() .toLowerCase()
.equals("tfw") ) .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,12 +367,11 @@ 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
@@ -382,13 +381,16 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
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)
.as("map50kName"),
Expressions.stringTemplate( Expressions.stringTemplate(
"concat({0},substring({1}, 6, 8))", "concat({0},substring({1}, 6, 8))",
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum).as("map5kName"), mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum)
.as("map5kName"),
Expressions.stringTemplate( Expressions.stringTemplate(
"concat({0},substring({1}, 6, 8))", "concat({0},substring({1}, 6, 8))",
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum).as("mapSrcName"), mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum)
.as("mapSrcName"),
mapInkx5kEntity.fid, mapInkx5kEntity.fid,
mapSheetMngHstEntity.createdDate, mapSheetMngHstEntity.createdDate,
mapSheetMngHstEntity.syncState, mapSheetMngHstEntity.syncState,
@@ -396,18 +398,16 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
mapSheetMngHstEntity.syncTifFileName, mapSheetMngHstEntity.syncTifFileName,
mapSheetMngHstEntity.syncCheckState, mapSheetMngHstEntity.syncCheckState,
mapSheetMngHstEntity.syncCheckTfwFileName, mapSheetMngHstEntity.syncCheckTfwFileName,
mapSheetMngHstEntity.syncCheckTifFileName mapSheetMngHstEntity.syncCheckTifFileName))
)
)
.from(mapSheetMngHstEntity) .from(mapSheetMngHstEntity)
.innerJoin(mapInkx5kEntity).on(mapSheetMngHstEntity.mapSheetNum.eq(mapInkx5kEntity.mapidcdNo)) .innerJoin(mapInkx5kEntity)
.on(mapSheetMngHstEntity.mapSheetNum.eq(mapInkx5kEntity.mapidcdNo))
.where(whereBuilder) .where(whereBuilder)
.fetchOne(); .fetchOne();
return foundContent; return foundContent;
} }
public void MapSheetMngComplete(int mngYyyy) { public void MapSheetMngComplete(int mngYyyy) {
long execCount = long execCount =
queryFactory queryFactory