작업현황목록수정
This commit is contained in:
@@ -131,9 +131,14 @@ public class LabelWorkerApiController {
|
||||
@Parameter(description = "페이지 크기", example = "20") @RequestParam(defaultValue = "20")
|
||||
int size) {
|
||||
|
||||
// 대상추출(최근)
|
||||
UUID lstUuid = labelWorkService.findLastLabelWorkState();
|
||||
String uuid = lstUuid.toString();
|
||||
|
||||
LabelWorkDto.WorkerStateSearchReq searchReq = new WorkerStateSearchReq();
|
||||
searchReq.setUserRole(userRole);
|
||||
searchReq.setSearchVal(searchVal);
|
||||
searchReq.setUuid(uuid);
|
||||
searchReq.setPage(page);
|
||||
searchReq.setSize(size);
|
||||
return ApiResponseDto.ok(labelWorkService.findlabelWorkStateList(searchReq));
|
||||
|
||||
@@ -158,13 +158,13 @@ public class LabelWorkDto {
|
||||
@Schema(description = "Skip개수")
|
||||
private Long skipCnt;
|
||||
|
||||
@Schema(description = "Skip개수")
|
||||
@Schema(description = "3일전처리개수")
|
||||
private Long day3AgoDoneCnt;
|
||||
|
||||
@Schema(description = "Skip개수")
|
||||
@Schema(description = "2일전처리개수")
|
||||
private Long day2AgoDoneCnt;
|
||||
|
||||
@Schema(description = "Skip개수")
|
||||
@Schema(description = "1일전처리개수")
|
||||
private Long day1AgoDoneCnt;
|
||||
|
||||
public Long getremindCnt() {
|
||||
@@ -172,10 +172,12 @@ public class LabelWorkDto {
|
||||
}
|
||||
|
||||
public double getDoneRate() {
|
||||
if (this.doneCnt == null || this.assignedCnt == 0) {
|
||||
Long dayDoneCnt = this.day3AgoDoneCnt + this.day2AgoDoneCnt + this.day1AgoDoneCnt;
|
||||
|
||||
if (dayDoneCnt == null || dayDoneCnt == 0) {
|
||||
return 0.0;
|
||||
}
|
||||
return (double) this.doneCnt / this.assignedCnt * 100.0;
|
||||
return (double) dayDoneCnt / 3;
|
||||
}
|
||||
|
||||
public String getUserRoleName() {
|
||||
|
||||
@@ -55,4 +55,8 @@ public class LabelWorkService {
|
||||
|
||||
return labelWorkCoreService.findlabelWorkStateList(searchReq);
|
||||
}
|
||||
|
||||
public UUID findLastLabelWorkState() {
|
||||
return labelWorkCoreService.findLastLabelWorkState();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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