Merge remote-tracking branch 'origin/feat/dev_251201' into feat/dev_251201
This commit is contained in:
@@ -2,6 +2,7 @@ package com.kamco.cd.kamcoback.Innopam.dto;
|
|||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
@@ -38,7 +39,7 @@ public class DetectMastDto {
|
|||||||
@Schema(description = "after 연도", example = "2024")
|
@Schema(description = "after 연도", example = "2024")
|
||||||
private String cprsAdYr;
|
private String cprsAdYr;
|
||||||
|
|
||||||
@NotBlank
|
@NotNull
|
||||||
@Schema(description = "차수(회차)", example = "4")
|
@Schema(description = "차수(회차)", example = "4")
|
||||||
private Integer dtctSno;
|
private Integer dtctSno;
|
||||||
|
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ public class LabelAllocateApiController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Operation(
|
@Operation(
|
||||||
summary = "작업현황 관리 (라벨링, 검수 진행률 요약정보, 작업자 목록)",
|
summary = "작업현황 관리 (라벨링, 검수 진행률 요약정보)",
|
||||||
description = "작업현황 관리 (라벨링, 검수 진행률 요약정보, 작업자 목록)")
|
description = "작업현황 관리 (라벨링, 검수 진행률 요약정보)")
|
||||||
@ApiResponses(
|
@ApiResponses(
|
||||||
value = {
|
value = {
|
||||||
@ApiResponse(responseCode = "200", description = "조회 성공"),
|
@ApiResponse(responseCode = "200", description = "조회 성공"),
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ public class WorkerStatsDto {
|
|||||||
|
|
||||||
@Schema(description = "작업 시작일 (예: 2026-04-06)")
|
@Schema(description = "작업 시작일 (예: 2026-04-06)")
|
||||||
private String startDate;
|
private String startDate;
|
||||||
|
|
||||||
|
@Schema(description = "프로젝트 UUID")
|
||||||
|
private String uuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
|||||||
@@ -118,8 +118,10 @@ public class LabelAllocateService {
|
|||||||
public WorkerListResponse getWorkerStatistics(
|
public WorkerListResponse getWorkerStatistics(
|
||||||
Long analUid, String workerType, String search, String sortType) {
|
Long analUid, String workerType, String search, String sortType) {
|
||||||
|
|
||||||
// 프로젝트 정보 조회 (analUid가 있을 때만)
|
// 프로젝트 정보 조회 (analUid가 없으면 최신 프로젝트 정보 조회)
|
||||||
var projectInfo = labelAllocateCoreService.findProjectInfo(analUid);
|
var projectInfo = analUid != null
|
||||||
|
? labelAllocateCoreService.findProjectInfo(analUid)
|
||||||
|
: labelAllocateCoreService.findLatestProjectInfo();
|
||||||
|
|
||||||
// 작업 진행 현황 조회
|
// 작업 진행 현황 조회
|
||||||
var progressInfo = labelAllocateCoreService.findWorkProgressInfo(analUid);
|
var progressInfo = labelAllocateCoreService.findWorkProgressInfo(analUid);
|
||||||
|
|||||||
@@ -56,6 +56,10 @@ public class LabelAllocateCoreService {
|
|||||||
return labelAllocateRepository.findProjectInfo(analUid);
|
return labelAllocateRepository.findProjectInfo(analUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ProjectInfo findLatestProjectInfo() {
|
||||||
|
return labelAllocateRepository.findLatestProjectInfo();
|
||||||
|
}
|
||||||
|
|
||||||
public List<WorkerStatistics> findWorkerStatistics(
|
public List<WorkerStatistics> findWorkerStatistics(
|
||||||
Long analUid, String workerType, String search, String sortType) {
|
Long analUid, String workerType, String search, String sortType) {
|
||||||
return labelAllocateRepository.findWorkerStatistics(analUid, workerType, search, sortType);
|
return labelAllocateRepository.findWorkerStatistics(analUid, workerType, search, sortType);
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ public interface LabelAllocateRepositoryCustom {
|
|||||||
// 프로젝트 정보 조회
|
// 프로젝트 정보 조회
|
||||||
ProjectInfo findProjectInfo(Long analUid);
|
ProjectInfo findProjectInfo(Long analUid);
|
||||||
|
|
||||||
|
// 최신 프로젝트 정보 조회 (analUid 없이)
|
||||||
|
ProjectInfo findLatestProjectInfo();
|
||||||
|
|
||||||
// 작업자 통계 조회
|
// 작업자 통계 조회
|
||||||
List<WorkerStatistics> findWorkerStatistics(
|
List<WorkerStatistics> findWorkerStatistics(
|
||||||
Long analUid, String workerType, String search, String sortType);
|
Long analUid, String workerType, String search, String sortType);
|
||||||
|
|||||||
@@ -103,8 +103,6 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
.update(mapSheetAnalDataInferenceGeomEntity)
|
.update(mapSheetAnalDataInferenceGeomEntity)
|
||||||
.set(mapSheetAnalDataInferenceGeomEntity.labelState, LabelState.ASSIGNED.getId())
|
.set(mapSheetAnalDataInferenceGeomEntity.labelState, LabelState.ASSIGNED.getId())
|
||||||
.set(mapSheetAnalDataInferenceGeomEntity.labelStateDttm, ZonedDateTime.now())
|
.set(mapSheetAnalDataInferenceGeomEntity.labelStateDttm, ZonedDateTime.now())
|
||||||
.set(mapSheetAnalDataInferenceGeomEntity.testState, InspectState.UNCONFIRM.getId())
|
|
||||||
.set(mapSheetAnalDataInferenceGeomEntity.testStateDttm, ZonedDateTime.now())
|
|
||||||
.where(mapSheetAnalDataInferenceGeomEntity.geoUid.in(geoUidList))
|
.where(mapSheetAnalDataInferenceGeomEntity.geoUid.in(geoUidList))
|
||||||
.execute();
|
.execute();
|
||||||
|
|
||||||
@@ -648,24 +646,26 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
var result =
|
var result =
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(
|
.select(
|
||||||
mapSheetAnalEntity.compareYyyy,
|
mapSheetAnalInferenceEntity.compareYyyy,
|
||||||
mapSheetAnalEntity.targetYyyy,
|
mapSheetAnalInferenceEntity.targetYyyy,
|
||||||
mapSheetAnalEntity.analTitle,
|
mapSheetAnalInferenceEntity.analTitle,
|
||||||
mapSheetAnalEntity.gukyuinApplyDttm,
|
mapSheetAnalInferenceEntity.gukyuinApplyDttm,
|
||||||
mapSheetAnalEntity.analStrtDttm)
|
mapSheetAnalInferenceEntity.analStrtDttm,
|
||||||
.from(mapSheetAnalEntity)
|
mapSheetAnalInferenceEntity.uuid)
|
||||||
.where(mapSheetAnalEntity.id.eq(analUid))
|
.from(mapSheetAnalInferenceEntity)
|
||||||
|
.where(mapSheetAnalInferenceEntity.id.eq(analUid))
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
|
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Integer compareYyyy = result.get(mapSheetAnalEntity.compareYyyy);
|
Integer compareYyyy = result.get(mapSheetAnalInferenceEntity.compareYyyy);
|
||||||
Integer targetYyyy = result.get(mapSheetAnalEntity.targetYyyy);
|
Integer targetYyyy = result.get(mapSheetAnalInferenceEntity.targetYyyy);
|
||||||
String analTitle = result.get(mapSheetAnalEntity.analTitle);
|
String analTitle = result.get(mapSheetAnalInferenceEntity.analTitle);
|
||||||
ZonedDateTime gukyuinApplyDttm = result.get(mapSheetAnalEntity.gukyuinApplyDttm);
|
ZonedDateTime gukyuinApplyDttm = result.get(mapSheetAnalInferenceEntity.gukyuinApplyDttm);
|
||||||
ZonedDateTime analStrtDttm = result.get(mapSheetAnalEntity.analStrtDttm);
|
ZonedDateTime analStrtDttm = result.get(mapSheetAnalInferenceEntity.analStrtDttm);
|
||||||
|
UUID uuid = result.get(mapSheetAnalInferenceEntity.uuid);
|
||||||
|
|
||||||
// 변화탐지년도 생성
|
// 변화탐지년도 생성
|
||||||
String detectionYear =
|
String detectionYear =
|
||||||
@@ -679,6 +679,54 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
.round(round)
|
.round(round)
|
||||||
.reflectionDate(formatDate(gukyuinApplyDttm))
|
.reflectionDate(formatDate(gukyuinApplyDttm))
|
||||||
.startDate(formatDate(analStrtDttm))
|
.startDate(formatDate(analStrtDttm))
|
||||||
|
.uuid(uuid != null ? uuid.toString() : null)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProjectInfo findLatestProjectInfo() {
|
||||||
|
// 최신 target_yyyy를 기준으로 프로젝트 정보 조회
|
||||||
|
var result =
|
||||||
|
queryFactory
|
||||||
|
.select(
|
||||||
|
mapSheetAnalInferenceEntity.compareYyyy,
|
||||||
|
mapSheetAnalInferenceEntity.targetYyyy,
|
||||||
|
mapSheetAnalInferenceEntity.analTitle,
|
||||||
|
mapSheetAnalInferenceEntity.gukyuinApplyDttm,
|
||||||
|
mapSheetAnalInferenceEntity.analStrtDttm,
|
||||||
|
mapSheetAnalInferenceEntity.uuid)
|
||||||
|
.from(mapSheetAnalInferenceEntity)
|
||||||
|
.orderBy(
|
||||||
|
mapSheetAnalInferenceEntity.targetYyyy.desc(),
|
||||||
|
mapSheetAnalInferenceEntity.compareYyyy.desc(),
|
||||||
|
mapSheetAnalInferenceEntity.createdDttm.desc())
|
||||||
|
.limit(1)
|
||||||
|
.fetchOne();
|
||||||
|
|
||||||
|
if (result == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Integer compareYyyy = result.get(mapSheetAnalInferenceEntity.compareYyyy);
|
||||||
|
Integer targetYyyy = result.get(mapSheetAnalInferenceEntity.targetYyyy);
|
||||||
|
String analTitle = result.get(mapSheetAnalInferenceEntity.analTitle);
|
||||||
|
ZonedDateTime gukyuinApplyDttm = result.get(mapSheetAnalInferenceEntity.gukyuinApplyDttm);
|
||||||
|
ZonedDateTime analStrtDttm = result.get(mapSheetAnalInferenceEntity.analStrtDttm);
|
||||||
|
UUID uuid = result.get(mapSheetAnalInferenceEntity.uuid);
|
||||||
|
|
||||||
|
// 변화탐지년도 생성
|
||||||
|
String detectionYear =
|
||||||
|
(compareYyyy != null && targetYyyy != null) ? compareYyyy + "-" + targetYyyy : null;
|
||||||
|
|
||||||
|
// 회차 추출 (예: "8회차" → "8")
|
||||||
|
String round = extractRoundFromTitle(analTitle);
|
||||||
|
|
||||||
|
return ProjectInfo.builder()
|
||||||
|
.detectionYear(detectionYear)
|
||||||
|
.round(round)
|
||||||
|
.reflectionDate(formatDate(gukyuinApplyDttm))
|
||||||
|
.startDate(formatDate(analStrtDttm))
|
||||||
|
.uuid(uuid != null ? uuid.toString() : null)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ public class LabelWorkRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
.innerJoin(memberEntity)
|
.innerJoin(memberEntity)
|
||||||
.on(whereSubBuilder)
|
.on(whereSubBuilder)
|
||||||
.where(whereBuilder)
|
.where(whereBuilder)
|
||||||
//.groupBy(memberEntity.userRole, memberEntity.name, memberEntity.userId)
|
// .groupBy(memberEntity.userRole, memberEntity.name, memberEntity.userId)
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
|
|
||||||
return new PageImpl<>(foundContent, pageable, countQuery);
|
return new PageImpl<>(foundContent, pageable, countQuery);
|
||||||
|
|||||||
Reference in New Issue
Block a user