261019_01_ENH: 리스트 대량 작업 비동기 처리 및 프로젝트별 동시 실행 제어 적용, 미사용 코드 정
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
package com.kri.contact.server.dto.list.async;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record ListAsyncActiveJobsDto(List<ListAsyncJobStatusDto> items) {}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.kri.contact.server.dto.list.async;
|
||||
|
||||
import com.kri.contact.server.common.enums.ListAsyncJobStatus;
|
||||
import com.kri.contact.server.common.enums.ListAsyncJobType;
|
||||
import com.kri.contact.server.common.enums.ListAsyncAssignOperation;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
public record ListAsyncAvailabilityDto(ListAsyncJobType requestedJobType, boolean allowed,
|
||||
String reasonCode, int blockerCount, List<Blocker> blockers) {
|
||||
public record Blocker(ListAsyncJobType jobType, ListAsyncJobStatus jobStatus,
|
||||
String blockingPhase, String requestUserId, String requestUserName,
|
||||
boolean mine, String jobKey, LocalDateTime regDt, ListAsyncAssignOperation operation) {}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package com.kri.contact.server.dto.list.async;
|
||||
|
||||
public record ListAsyncJobAcceptedDto(String jobKey) {}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.kri.contact.server.dto.list.async;
|
||||
|
||||
import com.kri.contact.server.common.enums.ListAsyncJobStatus;
|
||||
import com.kri.contact.server.common.enums.ListAsyncJobType;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
// Scalar projection avoids OSIV entity staleness and loading request/result/error JSON.
|
||||
public record ListAsyncJobActivity(String jobKey, ListAsyncJobType jobType,
|
||||
ListAsyncJobStatus jobStatus, String requestUser, LocalDateTime regDt, String operation) {}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.kri.contact.server.dto.list.async;
|
||||
|
||||
import com.kri.contact.server.common.enums.ListAsyncJobStatus;
|
||||
import com.kri.contact.server.common.enums.ListAsyncJobType;
|
||||
import com.kri.contact.server.common.enums.ListAsyncAssignOperation;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public record ListAsyncJobStatusDto(
|
||||
String jobKey, ListAsyncJobType jobType, ListAsyncAssignOperation operation,
|
||||
ListAsyncJobStatus jobStatus, String jobStage,
|
||||
Long totalSidCnt, long completedSidCnt, long completedChunkCnt,
|
||||
long failedSidCnt, long processedSidCnt, Long remainingSidCnt,
|
||||
Map<String, Object> progress, Integer failedChunkNo, String errorCode, String errorMessage,
|
||||
String cancelReason, LocalDateTime regDt, LocalDateTime startedDt, LocalDateTime finishedDt,
|
||||
List<ResultFile> resultFiles
|
||||
) {
|
||||
public record ResultFile(int index, String type, String fileName, long sizeBytes, boolean ready) {}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.kri.contact.server.dto.list.async;
|
||||
|
||||
public record ListAsyncResultFileDto(
|
||||
String type, String fileRef, String fileName, long sizeBytes, boolean ready
|
||||
) {}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.kri.contact.server.dto.list.async;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.kri.contact.server.persistence.entity.TListAsyncJobEntity;
|
||||
import com.kri.contact.server.service.async.ListAsyncJobStore;
|
||||
|
||||
public record ListAsyncSidFailuresDto(long total, int offset, List<Failure> items) {
|
||||
public record Failure(String sid, String code, int chunkNo) {}
|
||||
|
||||
public static ListAsyncSidFailuresDto from(TListAsyncJobEntity job, int offset, int limit) {
|
||||
var items = new ArrayList<Failure>();
|
||||
long seen = 0;
|
||||
Object groups = job.getErrorDetailJson() == null ? null
|
||||
: job.getErrorDetailJson().get("sidFailureGroups");
|
||||
if (groups instanceof List<?> entries) {
|
||||
for (Object entry : entries) {
|
||||
if (entry instanceof Map<?, ?> group && group.get("sids") instanceof List<?> sids) {
|
||||
for (Object sid : sids) {
|
||||
if (seen++ >= offset && items.size() < limit) {
|
||||
items.add(new Failure((String) sid, (String) group.get("code"),
|
||||
((Number) group.get("chunkNo")).intValue()));
|
||||
}
|
||||
if (items.size() == limit) {
|
||||
return new ListAsyncSidFailuresDto(ListAsyncJobStore.failedSidCount(job), offset, items);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return new ListAsyncSidFailuresDto(ListAsyncJobStore.failedSidCount(job), offset, items);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.kri.contact.server.dto.list.async;
|
||||
|
||||
import com.kri.contact.server.common.enums.ListAsyncJobStatus;
|
||||
import com.kri.contact.server.common.enums.ListAsyncJobType;
|
||||
|
||||
// 프로젝트의 다른 사용자에게도 응답한다. 요청자·요청 본문·오류 상세·파일 정보를 담지 않는다.
|
||||
public record ListUploadResetActiveDto(boolean active, Job job) {
|
||||
public record Job(ListAsyncJobType jobType, ListAsyncJobStatus jobStatus, String jobStage,
|
||||
Long totalSidCnt, long processedSidCnt, boolean mine, String jobKey) {}
|
||||
}
|
||||
Reference in New Issue
Block a user