spotlessApply 적용

This commit is contained in:
2025-12-17 11:31:34 +09:00
parent 3efb5302df
commit 7dad0496d0
5 changed files with 149 additions and 161 deletions

View File

@@ -47,20 +47,19 @@ public class MapSheetMngApiController {
@Operation(summary = "영상데이터관리 상세", description = "영상데이터관리 상세") @Operation(summary = "영상데이터관리 상세", description = "영상데이터관리 상세")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse( @ApiResponse(
responseCode = "200", responseCode = "200",
description = "조회 성공", description = "조회 성공",
content = content =
@Content( @Content(
mediaType = "application/json", mediaType = "application/json",
schema = @Schema(implementation = CommonCodeDto.Basic.class))), schema = @Schema(implementation = CommonCodeDto.Basic.class))),
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content), @ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
}) })
@GetMapping("/mng") @GetMapping("/mng")
public ApiResponseDto<MapSheetMngDto.MngDto> findMapSheetMng( public ApiResponseDto<MapSheetMngDto.MngDto> findMapSheetMng(@RequestParam int mngYyyy) {
@RequestParam int mngYyyy) {
return ApiResponseDto.ok(mapSheetMngService.findMapSheetMng(mngYyyy)); return ApiResponseDto.ok(mapSheetMngService.findMapSheetMng(mngYyyy));
} }

View File

