작업현황목록수정
This commit is contained in:
@@ -57,4 +57,8 @@ public class LabelWorkCoreService {
|
||||
public LabelWorkMngDetail findLabelWorkMngDetail(UUID uuid) {
|
||||
return labelWorkRepository.findLabelWorkMngDetail(uuid);
|
||||
}
|
||||
|
||||
public UUID findLastLabelWorkState() {
|
||||
return labelWorkRepository.findLastLabelWorkState();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,4 +18,6 @@ public interface LabelWorkRepositoryCustom {
|
||||
LabelWorkMngDetail findLabelWorkMngDetail(UUID uuid);
|
||||
|
||||
Page<WorkerState> findlabelWorkStateList(LabelWorkDto.WorkerStateSearchReq searchReq);
|
||||
|
||||
UUID findLastLabelWorkState();
|
||||
}
|
||||
|
||||
@@ -212,6 +212,8 @@ public class LabelWorkRepositoryImpl extends QuerydslRepositorySupport
|
||||
BooleanBuilder whereBuilder = new BooleanBuilder();
|
||||
BooleanBuilder whereSubBuilder = new BooleanBuilder();
|
||||
|
||||
UUID uuid = UUID.fromString(searchReq.getUuid());
|
||||
|
||||
LocalDate threeDaysAgo = LocalDate.now().minusDays(3);
|
||||
String s3 = threeDaysAgo.format(DateTimeFormatter.ofPattern("YYYY-MM-DD"));
|
||||
|
||||
@@ -300,6 +302,12 @@ public class LabelWorkRepositoryImpl extends QuerydslRepositorySupport
|
||||
.sum()
|
||||
.as("day1AgoDoneCnt")))
|
||||
.from(labelingAssignmentEntity)
|
||||
.innerJoin(mapSheetAnalInferenceEntity)
|
||||
.on(
|
||||
mapSheetAnalInferenceEntity
|
||||
.uuid
|
||||
.eq(uuid)
|
||||
.and(labelingAssignmentEntity.analUid.eq(mapSheetAnalInferenceEntity.id)))
|
||||
.innerJoin(memberEntity)
|
||||
.on(whereSubBuilder)
|
||||
.where(whereBuilder)
|
||||
@@ -312,6 +320,12 @@ public class LabelWorkRepositoryImpl extends QuerydslRepositorySupport
|
||||
queryFactory
|
||||
.select(labelingAssignmentEntity.workerUid.countDistinct())
|
||||
.from(labelingAssignmentEntity)
|
||||
.innerJoin(mapSheetAnalInferenceEntity)
|
||||
.on(
|
||||
mapSheetAnalInferenceEntity
|
||||
.uuid
|
||||
.eq(uuid)
|
||||
.and(labelingAssignmentEntity.analUid.eq(mapSheetAnalInferenceEntity.id)))
|
||||
.innerJoin(memberEntity)
|
||||
.on(whereSubBuilder)
|
||||
.where(whereBuilder)
|
||||
@@ -321,6 +335,40 @@ public class LabelWorkRepositoryImpl extends QuerydslRepositorySupport
|
||||
return new PageImpl<>(foundContent, pageable, countQuery);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UUID findLastLabelWorkState() {
|
||||
|
||||
BooleanBuilder whereBuilder = new BooleanBuilder();
|
||||
|
||||
UUID uuid =
|
||||
queryFactory
|
||||
.select(mapSheetAnalInferenceEntity.uuid)
|
||||
.from(mapSheetAnalInferenceEntity)
|
||||
.innerJoin(labelingAssignmentEntity)
|
||||
.on(mapSheetAnalInferenceEntity.id.eq(labelingAssignmentEntity.analUid))
|
||||
.where(whereBuilder)
|
||||
.orderBy(
|
||||
mapSheetAnalInferenceEntity.compareYyyy.desc(),
|
||||
mapSheetAnalInferenceEntity.targetYyyy.desc(),
|
||||
mapSheetAnalInferenceEntity.stage.desc())
|
||||
.fetchFirst();
|
||||
|
||||
if (uuid == null) {
|
||||
uuid =
|
||||
queryFactory
|
||||
.select(mapSheetAnalInferenceEntity.uuid)
|
||||
.from(mapSheetAnalInferenceEntity)
|
||||
.where(whereBuilder)
|
||||
.orderBy(
|
||||
mapSheetAnalInferenceEntity.compareYyyy.desc(),
|
||||
mapSheetAnalInferenceEntity.targetYyyy.desc(),
|
||||
mapSheetAnalInferenceEntity.stage.desc())
|
||||
.fetchFirst();
|
||||
}
|
||||
|
||||
return uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 작업배정 상세조회
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user