Merge pull request '[KC-148] 학습데이터 목록 API 항목 수정, 현황관리 상세 사용자 목록 API 수정' (#168) from feat/infer_dev_260107 into develop
Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/168
This commit is contained in:
@@ -136,11 +136,13 @@ public class LabelWorkerApiController {
|
|||||||
@Parameter(description = "페이지 번호 (0부터 시작)", example = "0") @RequestParam(defaultValue = "0")
|
@Parameter(description = "페이지 번호 (0부터 시작)", example = "0") @RequestParam(defaultValue = "0")
|
||||||
int page,
|
int page,
|
||||||
@Parameter(description = "페이지 크기", example = "20") @RequestParam(defaultValue = "20")
|
@Parameter(description = "페이지 크기", example = "20") @RequestParam(defaultValue = "20")
|
||||||
int size) {
|
int size,
|
||||||
|
@Parameter(description = "회차 UUID key", example = "f97dc186-e6d3-4645-9737-3173dde8dc64")
|
||||||
|
String uuid) {
|
||||||
|
|
||||||
// 대상추출(최근)
|
// 대상추출(최근)
|
||||||
UUID lstUuid = labelWorkService.findLastLabelWorkState();
|
// UUID lstUuid = labelWorkService.findLastLabelWorkState();
|
||||||
String uuid = lstUuid.toString();
|
// String uuid = lstUuid.toString();
|
||||||
|
|
||||||
LabelWorkDto.WorkerStateSearchReq searchReq = new WorkerStateSearchReq();
|
LabelWorkDto.WorkerStateSearchReq searchReq = new WorkerStateSearchReq();
|
||||||
searchReq.setUserRole(userRole);
|
searchReq.setUserRole(userRole);
|
||||||
|
|||||||
@@ -38,17 +38,16 @@ public class LabelWorkDto {
|
|||||||
private Integer compareYyyy;
|
private Integer compareYyyy;
|
||||||
private Integer targetYyyy;
|
private Integer targetYyyy;
|
||||||
private Integer stage;
|
private Integer stage;
|
||||||
@JsonFormatDttm private ZonedDateTime createdDttm;
|
@JsonFormatDttm private ZonedDateTime gukyuinApplyDttm;
|
||||||
private Long detectionTotCnt;
|
private Long detectionTotCnt;
|
||||||
private Long labelTotCnt;
|
private Long labelTotCnt;
|
||||||
private Long labelAssignCnt;
|
private Long labelAssignCnt;
|
||||||
private Long labelStopTotCnt;
|
private Long labelSkipTotCnt;
|
||||||
private Long labelIngTotCnt;
|
|
||||||
private Long labelCompleteTotCnt;
|
private Long labelCompleteTotCnt;
|
||||||
@JsonFormatDttm private ZonedDateTime labelStartDttm;
|
@JsonFormatDttm private ZonedDateTime labelStartDttm;
|
||||||
|
|
||||||
// tb_map_sheet_anal_inference.anal_state 컬럼 값
|
// tb_map_sheet_anal_inference.anal_state 컬럼 값 -> 미사용
|
||||||
private String analState;
|
// private String analState;
|
||||||
|
|
||||||
// tb_labeling_assignment 테이블에서 stagnation_yn = 'N'인 정상 진행 건수
|
// tb_labeling_assignment 테이블에서 stagnation_yn = 'N'인 정상 진행 건수
|
||||||
private Long normalProgressCnt;
|
private Long normalProgressCnt;
|
||||||
@@ -56,6 +55,9 @@ public class LabelWorkDto {
|
|||||||
// tb_labeling_assignment 테이블에서 총 배정 건수
|
// tb_labeling_assignment 테이블에서 총 배정 건수
|
||||||
private Long totalAssignmentCnt;
|
private Long totalAssignmentCnt;
|
||||||
|
|
||||||
|
private String labelingClosedYn;
|
||||||
|
private String inspectionClosedYn;
|
||||||
|
|
||||||
@JsonProperty("detectYear")
|
@JsonProperty("detectYear")
|
||||||
public String getDetectYear() {
|
public String getDetectYear() {
|
||||||
if (compareYyyy == null || targetYyyy == null) {
|
if (compareYyyy == null || targetYyyy == null) {
|
||||||
@@ -66,22 +68,24 @@ public class LabelWorkDto {
|
|||||||
|
|
||||||
/** 라벨링 상태 반환 (tb_map_sheet_anal_inference.anal_state 기준) */
|
/** 라벨링 상태 반환 (tb_map_sheet_anal_inference.anal_state 기준) */
|
||||||
public String getLabelState() {
|
public String getLabelState() {
|
||||||
// anal_state 값이 있으면 해당 값 사용
|
// anal_state 값이 있으면 해당 값 사용 -> 우선은 미사용
|
||||||
if (this.analState != null && !this.analState.isEmpty()) {
|
// if (this.analState != null && !this.analState.isEmpty()) {
|
||||||
return this.analState;
|
// return this.analState;
|
||||||
}
|
// }
|
||||||
|
|
||||||
// anal_state 값이 없으면 기존 로직으로 폴백
|
// anal_state 값이 없으면 기존 로직으로 폴백
|
||||||
String mngState = "PENDING";
|
String mngState = LabelMngState.PENDING.getId();
|
||||||
|
|
||||||
if (this.labelTotCnt == 0) {
|
if (this.labelTotCnt == 0) {
|
||||||
mngState = "PENDING";
|
mngState = LabelMngState.PENDING.getId();
|
||||||
} else if (this.labelTotCnt > 0 && this.labelAssignCnt > 0 && this.labelIngTotCnt == 0) {
|
} else if (this.labelTotCnt > 0 && this.labelAssignCnt > 0 && this.labelCompleteTotCnt == 0) {
|
||||||
mngState = "ASSIGNED";
|
mngState = LabelMngState.ASSIGNED.getId();
|
||||||
} else if (this.labelIngTotCnt > 0) {
|
} else if (this.labelCompleteTotCnt > 0) {
|
||||||
mngState = "LABEL_ING";
|
mngState = LabelMngState.LABEL_ING.getId();
|
||||||
} else if (this.labelTotCnt <= labelCompleteTotCnt) {
|
} else if (this.labelTotCnt <= labelCompleteTotCnt) {
|
||||||
mngState = "LABEL_COMPLETE";
|
mngState = LabelMngState.LABEL_COMPLETE.getId();
|
||||||
|
} else if (this.labelingClosedYn.equals("Y") && this.inspectionClosedYn.equals("Y")) {
|
||||||
|
mngState = LabelMngState.FINISH.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
return mngState;
|
return mngState;
|
||||||
@@ -109,10 +113,10 @@ public class LabelWorkDto {
|
|||||||
if (this.totalAssignmentCnt == null || this.totalAssignmentCnt == 0) {
|
if (this.totalAssignmentCnt == null || this.totalAssignmentCnt == 0) {
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
if (this.normalProgressCnt == null) {
|
if (this.labelCompleteTotCnt == null) {
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
return (double) this.normalProgressCnt / this.totalAssignmentCnt * 100.0;
|
return (double) this.labelCompleteTotCnt / this.totalAssignmentCnt * 100.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -169,38 +169,42 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom {
|
|||||||
mapSheetAnalInferenceEntity.compareYyyy,
|
mapSheetAnalInferenceEntity.compareYyyy,
|
||||||
mapSheetAnalInferenceEntity.targetYyyy,
|
mapSheetAnalInferenceEntity.targetYyyy,
|
||||||
mapSheetAnalInferenceEntity.stage,
|
mapSheetAnalInferenceEntity.stage,
|
||||||
// createdDttm: tb_map_sheet_anal_inference.created_dttm 사용
|
// 국유인 반영 컬럼 gukyuinApplyDttm
|
||||||
mapSheetAnalInferenceEntity.createdDttm,
|
mapSheetAnalInferenceEntity.gukyuinApplyDttm,
|
||||||
mapSheetAnalDataInferenceGeomEntity.dataUid.count(),
|
mapSheetAnalDataInferenceGeomEntity.dataUid.count(),
|
||||||
// labelTotCnt: pnu 있고 pass_yn = false인 건수
|
// labelTotCnt: pnu 있고 pass_yn = false인 건수
|
||||||
labelTotCntExpr,
|
labelTotCntExpr,
|
||||||
new CaseBuilder()
|
new CaseBuilder()
|
||||||
.when(mapSheetAnalDataInferenceGeomEntity.labelState.eq("ASSIGNED"))
|
.when(
|
||||||
|
mapSheetAnalDataInferenceGeomEntity.labelState.eq(
|
||||||
|
LabelState.ASSIGNED.getId()))
|
||||||
.then(1L)
|
.then(1L)
|
||||||
.otherwise(0L)
|
.otherwise(0L)
|
||||||
.sum(),
|
.sum(),
|
||||||
new CaseBuilder()
|
new CaseBuilder()
|
||||||
.when(mapSheetAnalDataInferenceGeomEntity.labelState.eq("STOP"))
|
.when(
|
||||||
|
mapSheetAnalDataInferenceGeomEntity.labelState.eq(
|
||||||
|
LabelState.SKIP.getId())) // "STOP"?
|
||||||
.then(1L)
|
.then(1L)
|
||||||
.otherwise(0L)
|
.otherwise(0L)
|
||||||
.sum(),
|
.sum(),
|
||||||
new CaseBuilder()
|
new CaseBuilder()
|
||||||
.when(mapSheetAnalDataInferenceGeomEntity.labelState.eq("LABEL_ING"))
|
.when(
|
||||||
.then(1L)
|
mapSheetAnalDataInferenceGeomEntity.labelState.eq(
|
||||||
.otherwise(0L)
|
LabelState.DONE.getId())) // "LABEL_COMPLETE"?
|
||||||
.sum(),
|
|
||||||
new CaseBuilder()
|
|
||||||
.when(mapSheetAnalDataInferenceGeomEntity.labelState.eq("LABEL_COMPLETE"))
|
|
||||||
.then(1L)
|
.then(1L)
|
||||||
.otherwise(0L)
|
.otherwise(0L)
|
||||||
.sum(),
|
.sum(),
|
||||||
mapSheetAnalDataInferenceGeomEntity.labelStateDttm.min(),
|
mapSheetAnalDataInferenceGeomEntity.labelStateDttm.min(),
|
||||||
// analState: tb_map_sheet_anal_inference.anal_state
|
// analState: tb_map_sheet_anal_inference.anal_state -> 우선은 미사용, java 단에서 로직화 해서
|
||||||
mapSheetAnalInferenceEntity.analState,
|
// 내려줌
|
||||||
|
// mapSheetAnalInferenceEntity.analState,
|
||||||
// normalProgressCnt: stagnation_yn = 'N'인 건수 (서브쿼리)
|
// normalProgressCnt: stagnation_yn = 'N'인 건수 (서브쿼리)
|
||||||
normalProgressCntSubQuery,
|
normalProgressCntSubQuery,
|
||||||
// totalAssignmentCnt: 총 배정 건수 (서브쿼리)
|
// totalAssignmentCnt: 총 배정 건수 (서브쿼리)
|
||||||
totalAssignmentCntSubQuery))
|
totalAssignmentCntSubQuery,
|
||||||
|
mapSheetAnalInferenceEntity.labelingClosedYn,
|
||||||
|
mapSheetAnalInferenceEntity.inspectionClosedYn))
|
||||||
.from(mapSheetAnalInferenceEntity)
|
.from(mapSheetAnalInferenceEntity)
|
||||||
.innerJoin(mapSheetAnalDataInferenceEntity)
|
.innerJoin(mapSheetAnalDataInferenceEntity)
|
||||||
.on(whereSubDataBuilder)
|
.on(whereSubDataBuilder)
|
||||||
|
|||||||
Reference in New Issue
Block a user