projectinfo closed BOTH ADD
This commit is contained in:
@@ -267,7 +267,13 @@ public class LabelAllocateApiController {
|
|||||||
value =
|
value =
|
||||||
"""
|
"""
|
||||||
{"uuid": "f97dc186-e6d3-4645-9737-3173dde8dc64", "closedType": "INSPECTION", "closedYn": "Y"}
|
{"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
|
@RequestBody
|
||||||
@Valid
|
@Valid
|
||||||
@@ -276,7 +282,17 @@ public class LabelAllocateApiController {
|
|||||||
labelAllocateService.updateClosedYn(
|
labelAllocateService.updateClosedYn(
|
||||||
request.getUuid(), request.getClosedType(), request.getClosedYn());
|
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 =
|
String statusMessage =
|
||||||
"Y".equals(request.getClosedYn())
|
"Y".equals(request.getClosedYn())
|
||||||
? typeLabel + "이(가) 종료되었습니다."
|
? typeLabel + "이(가) 종료되었습니다."
|
||||||
|
|||||||
@@ -57,13 +57,14 @@ public class WorkerStatsDto {
|
|||||||
example = "f97dc186-e6d3-4645-9737-3173dde8dc64")
|
example = "f97dc186-e6d3-4645-9737-3173dde8dc64")
|
||||||
private String uuid;
|
private String uuid;
|
||||||
|
|
||||||
@NotBlank(message = "종료 유형은 필수입니다.")
|
@Pattern(
|
||||||
@Pattern(regexp = "^(LABELING|INSPECTION)$", message = "종료 유형은 LABELING 또는 INSPECTION이어야 합니다.")
|
regexp = "^(LABELING|INSPECTION|BOTH)$",
|
||||||
|
message = "종료 유형은 LABELING, INSPECTION 또는 BOTH 이어야 합니다.")
|
||||||
@Schema(
|
@Schema(
|
||||||
description = "종료 유형 (LABELING: 라벨링, INSPECTION: 검수)",
|
description = "종료 유형 (LABELING: 라벨링만, INSPECTION: 검수만, BOTH: 라벨링+검수 동시)",
|
||||||
example = "LABELING",
|
example = "LABELING",
|
||||||
allowableValues = {"LABELING", "INSPECTION"},
|
allowableValues = {"LABELING", "INSPECTION", "BOTH"},
|
||||||
requiredMode = Schema.RequiredMode.REQUIRED)
|
requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
private String closedType;
|
private String closedType;
|
||||||
|
|
||||||
@NotBlank(message = "종료 여부는 필수입니다.")
|
@NotBlank(message = "종료 여부는 필수입니다.")
|
||||||
|
|||||||
@@ -234,13 +234,19 @@ public class LabelAllocateService {
|
|||||||
* 프로젝트 종료 여부 업데이트
|
* 프로젝트 종료 여부 업데이트
|
||||||
*
|
*
|
||||||
* @param uuid 프로젝트 UUID (선택, 미입력 시 최신 프로젝트 대상)
|
* @param uuid 프로젝트 UUID (선택, 미입력 시 최신 프로젝트 대상)
|
||||||
* @param closedType 종료 유형 (LABELING/INSPECTION)
|
* @param closedType 종료 유형 (LABELING/INSPECTION/BOTH)
|
||||||
* @param closedYn 종료 여부 (Y/N)
|
* @param closedYn 종료 여부 (Y/N)
|
||||||
*/
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
public void updateClosedYn(String uuid, String closedType, String closedYn) {
|
public void updateClosedYn(String uuid, String closedType, String closedYn) {
|
||||||
String targetUuid = uuid;
|
String targetUuid = uuid;
|
||||||
|
|
||||||
|
// closedType 유효성 검증
|
||||||
|
if (closedType == null || closedType.isBlank()) {
|
||||||
|
throw new IllegalArgumentException(
|
||||||
|
"종료 유형(closedType)은 필수입니다. (LABELING, INSPECTION, BOTH 중 하나)");
|
||||||
|
}
|
||||||
|
|
||||||
// uuid가 없으면 최신 프로젝트 uuid 조회
|
// uuid가 없으면 최신 프로젝트 uuid 조회
|
||||||
if (targetUuid == null || targetUuid.isBlank()) {
|
if (targetUuid == null || targetUuid.isBlank()) {
|
||||||
var latestProjectInfo = labelAllocateCoreService.findLatestProjectInfo();
|
var latestProjectInfo = labelAllocateCoreService.findLatestProjectInfo();
|
||||||
|
|||||||
@@ -1553,6 +1553,10 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
updateQuery.set(mapSheetAnalInferenceEntity.labelingClosedYn, closedYn);
|
updateQuery.set(mapSheetAnalInferenceEntity.labelingClosedYn, closedYn);
|
||||||
} else if ("INSPECTION".equals(closedType)) {
|
} else if ("INSPECTION".equals(closedType)) {
|
||||||
updateQuery.set(mapSheetAnalInferenceEntity.inspectionClosedYn, closedYn);
|
updateQuery.set(mapSheetAnalInferenceEntity.inspectionClosedYn, closedYn);
|
||||||
|
} else if ("BOTH".equals(closedType)) {
|
||||||
|
updateQuery
|
||||||
|
.set(mapSheetAnalInferenceEntity.labelingClosedYn, closedYn)
|
||||||
|
.set(mapSheetAnalInferenceEntity.inspectionClosedYn, closedYn);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateQuery
|
updateQuery
|
||||||
|
|||||||
Reference in New Issue
Block a user