영상데이터관리 목록 조회 수정

This commit is contained in:
Moon
2025-12-16 12:33:36 +09:00
parent b6a96846b5
commit 103242d292
5 changed files with 49 additions and 21 deletions

View File

@@ -253,8 +253,8 @@ public class FIleChecker {
List<Basic> fileList = new ArrayList<>(); List<Basic> fileList = new ArrayList<>();
SimpleDateFormat dttmFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat dttmFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
int fileTotCnt = 0; //int fileTotCnt = 0;
long fileTotSize = 0; //long fileTotSize = 0;
try (Stream<Path> stream = Files.walk(startPath, maxDepth)) { try (Stream<Path> stream = Files.walk(startPath, maxDepth)) {

View File

@@ -42,6 +42,9 @@ public class MapSheetMngApiController {
@PostMapping("/mng-list") @PostMapping("/mng-list")
public ApiResponseDto<Page<MapSheetMngDto.MngDto>> findMapSheetMngList( public ApiResponseDto<Page<MapSheetMngDto.MngDto>> findMapSheetMngList(
@RequestBody MapSheetMngDto.MngSearchReq searchReq) { @RequestBody MapSheetMngDto.MngSearchReq searchReq) {
System.out.println("kkkkkkkkkkkkkkkkkkkkkkkkk");
return ApiResponseDto.ok(mapSheetMngService.findMapSheetMngList(searchReq)); return ApiResponseDto.ok(mapSheetMngService.findMapSheetMngList(searchReq));
} }

View File

@@ -69,15 +69,29 @@ public class MapSheetMngDto {
private int mngYyyy; private int mngYyyy;
private String mngState; private String mngState;
private String syncState; private String syncState;
private String syncCheckState; private String syncDataCheckState;
private Long syncTotCnt; private Long syncTotCnt;
private Long syncStateDoneCnt; private Long syncStateDoneCnt;
private Long syncCheckStateDoneCnt; private Long syncDataCheckDoneCnt;
private Long syncNotFileCnt; private Long syncNotPaireCnt;
private Long syncTypeErrorCnt; private Long syncDuplicateCnt;
private Long syncSizeErrorCnt; private Long syncFaultCnt;
@JsonFormatDttm private ZonedDateTime rgstStrtDttm; @JsonFormatDttm private ZonedDateTime rgstStrtDttm;
@JsonFormatDttm private ZonedDateTime rgstEndDttm; @JsonFormatDttm private ZonedDateTime rgstEndDttm;
public double getSyncStateDoneRate() {
if (this.syncTotCnt == null || this.syncTotCnt == 0) {
return 0.0;
}
return (double) this.syncStateDoneCnt / this.syncTotCnt * 100.0;
}
public double getSyncDataCheckDoneRate() {
if (this.syncTotCnt == null || this.syncTotCnt == 0) {
return 0.0;
}
return (double) this.syncDataCheckDoneCnt / this.syncTotCnt * 100.0;
}
} }
@Schema(name = "ErrorSearchReq", description = "영상관리 오류데이터 검색 요청") @Schema(name = "ErrorSearchReq", description = "영상관리 오류데이터 검색 요청")

View File

@@ -52,6 +52,15 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
whereBuilder.and(mapSheetMngEntity.mngYyyy.eq(searchReq.getMngYyyy())); whereBuilder.and(mapSheetMngEntity.mngYyyy.eq(searchReq.getMngYyyy()));
} }
NumberExpression<Long> totalCount = mapSheetMngHstEntity.count().as("syncTotCnt");
NumberExpression<Long> doneCount = new CaseBuilder()
.when(mapSheetMngHstEntity.dataState.eq("DONE"))
.then(1L)
.otherwise(0L)
.sum()
.as("syncStateDoneCnt");
List<MapSheetMngDto.MngDto> foundContent = List<MapSheetMngDto.MngDto> foundContent =
queryFactory queryFactory
.select( .select(
@@ -67,33 +76,35 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
mapSheetMngEntity.syncCheckState, mapSheetMngEntity.syncCheckState,
mapSheetMngHstEntity.count(), mapSheetMngHstEntity.count(),
new CaseBuilder() new CaseBuilder()
.when(mapSheetMngHstEntity.syncState.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.syncCheckState.eq("DONE")) .when(mapSheetMngHstEntity.syncState.ne("NOTYET"))
.then(1L) .then(1L)
.otherwise(0L) .otherwise(0L)
.sum(), .sum(),
new CaseBuilder() new CaseBuilder()
.when(mapSheetMngHstEntity.dataState.eq("NOT")) .when(mapSheetMngHstEntity.syncState.eq("NOFILE")
.or( mapSheetMngHstEntity.syncState.eq("NOTPAIR")))
.then(1L) .then(1L)
.otherwise(0L) .otherwise(0L)
.sum(), .sum(),
new CaseBuilder() new CaseBuilder()
.when(mapSheetMngHstEntity.dataState.eq("TYPEERROR")) .when(mapSheetMngHstEntity.syncState.eq("DUPLICATE"))
.then(1L) .then(1L)
.otherwise(0L) .otherwise(0L)
.sum(), .sum(),
new CaseBuilder() new CaseBuilder()
.when(mapSheetMngHstEntity.dataState.eq("SIZEERROR")) .when(mapSheetMngHstEntity.syncState.eq("TYPEERROR")
.then(1L) .or( mapSheetMngHstEntity.syncState.eq("SIZEERROR")))
.otherwise(0L) .then(1L)
.sum(), .otherwise(0L)
mapSheetMngHstEntity.syncStrtDttm.min(), .sum(),
mapSheetMngHstEntity.syncCheckEndDttm.max())) mapSheetMngEntity.createdDttm,
mapSheetMngHstEntity.syncEndDttm.max()))
.from(mapSheetMngEntity) .from(mapSheetMngEntity)
.leftJoin(mapSheetMngHstEntity) .leftJoin(mapSheetMngHstEntity)
.on(mapSheetMngEntity.mngYyyy.eq(mapSheetMngHstEntity.mngYyyy)) .on(mapSheetMngEntity.mngYyyy.eq(mapSheetMngHstEntity.mngYyyy))

View File

@@ -108,7 +108,7 @@ public class MapSheetMngFileJobRepositoryImpl extends QuerydslRepositorySupport
public void mngHstDataSyncStateUpdate(MapSheetMngDto.MngHstDto updateReq) { public void mngHstDataSyncStateUpdate(MapSheetMngDto.MngHstDto updateReq) {
if (updateReq.getSyncState().equals("DONE")) { if (updateReq.getDataState().equals("DONE")) {
long updateCount = long updateCount =
queryFactory queryFactory
.update(mapSheetMngHstEntity) .update(mapSheetMngHstEntity)