diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/core/MapSheetMngCoreService.java b/src/main/java/com/kamco/cd/kamcoback/postgres/core/MapSheetMngCoreService.java index 4ae78bf3..047b5231 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/core/MapSheetMngCoreService.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/core/MapSheetMngCoreService.java @@ -229,6 +229,7 @@ public class MapSheetMngCoreService { MapSheetMngEntity saved = mapSheetMngRepository.save(entity); int hstCnt = mapSheetMngRepository.insertMapSheetOrgDataToMapSheetMngHst(saved.getMngYyyy()); + mapSheetMngRepository.updateYearState(saved.getMngYyyy(), "DONE"); return new MapSheetMngDto.DmlReturn("success", saved.getMngYyyy().toString()); } diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/mapsheet/MapSheetMngRepositoryCustom.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/mapsheet/MapSheetMngRepositoryCustom.java index 114cbdea..b26508da 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/mapsheet/MapSheetMngRepositoryCustom.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/mapsheet/MapSheetMngRepositoryCustom.java @@ -43,6 +43,8 @@ public interface MapSheetMngRepositoryCustom { void updateByHstUidMngFileState(Long hstUid, String fileState); + void updateYearState(int yyyy, String status); + Page findMapSheetErrorList( MapSheetMngDto.@Valid ErrorSearchReq searchReq); diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/mapsheet/MapSheetMngRepositoryImpl.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/mapsheet/MapSheetMngRepositoryImpl.java index 165bbc8e..dd22e418 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/mapsheet/MapSheetMngRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/mapsheet/MapSheetMngRepositoryImpl.java @@ -5,6 +5,7 @@ import static com.kamco.cd.kamcoback.postgres.entity.QMapInkx5kEntity.mapInkx5kE import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetMngEntity.mapSheetMngEntity; import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetMngFileEntity.mapSheetMngFileEntity; import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetMngHstEntity.mapSheetMngHstEntity; +import static com.kamco.cd.kamcoback.postgres.entity.QYearEntity.yearEntity; import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto; import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngHstEntity; @@ -19,9 +20,8 @@ import com.querydsl.jpa.impl.JPAQueryFactory; import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; import jakarta.validation.Valid; -import java.time.LocalDate; import java.time.ZonedDateTime; -import java.util.ArrayList; +import java.util.Comparator; import java.util.List; import java.util.Objects; import java.util.Optional; @@ -173,57 +173,31 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport public List findMapSheetMngYyyyList() { - /* List foundContent = queryFactory - .select(mapSheetMngEntity.mngYyyy) - .from(mapSheetMngEntity) - .where(mapSheetMngEntity.mngState.ne("COMPLETE")) - .orderBy(mapSheetMngEntity.mngYyyy.desc()) - .fetch(); - */ - - int currentYear = LocalDate.now().getYear(); - - List foundContentCurrent = - queryFactory - .select(mapSheetMngEntity.mngYyyy) - .from(mapSheetMngEntity) - .where(mapSheetMngEntity.mngYyyy.eq(currentYear)) - .orderBy(mapSheetMngEntity.mngYyyy.desc()) + .select(yearEntity.yyyy) + .from(yearEntity) + .leftJoin(mapSheetMngEntity) + .on(mapSheetMngEntity.mngYyyy.eq(yearEntity.yyyy)) + .where(yearEntity.status.eq("NOTYET")) + .orderBy(yearEntity.yyyy.asc()) + .limit(10) .fetch(); - List foundContent1 = - queryFactory - .select(mapSheetMngEntity.mngYyyy) - .from(mapSheetMngEntity) - .where( - mapSheetMngEntity - .mngYyyy - .ne(currentYear) - .and( - mapSheetMngEntity - .mngState - .ne("NOTYET") - .or(mapSheetMngEntity.mngState.ne("DELETE")))) - .orderBy(mapSheetMngEntity.mngYyyy.desc()) - .fetch(); - - // if( foundContentCurrent == null || foundContentCurrent.size() == 0) - // { - // foundContent.add(currentYear); - // } - - List foundContent = new ArrayList<>(); - - foundContent.add(2025); - foundContent.add(2024); - foundContent.add(2023); - foundContent.add(2022); + foundContent.sort(Comparator.reverseOrder()); return foundContent; } + public void updateYearState(int yyyy, String status) { + long execCount = + queryFactory + .update(yearEntity) + .set(yearEntity.status, status) + .where(yearEntity.yyyy.eq(yyyy)) + .execute(); + } + public MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy) { BooleanBuilder whereBuilder = new BooleanBuilder(); diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml deleted file mode 100644 index 0a37bd4a..00000000 --- a/src/main/resources/logback-spring.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - ${LOG_PATTERN} - - - - - - - - ${LOG_PATH}/application.log - - - - ${LOG_PATH}/application.%d{yyyy-MM-dd}.log - - 30 - - - - ${LOG_PATTERN} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -