Merge remote-tracking branch 'origin/feat/infer_dev_260107' into feat/infer_dev_260107
This commit is contained in:
@@ -49,8 +49,7 @@ public class LabelAllocateDto {
|
||||
WAIT("대기"),
|
||||
ASSIGNED("배정"),
|
||||
SKIP("스킵"),
|
||||
DONE("완료"),
|
||||
COMPLETE("완료");
|
||||
DONE("완료");
|
||||
|
||||
private String desc;
|
||||
|
||||
@@ -202,8 +201,6 @@ public class LabelAllocateDto {
|
||||
private Integer stage;
|
||||
private ZonedDateTime gukyuinDttm;
|
||||
private Long count;
|
||||
private Long labelCnt;
|
||||
private Long inspectorCnt;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@@ -235,10 +232,10 @@ public class LabelAllocateDto {
|
||||
@Schema(
|
||||
description = "이관할 라벨러",
|
||||
example = """
|
||||
[
|
||||
"87654321"
|
||||
]
|
||||
""")
|
||||
[
|
||||
"87654321"
|
||||
]
|
||||
""")
|
||||
private List<String> labelers;
|
||||
|
||||
@Schema(description = "회차 마스터 key", example = "f97dc186-e6d3-4645-9737-3173dde8dc64")
|
||||
|
||||
@@ -12,9 +12,7 @@ import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.TargetUser;
|
||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.UserList;
|
||||
import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.WorkerListResponse;
|
||||
import com.kamco.cd.kamcoback.postgres.core.LabelAllocateCoreService;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.data.domain.Page;
|
||||
@@ -123,7 +121,6 @@ public class LabelAllocateService {
|
||||
public ApiResponseDto.ResponseObj allocateMove(
|
||||
Integer totalCnt, String uuid, List<String> targetUsers, String userId) {
|
||||
|
||||
Map<String, Integer> result = new LinkedHashMap<>();
|
||||
int userCount = targetUsers.size();
|
||||
if (userCount <= 0) {
|
||||
return new ApiResponseDto.ResponseObj(ApiResponseCode.BAD_REQUEST, "재할당할 라벨러를 선택해주세요.");
|
||||
@@ -132,6 +129,11 @@ public class LabelAllocateService {
|
||||
int base = totalCnt / userCount;
|
||||
int remainder = totalCnt % userCount;
|
||||
|
||||
Long lastId = null;
|
||||
List<Long> allIds =
|
||||
labelAllocateCoreService.fetchNextMoveIds(lastId, totalCnt.longValue(), uuid, userId);
|
||||
|
||||
int index = 0;
|
||||
for (int i = 0; i < userCount; i++) {
|
||||
int assignCount = base;
|
||||
|
||||
@@ -140,11 +142,15 @@ public class LabelAllocateService {
|
||||
assignCount += remainder;
|
||||
}
|
||||
|
||||
result.put(targetUsers.get(i), assignCount);
|
||||
|
||||
// TODO: 재할당 테이블에 update 까지만 하고 나머지는 배치에서 처리하기?
|
||||
labelAllocateCoreService.assignOwnerReAllocate(
|
||||
uuid, userId, targetUsers.get(i), (long) assignCount);
|
||||
// labelAllocateCoreService.assignOwnerReAllocate(
|
||||
// uuid, userId, targetUsers.get(i), (long) assignCount);
|
||||
|
||||
int end = index + assignCount;
|
||||
List<Long> sub = allIds.subList(index, end);
|
||||
|
||||
labelAllocateCoreService.assignOwnerMove(sub, targetUsers.get(i));
|
||||
index = end;
|
||||
}
|
||||
|
||||
// Long lastId = null;
|
||||
|
||||
Reference in New Issue
Block a user