error-list api upgarde and sync api change to stable

This commit is contained in:
DanielLee
2025-12-16 15:36:16 +09:00
parent 77931aa97a
commit b5b7fc79a8
6 changed files with 119 additions and 18 deletions

View File

@@ -172,6 +172,30 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
MapSheetMngDto.@Valid ErrorSearchReq searchReq) {
Pageable pageable = PageRequest.of(searchReq.getPage(), searchReq.getSize());
BooleanBuilder whereBuilder = new BooleanBuilder();
whereBuilder.and(mapSheetMngHstEntity.mngYyyy.eq(searchReq.getMngYyyy()));
// syncStateFilter 조건 추가
if (searchReq.getSyncStateFilter() != null && !searchReq.getSyncStateFilter().isEmpty()) {
whereBuilder.and(mapSheetMngHstEntity.syncState.eq(searchReq.getSyncStateFilter()));
} else {
// 기본: 오류 상태만 조회 (NOFILE, NOTPAIR, DUPLICATE, SIZEERROR, TYPEERROR)
whereBuilder.and(
mapSheetMngHstEntity
.syncState
.eq("NOFILE")
.or(mapSheetMngHstEntity.syncState.eq("NOTPAIR"))
.or(mapSheetMngHstEntity.syncState.eq("DUPLICATE"))
.or(mapSheetMngHstEntity.syncState.eq("SIZEERROR"))
.or(mapSheetMngHstEntity.syncState.eq("TYPEERROR")));
}
// 검색어 조건 추가
if (searchReq.getSearchValue() != null && !searchReq.getSearchValue().isEmpty()) {
whereBuilder.and(mapSheetErrorSearchValue(searchReq));
}
List<MapSheetMngDto.ErrorDataDto> foundContent =
queryFactory
.select(
@@ -188,16 +212,17 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
mapSheetMngHstEntity.mapSheetCodeSrc,
Expressions.stringTemplate(
"to_char({0}, 'YYYY-MM-DD')", mapSheetMngHstEntity.createdDate),
mapSheetMngHstEntity.dataState))
mapSheetMngHstEntity.dataState,
mapSheetMngHstEntity.syncState,
mapSheetMngHstEntity.syncCheckState,
mapSheetMngHstEntity.syncCheckStrtDttm,
mapSheetMngHstEntity.syncCheckEndDttm))
.from(mapSheetMngHstEntity)
.innerJoin(mapInkx5kEntity)
.on(mapSheetMngHstEntity.mapSheetCode.eq(mapInkx5kEntity.fid))
.leftJoin(mapInkx50kEntity)
.on(mapInkx5kEntity.fidK50.eq(mapInkx50kEntity.fid.longValue()))
.where(
mapSheetMngHstEntity.mngYyyy.eq(searchReq.getMngYyyy()),
// mapSheetMngHstEntity.dataState.eq(MapSheetMngDto.DataState.FAIL), // 오류만 검색
mapSheetErrorSearchValue(searchReq))
.where(whereBuilder)
.offset(pageable.getOffset())
.limit(pageable.getPageSize())
.orderBy(mapSheetMngHstEntity.createdDate.desc())
@@ -211,10 +236,7 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
.on(mapSheetMngHstEntity.mapSheetCode.eq(mapInkx5kEntity.fid))
.leftJoin(mapInkx50kEntity)
.on(mapInkx5kEntity.fidK50.eq(mapInkx50kEntity.fid.longValue()))
.where(
mapSheetMngHstEntity.mngYyyy.eq(searchReq.getMngYyyy()),
// mapSheetMngHstEntity.dataState.eq(MapSheetMngDto.DataState.FAIL), // 오류만 검색
mapSheetErrorSearchValue(searchReq))
.where(whereBuilder)
.fetchOne();
return new PageImpl<>(foundContent, pageable, countQuery);

View File

@@ -108,14 +108,19 @@ public class MapSheetMngFileJobRepositoryImpl extends QuerydslRepositorySupport
public void mngHstDataSyncStateUpdate(MapSheetMngDto.MngHstDto updateReq) {
ZonedDateTime now = ZonedDateTime.now();
if (updateReq.getDataState().equals("DONE")) {
long updateCount =
queryFactory
.update(mapSheetMngHstEntity)
.set(mapSheetMngHstEntity.dataState, updateReq.getDataState())
.set(mapSheetMngHstEntity.dataStateDttm, ZonedDateTime.now())
.set(mapSheetMngHstEntity.dataStateDttm, now)
.set(mapSheetMngHstEntity.syncState, updateReq.getSyncState())
.set(mapSheetMngHstEntity.syncEndDttm, ZonedDateTime.now())
.set(mapSheetMngHstEntity.syncEndDttm, now)
.set(mapSheetMngHstEntity.syncCheckState, "DONE")
.set(mapSheetMngHstEntity.syncCheckStrtDttm, now)
.set(mapSheetMngHstEntity.syncCheckEndDttm, now)
.where(mapSheetMngHstEntity.hstUid.eq(updateReq.getHstUid()))
.execute();
} else {
@@ -123,10 +128,13 @@ public class MapSheetMngFileJobRepositoryImpl extends QuerydslRepositorySupport
queryFactory
.update(mapSheetMngHstEntity)
.set(mapSheetMngHstEntity.dataState, updateReq.getDataState())
.set(mapSheetMngHstEntity.dataStateDttm, ZonedDateTime.now())
.set(mapSheetMngHstEntity.dataStateDttm, now)
.set(mapSheetMngHstEntity.syncState, updateReq.getSyncState())
.set(mapSheetMngHstEntity.syncStrtDttm, ZonedDateTime.now())
.set(mapSheetMngHstEntity.syncEndDttm, ZonedDateTime.now())
.set(mapSheetMngHstEntity.syncStrtDttm, now)
.set(mapSheetMngHstEntity.syncEndDttm, now)
.set(mapSheetMngHstEntity.syncCheckState, "PROCESSING")
.set(mapSheetMngHstEntity.syncCheckStrtDttm, now)
.set(mapSheetMngHstEntity.syncCheckEndDttm, now)
.where(mapSheetMngHstEntity.hstUid.eq(updateReq.getHstUid()))
.execute();
}