Merge pull request '국유인연동 : 라벨링 진행중 회차 uuid 추가' (#147) from feat/infer_dev_260211 into develop
Reviewed-on: #147
This commit was merged in pull request #147.
This commit is contained in:
@@ -14,9 +14,9 @@ public class GukYuinDto {
|
|||||||
public enum GukYuinLinkFailCode implements EnumType {
|
public enum GukYuinLinkFailCode implements EnumType {
|
||||||
OK("연동 가능"),
|
OK("연동 가능"),
|
||||||
NOT_FOUND("대상 회차가 없습니다."),
|
NOT_FOUND("대상 회차가 없습니다."),
|
||||||
SCOPE_PART_NOT_ALLOWED("부분 도엽은 연동 불가능 합니다."),
|
SCOPE_PART_NOT_ALLOWED("부분 도엽 추론 결과는 연동 할 수 없습니다."),
|
||||||
HAS_RUNNING_INFERENCE("라벨링 진행 중 회차가 있습니다."),
|
HAS_RUNNING_INFERENCE("라벨링 진행중인 회차가 있습니다. 진행중인 라벨링 작업을 종료하신 후 다시 연동해주세요."),
|
||||||
OTHER_GUKYUIN_IN_PROGRESS("국유in 연동 진행 중 회차가 있습니다.");
|
OTHER_GUKYUIN_IN_PROGRESS("국유in 연동이 진행중입니다. 선행 연동 작업이 종료된 후 진행할 수 있습니다.");
|
||||||
|
|
||||||
private final String desc;
|
private final String desc;
|
||||||
|
|
||||||
@@ -36,8 +36,9 @@ public class GukYuinDto {
|
|||||||
public static class GukYuinLinkableRes {
|
public static class GukYuinLinkableRes {
|
||||||
|
|
||||||
private boolean linkable;
|
private boolean linkable;
|
||||||
// private GukYuinLinkFailCode code;
|
private GukYuinLinkFailCode code;
|
||||||
private String message;
|
private String message;
|
||||||
|
private UUID inferenceUuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Repository가 반환할 Fact(조회 결과)
|
// Repository가 반환할 Fact(조회 결과)
|
||||||
@@ -45,7 +46,8 @@ public class GukYuinDto {
|
|||||||
boolean existsLearn,
|
boolean existsLearn,
|
||||||
boolean isPartScope,
|
boolean isPartScope,
|
||||||
boolean hasRunningInference,
|
boolean hasRunningInference,
|
||||||
boolean hasOtherUnfinishedGukYuin) {}
|
boolean hasOtherUnfinishedGukYuin,
|
||||||
|
UUID inferenceUuid) {}
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
|||||||
@@ -237,9 +237,12 @@ public class GukYuinApiService {
|
|||||||
GukYuinLinkFailCode code = decideCode(f);
|
GukYuinLinkFailCode code = decideCode(f);
|
||||||
|
|
||||||
GukYuinLinkableRes res = new GukYuinLinkableRes();
|
GukYuinLinkableRes res = new GukYuinLinkableRes();
|
||||||
// res.setCode(code);
|
res.setCode(code);
|
||||||
res.setLinkable(code == GukYuinLinkFailCode.OK);
|
res.setLinkable(code == GukYuinLinkFailCode.OK);
|
||||||
res.setMessage(code.getDesc());
|
res.setMessage(code.getDesc());
|
||||||
|
if (code == GukYuinLinkFailCode.HAS_RUNNING_INFERENCE) {
|
||||||
|
res.setInferenceUuid(f.inferenceUuid());
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -519,7 +519,7 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
|||||||
.fetchOne();
|
.fetchOne();
|
||||||
|
|
||||||
if (learn == null) {
|
if (learn == null) {
|
||||||
return new GukYuinLinkFacts(false, false, false, false);
|
return new GukYuinLinkFacts(false, false, false, false, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 부분 도엽 실행인지 확인
|
// 부분 도엽 실행인지 확인
|
||||||
@@ -529,10 +529,11 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
|||||||
QMapSheetLearnEntity learn2 = new QMapSheetLearnEntity("learn2");
|
QMapSheetLearnEntity learn2 = new QMapSheetLearnEntity("learn2");
|
||||||
QMapSheetLearnEntity learnQ = QMapSheetLearnEntity.mapSheetLearnEntity;
|
QMapSheetLearnEntity learnQ = QMapSheetLearnEntity.mapSheetLearnEntity;
|
||||||
|
|
||||||
// 실행중인 추론 있는지 확인
|
// 현재 국유인 연동하려는 추론의 비교년도,기준년도와 같은 회차 중, 할당되거나 진행중인 학습데이터 uuid 조회
|
||||||
boolean hasRunningInference =
|
// ex. 2022-2023년도 9회차 학습데이터 제작 진행중 -> 10회차 연동하려고 할 시, 먼저 9회차를 종료해야 함
|
||||||
|
UUID runningInferenceUuid =
|
||||||
queryFactory
|
queryFactory
|
||||||
.selectOne()
|
.select(inf.uuid)
|
||||||
.from(inf)
|
.from(inf)
|
||||||
.join(learn2)
|
.join(learn2)
|
||||||
.on(inf.learnId.eq(learn2.id))
|
.on(inf.learnId.eq(learn2.id))
|
||||||
@@ -540,8 +541,9 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
|||||||
learn2.compareYyyy.eq(learn.getCompareYyyy()),
|
learn2.compareYyyy.eq(learn.getCompareYyyy()),
|
||||||
learn2.targetYyyy.eq(learn.getTargetYyyy()),
|
learn2.targetYyyy.eq(learn.getTargetYyyy()),
|
||||||
inf.analState.in("ASSIGNED", "ING"))
|
inf.analState.in("ASSIGNED", "ING"))
|
||||||
.fetchFirst()
|
.fetchFirst();
|
||||||
!= null;
|
|
||||||
|
boolean hasRunningInference = runningInferenceUuid != null;
|
||||||
|
|
||||||
// 국유인 작업 진행중 있는지 확인
|
// 국유인 작업 진행중 있는지 확인
|
||||||
boolean hasOtherUnfinishedGukYuin =
|
boolean hasOtherUnfinishedGukYuin =
|
||||||
@@ -556,6 +558,7 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
|||||||
.fetchFirst()
|
.fetchFirst()
|
||||||
!= null;
|
!= null;
|
||||||
|
|
||||||
return new GukYuinLinkFacts(true, isPartScope, hasRunningInference, hasOtherUnfinishedGukYuin);
|
return new GukYuinLinkFacts(
|
||||||
|
true, isPartScope, hasRunningInference, hasOtherUnfinishedGukYuin, runningInferenceUuid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user