파라미터 yyyy기준으로 변경
This commit is contained in:
@@ -162,7 +162,9 @@ public class LabelAllocateApiController {
|
|||||||
dto.getStage(),
|
dto.getStage(),
|
||||||
dto.getLabelers(),
|
dto.getLabelers(),
|
||||||
dto.getInspectors(),
|
dto.getInspectors(),
|
||||||
dto.getAnalUid());
|
dto.getCompareYyyy(),
|
||||||
|
dto.getTargetYyyy()
|
||||||
|
);
|
||||||
|
|
||||||
return ApiResponseDto.ok(null);
|
return ApiResponseDto.ok(null);
|
||||||
}
|
}
|
||||||
@@ -176,17 +178,21 @@ public class LabelAllocateApiController {
|
|||||||
})
|
})
|
||||||
@GetMapping("/stage-detail")
|
@GetMapping("/stage-detail")
|
||||||
public ApiResponseDto<InferenceDetail> findInferenceDetail(
|
public ApiResponseDto<InferenceDetail> findInferenceDetail(
|
||||||
@Parameter(description = "분석 ID", required = true, example = "3") @RequestParam
|
@Parameter(description = "비교년도", required = true, example = "2022") @RequestParam Integer compareYyyy,
|
||||||
Long analUid) {
|
@Parameter(description = "기준년도", required = true, example = "2024") @RequestParam Integer targetYyyy,
|
||||||
return ApiResponseDto.ok(labelAllocateService.findInferenceDetail(analUid));
|
@Parameter(description = "회차", required = true, example = "4") @RequestParam Integer stage
|
||||||
|
) {
|
||||||
|
return ApiResponseDto.ok(labelAllocateService.findInferenceDetail(compareYyyy, targetYyyy, stage));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "작업이관 > 라벨러 상세 정보", description = "작업이관 > 라벨러 상세 정보")
|
@Operation(summary = "작업이관 > 라벨러 상세 정보", description = "작업이관 > 라벨러 상세 정보")
|
||||||
@GetMapping("/labeler-detail")
|
@GetMapping("/labeler-detail")
|
||||||
public ApiResponseDto<LabelerDetail> findLabelerDetail(
|
public ApiResponseDto<LabelerDetail> findLabelerDetail(
|
||||||
@RequestParam(defaultValue = "01022223333") String userId,
|
@RequestParam(defaultValue = "01022223333") String userId,
|
||||||
@RequestParam(defaultValue = "3") Long analUid) {
|
@Parameter(description = "비교년도", required = true, example = "2022") @RequestParam Integer compareYyyy,
|
||||||
return ApiResponseDto.ok(labelAllocateService.findLabelerDetail(userId, analUid));
|
@Parameter(description = "기준년도", required = true, example = "2024") @RequestParam Integer targetYyyy,
|
||||||
|
@Parameter(description = "회차", required = true, example = "4") @RequestParam Integer stage) {
|
||||||
|
return ApiResponseDto.ok(labelAllocateService.findLabelerDetail(userId, compareYyyy, targetYyyy, stage));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "작업 이관", description = "작업 이관")
|
@Operation(summary = "작업 이관", description = "작업 이관")
|
||||||
@@ -237,7 +243,7 @@ public class LabelAllocateApiController {
|
|||||||
@RequestBody
|
@RequestBody
|
||||||
LabelAllocateDto.AllocateMoveDto dto) {
|
LabelAllocateDto.AllocateMoveDto dto) {
|
||||||
|
|
||||||
labelAllocateService.allocateMove(dto.getAutoType(), dto.getStage(), dto.getLabelers());
|
labelAllocateService.allocateMove(dto.getAutoType(), dto.getStage(), dto.getLabelers(), dto.getCompareYyyy(), dto.getTargetYyyy());
|
||||||
|
|
||||||
return ApiResponseDto.ok(null);
|
return ApiResponseDto.ok(null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,9 +87,15 @@ public class LabelAllocateDto {
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class AllocateDto {
|
public static class AllocateDto {
|
||||||
|
|
||||||
@Schema(description = "분석 ID", example = "3", required = true)
|
@Schema(description = "분석 ID", example = "3")
|
||||||
private Long analUid;
|
private Long analUid;
|
||||||
|
|
||||||
|
@Schema(description = "비교년도", example = "2022", required = true)
|
||||||
|
private Integer compareYyyy;
|
||||||
|
|
||||||
|
@Schema(description = "기준년도", example = "2024", required = true)
|
||||||
|
private Integer targetYyyy;
|
||||||
|
|
||||||
@Schema(description = "자동/수동여부(AUTO/MANUAL)", example = "AUTO")
|
@Schema(description = "자동/수동여부(AUTO/MANUAL)", example = "AUTO")
|
||||||
private String autoType;
|
private String autoType;
|
||||||
|
|
||||||
@@ -197,5 +203,11 @@ public class LabelAllocateDto {
|
|||||||
|
|
||||||
@Schema(description = "라벨러 할당 목록")
|
@Schema(description = "라벨러 할당 목록")
|
||||||
private List<TargetUser> labelers;
|
private List<TargetUser> labelers;
|
||||||
|
|
||||||
|
@Schema(description = "비교년도", example = "2022")
|
||||||
|
private Integer compareYyyy;
|
||||||
|
|
||||||
|
@Schema(description = "기준년도", example = "2024")
|
||||||
|
private Integer targetYyyy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ public class LabelAllocateService {
|
|||||||
* @param stage 회차
|
* @param stage 회차
|
||||||
* @param targetUsers 라벨러 목록
|
* @param targetUsers 라벨러 목록
|
||||||
* @param targetInspectors 검수자 목록
|
* @param targetInspectors 검수자 목록
|
||||||
* @param analUid 분석 ID
|
|
||||||
*/
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
public void allocateAsc(
|
public void allocateAsc(
|
||||||
@@ -46,11 +45,13 @@ public class LabelAllocateService {
|
|||||||
Integer stage,
|
Integer stage,
|
||||||
List<TargetUser> targetUsers,
|
List<TargetUser> targetUsers,
|
||||||
List<TargetInspector> targetInspectors,
|
List<TargetInspector> targetInspectors,
|
||||||
Long analUid) {
|
Integer compareYyyy,
|
||||||
|
Integer targetYyyy
|
||||||
|
) {
|
||||||
Long lastId = null;
|
Long lastId = null;
|
||||||
|
|
||||||
// geom 잔여건수 조회
|
// geom 잔여건수 조회
|
||||||
Long chargeCnt = labelAllocateCoreService.findLabelUnAssignedCnt(analUid, stage);
|
Long chargeCnt = labelAllocateCoreService.findLabelUnAssignedCnt(stage, compareYyyy, targetYyyy);
|
||||||
// Long totalDemand = targetUsers.stream().mapToLong(TargetUser::getDemand).sum();
|
// Long totalDemand = targetUsers.stream().mapToLong(TargetUser::getDemand).sum();
|
||||||
// if (!Objects.equals(chargeCnt, totalDemand)) {
|
// if (!Objects.equals(chargeCnt, totalDemand)) {
|
||||||
// log.info("chargeCnt != totalDemand");
|
// log.info("chargeCnt != totalDemand");
|
||||||
@@ -61,18 +62,18 @@ public class LabelAllocateService {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Long> allIds = labelAllocateCoreService.fetchNextIds(lastId, chargeCnt, analUid);
|
List<Long> allIds = labelAllocateCoreService.fetchNextIds(lastId, chargeCnt, compareYyyy, targetYyyy, stage);
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for (TargetUser target : targetUsers) {
|
for (TargetUser target : targetUsers) {
|
||||||
int end = index + target.getDemand();
|
int end = index + target.getDemand();
|
||||||
List<Long> sub = allIds.subList(index, end);
|
List<Long> sub = allIds.subList(index, end);
|
||||||
|
|
||||||
labelAllocateCoreService.assignOwner(sub, target.getUserId(), analUid);
|
labelAllocateCoreService.assignOwner(sub, target.getUserId(), compareYyyy, targetYyyy, stage);
|
||||||
index = end;
|
index = end;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 검수자에게 userCount명 만큼 할당
|
// 검수자에게 userCount명 만큼 할당
|
||||||
List<LabelAllocateDto.Basic> list = labelAllocateCoreService.findAssignedLabelerList(analUid);
|
List<LabelAllocateDto.Basic> list = labelAllocateCoreService.findAssignedLabelerList(compareYyyy, targetYyyy, stage);
|
||||||
int from = 0;
|
int from = 0;
|
||||||
|
|
||||||
for (TargetInspector inspector : targetInspectors) {
|
for (TargetInspector inspector : targetInspectors) {
|
||||||
@@ -154,11 +155,12 @@ public class LabelAllocateService {
|
|||||||
return WorkerListResponse.builder().progressInfo(progressInfo).workers(workers).build();
|
return WorkerListResponse.builder().progressInfo(progressInfo).workers(workers).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public InferenceDetail findInferenceDetail(Long analUid) {
|
public InferenceDetail findInferenceDetail(Integer compareYyyy, Integer targetYyyy, Integer stage) {
|
||||||
return labelAllocateCoreService.findInferenceDetail(analUid);
|
return labelAllocateCoreService.findInferenceDetail(compareYyyy, targetYyyy, stage);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void allocateMove(String autoType, Integer stage, List<TargetUser> targetUsers) {
|
public void allocateMove(String autoType, Integer stage, List<TargetUser> targetUsers, Integer compareYyyy,
|
||||||
|
Integer targetYyyy) {
|
||||||
Long lastId = null;
|
Long lastId = null;
|
||||||
|
|
||||||
Long chargeCnt = targetUsers.stream().mapToLong(TargetUser::getDemand).sum();
|
Long chargeCnt = targetUsers.stream().mapToLong(TargetUser::getDemand).sum();
|
||||||
@@ -167,7 +169,7 @@ public class LabelAllocateService {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Long> allIds = labelAllocateCoreService.fetchNextMoveIds(lastId, chargeCnt);
|
List<Long> allIds = labelAllocateCoreService.fetchNextMoveIds(lastId, chargeCnt, compareYyyy, targetYyyy, stage);
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for (TargetUser target : targetUsers) {
|
for (TargetUser target : targetUsers) {
|
||||||
int end = index + target.getDemand();
|
int end = index + target.getDemand();
|
||||||
@@ -178,7 +180,7 @@ public class LabelAllocateService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public LabelerDetail findLabelerDetail(String userId, Long analUid) {
|
public LabelerDetail findLabelerDetail(String userId, Integer compareYyyy, Integer targetYyyy, Integer stage) {
|
||||||
return labelAllocateCoreService.findLabelerDetail(userId, analUid);
|
return labelAllocateCoreService.findLabelerDetail(userId, compareYyyy, targetYyyy, stage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,22 +20,22 @@ public class LabelAllocateCoreService {
|
|||||||
|
|
||||||
private final LabelAllocateRepository labelAllocateRepository;
|
private final LabelAllocateRepository labelAllocateRepository;
|
||||||
|
|
||||||
public List<Long> fetchNextIds(Long lastId, Long batchSize, Long analUid) {
|
public List<Long> fetchNextIds(Long lastId, Long batchSize, Integer compareYyyy, Integer targetYyyy, Integer stage) {
|
||||||
return labelAllocateRepository.fetchNextIds(lastId, batchSize, analUid);
|
return labelAllocateRepository.fetchNextIds(lastId, batchSize, compareYyyy, targetYyyy, stage);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void assignOwner(List<Long> ids, String userId, Long analUid) {
|
public void assignOwner(List<Long> ids, String userId, Integer compareYyyy, Integer targetYyyy, Integer stage) {
|
||||||
labelAllocateRepository.assignOwner(ids, userId, analUid);
|
labelAllocateRepository.assignOwner(ids, userId, compareYyyy, targetYyyy, stage);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<LabelAllocateDto.Basic> findAssignedLabelerList(Long analUid) {
|
public List<LabelAllocateDto.Basic> findAssignedLabelerList(Integer compareYyyy, Integer targetYyyy, Integer stage) {
|
||||||
return labelAllocateRepository.findAssignedLabelerList(analUid).stream()
|
return labelAllocateRepository.findAssignedLabelerList(compareYyyy, targetYyyy, stage).stream()
|
||||||
.map(LabelingAssignmentEntity::toDto)
|
.map(LabelingAssignmentEntity::toDto)
|
||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long findLabelUnAssignedCnt(Long analUid, Integer stage) {
|
public Long findLabelUnAssignedCnt(Integer stage, Integer compareYyyy, Integer targetYyyy) {
|
||||||
return labelAllocateRepository.findLabelUnAssignedCnt(analUid, stage);
|
return labelAllocateRepository.findLabelUnAssignedCnt(stage, compareYyyy, targetYyyy);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void assignInspector(UUID assignmentUid, String inspectorUid) {
|
public void assignInspector(UUID assignmentUid, String inspectorUid) {
|
||||||
@@ -69,23 +69,23 @@ public class LabelAllocateCoreService {
|
|||||||
labelAllocateRepository.assignInspectorBulk(assignmentUids, inspectorUid);
|
labelAllocateRepository.assignInspectorBulk(assignmentUids, inspectorUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
public InferenceDetail findInferenceDetail(Long analUid) {
|
public InferenceDetail findInferenceDetail(Integer compareYyyy, Integer targetYyyy, Integer stage) {
|
||||||
return labelAllocateRepository.findInferenceDetail(analUid);
|
return labelAllocateRepository.findInferenceDetail(compareYyyy, targetYyyy, stage);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long findLabelUnCompleteCnt(Long analUid) {
|
public Long findLabelUnCompleteCnt(Long analUid) {
|
||||||
return labelAllocateRepository.findLabelUnCompleteCnt(analUid);
|
return labelAllocateRepository.findLabelUnCompleteCnt(analUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Long> fetchNextMoveIds(Long lastId, Long chargeCnt) {
|
public List<Long> fetchNextMoveIds(Long lastId, Long batchSize, Integer compareYyyy, Integer targetYyyy, Integer stage) {
|
||||||
return labelAllocateRepository.fetchNextMoveIds(lastId, chargeCnt);
|
return labelAllocateRepository.fetchNextMoveIds(lastId, batchSize, compareYyyy, targetYyyy, stage);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void assignOwnerMove(List<Long> sub, String userId) {
|
public void assignOwnerMove(List<Long> sub, String userId) {
|
||||||
labelAllocateRepository.assignOwnerMove(sub, userId);
|
labelAllocateRepository.assignOwnerMove(sub, userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LabelerDetail findLabelerDetail(String userId, Long analUid) {
|
public LabelerDetail findLabelerDetail(String userId, Integer compareYyyy, Integer targetYyyy, Integer stage) {
|
||||||
return labelAllocateRepository.findLabelerDetail(userId, analUid);
|
return labelAllocateRepository.findLabelerDetail(userId, compareYyyy, targetYyyy, stage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,13 +12,13 @@ import java.util.UUID;
|
|||||||
|
|
||||||
public interface LabelAllocateRepositoryCustom {
|
public interface LabelAllocateRepositoryCustom {
|
||||||
|
|
||||||
List<Long> fetchNextIds(Long lastId, Long batchSize, Long analUid);
|
List<Long> fetchNextIds(Long lastId, Long batchSize, Integer compareYyyy, Integer targetYyyy, Integer stage);
|
||||||
|
|
||||||
void assignOwner(List<Long> ids, String userId, Long analUid);
|
void assignOwner(List<Long> ids, String userId, Integer compareYyyy, Integer targetYyyy, Integer stage);
|
||||||
|
|
||||||
List<LabelingAssignmentEntity> findAssignedLabelerList(Long analUid);
|
List<LabelingAssignmentEntity> findAssignedLabelerList(Integer compareYyyy, Integer targetYyyy, Integer stage);
|
||||||
|
|
||||||
Long findLabelUnAssignedCnt(Long analUid, Integer stage);
|
Long findLabelUnAssignedCnt(Integer stage, Integer compareYyyy, Integer targetYyyy);
|
||||||
|
|
||||||
void assignInspector(UUID assignmentUid, String userId);
|
void assignInspector(UUID assignmentUid, String userId);
|
||||||
|
|
||||||
@@ -36,13 +36,13 @@ public interface LabelAllocateRepositoryCustom {
|
|||||||
|
|
||||||
void assignInspectorBulk(List<UUID> assignmentUids, String inspectorUid);
|
void assignInspectorBulk(List<UUID> assignmentUids, String inspectorUid);
|
||||||
|
|
||||||
InferenceDetail findInferenceDetail(Long analUid);
|
InferenceDetail findInferenceDetail(Integer compareYyyy, Integer targetYyyy, Integer stage);
|
||||||
|
|
||||||
List<Long> fetchNextMoveIds(Long lastId, Long batchSize);
|
public List<Long> fetchNextMoveIds(Long lastId, Long batchSize, Integer compareYyyy, Integer targetYyyy, Integer stage);
|
||||||
|
|
||||||
Long findLabelUnCompleteCnt(Long analUid);
|
Long findLabelUnCompleteCnt(Long analUid);
|
||||||
|
|
||||||
void assignOwnerMove(List<Long> sub, String userId);
|
void assignOwnerMove(List<Long> sub, String userId);
|
||||||
|
|
||||||
LabelerDetail findLabelerDetail(String userId, Long analUid);
|
LabelerDetail findLabelerDetail(String userId, Integer compareYyyy, Integer targetYyyy, Integer stage);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.kamco.cd.kamcoback.postgres.repository.label;
|
package com.kamco.cd.kamcoback.postgres.repository.label;
|
||||||
|
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QLabelingAssignmentEntity.labelingAssignmentEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QLabelingAssignmentEntity.labelingAssignmentEntity;
|
||||||
|
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceEntity.mapSheetAnalDataInferenceEntity;
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceGeomEntity.mapSheetAnalDataInferenceGeomEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceGeomEntity.mapSheetAnalDataInferenceGeomEntity;
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalEntity.mapSheetAnalEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalEntity.mapSheetAnalEntity;
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMemberEntity.memberEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QMemberEntity.memberEntity;
|
||||||
@@ -14,6 +15,7 @@ import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.UserList;
|
|||||||
import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.WorkProgressInfo;
|
import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.WorkProgressInfo;
|
||||||
import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.WorkerStatistics;
|
import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.WorkerStatistics;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.LabelingAssignmentEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.LabelingAssignmentEntity;
|
||||||
|
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceEntity;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalEntity;
|
||||||
import com.querydsl.core.types.Projections;
|
import com.querydsl.core.types.Projections;
|
||||||
import com.querydsl.core.types.dsl.BooleanExpression;
|
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||||
@@ -44,28 +46,20 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
|
|
||||||
private final JPAQueryFactory queryFactory;
|
private final JPAQueryFactory queryFactory;
|
||||||
|
|
||||||
@PersistenceContext private EntityManager em;
|
@PersistenceContext
|
||||||
|
private EntityManager em;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Long> fetchNextIds(Long lastId, Long batchSize, Long analUid) {
|
public List<Long> fetchNextIds(Long lastId, Long batchSize, Integer compareYyyy, Integer targetYyyy, Integer stage) {
|
||||||
// analUid로 분석 정보 조회
|
|
||||||
MapSheetAnalEntity analEntity =
|
|
||||||
queryFactory
|
|
||||||
.selectFrom(mapSheetAnalEntity)
|
|
||||||
.where(mapSheetAnalEntity.id.eq(analUid))
|
|
||||||
.fetchOne();
|
|
||||||
|
|
||||||
if (Objects.isNull(analEntity)) {
|
|
||||||
throw new EntityNotFoundException("MapSheetAnalEntity not found for analUid: " + analUid);
|
|
||||||
}
|
|
||||||
|
|
||||||
return queryFactory
|
return queryFactory
|
||||||
.select(mapSheetAnalDataInferenceGeomEntity.geoUid)
|
.select(mapSheetAnalDataInferenceGeomEntity.geoUid)
|
||||||
.from(mapSheetAnalDataInferenceGeomEntity)
|
.from(mapSheetAnalDataInferenceGeomEntity)
|
||||||
.where(
|
.where(
|
||||||
lastId == null ? null : mapSheetAnalDataInferenceGeomEntity.geoUid.gt(lastId),
|
lastId == null ? null : mapSheetAnalDataInferenceGeomEntity.geoUid.gt(lastId),
|
||||||
mapSheetAnalDataInferenceGeomEntity.compareYyyy.eq(analEntity.getCompareYyyy()),
|
mapSheetAnalDataInferenceGeomEntity.compareYyyy.eq(compareYyyy),
|
||||||
mapSheetAnalDataInferenceGeomEntity.targetYyyy.eq(analEntity.getTargetYyyy()),
|
mapSheetAnalDataInferenceGeomEntity.targetYyyy.eq(targetYyyy),
|
||||||
|
mapSheetAnalDataInferenceGeomEntity.stage.eq(stage),
|
||||||
mapSheetAnalDataInferenceGeomEntity.labelState.isNull())
|
mapSheetAnalDataInferenceGeomEntity.labelState.isNull())
|
||||||
.orderBy(mapSheetAnalDataInferenceGeomEntity.mapSheetNum.asc())
|
.orderBy(mapSheetAnalDataInferenceGeomEntity.mapSheetNum.asc())
|
||||||
.limit(batchSize)
|
.limit(batchSize)
|
||||||
@@ -73,7 +67,23 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void assignOwner(List<Long> ids, String userId, Long analUid) {
|
public void assignOwner(List<Long> ids, String userId, Integer compareYyyy, Integer targetYyyy, Integer stage) {
|
||||||
|
|
||||||
|
// analUid로 분석 정보 조회
|
||||||
|
MapSheetAnalDataInferenceEntity analEntity =
|
||||||
|
queryFactory
|
||||||
|
.selectFrom(mapSheetAnalDataInferenceEntity)
|
||||||
|
.where(mapSheetAnalDataInferenceEntity.compareYyyy.eq(compareYyyy),
|
||||||
|
mapSheetAnalDataInferenceEntity.targetYyyy.eq(targetYyyy),
|
||||||
|
mapSheetAnalDataInferenceEntity.stage.eq(stage)
|
||||||
|
)
|
||||||
|
.orderBy(mapSheetAnalDataInferenceEntity.analUid.asc())
|
||||||
|
.limit(1)
|
||||||
|
.fetchOne();
|
||||||
|
|
||||||
|
if (Objects.isNull(analEntity)) {
|
||||||
|
throw new EntityNotFoundException("MapSheetAnalEntity not found for analUid: ");
|
||||||
|
}
|
||||||
|
|
||||||
// data_geom 테이블에 label state 를 ASSIGNED 로 update
|
// data_geom 테이블에 label state 를 ASSIGNED 로 update
|
||||||
queryFactory
|
queryFactory
|
||||||
@@ -101,7 +111,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
.setParameter(3, userId)
|
.setParameter(3, userId)
|
||||||
.setParameter(4, LabelState.ASSIGNED.getId())
|
.setParameter(4, LabelState.ASSIGNED.getId())
|
||||||
.setParameter(5, "")
|
.setParameter(5, "")
|
||||||
.setParameter(6, analUid)
|
.setParameter(6, analEntity.getAnalUid())
|
||||||
.executeUpdate();
|
.executeUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,11 +120,27 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<LabelingAssignmentEntity> findAssignedLabelerList(Long analUid) {
|
public List<LabelingAssignmentEntity> findAssignedLabelerList(Integer compareYyyy, Integer targetYyyy, Integer stage) {
|
||||||
|
// analUid로 분석 정보 조회
|
||||||
|
MapSheetAnalDataInferenceEntity analEntity =
|
||||||
|
queryFactory
|
||||||
|
.selectFrom(mapSheetAnalDataInferenceEntity)
|
||||||
|
.where(mapSheetAnalDataInferenceEntity.compareYyyy.eq(compareYyyy),
|
||||||
|
mapSheetAnalDataInferenceEntity.targetYyyy.eq(targetYyyy),
|
||||||
|
mapSheetAnalDataInferenceEntity.stage.eq(stage)
|
||||||
|
)
|
||||||
|
.orderBy(mapSheetAnalDataInferenceEntity.analUid.asc())
|
||||||
|
.limit(1)
|
||||||
|
.fetchOne();
|
||||||
|
|
||||||
|
if (Objects.isNull(analEntity)) {
|
||||||
|
throw new EntityNotFoundException("MapSheetAnalEntity not found for analUid: ");
|
||||||
|
}
|
||||||
|
|
||||||
return queryFactory
|
return queryFactory
|
||||||
.selectFrom(labelingAssignmentEntity)
|
.selectFrom(labelingAssignmentEntity)
|
||||||
.where(
|
.where(
|
||||||
labelingAssignmentEntity.analUid.eq(analUid),
|
labelingAssignmentEntity.analUid.eq(analEntity.getAnalUid()),
|
||||||
labelingAssignmentEntity.workState.eq(LabelState.ASSIGNED.getId()),
|
labelingAssignmentEntity.workState.eq(LabelState.ASSIGNED.getId()),
|
||||||
labelingAssignmentEntity.inspectorUid.isNull())
|
labelingAssignmentEntity.inspectorUid.isNull())
|
||||||
.orderBy(labelingAssignmentEntity.workerUid.asc())
|
.orderBy(labelingAssignmentEntity.workerUid.asc())
|
||||||
@@ -122,23 +148,14 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long findLabelUnAssignedCnt(Long analUid, Integer stage) {
|
public Long findLabelUnAssignedCnt(Integer stage, Integer compareYyyy, Integer targetYyyy) {
|
||||||
MapSheetAnalEntity entity =
|
|
||||||
queryFactory
|
|
||||||
.selectFrom(mapSheetAnalEntity)
|
|
||||||
.where(mapSheetAnalEntity.id.eq(analUid))
|
|
||||||
.fetchOne();
|
|
||||||
|
|
||||||
if (Objects.isNull(entity)) {
|
|
||||||
throw new EntityNotFoundException("MapSheetAnalEntity not found for analUid: " + analUid);
|
|
||||||
}
|
|
||||||
|
|
||||||
return queryFactory
|
return queryFactory
|
||||||
.select(mapSheetAnalDataInferenceGeomEntity.geoUid.count())
|
.select(mapSheetAnalDataInferenceGeomEntity.geoUid.count())
|
||||||
.from(mapSheetAnalDataInferenceGeomEntity)
|
.from(mapSheetAnalDataInferenceGeomEntity)
|
||||||
.where(
|
.where(
|
||||||
mapSheetAnalDataInferenceGeomEntity.compareYyyy.eq(entity.getCompareYyyy()),
|
mapSheetAnalDataInferenceGeomEntity.compareYyyy.eq(compareYyyy),
|
||||||
mapSheetAnalDataInferenceGeomEntity.targetYyyy.eq(entity.getTargetYyyy()),
|
mapSheetAnalDataInferenceGeomEntity.targetYyyy.eq(targetYyyy),
|
||||||
mapSheetAnalDataInferenceGeomEntity.stage.eq(stage),
|
mapSheetAnalDataInferenceGeomEntity.stage.eq(stage),
|
||||||
mapSheetAnalDataInferenceGeomEntity.labelState.isNull())
|
mapSheetAnalDataInferenceGeomEntity.labelState.isNull())
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
@@ -411,7 +428,19 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InferenceDetail findInferenceDetail(Long analUid) {
|
public InferenceDetail findInferenceDetail(Integer compareYyyy, Integer targetYyyy, Integer stage) {
|
||||||
|
// analUid로 분석 정보 조회
|
||||||
|
MapSheetAnalDataInferenceEntity analEntity =
|
||||||
|
queryFactory
|
||||||
|
.selectFrom(mapSheetAnalDataInferenceEntity)
|
||||||
|
.where(mapSheetAnalDataInferenceEntity.compareYyyy.eq(compareYyyy),
|
||||||
|
mapSheetAnalDataInferenceEntity.targetYyyy.eq(targetYyyy),
|
||||||
|
mapSheetAnalDataInferenceEntity.stage.eq(stage)
|
||||||
|
)
|
||||||
|
.orderBy(mapSheetAnalDataInferenceEntity.analUid.asc())
|
||||||
|
.limit(1)
|
||||||
|
.fetchOne();
|
||||||
|
|
||||||
return queryFactory
|
return queryFactory
|
||||||
.select(
|
.select(
|
||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
@@ -425,7 +454,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
.from(mapSheetAnalEntity)
|
.from(mapSheetAnalEntity)
|
||||||
.innerJoin(labelingAssignmentEntity)
|
.innerJoin(labelingAssignmentEntity)
|
||||||
.on(mapSheetAnalEntity.id.eq(labelingAssignmentEntity.analUid))
|
.on(mapSheetAnalEntity.id.eq(labelingAssignmentEntity.analUid))
|
||||||
.where(mapSheetAnalEntity.id.eq(analUid))
|
.where(mapSheetAnalEntity.id.eq(analEntity.getAnalUid()))
|
||||||
.groupBy(
|
.groupBy(
|
||||||
mapSheetAnalEntity.analTitle,
|
mapSheetAnalEntity.analTitle,
|
||||||
mapSheetAnalEntity.gukyuinApplyDttm,
|
mapSheetAnalEntity.gukyuinApplyDttm,
|
||||||
@@ -434,16 +463,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Long> fetchNextMoveIds(Long lastId, Long batchSize) {
|
public List<Long> fetchNextMoveIds(Long lastId, Long batchSize, Integer compareYyyy, Integer targetYyyy, Integer stage) {
|
||||||
MapSheetAnalEntity entity =
|
|
||||||
queryFactory
|
|
||||||
.selectFrom(mapSheetAnalEntity)
|
|
||||||
.where(mapSheetAnalEntity.id.eq(3L)) // TODO
|
|
||||||
.fetchOne();
|
|
||||||
|
|
||||||
if (Objects.isNull(entity)) {
|
|
||||||
throw new EntityNotFoundException();
|
|
||||||
}
|
|
||||||
|
|
||||||
return queryFactory
|
return queryFactory
|
||||||
.select(mapSheetAnalDataInferenceGeomEntity.geoUid)
|
.select(mapSheetAnalDataInferenceGeomEntity.geoUid)
|
||||||
@@ -451,8 +471,9 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
.where(
|
.where(
|
||||||
// mapSheetAnalDataGeomEntity.pnu.isNotNull(), //TODO: Mockup 진행 이후 확인하기
|
// mapSheetAnalDataGeomEntity.pnu.isNotNull(), //TODO: Mockup 진행 이후 확인하기
|
||||||
lastId == null ? null : mapSheetAnalDataInferenceGeomEntity.geoUid.gt(lastId),
|
lastId == null ? null : mapSheetAnalDataInferenceGeomEntity.geoUid.gt(lastId),
|
||||||
mapSheetAnalDataInferenceGeomEntity.compareYyyy.eq(entity.getCompareYyyy()),
|
mapSheetAnalDataInferenceGeomEntity.compareYyyy.eq(compareYyyy),
|
||||||
mapSheetAnalDataInferenceGeomEntity.targetYyyy.eq(entity.getTargetYyyy()),
|
mapSheetAnalDataInferenceGeomEntity.targetYyyy.eq(targetYyyy),
|
||||||
|
mapSheetAnalDataInferenceGeomEntity.stage.eq(stage),
|
||||||
mapSheetAnalDataInferenceGeomEntity.labelState.in(
|
mapSheetAnalDataInferenceGeomEntity.labelState.in(
|
||||||
LabelState.ASSIGNED.getId(), LabelState.SKIP.getId()))
|
LabelState.ASSIGNED.getId(), LabelState.SKIP.getId()))
|
||||||
.orderBy(mapSheetAnalDataInferenceGeomEntity.mapSheetNum.asc())
|
.orderBy(mapSheetAnalDataInferenceGeomEntity.mapSheetNum.asc())
|
||||||
@@ -497,7 +518,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LabelerDetail findLabelerDetail(String userId, Long analUid) {
|
public LabelerDetail findLabelerDetail(String userId, Integer compareYyyy, Integer targetYyyy, Integer stage) {
|
||||||
NumberExpression<Long> assignedCnt =
|
NumberExpression<Long> assignedCnt =
|
||||||
new CaseBuilder()
|
new CaseBuilder()
|
||||||
.when(labelingAssignmentEntity.workState.eq(LabelState.ASSIGNED.getId()))
|
.when(labelingAssignmentEntity.workState.eq(LabelState.ASSIGNED.getId()))
|
||||||
@@ -530,6 +551,22 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
labelingAssignmentEntity.count(),
|
labelingAssignmentEntity.count(),
|
||||||
completeCnt));
|
completeCnt));
|
||||||
|
|
||||||
|
// analUid로 분석 정보 조회
|
||||||
|
MapSheetAnalDataInferenceEntity analEntity =
|
||||||
|
queryFactory
|
||||||
|
.selectFrom(mapSheetAnalDataInferenceEntity)
|
||||||
|
.where(mapSheetAnalDataInferenceEntity.compareYyyy.eq(compareYyyy),
|
||||||
|
mapSheetAnalDataInferenceEntity.targetYyyy.eq(targetYyyy),
|
||||||
|
mapSheetAnalDataInferenceEntity.stage.eq(stage)
|
||||||
|
)
|
||||||
|
.orderBy(mapSheetAnalDataInferenceEntity.analUid.asc())
|
||||||
|
.limit(1)
|
||||||
|
.fetchOne();
|
||||||
|
|
||||||
|
if (Objects.isNull(analEntity)) {
|
||||||
|
throw new EntityNotFoundException("MapSheetAnalEntity not found for analUid: ");
|
||||||
|
}
|
||||||
|
|
||||||
return queryFactory
|
return queryFactory
|
||||||
.select(
|
.select(
|
||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
@@ -545,7 +582,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
.innerJoin(labelingAssignmentEntity)
|
.innerJoin(labelingAssignmentEntity)
|
||||||
.on(
|
.on(
|
||||||
memberEntity.employeeNo.eq(labelingAssignmentEntity.workerUid),
|
memberEntity.employeeNo.eq(labelingAssignmentEntity.workerUid),
|
||||||
labelingAssignmentEntity.analUid.eq(analUid))
|
labelingAssignmentEntity.analUid.eq(analEntity.getAnalUid()))
|
||||||
.where(memberEntity.employeeNo.eq(userId))
|
.where(memberEntity.employeeNo.eq(userId))
|
||||||
.groupBy(memberEntity.userRole, memberEntity.name, memberEntity.employeeNo)
|
.groupBy(memberEntity.userRole, memberEntity.name, memberEntity.employeeNo)
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
|
|||||||
Reference in New Issue
Block a user