Merge pull request '라벨 이관 로직 수정' (#139) from feat/dev_251201 into develop

Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/139
This commit is contained in:
2026-01-05 14:14:10 +09:00
6 changed files with 48 additions and 23 deletions

View File

@@ -197,11 +197,11 @@ public class LabelAllocateApiController {
return ApiResponseDto.okObject( return ApiResponseDto.okObject(
labelAllocateService.allocateMove( labelAllocateService.allocateMove(
dto.getAutoType(),
dto.getStage(), dto.getStage(),
dto.getLabelers(), dto.getLabelers(),
dto.getCompareYyyy(), dto.getCompareYyyy(),
dto.getTargetYyyy())); dto.getTargetYyyy(),
dto.getUserId()));
} }
@Operation( @Operation(

View File

@@ -225,14 +225,11 @@ public class LabelAllocateDto {
@AllArgsConstructor @AllArgsConstructor
public static class AllocateMoveDto { public static class AllocateMoveDto {
@Schema(description = "자동/수동여부(AUTO/MANUAL)", example = "AUTO")
private String autoType;
@Schema(description = "회차", example = "4") @Schema(description = "회차", example = "4")
private Integer stage; private Integer stage;
@Schema( @Schema(
description = "라벨러 할당 목록", description = "이관할 라벨러 할당",
example = example =
""" """
[ [
@@ -253,6 +250,9 @@ public class LabelAllocateDto {
@Schema(description = "기준년도", example = "2024") @Schema(description = "기준년도", example = "2024")
private Integer targetYyyy; private Integer targetYyyy;
@Schema(description = "대상 사번", example = "01022223333")
private String userId;
} }
@Getter @Getter

View File

@@ -132,11 +132,11 @@ public class LabelAllocateService {
} }
public ApiResponseDto.ResponseObj allocateMove( public ApiResponseDto.ResponseObj allocateMove(
String autoType,
Integer stage, Integer stage,
List<TargetUser> targetUsers, List<TargetUser> targetUsers,
Integer compareYyyy, Integer compareYyyy,
Integer targetYyyy) { Integer targetYyyy,
String userId) {
Long lastId = null; Long lastId = null;
Long chargeCnt = targetUsers.stream().mapToLong(TargetUser::getDemand).sum(); Long chargeCnt = targetUsers.stream().mapToLong(TargetUser::getDemand).sum();
@@ -147,7 +147,7 @@ public class LabelAllocateService {
List<Long> allIds = List<Long> allIds =
labelAllocateCoreService.fetchNextMoveIds( labelAllocateCoreService.fetchNextMoveIds(
lastId, chargeCnt, compareYyyy, targetYyyy, stage); lastId, chargeCnt, compareYyyy, targetYyyy, stage, userId);
int index = 0; int index = 0;
for (TargetUser target : targetUsers) { for (TargetUser target : targetUsers) {
int end = index + target.getDemand(); int end = index + target.getDemand();

View File

@@ -79,9 +79,14 @@ public class LabelAllocateCoreService {
} }
public List<Long> fetchNextMoveIds( public List<Long> fetchNextMoveIds(
Long lastId, Long batchSize, Integer compareYyyy, Integer targetYyyy, Integer stage) { Long lastId,
Long batchSize,
Integer compareYyyy,
Integer targetYyyy,
Integer stage,
String userId) {
return labelAllocateRepository.fetchNextMoveIds( return labelAllocateRepository.fetchNextMoveIds(
lastId, batchSize, compareYyyy, targetYyyy, stage); lastId, batchSize, compareYyyy, targetYyyy, stage, userId);
} }
public void assignOwnerMove(List<Long> sub, String userId) { public void assignOwnerMove(List<Long> sub, String userId) {

View File

@@ -48,7 +48,12 @@ public interface LabelAllocateRepositoryCustom {
InferenceDetail findInferenceDetail(String uuid); InferenceDetail findInferenceDetail(String uuid);
List<Long> fetchNextMoveIds( List<Long> fetchNextMoveIds(
Long lastId, Long batchSize, Integer compareYyyy, Integer targetYyyy, Integer stage); Long lastId,
Long batchSize,
Integer compareYyyy,
Integer targetYyyy,
Integer stage,
String userId);
void assignOwnerMove(List<Long> sub, String userId); void assignOwnerMove(List<Long> sub, String userId);

View File

@@ -493,20 +493,35 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
@Override @Override
public List<Long> fetchNextMoveIds( public List<Long> fetchNextMoveIds(
Long lastId, Long batchSize, Integer compareYyyy, Integer targetYyyy, Integer stage) { Long lastId,
Long batchSize,
Integer compareYyyy,
Integer targetYyyy,
Integer stage,
String userId) {
MapSheetAnalInferenceEntity analEntity =
queryFactory
.selectFrom(mapSheetAnalInferenceEntity)
.where(
mapSheetAnalInferenceEntity.compareYyyy.eq(compareYyyy),
mapSheetAnalInferenceEntity.targetYyyy.eq(targetYyyy),
mapSheetAnalInferenceEntity.stage.eq(stage))
.fetchOne();
if (Objects.isNull(analEntity)) {
throw new EntityNotFoundException("MapSheetAnalInferenceEntity not found for analUid: ");
}
return queryFactory return queryFactory
.select(mapSheetAnalDataInferenceGeomEntity.geoUid) .select(labelingAssignmentEntity.inferenceGeomUid)
.from(mapSheetAnalDataInferenceGeomEntity) .from(labelingAssignmentEntity)
.where( .where(
// mapSheetAnalDataGeomEntity.pnu.isNotNull(), //TODO: Mockup 진행 이후 확인하기 labelingAssignmentEntity.workerUid.eq(userId),
lastId == null ? null : mapSheetAnalDataInferenceGeomEntity.geoUid.gt(lastId), labelingAssignmentEntity.workState.eq(LabelState.ASSIGNED.getId()),
mapSheetAnalDataInferenceGeomEntity.compareYyyy.eq(compareYyyy), labelingAssignmentEntity.analUid.eq(analEntity.getId()),
mapSheetAnalDataInferenceGeomEntity.targetYyyy.eq(targetYyyy), lastId == null ? null : labelingAssignmentEntity.inferenceGeomUid.gt(lastId))
mapSheetAnalDataInferenceGeomEntity.stage.eq(stage), .orderBy(labelingAssignmentEntity.inferenceGeomUid.asc())
mapSheetAnalDataInferenceGeomEntity.labelState.in(
LabelState.ASSIGNED.getId(), LabelState.SKIP.getId()))
.orderBy(mapSheetAnalDataInferenceGeomEntity.mapSheetNum.asc())
.limit(batchSize) .limit(batchSize)
.fetch(); .fetch();
} }