Merge pull request '라벨링 툴 상태 조건 수정, 검수 저장 로직 수정' (#260) from feat/infer_dev_260107 into develop
Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/260
This commit is contained in:
@@ -33,8 +33,8 @@ public class TrainingDataReviewCoreService {
|
||||
return trainingDataReviewRepository.findReviewOperatorGeoUid(operatorUid);
|
||||
}
|
||||
|
||||
public void updateReviewStateOperator(String operatorUid, String status, String memo) {
|
||||
trainingDataReviewRepository.updateReviewStateOperator(operatorUid, status, memo);
|
||||
public void updateReviewStateOperator(String operatorUid, String status) {
|
||||
trainingDataReviewRepository.updateReviewStateOperator(operatorUid, status);
|
||||
}
|
||||
|
||||
public void updateReviewExceptState(Long inferenceGeomUid, String status) {
|
||||
|
||||
@@ -73,14 +73,13 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
|
||||
BooleanExpression doneToday =
|
||||
labelingAssignmentEntity
|
||||
.workState
|
||||
.eq(LabelState.DONE.getId())
|
||||
.in(LabelState.DONE.getId(), LabelState.SKIP.getId())
|
||||
.and(labelingAssignmentEntity.workStatDttm.goe(start))
|
||||
.and(labelingAssignmentEntity.workStatDttm.lt(end));
|
||||
|
||||
BooleanExpression assignedOrSkip =
|
||||
labelingAssignmentEntity.workState.in(LabelState.SKIP.getId(), LabelState.ASSIGNED.getId());
|
||||
BooleanExpression assigned = labelingAssignmentEntity.workState.in(LabelState.ASSIGNED.getId());
|
||||
|
||||
BooleanExpression dayStateCondition = doneToday.or(assignedOrSkip);
|
||||
BooleanExpression dayStateCondition = doneToday.or(assigned);
|
||||
|
||||
Pageable pageable = PageRequest.of(searchReq.getPage(), searchReq.getSize());
|
||||
List<LabelingListDto> list =
|
||||
@@ -334,7 +333,8 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
|
||||
.from(labelingAssignmentEntity)
|
||||
.where(
|
||||
labelingAssignmentEntity.workerUid.eq(userId),
|
||||
labelingAssignmentEntity.workState.eq("DONE"),
|
||||
labelingAssignmentEntity.workState.in(
|
||||
LabelState.DONE.getId(), LabelState.SKIP.getId()),
|
||||
labelingAssignmentEntity.workStatDttm.isNotNull(),
|
||||
labelingAssignmentEntity.workStatDttm.goe(startOfToday),
|
||||
labelingAssignmentEntity.workStatDttm.lt(endOfToday))
|
||||
@@ -589,14 +589,13 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
|
||||
BooleanExpression doneToday =
|
||||
labelingAssignmentEntity
|
||||
.workState
|
||||
.eq(LabelState.DONE.getId())
|
||||
.in(LabelState.DONE.getId(), LabelState.SKIP.getId())
|
||||
.and(labelingAssignmentEntity.workStatDttm.goe(todayStart))
|
||||
.and(labelingAssignmentEntity.workStatDttm.lt(todayEnd));
|
||||
|
||||
BooleanExpression assignedOrSkip =
|
||||
labelingAssignmentEntity.workState.in(LabelState.SKIP.getId(), LabelState.ASSIGNED.getId());
|
||||
BooleanExpression assigned = labelingAssignmentEntity.workState.in(LabelState.ASSIGNED.getId());
|
||||
|
||||
BooleanExpression stateCondition = doneToday.or(assignedOrSkip);
|
||||
BooleanExpression stateCondition = doneToday.or(assigned);
|
||||
|
||||
Tuple firstAssigned =
|
||||
queryFactory
|
||||
|
||||
@@ -20,7 +20,7 @@ public interface TrainingDataReviewRepositoryCustom {
|
||||
|
||||
Long findReviewOperatorGeoUid(String operatorUid);
|
||||
|
||||
void updateReviewStateOperator(String operatorUid, String status, String memo);
|
||||
void updateReviewStateOperator(String operatorUid, String status);
|
||||
|
||||
void updateReviewExceptState(Long inferenceGeomUid, String status);
|
||||
|
||||
|
||||
@@ -72,15 +72,14 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport
|
||||
BooleanExpression doneToday =
|
||||
labelingAssignmentEntity
|
||||
.inspectState
|
||||
.eq(InspectState.COMPLETE.getId())
|
||||
.in(InspectState.COMPLETE.getId(), InspectState.EXCEPT.getId())
|
||||
.and(labelingAssignmentEntity.inspectStatDttm.goe(start))
|
||||
.and(labelingAssignmentEntity.inspectStatDttm.lt(end));
|
||||
|
||||
BooleanExpression unconfirmOrExcept =
|
||||
labelingAssignmentEntity.inspectState.in(
|
||||
InspectState.EXCEPT.getId(), InspectState.UNCONFIRM.getId());
|
||||
BooleanExpression unconfirm =
|
||||
labelingAssignmentEntity.inspectState.in(InspectState.UNCONFIRM.getId());
|
||||
|
||||
BooleanExpression dayStateCondition = doneToday.or(unconfirmOrExcept);
|
||||
BooleanExpression dayStateCondition = doneToday.or(unconfirm);
|
||||
|
||||
Pageable pageable = PageRequest.of(searchReq.getPage(), searchReq.getSize());
|
||||
List<ReviewListDto> list =
|
||||
@@ -104,8 +103,7 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport
|
||||
.on(labelingAssignmentEntity.assignGroupId.eq(mapInkx5kEntity.mapidcdNo))
|
||||
.where(
|
||||
labelingAssignmentEntity.inspectorUid.eq(userId),
|
||||
dayStateCondition,
|
||||
labelingAssignmentEntity.workState.eq("DONE")) // 라벨링 완료된 것만 검수 대상
|
||||
dayStateCondition) // 라벨링 완료된 것만 검수 대상
|
||||
.offset(pageable.getOffset())
|
||||
.limit(pageable.getPageSize())
|
||||
.orderBy(
|
||||
@@ -124,10 +122,7 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport
|
||||
mapSheetAnalDataInferenceGeomEntity.geoUid))
|
||||
.innerJoin(mapInkx5kEntity)
|
||||
.on(labelingAssignmentEntity.assignGroupId.eq(mapInkx5kEntity.mapidcdNo))
|
||||
.where(
|
||||
labelingAssignmentEntity.inspectorUid.eq(userId),
|
||||
dayStateCondition,
|
||||
labelingAssignmentEntity.workState.eq("DONE"))
|
||||
.where(labelingAssignmentEntity.inspectorUid.eq(userId), dayStateCondition)
|
||||
.fetchOne())
|
||||
.orElse(0L);
|
||||
|
||||
@@ -190,7 +185,7 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateReviewStateOperator(String operatorUid, String status, String memo) {
|
||||
public void updateReviewStateOperator(String operatorUid, String status) {
|
||||
queryFactory
|
||||
.update(labelingAssignmentEntity)
|
||||
.set(labelingAssignmentEntity.inspectState, status)
|
||||
@@ -201,8 +196,13 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport
|
||||
|
||||
@Override
|
||||
public void updateReviewExceptState(Long inferenceGeomUid, String status) {
|
||||
// 검수 제외 시 assignment 테이블만 업데이트
|
||||
// (inference_geom 테이블에는 inspect_state 컬럼이 없음)
|
||||
// 검수 제외 시 assignment 테이블 상태만 업데이트, geom 테이블도 상태만 업데이트
|
||||
queryFactory
|
||||
.update(mapSheetAnalDataInferenceGeomEntity)
|
||||
.set(mapSheetAnalDataInferenceGeomEntity.testState, status)
|
||||
.set(mapSheetAnalDataInferenceGeomEntity.testStateDttm, ZonedDateTime.now())
|
||||
.where(mapSheetAnalDataInferenceGeomEntity.geoUid.eq(inferenceGeomUid))
|
||||
.execute();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -282,9 +282,7 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport
|
||||
queryFactory
|
||||
.select(labelingAssignmentEntity.count())
|
||||
.from(labelingAssignmentEntity)
|
||||
.where(
|
||||
labelingAssignmentEntity.inspectorUid.eq(userId),
|
||||
labelingAssignmentEntity.workState.eq("DONE"))
|
||||
.where(labelingAssignmentEntity.inspectorUid.eq(userId))
|
||||
.fetchOne();
|
||||
|
||||
totalCnt = (result != null) ? result : 0L;
|
||||
@@ -306,7 +304,6 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport
|
||||
.from(labelingAssignmentEntity)
|
||||
.where(
|
||||
labelingAssignmentEntity.inspectorUid.eq(userId),
|
||||
labelingAssignmentEntity.workState.eq("DONE"),
|
||||
labelingAssignmentEntity.inspectState.eq("UNCONFIRM"))
|
||||
.fetchOne();
|
||||
|
||||
@@ -335,7 +332,7 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport
|
||||
.from(labelingAssignmentEntity)
|
||||
.where(
|
||||
labelingAssignmentEntity.inspectorUid.eq(userId),
|
||||
labelingAssignmentEntity.inspectState.eq("COMPLETE"),
|
||||
labelingAssignmentEntity.inspectState.in("COMPLETE", "EXCEPT"),
|
||||
labelingAssignmentEntity.inspectStatDttm.isNotNull(),
|
||||
labelingAssignmentEntity.inspectStatDttm.goe(startOfToday),
|
||||
labelingAssignmentEntity.inspectStatDttm.lt(endOfToday))
|
||||
@@ -589,15 +586,14 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport
|
||||
BooleanExpression doneToday =
|
||||
labelingAssignmentEntity
|
||||
.inspectState
|
||||
.eq(InspectState.COMPLETE.getId())
|
||||
.in(InspectState.COMPLETE.getId(), InspectState.EXCEPT.getId())
|
||||
.and(labelingAssignmentEntity.inspectStatDttm.goe(todayStart))
|
||||
.and(labelingAssignmentEntity.inspectStatDttm.lt(todayEnd));
|
||||
|
||||
BooleanExpression unconfirmOrExcept =
|
||||
labelingAssignmentEntity.inspectState.in(
|
||||
InspectState.EXCEPT.getId(), InspectState.UNCONFIRM.getId());
|
||||
BooleanExpression unconfirm =
|
||||
labelingAssignmentEntity.inspectState.in(InspectState.UNCONFIRM.getId());
|
||||
|
||||
BooleanExpression stateCondition = doneToday.or(unconfirmOrExcept);
|
||||
BooleanExpression stateCondition = doneToday.or(unconfirm);
|
||||
|
||||
Tuple firstAssigned =
|
||||
queryFactory
|
||||
@@ -608,7 +604,6 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport
|
||||
.from(labelingAssignmentEntity)
|
||||
.where(
|
||||
labelingAssignmentEntity.inspectorUid.eq(userId),
|
||||
labelingAssignmentEntity.workState.eq("DONE"),
|
||||
stateCondition,
|
||||
operatorUid == null
|
||||
? labelingAssignmentEntity.inspectState.eq(InspectState.UNCONFIRM.getId())
|
||||
@@ -643,7 +638,6 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport
|
||||
.from(labelingAssignmentEntity)
|
||||
.where(
|
||||
labelingAssignmentEntity.inspectorUid.eq(userId),
|
||||
labelingAssignmentEntity.workState.eq("DONE"),
|
||||
beforeCondition.and(stateCondition))
|
||||
.fetchOne();
|
||||
|
||||
|
||||
@@ -44,13 +44,11 @@ public class TrainingDataReviewService {
|
||||
if (request.getGeometry() == null || request.getGeometry().isEmpty()) {
|
||||
// EXCEPT 상태만 업데이트
|
||||
status = "EXCEPT";
|
||||
trainingDataReviewCoreService.updateReviewStateOperator(
|
||||
operatorUid, status, request.getProperties().getInspectMemo());
|
||||
trainingDataReviewCoreService.updateReviewStateOperator(operatorUid, status);
|
||||
trainingDataReviewCoreService.updateReviewExceptState(inferenceGeomUid, status);
|
||||
} else {
|
||||
status = "COMPLETE";
|
||||
trainingDataReviewCoreService.updateReviewStateOperator(
|
||||
operatorUid, status, request.getProperties().getInspectMemo());
|
||||
trainingDataReviewCoreService.updateReviewStateOperator(operatorUid, status);
|
||||
trainingDataReviewCoreService.updateReviewPolygonClass(
|
||||
inferenceGeomUid, request.getGeometry(), request.getProperties(), status);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user