@@ -4,7 +4,6 @@ import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm;
import com.kamco.cd.kamcoback.config.enums.EnumType; 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 java.util.List;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@@ -162,12 +161,11 @@ public class MapSheetMngDto {
private String syncState; private String syncState;
private String syncCheckState; private String syncCheckState;
//private Long fileUid; // private Long fileUid;
private String tfwFileName; private String tfwFileName;
private String tifFileName; private String tifFileName;
//private List<MngFIleDto> fileArray; // private List<MngFIleDto> fileArray;
public ErrorDataDto( public ErrorDataDto(
Long hstUid, Long hstUid,

View File

@@ -212,7 +212,6 @@ public class MapSheetMngService {
} }
} }
public List<MapSheetMngDto.MngDto> findMapSheetMngList() { public List<MapSheetMngDto.MngDto> findMapSheetMngList() {
return mapSheetMngCoreService.findMapSheetMngList(); return mapSheetMngCoreService.findMapSheetMngList();
} }
@@ -226,8 +225,6 @@ public class MapSheetMngService {
return mapSheetMngCoreService.findMapSheetErrorList(searchReq); return mapSheetMngCoreService.findMapSheetErrorList(searchReq);
} }
@Transactional @Transactional
public MapSheetMngDto.DmlReturn mngDataSave(MapSheetMngDto.AddReq AddReq) { public MapSheetMngDto.DmlReturn mngDataSave(MapSheetMngDto.AddReq AddReq) {
return mapSheetMngCoreService.mngDataSave(AddReq); return mapSheetMngCoreService.mngDataSave(AddReq);

View File

@@ -1,7 +1,6 @@
package com.kamco.cd.kamcoback.postgres.repository.mapsheet; package com.kamco.cd.kamcoback.postgres.repository.mapsheet;
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto; import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto;
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.MngDto;
import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngHstEntity; import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngHstEntity;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import java.util.List; import java.util.List;

View File

@@ -9,7 +9,6 @@ import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetMngHstEntity.mapSh
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto; import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto;
import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngHstEntity; import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngHstEntity;
import com.querydsl.core.BooleanBuilder; import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.Tuple;
import com.querydsl.core.types.Projections; import com.querydsl.core.types.Projections;
import com.querydsl.core.types.dsl.BooleanExpression; import com.querydsl.core.types.dsl.BooleanExpression;
import com.querydsl.core.types.dsl.CaseBuilder; import com.querydsl.core.types.dsl.CaseBuilder;
@@ -20,10 +19,7 @@ import com.querydsl.jpa.impl.JPAQueryFactory;
import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceContext; import jakarta.persistence.PersistenceContext;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.Optional; import java.util.Optional;
import org.hibernate.query.Query; import org.hibernate.query.Query;
@@ -49,12 +45,12 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
@Override @Override
public List<MapSheetMngDto.MngDto> findMapSheetMngList() { public List<MapSheetMngDto.MngDto> findMapSheetMngList() {
//Pageable pageable = searchReq.toPageable(); // Pageable pageable = searchReq.toPageable();
BooleanBuilder whereBuilder = new BooleanBuilder(); BooleanBuilder whereBuilder = new BooleanBuilder();
//if (searchReq.getMngYyyy() != null) { // if (searchReq.getMngYyyy() != null) {
//whereBuilder.and(mapSheetMngEntity.mngYyyy.eq(searchReq.getMngYyyy())); // whereBuilder.and(mapSheetMngEntity.mngYyyy.eq(searchReq.getMngYyyy()));
//} // }
NumberExpression<Long> totalCount = mapSheetMngHstEntity.count().as("syncTotCnt"); NumberExpression<Long> totalCount = mapSheetMngHstEntity.count().as("syncTotCnt");
@@ -155,8 +151,8 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
.leftJoin(mapSheetMngHstEntity) .leftJoin(mapSheetMngHstEntity)
.on(mapSheetMngEntity.mngYyyy.eq(mapSheetMngHstEntity.mngYyyy)) .on(mapSheetMngEntity.mngYyyy.eq(mapSheetMngHstEntity.mngYyyy))
.where(whereBuilder) .where(whereBuilder)
//.offset(pageable.getOffset()) // .offset(pageable.getOffset())
//.limit(pageable.getPageSize()) // .limit(pageable.getPageSize())
.orderBy(mapSheetMngEntity.mngYyyy.desc()) .orderBy(mapSheetMngEntity.mngYyyy.desc())
.groupBy(mapSheetMngEntity.mngYyyy) .groupBy(mapSheetMngEntity.mngYyyy)
.fetch(); .fetch();
@@ -171,102 +167,102 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
return foundContent; return foundContent;
} }
public MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy){ public MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy) {
BooleanBuilder whereBuilder = new BooleanBuilder(); BooleanBuilder whereBuilder = new BooleanBuilder();
whereBuilder.and(mapSheetMngEntity.mngYyyy.eq(mngYyyy)); whereBuilder.and(mapSheetMngEntity.mngYyyy.eq(mngYyyy));
MapSheetMngDto.MngDto foundContent = MapSheetMngDto.MngDto foundContent =
queryFactory queryFactory
.select( .select(
Projections.constructor( Projections.constructor(
MapSheetMngDto.MngDto.class, MapSheetMngDto.MngDto.class,
Expressions.numberTemplate( Expressions.numberTemplate(
Integer.class, Integer.class,
"row_number() over(order by {0} desc)", "row_number() over(order by {0} desc)",
mapSheetMngEntity.createdDttm), mapSheetMngEntity.createdDttm),
mapSheetMngEntity.mngYyyy, mapSheetMngEntity.mngYyyy,
mapSheetMngEntity.mngState, mapSheetMngEntity.mngState,
mapSheetMngEntity.syncState, mapSheetMngEntity.syncState,
mapSheetMngEntity.syncCheckState, mapSheetMngEntity.syncCheckState,
mapSheetMngHstEntity.count(), mapSheetMngHstEntity.count(),
new CaseBuilder() new CaseBuilder()
.when(mapSheetMngHstEntity.dataState.eq("DONE")) .when(mapSheetMngHstEntity.dataState.eq("DONE"))
.then(1L) .then(1L)
.otherwise(0L) .otherwise(0L)
.sum() .sum()
.as("syncStateDoneCnt"), .as("syncStateDoneCnt"),
new CaseBuilder() new CaseBuilder()
.when(mapSheetMngHstEntity.syncState.ne("NOTYET")) .when(mapSheetMngHstEntity.syncState.ne("NOTYET"))
.then(1L) .then(1L)
.otherwise(0L) .otherwise(0L)
.sum(), .sum(),
new CaseBuilder() new CaseBuilder()
.when( .when(
mapSheetMngHstEntity mapSheetMngHstEntity
.syncState .syncState
.eq("NOFILE") .eq("NOFILE")
.or(mapSheetMngHstEntity.syncState.eq("NOTPAIR"))) .or(mapSheetMngHstEntity.syncState.eq("NOTPAIR")))
.then(1L) .then(1L)
.otherwise(0L) .otherwise(0L)
.sum(), .sum(),
new CaseBuilder() new CaseBuilder()
.when( .when(
mapSheetMngHstEntity mapSheetMngHstEntity
.syncCheckState .syncCheckState
.eq("DONE") .eq("DONE")
.and( .and(
mapSheetMngHstEntity mapSheetMngHstEntity
.syncState .syncState
.eq("NOFILE") .eq("NOFILE")
.or(mapSheetMngHstEntity.syncState.eq("NOTPAIR")))) .or(mapSheetMngHstEntity.syncState.eq("NOTPAIR"))))
.then(1L) .then(1L)
.otherwise(0L) .otherwise(0L)
.sum(), .sum(),
new CaseBuilder() new CaseBuilder()
.when(mapSheetMngHstEntity.syncState.eq("DUPLICATE")) .when(mapSheetMngHstEntity.syncState.eq("DUPLICATE"))
.then(1L) .then(1L)
.otherwise(0L) .otherwise(0L)
.sum(), .sum(),
new CaseBuilder() new CaseBuilder()
.when( .when(
mapSheetMngHstEntity mapSheetMngHstEntity
.syncCheckState .syncCheckState
.eq("DONE") .eq("DONE")
.and(mapSheetMngHstEntity.syncState.eq("DUPLICATE"))) .and(mapSheetMngHstEntity.syncState.eq("DUPLICATE")))
.then(1L) .then(1L)
.otherwise(0L) .otherwise(0L)
.sum(), .sum(),
new CaseBuilder() new CaseBuilder()
.when( .when(
mapSheetMngHstEntity mapSheetMngHstEntity
.syncState .syncState
.eq("TYPEERROR") .eq("TYPEERROR")
.or(mapSheetMngHstEntity.syncState.eq("SIZEERROR"))) .or(mapSheetMngHstEntity.syncState.eq("SIZEERROR")))
.then(1L) .then(1L)
.otherwise(0L) .otherwise(0L)
.sum(), .sum(),
new CaseBuilder() new CaseBuilder()
.when( .when(
mapSheetMngHstEntity mapSheetMngHstEntity
.syncCheckState .syncCheckState
.eq("DONE") .eq("DONE")
.and( .and(
mapSheetMngHstEntity mapSheetMngHstEntity
.syncState .syncState
.eq("TYPEERROR") .eq("TYPEERROR")
.or(mapSheetMngHstEntity.syncState.eq("SIZEERROR")))) .or(mapSheetMngHstEntity.syncState.eq("SIZEERROR"))))
.then(1L) .then(1L)
.otherwise(0L) .otherwise(0L)
.sum(), .sum(),
mapSheetMngEntity.createdDttm, mapSheetMngEntity.createdDttm,
mapSheetMngHstEntity.syncEndDttm.max())) mapSheetMngHstEntity.syncEndDttm.max()))
.from(mapSheetMngEntity) .from(mapSheetMngEntity)
.leftJoin(mapSheetMngHstEntity) .leftJoin(mapSheetMngHstEntity)
.on(mapSheetMngEntity.mngYyyy.eq(mapSheetMngHstEntity.mngYyyy)) .on(mapSheetMngEntity.mngYyyy.eq(mapSheetMngHstEntity.mngYyyy))
.where(whereBuilder) .where(whereBuilder)
.groupBy(mapSheetMngEntity.mngYyyy) .groupBy(mapSheetMngEntity.mngYyyy)
.fetchOne(); .fetchOne();
return foundContent; return foundContent;
} }
@@ -323,45 +319,44 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
} }
List<MapSheetMngDto.ErrorDataDto> foundContent = List<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.syncCheckState, mapInkx5kEntity.fid,
Expressions.stringTemplate( mapSheetMngHstEntity.createdDate,
"MAX(CASE WHEN {0} = 'tfw' THEN {1} END)", mapSheetMngHstEntity.syncState,
mapSheetMngFileEntity.fileExt, mapSheetMngFileEntity.fileName mapSheetMngHstEntity.syncCheckState,
), Expressions.stringTemplate(
Expressions.stringTemplate( "MAX(CASE WHEN {0} = 'tfw' THEN {1} END)",
"MAX(CASE WHEN {0} = 'tif' THEN {1} END)", mapSheetMngFileEntity.fileExt, mapSheetMngFileEntity.fileName),
mapSheetMngFileEntity.fileExt, mapSheetMngFileEntity.fileName Expressions.stringTemplate(
) "MAX(CASE WHEN {0} = 'tif' THEN {1} END)",
) mapSheetMngFileEntity.fileExt, mapSheetMngFileEntity.fileName)))
) .from(mapSheetMngHstEntity)
.from(mapSheetMngHstEntity) .innerJoin(mapInkx5kEntity)
.innerJoin(mapInkx5kEntity).on(mapSheetMngHstEntity.mapSheetNum.eq(mapInkx5kEntity.mapidcdNo)) .on(mapSheetMngHstEntity.mapSheetNum.eq(mapInkx5kEntity.mapidcdNo))
.leftJoin(mapSheetMngFileEntity).on(mapSheetMngHstEntity.hstUid.eq(mapSheetMngFileEntity.hstUid)) .leftJoin(mapSheetMngFileEntity)
.where(whereBuilder) .on(mapSheetMngHstEntity.hstUid.eq(mapSheetMngFileEntity.hstUid))
.groupBy(mapSheetMngHstEntity.hstUid, mapInkx5kEntity.fid, mapInkx5kEntity.mapidNm) .where(whereBuilder)
.orderBy(mapSheetMngHstEntity.createdDate.desc()) .groupBy(mapSheetMngHstEntity.hstUid, mapInkx5kEntity.fid, mapInkx5kEntity.mapidNm)
.offset(pageable.getOffset()) .orderBy(mapSheetMngHstEntity.createdDate.desc())
.limit(pageable.getPageSize()) .offset(pageable.getOffset())
.fetch(); .limit(pageable.getPageSize())
.fetch();
Long countQuery = Long countQuery =
queryFactory queryFactory