spotlessApply 적용

This commit is contained in:
2025-12-17 13:53:21 +09:00
parent 5359943471
commit a911ecf7e2
3 changed files with 132 additions and 142 deletions

View File

@@ -1,13 +1,11 @@
package com.kamco.cd.kamcoback.mapsheet.dto; package com.kamco.cd.kamcoback.mapsheet.dto;
import com.kamco.cd.kamcoback.common.enums.RoleType;
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 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;
@@ -172,8 +170,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,
@@ -205,7 +202,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();
@@ -254,8 +251,6 @@ public class MapSheetMngDto {
} }
} }
@Getter @Getter
@AllArgsConstructor @AllArgsConstructor
public enum DataState implements EnumType { public enum DataState implements EnumType {

View File

@@ -103,5 +103,4 @@ public class MapSheetMngHstEntity extends CommonDateEntity {
@Size(max = 100) @Size(max = 100)
@Column(name = "sync_check_tfw_file_name", length = 100) @Column(name = "sync_check_tfw_file_name", length = 100)
private String syncCheckTfwFileName; private String syncCheckTfwFileName;
} }

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,39 +319,39 @@ 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.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)
.orderBy(mapSheetMngHstEntity.createdDate.desc()) .on(mapSheetMngHstEntity.mapSheetNum.eq(mapInkx5kEntity.mapidcdNo))
.offset(pageable.getOffset()) .where(whereBuilder)
.limit(pageable.getPageSize()) .orderBy(mapSheetMngHstEntity.createdDate.desc())
.fetch(); .offset(pageable.getOffset())
.limit(pageable.getPageSize())
.fetch();
Long countQuery = Long countQuery =
queryFactory queryFactory