라벨링 작업관리 목록조회 수정

This commit is contained in:
DanielLee
2026-01-08 18:09:52 +09:00
parent 8397a0176f
commit 3691a82717
2 changed files with 78 additions and 26 deletions

View File

@@ -37,7 +37,7 @@ public class LabelWorkDto {
private UUID uuid;
private Integer compareYyyy;
private Integer targetYyyy;
private int stage;
private Integer stage;
@JsonFormatDttm private ZonedDateTime createdDttm;
private Long detectionTotCnt;
private Long labelTotCnt;
@@ -47,6 +47,15 @@ public class LabelWorkDto {
private Long labelCompleteTotCnt;
@JsonFormatDttm private ZonedDateTime labelStartDttm;
// tb_map_sheet_anal_inference.anal_state 컬럼 값
private String analState;
// tb_labeling_assignment 테이블에서 stagnation_yn = 'N'인 정상 진행 건수
private Long normalProgressCnt;
// tb_labeling_assignment 테이블에서 총 배정 건수
private Long totalAssignmentCnt;
@JsonProperty("detectYear")
public String getDetectYear() {
if (compareYyyy == null || targetYyyy == null) {
@@ -55,8 +64,16 @@ public class LabelWorkDto {
return compareYyyy + "-" + targetYyyy;
}
/**
* 라벨링 상태 반환 (tb_map_sheet_anal_inference.anal_state 기준)
*/
public String getLabelState() {
// anal_state 값이 있으면 해당 값 사용
if (this.analState != null && !this.analState.isEmpty()) {
return this.analState;
}
// anal_state 값이 없으면 기존 로직으로 폴백
String mngState = "PENDING";
if (this.labelTotCnt == 0) {
@@ -79,14 +96,25 @@ public class LabelWorkDto {
}
LabelMngState type = Enums.fromId(LabelMngState.class, enumId);
// type이 null인 경우 (enum에 정의되지 않은 상태값) 상태값 자체를 반환
if (type == null) {
return enumId;
}
return type.getText();
}
/**
* 작업 진행률 반환 (tb_labeling_assignment.stagnation_yn = 'N'인 정상 진행율 기준)
* 계산식: (정상 진행 건수 / 총 배정 건수) * 100
*/
public double getLabelRate() {
if (this.labelTotCnt == null || this.labelCompleteTotCnt == 0) {
if (this.totalAssignmentCnt == null || this.totalAssignmentCnt == 0) {
return 0.0;
}
return (double) this.labelTotCnt / this.labelCompleteTotCnt * 100.0;
if (this.normalProgressCnt == null) {
return 0.0;
}
return (double) this.normalProgressCnt / this.totalAssignmentCnt * 100.0;
}
}