spotless
This commit is contained in:
@@ -110,7 +110,8 @@ public class LabelAllocateApiController {
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = Long.class),
|
||||
examples = {@ExampleObject(
|
||||
examples = {
|
||||
@ExampleObject(
|
||||
name = "라벨러 할당 예시",
|
||||
description = "라벨러 할당 예시",
|
||||
value =
|
||||
@@ -148,8 +149,8 @@ public class LabelAllocateApiController {
|
||||
|
||||
]
|
||||
}
|
||||
""")}
|
||||
)),
|
||||
""")
|
||||
})),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content),
|
||||
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
@@ -182,7 +183,9 @@ public class LabelAllocateApiController {
|
||||
|
||||
@Operation(summary = "작업이관 > 라벨러 상세 정보", description = "작업이관 > 라벨러 상세 정보")
|
||||
@GetMapping("/labeler-detail")
|
||||
public ApiResponseDto<LabelerDetail> findLabelerDetail(@RequestParam(defaultValue = "01022223333") String userId, @RequestParam(defaultValue = "3") Long analUid) {
|
||||
public ApiResponseDto<LabelerDetail> findLabelerDetail(
|
||||
@RequestParam(defaultValue = "01022223333") String userId,
|
||||
@RequestParam(defaultValue = "3") Long analUid) {
|
||||
return ApiResponseDto.ok(labelAllocateService.findLabelerDetail(userId, analUid));
|
||||
}
|
||||
|
||||
@@ -196,7 +199,8 @@ public class LabelAllocateApiController {
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = Long.class),
|
||||
examples = {@ExampleObject(
|
||||
examples = {
|
||||
@ExampleObject(
|
||||
name = "라벨러 할당 예시",
|
||||
description = "라벨러 할당 예시",
|
||||
value =
|
||||
@@ -215,8 +219,8 @@ public class LabelAllocateApiController {
|
||||
}
|
||||
]
|
||||
}
|
||||
""")}
|
||||
)),
|
||||
""")
|
||||
})),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content),
|
||||
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
@@ -233,8 +237,7 @@ public class LabelAllocateApiController {
|
||||
@RequestBody
|
||||
LabelAllocateDto.AllocateMoveDto dto) {
|
||||
|
||||
labelAllocateService.allocateMove(
|
||||
dto.getAutoType(), dto.getStage(), dto.getLabelers());
|
||||
labelAllocateService.allocateMove(dto.getAutoType(), dto.getStage(), dto.getLabelers());
|
||||
|
||||
return ApiResponseDto.ok(null);
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ public class LabelAllocateDto {
|
||||
|
||||
private String roleType;
|
||||
private String name;
|
||||
private String userId; //사번
|
||||
private String userId; // 사번
|
||||
private Long count;
|
||||
private Long completeCnt;
|
||||
private Long skipCnt;
|
||||
@@ -198,5 +198,4 @@ public class LabelAllocateDto {
|
||||
@Schema(description = "라벨러 할당 목록")
|
||||
private List<TargetUser> labelers;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -176,7 +176,6 @@ public class LabelAllocateService {
|
||||
labelAllocateCoreService.assignOwnerMove(sub, target.getUserId());
|
||||
index = end;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public LabelerDetail findLabelerDetail(String userId, Long analUid) {
|
||||
|
||||
@@ -44,8 +44,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
||||
|
||||
private final JPAQueryFactory queryFactory;
|
||||
|
||||
@PersistenceContext
|
||||
private EntityManager em;
|
||||
@PersistenceContext private EntityManager em;
|
||||
|
||||
@Override
|
||||
public List<Long> fetchNextIds(Long lastId, Long batchSize, Long analUid) {
|
||||
@@ -434,13 +433,12 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
||||
.fetchOne();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Long> fetchNextMoveIds(Long lastId, Long batchSize) {
|
||||
MapSheetAnalEntity entity =
|
||||
queryFactory
|
||||
.selectFrom(mapSheetAnalEntity)
|
||||
.where(mapSheetAnalEntity.id.eq(3L)) //TODO
|
||||
.where(mapSheetAnalEntity.id.eq(3L)) // TODO
|
||||
.fetchOne();
|
||||
|
||||
if (Objects.isNull(entity)) {
|
||||
@@ -455,7 +453,8 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
||||
lastId == null ? null : mapSheetAnalDataInferenceGeomEntity.geoUid.gt(lastId),
|
||||
mapSheetAnalDataInferenceGeomEntity.compareYyyy.eq(entity.getCompareYyyy()),
|
||||
mapSheetAnalDataInferenceGeomEntity.targetYyyy.eq(entity.getTargetYyyy()),
|
||||
mapSheetAnalDataInferenceGeomEntity.labelState.in(LabelState.ASSIGNED.getId(), LabelState.SKIP.getId()))
|
||||
mapSheetAnalDataInferenceGeomEntity.labelState.in(
|
||||
LabelState.ASSIGNED.getId(), LabelState.SKIP.getId()))
|
||||
.orderBy(mapSheetAnalDataInferenceGeomEntity.mapSheetNum.asc())
|
||||
.limit(batchSize)
|
||||
.fetch();
|
||||
@@ -480,7 +479,8 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
||||
mapSheetAnalDataInferenceGeomEntity.compareYyyy.eq(entity.getCompareYyyy()),
|
||||
mapSheetAnalDataInferenceGeomEntity.targetYyyy.eq(entity.getTargetYyyy()),
|
||||
mapSheetAnalDataInferenceGeomEntity.stage.eq(4), // TODO: 회차 컬럼을 가져와야 할 듯?
|
||||
mapSheetAnalDataInferenceGeomEntity.labelState.in(LabelState.ASSIGNED.getId(), LabelState.SKIP.getId()))
|
||||
mapSheetAnalDataInferenceGeomEntity.labelState.in(
|
||||
LabelState.ASSIGNED.getId(), LabelState.SKIP.getId()))
|
||||
.fetchOne();
|
||||
}
|
||||
|
||||
@@ -500,19 +500,22 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
||||
public LabelerDetail findLabelerDetail(String userId, Long analUid) {
|
||||
NumberExpression<Long> assignedCnt =
|
||||
new CaseBuilder()
|
||||
.when(labelingAssignmentEntity.workState.eq(LabelState.ASSIGNED.getId())).then(1L)
|
||||
.when(labelingAssignmentEntity.workState.eq(LabelState.ASSIGNED.getId()))
|
||||
.then(1L)
|
||||
.otherwise((Long) null)
|
||||
.count();
|
||||
|
||||
NumberExpression<Long> skipCnt =
|
||||
new CaseBuilder()
|
||||
.when(labelingAssignmentEntity.workState.eq(LabelState.SKIP.getId())).then(1L)
|
||||
.when(labelingAssignmentEntity.workState.eq(LabelState.SKIP.getId()))
|
||||
.then(1L)
|
||||
.otherwise((Long) null)
|
||||
.count();
|
||||
|
||||
NumberExpression<Long> completeCnt =
|
||||
new CaseBuilder()
|
||||
.when(labelingAssignmentEntity.workState.eq(LabelState.COMPLETE.getId())).then(1L)
|
||||
.when(labelingAssignmentEntity.workState.eq(LabelState.COMPLETE.getId()))
|
||||
.then(1L)
|
||||
.otherwise((Long) null)
|
||||
.count();
|
||||
|
||||
@@ -525,30 +528,26 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
||||
Double.class,
|
||||
"round({0} / {1}, 2)",
|
||||
labelingAssignmentEntity.count(),
|
||||
completeCnt
|
||||
)
|
||||
);
|
||||
completeCnt));
|
||||
|
||||
return queryFactory
|
||||
.select(Projections.constructor(LabelerDetail.class,
|
||||
.select(
|
||||
Projections.constructor(
|
||||
LabelerDetail.class,
|
||||
memberEntity.userRole,
|
||||
memberEntity.name,
|
||||
memberEntity.employeeNo,
|
||||
assignedCnt,
|
||||
skipCnt,
|
||||
completeCnt,
|
||||
percent
|
||||
))
|
||||
percent))
|
||||
.from(memberEntity)
|
||||
.innerJoin(labelingAssignmentEntity)
|
||||
.on(memberEntity.employeeNo.eq(labelingAssignmentEntity.workerUid),
|
||||
labelingAssignmentEntity.analUid.eq(analUid)
|
||||
)
|
||||
.on(
|
||||
memberEntity.employeeNo.eq(labelingAssignmentEntity.workerUid),
|
||||
labelingAssignmentEntity.analUid.eq(analUid))
|
||||
.where(memberEntity.employeeNo.eq(userId))
|
||||
.groupBy(memberEntity.userRole,
|
||||
memberEntity.name,
|
||||
memberEntity.employeeNo)
|
||||
.fetchOne()
|
||||
;
|
||||
.groupBy(memberEntity.userRole, memberEntity.name, memberEntity.employeeNo)
|
||||
.fetchOne();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user