년도별 상태추가
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
@@ -43,6 +43,8 @@ public interface MapSheetMngRepositoryCustom {
|
||||
|
||||
void updateByHstUidMngFileState(Long hstUid, String fileState);
|
||||
|
||||
void updateYearState(int yyyy, String status);
|
||||
|
||||
Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(
|
||||
MapSheetMngDto.@Valid ErrorSearchReq searchReq);
|
||||
|
||||
|
||||
@@ -5,7 +5,10 @@ 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 static java.lang.String.CASE_INSENSITIVE_ORDER;
|
||||
|
||||
import com.kamco.cd.kamcoback.common.utils.FIleChecker.Folder;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngHstEntity;
|
||||
import com.querydsl.core.BooleanBuilder;
|
||||
@@ -22,6 +25,7 @@ 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 +177,32 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
||||
|
||||
public List<Integer> findMapSheetMngYyyyList() {
|
||||
|
||||
/*
|
||||
List<Integer> foundContent =
|
||||
queryFactory
|
||||
.select(mapSheetMngEntity.mngYyyy)
|
||||
.from(mapSheetMngEntity)
|
||||
.where(mapSheetMngEntity.mngState.ne("COMPLETE"))
|
||||
.orderBy(mapSheetMngEntity.mngYyyy.desc())
|
||||
.fetch();
|
||||
*/
|
||||
queryFactory
|
||||
.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();
|
||||
|
||||
int currentYear = LocalDate.now().getYear();
|
||||
|
||||
List<Integer> foundContentCurrent =
|
||||
queryFactory
|
||||
.select(mapSheetMngEntity.mngYyyy)
|
||||
.from(mapSheetMngEntity)
|
||||
.where(mapSheetMngEntity.mngYyyy.eq(currentYear))
|
||||
.orderBy(mapSheetMngEntity.mngYyyy.desc())
|
||||
.fetch();
|
||||
|
||||
List<Integer> 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<Integer> 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();
|
||||
|
||||
Reference in New Issue
Block a user