Merge pull request 'feat/infer_dev_260107' (#253) from feat/infer_dev_260107 into develop
Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/253
This commit is contained in:
@@ -267,7 +267,13 @@ public class LabelAllocateApiController {
|
||||
value =
|
||||
"""
|
||||
{"uuid": "f97dc186-e6d3-4645-9737-3173dde8dc64", "closedType": "INSPECTION", "closedYn": "Y"}
|
||||
""")
|
||||
"""),
|
||||
@io.swagger.v3.oas.annotations.media.ExampleObject(
|
||||
name = "특정 프로젝트 라벨링+검수 동시 종료",
|
||||
value =
|
||||
"""
|
||||
{"uuid": "f97dc186-e6d3-4645-9737-3173dde8dc64", "closedType": "BOTH", "closedYn": "Y"}
|
||||
""")
|
||||
}))
|
||||
@RequestBody
|
||||
@Valid
|
||||
@@ -276,7 +282,17 @@ public class LabelAllocateApiController {
|
||||
labelAllocateService.updateClosedYn(
|
||||
request.getUuid(), request.getClosedType(), request.getClosedYn());
|
||||
|
||||
String typeLabel = "LABELING".equals(request.getClosedType()) ? "라벨링" : "검수";
|
||||
String typeLabel;
|
||||
if ("LABELING".equals(request.getClosedType())) {
|
||||
typeLabel = "라벨링";
|
||||
} else if ("INSPECTION".equals(request.getClosedType())) {
|
||||
typeLabel = "검수";
|
||||
} else if ("BOTH".equals(request.getClosedType())) {
|
||||
typeLabel = "라벨링 및 검수";
|
||||
} else {
|
||||
typeLabel = "작업";
|
||||
}
|
||||
|
||||
String statusMessage =
|
||||
"Y".equals(request.getClosedYn())
|
||||
? typeLabel + "이(가) 종료되었습니다."
|
||||
|
||||
@@ -57,13 +57,14 @@ public class WorkerStatsDto {
|
||||
example = "f97dc186-e6d3-4645-9737-3173dde8dc64")
|
||||
private String uuid;
|
||||
|
||||
@NotBlank(message = "종료 유형은 필수입니다.")
|
||||
@Pattern(regexp = "^(LABELING|INSPECTION)$", message = "종료 유형은 LABELING 또는 INSPECTION이어야 합니다.")
|
||||
@Pattern(
|
||||
regexp = "^(LABELING|INSPECTION|BOTH)$",
|
||||
message = "종료 유형은 LABELING, INSPECTION 또는 BOTH 이어야 합니다.")
|
||||
@Schema(
|
||||
description = "종료 유형 (LABELING: 라벨링, INSPECTION: 검수)",
|
||||
description = "종료 유형 (LABELING: 라벨링만, INSPECTION: 검수만, BOTH: 라벨링+검수 동시)",
|
||||
example = "LABELING",
|
||||
allowableValues = {"LABELING", "INSPECTION"},
|
||||
requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
allowableValues = {"LABELING", "INSPECTION", "BOTH"},
|
||||
requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private String closedType;
|
||||
|
||||
@NotBlank(message = "종료 여부는 필수입니다.")
|
||||
|
||||
@@ -234,13 +234,19 @@ public class LabelAllocateService {
|
||||
* 프로젝트 종료 여부 업데이트
|
||||
*
|
||||
* @param uuid 프로젝트 UUID (선택, 미입력 시 최신 프로젝트 대상)
|
||||
* @param closedType 종료 유형 (LABELING/INSPECTION)
|
||||
* @param closedType 종료 유형 (LABELING/INSPECTION/BOTH)
|
||||
* @param closedYn 종료 여부 (Y/N)
|
||||
*/
|
||||
@Transactional
|
||||
public void updateClosedYn(String uuid, String closedType, String closedYn) {
|
||||
String targetUuid = uuid;
|
||||
|
||||
// closedType 유효성 검증
|
||||
if (closedType == null || closedType.isBlank()) {
|
||||
throw new IllegalArgumentException(
|
||||
"종료 유형(closedType)은 필수입니다. (LABELING, INSPECTION, BOTH 중 하나)");
|
||||
}
|
||||
|
||||
// uuid가 없으면 최신 프로젝트 uuid 조회
|
||||
if (targetUuid == null || targetUuid.isBlank()) {
|
||||
var latestProjectInfo = labelAllocateCoreService.findLatestProjectInfo();
|
||||
|
||||
@@ -184,9 +184,9 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC
|
||||
SELECT
|
||||
r.uid AS result_uid,
|
||||
msadi.stage,
|
||||
r.cd_prob,
|
||||
r.input1 AS compare_yyyy,
|
||||
r.input2 AS target_yyyy,
|
||||
r.after_p as cd_prob,
|
||||
msl.compare_yyyy,
|
||||
msl.target_yyyy,
|
||||
CASE
|
||||
WHEN r.map_id ~ '^[0-9]+$' THEN r.map_id::bigint
|
||||
ELSE NULL
|
||||
|
||||
@@ -1553,6 +1553,10 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
||||
updateQuery.set(mapSheetAnalInferenceEntity.labelingClosedYn, closedYn);
|
||||
} else if ("INSPECTION".equals(closedType)) {
|
||||
updateQuery.set(mapSheetAnalInferenceEntity.inspectionClosedYn, closedYn);
|
||||
} else if ("BOTH".equals(closedType)) {
|
||||
updateQuery
|
||||
.set(mapSheetAnalInferenceEntity.labelingClosedYn, closedYn)
|
||||
.set(mapSheetAnalInferenceEntity.inspectionClosedYn, closedYn);
|
||||
}
|
||||
|
||||
updateQuery
|
||||
|
||||
Reference in New Issue
Block a user